diff --git a/.gitignore b/.gitignore index 858238c5bf..ce5d4a9d8c 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,6 @@ node_modules .sublimets .settings/launch.json + .vscode -yarn.lock \ No newline at end of file +yarn.lock diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8b263f19ae..1036be548d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1665,7 +1665,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju) * [:link:](supertest-as-promised/supertest-as-promised.d.ts) [SuperTest as Promised](https://github.com/WhoopInc/supertest-as-promised) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](svg-injector/svg-injector.d.ts) [SVG Injector](https://github.com/iconic/SVGInjector) by [Patrick Westerhoff](https://github.com/poke) -* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) +* [:link:](svg-pan-zoom/svg-pan-zoom-2.3.9.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) +* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [César Vidril](https://github.com/Yimiprod) * [:link:](svg-sprite/svg-sprite.d.ts) [svg-sprite](https://github.com/jkphl/svg-sprite) by [Qubo](https://github.com/tkqubo) * [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io) * [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index a864dbcb13..95d0041063 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -13,5 +13,5 @@ If adding a new definition: - [ ] Include the required [files](https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package) and header. Base these on the README, *not* on an existing project. If changing an existing definition: -- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> +- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> - [ ] Increase the version number in the header if appropriate. diff --git a/README.md b/README.md index d3e6c0e27c..7187e9e8f6 100644 --- a/README.md +++ b/README.md @@ -52,21 +52,26 @@ DefinitelyTyped only works because of contributions by users like you! Before you share your improvement with the world, use it yourself. -#### Test editing an exiting package +#### Test editing an existing package To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html). -You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, -or copy them from there and paste inside of `declarations.d.ts` and follow the steps below. +You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below. #### Test a new package -* Add a new file `declarations.d.ts` to your project. -* Add it to the compilation, through `"includes"` or `"files"` in your [tsconfig](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html), -or through a `/// ` declaration in your code. -* Inside `declarations.d.ts`, write `declare module "foo" { }`, then write the module declaration inside. -* Test that your code works. -* *Then*, once you've tested your definitions, make a PR contributing the definition. +Add to your `tsconfig.json`: + +```json +"baseUrl": "types", +"typeRoots": ["types"], +``` + +(You can also use `src/types`.) +Create `types/foo/index.d.ts` containing declarations for the module "foo". +You should now be able import from `"foo"` in your code and it will route to the new type definition. +Then build *and* run the code to make sure your type definition actually corresponds to what happens at runtime. +Once you've tested your definitions with real code, make a PR contributing the definition by copying `types/foo` to `DefinitelyTyped/foo` and adding a `tsconfig.json` and `foo-tests.ts`. ### Make a pull request @@ -95,7 +100,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR. #### Create a new package -If you are the library author, or can make a pull request to the library, [bundle](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) types instead of publishing to DefinitelyTyped. +If you are the library author, or can make a pull request to the library, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) instead of publishing to DefinitelyTyped. If you are adding typings for an NPM package, create a directory with the same name. If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM. @@ -108,6 +113,7 @@ Your package should have this structure: | index.d.ts | This contains the typings for the package. | | foo-tests.ts | This contains sample code which tests the typings. This code does *not* run, but it is type-checked. | | tsconfig.json | This allows you to run `tsc` within the package. | +| tslint.json | Enables linting. | Generate these by running `npm run new-package -- new-package-name`. @@ -125,7 +131,7 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D * `interface X {}`: An empty interface is essentially the `{}` type: it places no constraints on an object. * `interface IFoo {}`: Don't add `I` to the front of an interface name. * `interface Foo { new(): Foo; }`: - This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); } + This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); }`. * `const Class: { new(): IClass; }`: Prefer to use a class declaration `class Class { constructor(); }` instead of a new-able constant. * `namespace foo {}`: @@ -187,7 +193,7 @@ Changes to the `master` branch are also manually merged into the `types-2.0` bra #### I'm writing a definition that depends on another definition. Should I use `` or an import? If the module you're referencing is an external module (uses `export`), use an import. -If the module you're referenceing is an ambient module (uses `declare module`, or just declares globals), use ``. +If the module you're referencing is an ambient module (uses `declare module`, or just declares globals), use ``. #### What do I do about older versions of typings? diff --git a/accepts/accepts-tests.ts b/accepts/accepts-tests.ts new file mode 100644 index 0000000000..7d9c5a8240 --- /dev/null +++ b/accepts/accepts-tests.ts @@ -0,0 +1,25 @@ +import accepts = require("accepts"); + +const req: any = {}; + +const accept = accepts(req); + +const charsets = accept.charsets(); +const charsetFromEmpty = accept.charset(); +const charsetFromParams = accept.charset("json", "text"); +const charsetFromArray = accept.charset(["json", "text"]); + +const encodings = accept.encodings(); +const encodingFromEmpty = accept.encoding(); +const encodingFromParams = accept.encoding("json", "text"); +const encodingFromArray = accept.encoding(["json", "text"]); + +const languages = accept.languages(); +const languageFromEmpty = accept.language(); +const languageFromParams = accept.language("json", "text"); +const languageFromArray = accept.language(["json", "text"]); + +const types = accept.types(); +const typeFromEmpty = accept.type(); +const typeFromParams = accept.type("json", "text"); +const typeFromArray = accept.type(["json", "text"]); diff --git a/accepts/index.d.ts b/accepts/index.d.ts new file mode 100644 index 0000000000..ff6a9d0995 --- /dev/null +++ b/accepts/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for accepts 1.3 +// Project: https://github.com/jshttp/accepts +// Definitions by: Stefan Reichel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { IncomingMessage } from "http"; + +declare namespace accepts { + export interface Accepts { + charset(charsets: string[]): string | string[] | boolean; + charset(...charsets: string[]): string | string[] | boolean; + charsets(): string[]; + + encoding(encodings: string[]): string | string[] | boolean; + encoding(...encodings: string[]): string | string[] | boolean; + encodings(): string[]; + + language(languages: string[]): string | string[] | boolean; + language(...languages: string[]): string | string[] | boolean; + languages(): string[]; + + type(types: string[]): string | string[] | boolean; + type(...types: string[]): string | string[] | boolean; + types(): string[]; + } +} + +declare function accepts(req: IncomingMessage): accepts.Accepts; + +export = accepts; diff --git a/accepts/tsconfig.json b/accepts/tsconfig.json new file mode 100644 index 0000000000..8adaf7363b --- /dev/null +++ b/accepts/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "accepts-tests.ts" + ] +} diff --git a/accepts/tslint.json b/accepts/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/accepts/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/accounting/index.d.ts b/accounting/index.d.ts index b8187e41c4..b437a63c36 100644 --- a/accounting/index.d.ts +++ b/accounting/index.d.ts @@ -3,77 +3,72 @@ // Definitions by: Sergey Gerasimov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface IAccountingCurrencyFormat { - pos: string; // for positive values, eg. "$ 1.00" - neg?: string; // for negative values, eg. "$ (1.00)" - zero?: string; // for zero values, eg. "$ --" +declare namespace accounting { + interface IAccountingCurrencyFormat { + pos: string; // for positive values, eg. "$ 1.00" + neg?: string; // for negative values, eg. "$ (1.00)" + zero?: string; // for zero values, eg. "$ --" + } + + interface IAccountingCurrencySettings { + symbol?: string; // default currency symbol is '$' + format?: TFormat; // controls output: %s = symbol, %v = value/number + decimal?: string; // decimal point separator + thousand?: string; // thousands separator + precision?: number; // decimal places + } + + interface IAccountingNumberSettings { + precision?: number; // default precision on numbers is 0 + thousand?: string; + decimal?: string; + } + + interface IAccountingSettings { + currency: IAccountingCurrencySettings; // IAccountingCurrencySettings or IAccountingCurrencySettings + number: IAccountingNumberSettings; + } + + interface IAccountingStatic { + // format any number into currency + formatMoney(number: number, symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string; + formatMoney(number: number, options: IAccountingCurrencySettings | IAccountingCurrencySettings): string; + + formatMoney(numbers: number[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[]; + formatMoney(numbers: number[], options: IAccountingCurrencySettings | IAccountingCurrencySettings): string[]; + + // generic case (any array of numbers) + formatMoney(numbers: any[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): any[]; + formatMoney(numbers: any[], options: IAccountingCurrencySettings | IAccountingCurrencySettings): any[]; + + // format a list of values for column-display + formatColumn(numbers: number[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[]; + formatColumn(numbers: number[], options: IAccountingCurrencySettings | IAccountingCurrencySettings): string[]; + + formatColumn(numbers: number[][], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[][]; + formatColumn(numbers: number[][], options: IAccountingCurrencySettings | IAccountingCurrencySettings): string[][]; + + // format a number with custom precision and localisation + formatNumber(number: number, precision?: number, thousand?: string, decimal?: string): string; + formatNumber(number: number, options: IAccountingNumberSettings): string; + + formatNumber(number: number[], precision?: number, thousand?: string, decimal?: string): string[]; + formatNumber(number: number[], options: IAccountingNumberSettings): string[]; + + formatNumber(number: any[], precision?: number, thousand?: string, decimal?: string): any[]; + formatNumber(number: any[], options: IAccountingNumberSettings): any[]; + + // better rounding for floating point numbers + toFixed(number: number, precision?: number): string; + + // get a value from any formatted number/currency string + unformat(string: string, decimal?: string): number; + + // settings object that controls default parameters for library methods + settings: IAccountingSettings; + } } -interface IAccountingCurrencySettings { - symbol?: string; // default currency symbol is '$' - format?: TFormat; // controls output: %s = symbol, %v = value/number - decimal?: string; // decimal point separator - thousand?: string; // thousands separator - precision?: number // decimal places -} - -interface IAccountingNumberSettings { - precision?: number; // default precision on numbers is 0 - thousand?: string; - decimal?: string; -} - -interface IAccountingSettings { - currency: IAccountingCurrencySettings; // IAccountingCurrencySettings or IAccountingCurrencySettings - number: IAccountingNumberSettings; -} - -interface IAccountingStatic { - // format any number into currency - formatMoney(number: number, symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string; - formatMoney(number: number, options: IAccountingCurrencySettings): string; - formatMoney(number: number, options: IAccountingCurrencySettings): string; - - formatMoney(numbers: number[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[]; - formatMoney(numbers: number[], options: IAccountingCurrencySettings): string[]; - formatMoney(numbers: number[], options: IAccountingCurrencySettings): string[]; - - // generic case (any array of numbers) - formatMoney(numbers: any[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): any[]; - formatMoney(numbers: any[], options: IAccountingCurrencySettings): any[]; - formatMoney(numbers: any[], options: IAccountingCurrencySettings): any[]; - - // format a list of values for column-display - formatColumn(numbers: number[], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[]; - formatColumn(numbers: number[], options: IAccountingCurrencySettings): string[]; - formatColumn(numbers: number[], options: IAccountingCurrencySettings): string[]; - - formatColumn(numbers: number[][], symbol?: string, precision?: number, thousand?: string, decimal?: string, format?: string): string[][]; - formatColumn(numbers: number[][], options: IAccountingCurrencySettings): string[][]; - formatColumn(numbers: number[][], options: IAccountingCurrencySettings): string[][]; - - // format a number with custom precision and localisation - formatNumber(number: number, precision?: number, thousand?: string, decimal?: string): string; - formatNumber(number: number, options: IAccountingNumberSettings): string; - - formatNumber(number: number[], precision?: number, thousand?: string, decimal?: string): string[]; - formatNumber(number: number[], options: IAccountingNumberSettings): string[]; - - formatNumber(number: any[], precision?: number, thousand?: string, decimal?: string): any[]; - formatNumber(number: any[], options: IAccountingNumberSettings): any[]; - - // better rounding for floating point numbers - toFixed(number: number, precision?: number): string; - - // get a value from any formatted number/currency string - unformat(string: string, decimal?: string): number; - - // settings object that controls default parameters for library methods - settings: IAccountingSettings; -} - -declare var accounting: IAccountingStatic; - -declare module "accounting" { - export = accounting; -} +declare var accounting: accounting.IAccountingStatic; +export = accounting; +export as namespace accounting; diff --git a/accounting/tslint.json b/accounting/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/accounting/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/adm-zip/index.d.ts b/adm-zip/index.d.ts index f22b929b76..9a723dc152 100644 --- a/adm-zip/index.d.ts +++ b/adm-zip/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for adm-zip v0.4.4 +// Type definitions for adm-zip v0.4.4 // Project: https://github.com/cthackers/adm-zip // Definitions by: John Vilk , Abner Oliveira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ajv/index.d.ts b/ajv/index.d.ts index bf487fd341..94d0055551 100644 --- a/ajv/index.d.ts +++ b/ajv/index.d.ts @@ -66,18 +66,20 @@ declare namespace Ajv { unicode?: boolean; format?: string; formats?: any; + unknownFormats?: true | string[] | "ignore"; schemas?: any; - missingRefs?: boolean; + missingRefs?: true | "ignore" | "fail"; + extendRefs?: true | "ignore" | "fail"; loadSchema?(uri: string, callback: (error: Error, body: any) => void): void; - removeAdditional?: boolean; - useDefaults?: boolean; - coerceTypes?: boolean; + removeAdditional?: boolean | "all" | "failing"; + useDefaults?: boolean | "shared"; + coerceTypes?: boolean | "array"; async?: any; transpile?: string; meta?: boolean; - validateSchema?: boolean; + validateSchema?: boolean | "log"; addUsedSchema?: boolean; - inlineRefs?: boolean; + inlineRefs?: boolean | number; passContext?: boolean; loopRequired?: number; ownProperties?: boolean; diff --git a/alertify/index.d.ts b/alertify/index.d.ts index aa9219282a..fa71118381 100644 --- a/alertify/index.d.ts +++ b/alertify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for alertify 0.3.11 +// Type definitions for alertify 0.3.11 // Project: http://fabien-d.github.io/alertify.js/ // Definitions by: John Jeffery // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/algoliasearch-client-js/index.d.ts b/algoliasearch-client-js/index.d.ts deleted file mode 100644 index b0eeb9968b..0000000000 --- a/algoliasearch-client-js/index.d.ts +++ /dev/null @@ -1,1571 +0,0 @@ -// Type definitions for algoliasearch-client-js 3.18.1 -// Project: https://github.com/algolia/algoliasearch-client-js -// Definitions by: Baptiste Coquelle -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface AlgoliaResponse { - /** - * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hits: any[]; - /** - * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - page: number; - /** - * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbHits: number; - /** - * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbPage: number; - /** - * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hitsPerPage: number; - /** - * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - processingTimeMS: number; - /** - * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - query: string; - /** - * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - params: string; -} -/* - Interface for the algolia client object - */ -interface AlgoliaClient { - /** - * Initialization of the index - * @param name: index name - * return algolia index object - * https://github.com/algolia/algoliasearch-client-js#init-index---initindex - */ - initIndex(name: string): AlgoliaIndex; - /** - * Query on multiple index - * @param queries index name, query and query parameters - * @param cb callback(err, res) - * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries - */ - search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }, cb: (err: Error, res: any) => void): void; - /** - * Query on multiple index - * @param queries index name, query and query parameters - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries - */ - search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }): Promise; - /** - * clear browser cache - * https://github.com/algolia/algoliasearch-client-js#cache - */ - clearCache(): void; - /** - * kill alive connections - * https://github.com/algolia/algoliasearch-client-js#keep-alive - */ - destroy(): void; - /** - * List all your indices along with their associated information (number of entries, disk size, etc.) - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes - */ - listIndexes(cb: (err: Error, res: any) => void): void; - /** - * List all your indices along with their associated information (number of entries, disk size, etc.) - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes - */ - listIndexes(): Promise; - /** - * Delete a specific index - * @param name - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex - */ - deleteIndex(name: string, cb: (err: Error, res: any) => void): void; - /** - * Delete a specific index - * @param name - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex - */ - deleteIndex(name: string): Promise; - /** - * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex - */ - copyIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; - /** - * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex - */ - copyIndex(from: string, to: string): Promise; - /** - * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex - */ - moveIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; - /** - * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex - */ - moveIndex(from: string, to: string): Promise; - /** - * Generate a public API key - * @param key api key - * @param filters - * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey - */ - generateSecuredApiKey(key: string, filters: AlgoliaSecuredApiOptions): void; - /** - * Perform multiple operations with one API call to reduce latency - * @param action - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - batch(action: AlgoliaAction, cb: (err: Error, res: any) => void): void; - /** - * Perform multiple operations with one API call to reduce latency - * @param action - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - batch(action: AlgoliaAction): Promise; - /** - * Lists global API Keys - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - listUserKeys(cb: (err: Error, res: any) => void): void; - /** - * Lists global API Keys - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - listUserKeys(): Promise; - /** - * Add global API Keys - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Add global API Keys - * @param scopes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[]): Promise; - /** - * Add global API Key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Add global API Key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions): Promise; - /** - * Update global API key - * @param key - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Update global API key - * @param key - * @param scopes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[]): Promise; - /** - * Update global API key - * @param key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Update global API key - * @param key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions): Promise; - /** - * Gets the rights of a global key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; - /** - * Gets the rights of a global key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - getUserKeyACL(key: string): Promise; - /** - * Deletes a global key - * @param key - * @param cb(err,res) - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; - /** - * Deletes a global key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string): Promise; - /** - * Get 1000 last events - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; - /** - * Get 1000 last events - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - getLogs(options: LogsOptions): Promise; -} -/** - * Interface for the index algolia object - */ -interface AlgoliaIndex { - /** - * Gets a specific object - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Gets specific attributes from an object - * @param objectID - * @param attributes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, attributes: string[], cb: (err: Error, res: any) => void): void; - /** - * Gets a list of objects - * @param objectIDs - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; - /** - * Add a specific object - * @param object without objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Add a list of objects - * @param object with objectID - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Add list of objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Add or replace a specific object - * @param object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Add or replace several objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Update parameters of a specific object - * @param object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Update parameters of a list of objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Delete a specific object - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Delete a list of objects - * @param objectIDs - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; - /** - * Delete objects that matches the query - * @param query - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; - /** - * Delete objects that matches the query - * @param query - * @param params of the object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, params: {}, cb: (err: Error, res: any) => void): void; - /** - * Wait for an indexing task to be compete - * @param taskID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask - */ - waitTask(taskID: number, cb: (err: Error, res: any) => void): void; - /** - * Get an index settings - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings - */ - getSettings(cb: (err: Error, res: any) => void): void; - /** - * Set an index settings - * @param settings - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings - */ - setSettings(settings: AlgoliaIndexSettings, cb: (err: Error, res: any) => void): void; - /** - * Clear cache of an index - * https://github.com/algolia/algoliasearch-client-js#cache - */ - clearCache(): void; - /** - * Clear an index content - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex - */ - clearIndex(cb: (err: Error, res: any) => void): void; - /** - * Save a synonym object - * @param synonym - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - saveSynonym(synonym: AlgoliaSynonym, option: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Save a synonym object - * @param synonyms - * @param options - * @param cb(err, res) - */ - batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Delete a specific synonym - * @param identifier - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - deleteSynonym(identifier: string, options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Clear all synonyms of an index - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms - */ - clearSynonyms(options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Get a specific synonym - * @param identifier - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym - */ - getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; - /** - * Search a synonyms - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - searchSynonyms(options: SearchSynonymOptions, cb: (err: Error, res: any) => void): void; - /** - * List index user keys - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys - */ - listUserKeys(cb: (err: Error, res: any) => void): void; - /** - * Add key for this index - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Add key for this index - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Update a key for this index - * @param key - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Update a key for this index - * @param key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Gets the rights of an index specific key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl - */ - getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; - /** - * Deletes an index specific key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; - /** - * Gets a specific object - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string): Promise ; - /** - * Gets specific attributes from an object - * @param objectID - * @param attributes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, attributes: string[]): Promise ; - /** - * Gets a list of objects - * @param objectIDs - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObjects(objectIDs: string[]): Promise ; - /** - * Add a specific object - * @param object without objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}): Promise ; - /** - * Add a list of objects - * @param object with objectID - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, objectID: string): Promise ; - /** - * Add list of objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObjects(objects: [{}]): Promise ; - /** - * Add or replace a specific object - * @param object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObject(object: {}): Promise ; - /** - * Add or replace several objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObjects(objects: [{}]): Promise ; - /** - * Update parameters of a specific object - * @param object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObject(object: {}): Promise ; - /** - * Update parameters of a list of objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObjects(objects: [{}]): Promise ; - /** - * Delete a specific object - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObject(objectID: string): Promise ; - /** - * Delete a list of objects - * @param objectIDs - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObjects(objectIDs: string[]): Promise ; - /** - * Delete objects that matches the query - * @param query - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string): Promise ; - /** - * Delete objects that matches the query - * @param query - * @param params of the object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, params: {}): Promise ; - /** - * Wait for an indexing task to be compete - * @param taskID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask - */ - waitTask(taskID: number): Promise ; - /** - * Get an index settings - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings - */ - getSettings(): Promise ; - /** - * Set an index settings - * @param settings - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings - */ - setSettings(settings: AlgoliaIndexSettings): Promise ; - /** - * Search in an index - * @param params query parameter - * return {Promise} - * @param err() error callback - * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search - */ - search(params: AlgoliaQueryParameters): Promise ; - /** - * Search in an index - * @param params query parameter - * @param cb(err, res) - * @param err() error callback - * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search - */ - search(params: AlgoliaQueryParameters, cb: (err: Error, res: any) => void): void; - /** - * Browse an index - * @param query - * @param cb(err, content) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browse(query: string, cb: (err: Error, res: any) => void): void; - /** - * Browse an index - * @param query - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browse(query: string): Promise; - /** - * Browse an index from a cursor - * @param cursor - * @param cb(err, content) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; - /** - * Browse an index from a cursor - * @param cursor - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseFrom(cursor: string): Promise; - /** - * Browse an entire index - * return Promise - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseAll(): Promise; - /** - * Clear an index content - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex - */ - clearIndex(): Promise ; - /** - * Save a synonym object - * @param synonym - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - saveSynonym(synonym: AlgoliaSynonym, option: SynonymOption): Promise ; - /** - * Save a synonym object - * @param synonyms - * @param options - * return {Promise} - */ - batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption): Promise ; - /** - * Delete a specific synonym - * @param identifier - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - deleteSynonym(identifier: string, options: SynonymOption): Promise ; - /** - * Clear all synonyms of an index - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms - */ - clearSynonyms(options: SynonymOption): Promise ; - /** - * Get a specific synonym - * @param identifier - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym - */ - getSynonym(identifier: string): Promise ; - /** - * Search a synonyms - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - searchSynonyms(options: SearchSynonymOptions): Promise ; - /** - * List index user keys - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys - */ - listUserKeys(): Promise ; - /** - * Add key for this index - * @param scopes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[]): Promise ; - /** - * Add key for this index - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions): Promise ; - /** - * Update a key for this index - * @param key - * @param scopes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[]): Promise ; - /** - * Update a key for this index - * @param key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions): Promise ; - /** - * Gets the rights of an index specific key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl - */ - getUserKeyACL(key: string): Promise ; - /** - * Deletes an index specific key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string): Promise ; -} -/* - Interface describing available options when initializing a client - */ -interface ClientOptions { - /** - * Timeout for requests to our servers, in milliseconds - * default: 15s (node), 2s (browser) - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - timeout?: number; - /** - * Protocol to use when communicating with algolia - * default: current protocol(browser), https(node) - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - protocol?: string; - /** - * (node only) httpAgent instance to use when communicating with Algolia servers. - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - httpAgent?: any; - /** - * read: array of read hosts to use to call Algolia servers, computed automatically - * write: array of read hosts to use to call Algolia servers, computed automatically - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - hosts?: { read?: string[], write?: string[] }; -} -/* - Interface describing options available for gettings the logs - */ -interface LogsOptions { - /** - * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). - * default: 0 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - offset?: number; - /** - * Specify the maximum number of entries to retrieve starting at the offset. - * default: 10 - * maximum: 1000 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - length?: number; - /** - * @deprecated - * Retrieve only logs with an HTTP code different than 200 or 201 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - onlyErrors?: boolean; - /** - * Specify the type of logs to retrieve - * 'query' Retrieve only the queries - * 'build' Retrieve only the build operations - * 'error' Retrieve only the errors (same as onlyErrors parameters) - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - type?: string; -} -/** - * Describe the action object used for batch operation - */ -interface AlgoliaAction { - /** - * Type of the batch action - * values: addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - action: string; - /** - * Name of the index where the bact will be performed - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - indexName: string; - /** - * Object - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - body: {}; -} -/** - * Describes the option used when creating user key - */ -interface AlgoliaUserKeyOptions { - /** - * Add a validity period. The key will be valid for a specific period of time (in seconds). - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - validity?: number; - /** - * Specify the maximum number of API calls allowed from an IP address per hour - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - maxQueriesPerIPPerHour?: number; - /** - * Specify the maximum number of hits this API key can retrieve in one call - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - maxHitsPerQuery?: boolean; - /** - * Specify the list of targeted indices - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - indexes?: string[]; - /** - * Specify the list of referers - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - referers?: string[]; - /** - * Specify the list of query parameters - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - queryParameters?: AlgoliaQueryParameters; - /** - * Specify a description to describe where the key is used. - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - description?: string; -} -/** - * Describes option used when making operation on synonyms - */ -interface SynonymOption { - /** - * You can forward all settings updates to the slaves of an index - * https://github.com/algolia/algoliasearch-client-js#slave-settings - */ - forwardToSlaves?: boolean; - /** - * Replace all existing synonyms on the index with the content of the batch - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - replaceExistingSynonyms?: boolean; -} -/** - * Describes options used when searching for synonyms - */ -interface SearchSynonymOptions { - /** - * The actual search query to find synonyms - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - query?: string; - /** - * The page to fetch when browsing through several pages of results - * default: 100 - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - page?: number; - /** - * Restrict the search to a specific type of synonym - * Use an empty string to search all types (default behavior) - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - type?: string; - /** - * Number of hits per page - * default: 100 - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - hitsPerPage?: number -} -interface AlgoliaBrowseResponse { - cursor?: string, - hits: any[], - params: string, - query: string, - processingTimeMS: number -} -/** - * Describes a synonym object - */ -interface AlgoliaSynonym { - /** - * ObjectID of the synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - objectID: string; - /** - * Type of synonym - * values: synonym,oneWaySynonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - type: string; - /** - * Values used for the synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - synonyms: string[]; -} -/** - * Describes the options used when generating new api keys - */ -interface AlgoliaSecuredApiOptions { - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters-1 - */ - filters?: string; - /** - * Defines the expiration date of the API key - * https://github.com/algolia/algoliasearch-client-js#valid-until - */ - validUntil?: number; - /** - * Restricts the key to a list of index names allowed for the secured API key - * https://github.com/algolia/algoliasearch-client-js#index-restriction - */ - restrictIndices?: string; - /** - * Allows you to restrict a single user to performing a maximum of N API calls per hour - * https://github.com/algolia/algoliasearch-client-js#user-rate-limiting - */ - userToken?: string; -} - -/** - * Describes the settings available for configure your index - */ -interface AlgoliaIndexSettings { - /** - * The list of attributes you want index - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoindex - */ - attributesToIndex?: string[]; - /** - * The list of attributes you want to use for faceting - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting - */ - attributesforFaceting?: string[]; - /** - * The list of attributes that cannot be retrieved at query time - * default: null - * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes - */ - unretrievableAttributes?: string[]; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * Controls the way results are sorted - * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] - * https://github.com/algolia/algoliasearch-client-js#ranking - */ - ranking?: string[]; - /** - * Lets you specify part of the ranking - * default: [] - * https://github.com/algolia/algoliasearch-client-js#customranking - */ - customRanking?: string[]; - /** - * The list of indices on which you want to replicate all write operations - * default: [] - * https://github.com/algolia/algoliasearch-client-js#slaves - */ - slaves?: string[]; - /** - * Limit the number of facet values returned for each facet - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * The minimum number of characters needed to accept one typo - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typos. - * default: 8 - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. - * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#typotolerance - */ - typoTolerance?: any; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: true - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Specify the separators (punctuation characters) to index. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#separatorstoindex - */ - separatorsToIndex?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable prefix matching - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes - */ - disablePrefixOnAttributes?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * The name of the attribute used for the Distinct feature - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributefordistinct - */ - attributeForDistinct?: string; - /** - * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct - */ - distinct?: any; - /** - * All numerical attributes are automatically indexed as numerical filters - * default '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * Allows compression of big integer arrays. - * default: false - * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray - */ - allowCompressionOfIntegerArray?: boolean; - /** - * Specify alternative corrections that you want to consider. - * default: [] - * https://github.com/algolia/algoliasearch-client-js#altcorrections - */ - altCorrections?: [{}]; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - minProximity?: number; - /** - * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable - * default: '' - * https://github.com/algolia/algoliasearch-client-js#placeholders - */ - placeholders?: any; -} - -interface AlgoliaQueryParameters { - /** - * Query string used to perform the search - * default: '' - * https://github.com/algolia/algoliasearch-client-js#query - */ - query?: string; - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters - */ - filters?: string; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * List of attributes you want to use for textual search - * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes - */ - restrictSearchableAttributes?: string[]; - /** - * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets - */ - facets?: string; - /** - * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * Pagination parameter used to select the page to retrieve. - * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page - */ - page?: number; - /** - * Offset of the first hit to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#offset - */ - offset?: number; - /** - * Number of hits to return. - * default: null - * https://github.com/algolia/algoliasearch-client-js#length - */ - length?: number; - /** - * The minimum number of characters needed to accept one typo. - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typo. - * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set: - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos - * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos - */ - typoTolerance?: boolean; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Search for entries around a given location - * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng - */ - aroundLatLng?: string; - /** - * Search for entries around a given latitude/longitude automatically computed from user IP address. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip - */ - aroundLatLngViaIP?: string; - /** - * Control the radius associated with a geo search. Defined in meters. - * default: null - * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius - */ - aroundRadius?: any; - /** - * Control the precision of a geo search - * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision - */ - aroundPrecision?: number; - /** - * Define the minimum radius used for a geo search when aroundRadius is not set. - * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius - */ - minimumAroundRadius?: number; - /** - * Search entries inside a given area defined by the two extreme points of a rectangle - * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox - */ - insideBoundingBox?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * Search entries inside a given area defined by a set of points - * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon - */ - insidePolygon?: string; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct - */ - distinct?: any; - /** - * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. - * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo - */ - getRankingInfo?: boolean; - /** - * All numerical attributes are automatically indexed as numerical filters - * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * @deprecated please use filters instead - * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated - */ - numericFilters?: string[]; - /** - * @deprecated - * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated - */ - tagFilters?: string; - /** - * @deprecated - * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated - */ - facetFilters?: string; - /** - * If set to false, this query will not be taken into account in the analytics feature. - * default true - * https://github.com/algolia/algoliasearch-client-js#analytics - */ - analytics?: boolean; - /** - * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags - */ - analyticsTags?: string[]; - /** - * If set to false, the search will not use the synonyms defined for the targeted index. - * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms - */ - synonyms?: boolean; - /** - * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. - * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight - */ - replaceSynonymsInHighlight?: boolean; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - minProximity?: number; -} - -declare module "algoliasearch" { - function algoliasearch(applicationId: string, apiKey: string, options?: ClientOptions) : AlgoliaClient; - export = algoliasearch; -} diff --git a/algoliasearch-client-js/algoliasearch-client-js-tests.ts b/algoliasearch/algoliasearch-tests.ts similarity index 94% rename from algoliasearch-client-js/algoliasearch-client-js-tests.ts rename to algoliasearch/algoliasearch-tests.ts index 82d57c55e0..a3a04aadc2 100644 --- a/algoliasearch-client-js/algoliasearch-client-js-tests.ts +++ b/algoliasearch/algoliasearch-tests.ts @@ -1,5 +1,6 @@ - import algoliasearch = require('algoliasearch'); +import { ClientOptions, SynonymOption, AlgoliaUserKeyOptions, SearchSynonymOptions, + AlgoliaSecuredApiOptions, AlgoliaIndexSettings, AlgoliaQueryParameters, AlgoliaIndex } from "algoliasearch"; var _clientOptions: ClientOptions = { timeout : 12, diff --git a/algoliasearch/index.d.ts b/algoliasearch/index.d.ts new file mode 100644 index 0000000000..582e91999b --- /dev/null +++ b/algoliasearch/index.d.ts @@ -0,0 +1,1528 @@ +// Type definitions for algoliasearch-client-js 3.18.1 +// Project: https://github.com/algolia/algoliasearch-client-js +// Definitions by: Baptiste Coquelle +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace algoliasearch { + interface AlgoliaResponse { + /** + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hits: any[]; + /** + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + page: number; + /** + * Number of total hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbHits: number; + /** + * Number of pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbPage: number; + /** + * Number of hits per pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hitsPerPage: number; + /** + * Engine processing time (excluding network transfer) + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + processingTimeMS: number; + /** + * Query used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + query: string; + /** + * GET parameters used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + params: string; + } + /* + Interface for the algolia client object + */ + interface AlgoliaClient { + /** + * Initialization of the index + * @param name: index name + * return algolia index object + * https://github.com/algolia/algoliasearch-client-js#init-index---initindex + */ + initIndex(name: string): AlgoliaIndex; + /** + * Query on multiple index + * @param queries index name, query and query parameters + * @param cb callback(err, res) + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries + */ + search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }, cb: (err: Error, res: any) => void): void; + /** + * Query on multiple index + * @param queries index name, query and query parameters + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries + */ + search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }): Promise; + /** + * clear browser cache + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * kill alive connections + * https://github.com/algolia/algoliasearch-client-js#keep-alive + */ + destroy(): void; + /** + * List all your indices along with their associated information (number of entries, disk size, etc.) + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes + */ + listIndexes(cb: (err: Error, res: any) => void): void; + /** + * List all your indices along with their associated information (number of entries, disk size, etc.) + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes + */ + listIndexes(): Promise; + /** + * Delete a specific index + * @param name + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex + */ + deleteIndex(name: string, cb: (err: Error, res: any) => void): void; + /** + * Delete a specific index + * @param name + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex + */ + deleteIndex(name: string): Promise; + /** + * Copy an index from a specific index to a new one + * @param from origin index + * @param to destination index + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; + /** + * Copy an index from a specific index to a new one + * @param from origin index + * @param to destination index + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex(from: string, to: string): Promise; + /** + * Move index to a new one (and will overwrite the original one) + * @param from origin index + * @param to destination index + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex + */ + moveIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; + /** + * Move index to a new one (and will overwrite the original one) + * @param from origin index + * @param to destination index + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex + */ + moveIndex(from: string, to: string): Promise; + /** + * Generate a public API key + * @param key api key + * @param filters + * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey + */ + generateSecuredApiKey(key: string, filters: AlgoliaSecuredApiOptions): void; + /** + * Perform multiple operations with one API call to reduce latency + * @param action + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + batch(action: AlgoliaAction, cb: (err: Error, res: any) => void): void; + /** + * Perform multiple operations with one API call to reduce latency + * @param action + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + batch(action: AlgoliaAction): Promise; + /** + * Lists global API Keys + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + listUserKeys(cb: (err: Error, res: any) => void): void; + /** + * Lists global API Keys + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + listUserKeys(): Promise; + /** + * Add global API Keys + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Add global API Key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; + /** + * Add global API Keys + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + addUserKey(scopes: string[], options?: AlgoliaUserKeyOptions): Promise; + /** + * Update global API key + * @param key + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Update global API key + * @param key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; + /** + * Update global API key + * @param key + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[], options?: AlgoliaUserKeyOptions): Promise; + /** + * Gets the rights of a global key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; + /** + * Gets the rights of a global key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + getUserKeyACL(key: string): Promise; + /** + * Deletes a global key + * @param key + * @param cb(err,res) + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey + */ + deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Deletes a global key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey + */ + deleteUserKey(key: string): Promise; + /** + * Get 1000 last events + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; + /** + * Get 1000 last events + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + getLogs(options: LogsOptions): Promise; + } + /** + * Interface for the index algolia object + */ + interface AlgoliaIndex { + /** + * Gets a specific object + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Gets specific attributes from an object + * @param objectID + * @param attributes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, attributes: string[], cb: (err: Error, res: any) => void): void; + /** + * Gets a list of objects + * @param objectIDs + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; + /** + * Add a specific object + * @param object without objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Add a list of objects + * @param object with objectID + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Add list of objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + /** + * Add or replace a specific object + * @param object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Add or replace several objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + /** + * Update parameters of a specific object + * @param object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Update parameters of a list of objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + /** + * Delete a specific object + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Delete a list of objects + * @param objectIDs + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; + /** + * Delete objects that matches the query + * @param query + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, params: {}, cb: (err: Error, res: any) => void): void; + /** + * Wait for an indexing task to be compete + * @param taskID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask + */ + waitTask(taskID: number, cb: (err: Error, res: any) => void): void; + /** + * Get an index settings + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings + */ + getSettings(cb: (err: Error, res: any) => void): void; + /** + * Set an index settings + * @param settings + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings(settings: AlgoliaIndexSettings, cb: (err: Error, res: any) => void): void; + /** + * Clear cache of an index + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * Clear an index content + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex + */ + clearIndex(cb: (err: Error, res: any) => void): void; + /** + * Save a synonym object + * @param synonym + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + saveSynonym(synonym: AlgoliaSynonym, option: SynonymOption, cb: (err: Error, res: any) => void): void; + /** + * Save a synonym object + * @param synonyms + * @param options + * @param cb(err, res) + */ + batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption, cb: (err: Error, res: any) => void): void; + /** + * Delete a specific synonym + * @param identifier + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + deleteSynonym(identifier: string, options: SynonymOption, cb: (err: Error, res: any) => void): void; + /** + * Clear all synonyms of an index + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms + */ + clearSynonyms(options: SynonymOption, cb: (err: Error, res: any) => void): void; + /** + * Get a specific synonym + * @param identifier + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym + */ + getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; + /** + * Search a synonyms + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + searchSynonyms(options: SearchSynonymOptions, cb: (err: Error, res: any) => void): void; + /** + * List index user keys + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys + */ + listUserKeys(cb: (err: Error, res: any) => void): void; + /** + * Add key for this index + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Add key for this index + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; + /** + * Update a key for this index + * @param key + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Update a key for this index + * @param key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; + /** + * Gets the rights of an index specific key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl + */ + getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; + /** + * Deletes an index specific key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey + */ + deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Gets specific attributes from an object + * @param objectID + * @param attributes + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, attributes?: string[]): Promise ; + /** + * Gets a list of objects + * @param objectIDs + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[]): Promise ; + /** + * Add a list of objects + * @param object with objectID + * @param objectID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, objectID?: string): Promise ; + /** + * Add list of objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObjects(objects: [{}]): Promise ; + /** + * Add or replace a specific object + * @param object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObject(object: {}): Promise ; + /** + * Add or replace several objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObjects(objects: [{}]): Promise ; + /** + * Update parameters of a specific object + * @param object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObject(object: {}): Promise ; + /** + * Update parameters of a list of objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObjects(objects: [{}]): Promise ; + /** + * Delete a specific object + * @param objectID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObject(objectID: string): Promise ; + /** + * Delete a list of objects + * @param objectIDs + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObjects(objectIDs: string[]): Promise ; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, params?: {}): Promise ; + /** + * Wait for an indexing task to be compete + * @param taskID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask + */ + waitTask(taskID: number): Promise ; + /** + * Get an index settings + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings + */ + getSettings(): Promise ; + /** + * Set an index settings + * @param settings + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings(settings: AlgoliaIndexSettings): Promise ; + /** + * Search in an index + * @param params query parameter + * return {Promise} + * @param err() error callback + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search(params: AlgoliaQueryParameters): Promise ; + /** + * Search in an index + * @param params query parameter + * @param cb(err, res) + * @param err() error callback + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search(params: AlgoliaQueryParameters, cb: (err: Error, res: any) => void): void; + /** + * Browse an index + * @param query + * @param cb(err, content) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, cb: (err: Error, res: any) => void): void; + /** + * Browse an index + * @param query + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string): Promise; + /** + * Browse an index from a cursor + * @param cursor + * @param cb(err, content) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; + /** + * Browse an index from a cursor + * @param cursor + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string): Promise; + /** + * Browse an entire index + * return Promise + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseAll(): Promise; + /** + * Clear an index content + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex + */ + clearIndex(): Promise ; + /** + * Save a synonym object + * @param synonym + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + saveSynonym(synonym: AlgoliaSynonym, option: SynonymOption): Promise ; + /** + * Save a synonym object + * @param synonyms + * @param options + * return {Promise} + */ + batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption): Promise ; + /** + * Delete a specific synonym + * @param identifier + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + deleteSynonym(identifier: string, options: SynonymOption): Promise ; + /** + * Clear all synonyms of an index + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms + */ + clearSynonyms(options: SynonymOption): Promise ; + /** + * Get a specific synonym + * @param identifier + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym + */ + getSynonym(identifier: string): Promise ; + /** + * Search a synonyms + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + searchSynonyms(options: SearchSynonymOptions): Promise ; + /** + * List index user keys + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys + */ + listUserKeys(): Promise ; + /** + * Add key for this index + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + addUserKey(scopes: string[], options?: AlgoliaUserKeyOptions): Promise ; + /** + * Update a key for this index + * @param key + * @param scopes + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[]): Promise ; + /** + * Update a key for this index + * @param key + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey + */ + updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions): Promise ; + /** + * Gets the rights of an index specific key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl + */ + getUserKeyACL(key: string): Promise ; + /** + * Deletes an index specific key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey + */ + deleteUserKey(key: string): Promise ; + } + /* + Interface describing available options when initializing a client + */ + interface ClientOptions { + /** + * Timeout for requests to our servers, in milliseconds + * default: 15s (node), 2s (browser) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + timeout?: number; + /** + * Protocol to use when communicating with algolia + * default: current protocol(browser), https(node) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + protocol?: string; + /** + * (node only) httpAgent instance to use when communicating with Algolia servers. + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + httpAgent?: any; + /** + * read: array of read hosts to use to call Algolia servers, computed automatically + * write: array of read hosts to use to call Algolia servers, computed automatically + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + hosts?: { read?: string[], write?: string[] }; + } + /* + Interface describing options available for gettings the logs + */ + interface LogsOptions { + /** + * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + offset?: number; + /** + * Specify the maximum number of entries to retrieve starting at the offset. + * default: 10 + * maximum: 1000 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + length?: number; + /** + * @deprecated + * Retrieve only logs with an HTTP code different than 200 or 201 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + onlyErrors?: boolean; + /** + * Specify the type of logs to retrieve + * 'query' Retrieve only the queries + * 'build' Retrieve only the build operations + * 'error' Retrieve only the errors (same as onlyErrors parameters) + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + type?: string; + } + /** + * Describe the action object used for batch operation + */ + interface AlgoliaAction { + /** + * Type of the batch action + * values: addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + action: string; + /** + * Name of the index where the bact will be performed + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + indexName: string; + /** + * Object + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + body: {}; + } + /** + * Describes the option used when creating user key + */ + interface AlgoliaUserKeyOptions { + /** + * Add a validity period. The key will be valid for a specific period of time (in seconds). + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + validity?: number; + /** + * Specify the maximum number of API calls allowed from an IP address per hour + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + maxQueriesPerIPPerHour?: number; + /** + * Specify the maximum number of hits this API key can retrieve in one call + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + maxHitsPerQuery?: boolean; + /** + * Specify the list of targeted indices + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + indexes?: string[]; + /** + * Specify the list of referers + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + referers?: string[]; + /** + * Specify the list of query parameters + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + queryParameters?: AlgoliaQueryParameters; + /** + * Specify a description to describe where the key is used. + * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey + */ + description?: string; + } + /** + * Describes option used when making operation on synonyms + */ + interface SynonymOption { + /** + * You can forward all settings updates to the slaves of an index + * https://github.com/algolia/algoliasearch-client-js#slave-settings + */ + forwardToSlaves?: boolean; + /** + * Replace all existing synonyms on the index with the content of the batch + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + replaceExistingSynonyms?: boolean; + } + /** + * Describes options used when searching for synonyms + */ + interface SearchSynonymOptions { + /** + * The actual search query to find synonyms + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + query?: string; + /** + * The page to fetch when browsing through several pages of results + * default: 100 + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + page?: number; + /** + * Restrict the search to a specific type of synonym + * Use an empty string to search all types (default behavior) + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + type?: string; + /** + * Number of hits per page + * default: 100 + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + hitsPerPage?: number; + } + interface AlgoliaBrowseResponse { + cursor?: string; + hits: any[]; + params: string; + query: string; + processingTimeMS: number; + } + /** + * Describes a synonym object + */ + interface AlgoliaSynonym { + /** + * ObjectID of the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + objectID: string; + /** + * Type of synonym + * values: synonym,oneWaySynonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + type: string; + /** + * Values used for the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + synonyms: string[]; + } + /** + * Describes the options used when generating new api keys + */ + interface AlgoliaSecuredApiOptions { + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters-1 + */ + filters?: string; + /** + * Defines the expiration date of the API key + * https://github.com/algolia/algoliasearch-client-js#valid-until + */ + validUntil?: number; + /** + * Restricts the key to a list of index names allowed for the secured API key + * https://github.com/algolia/algoliasearch-client-js#index-restriction + */ + restrictIndices?: string; + /** + * Allows you to restrict a single user to performing a maximum of N API calls per hour + * https://github.com/algolia/algoliasearch-client-js#user-rate-limiting + */ + userToken?: string; + } + + /** + * Describes the settings available for configure your index + */ + interface AlgoliaIndexSettings { + /** + * The list of attributes you want index + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoindex + */ + attributesToIndex?: string[]; + /** + * The list of attributes you want to use for faceting + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting + */ + attributesforFaceting?: string[]; + /** + * The list of attributes that cannot be retrieved at query time + * default: null + * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes + */ + unretrievableAttributes?: string[]; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * Controls the way results are sorted + * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] + * https://github.com/algolia/algoliasearch-client-js#ranking + */ + ranking?: string[]; + /** + * Lets you specify part of the ranking + * default: [] + * https://github.com/algolia/algoliasearch-client-js#customranking + */ + customRanking?: string[]; + /** + * The list of indices on which you want to replicate all write operations + * default: [] + * https://github.com/algolia/algoliasearch-client-js#slaves + */ + slaves?: string[]; + /** + * Limit the number of facet values returned for each facet + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: string; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * The minimum number of characters needed to accept one typo + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typos. + * default: 8 + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#typotolerance + */ + typoTolerance?: any; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: true + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Specify the separators (punctuation characters) to index. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#separatorstoindex + */ + separatorsToIndex?: string; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable prefix matching + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes + */ + disablePrefixOnAttributes?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * The name of the attribute used for the Distinct feature + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributefordistinct + */ + attributeForDistinct?: string; + /** + * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. + * https://github.com/algolia/algoliasearch-client-js#distinct + */ + distinct?: any; + /** + * All numerical attributes are automatically indexed as numerical filters + * default '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * Allows compression of big integer arrays. + * default: false + * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray + */ + allowCompressionOfIntegerArray?: boolean; + /** + * Specify alternative corrections that you want to consider. + * default: [] + * https://github.com/algolia/algoliasearch-client-js#altcorrections + */ + altCorrections?: [{}]; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + /** + * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable + * default: '' + * https://github.com/algolia/algoliasearch-client-js#placeholders + */ + placeholders?: any; + } + + interface AlgoliaQueryParameters { + /** + * Query string used to perform the search + * default: '' + * https://github.com/algolia/algoliasearch-client-js#query + */ + query?: string; + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters + */ + filters?: string; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * List of attributes you want to use for textual search + * default: attributeToIndex + * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes + */ + restrictSearchableAttributes?: string[]; + /** + * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes + * default: "" + * https://github.com/algolia/algoliasearch-client-js#facets + */ + facets?: string; + /** + * Limit the number of facet values returned for each facet. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: string; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * Pagination parameter used to select the page to retrieve. + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#page + */ + page?: number; + /** + * Offset of the first hit to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#offset + */ + offset?: number; + /** + * Number of hits to return. + * default: null + * https://github.com/algolia/algoliasearch-client-js#length + */ + length?: number; + /** + * The minimum number of characters needed to accept one typo. + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typo. + * fault: 8 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set: + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + typoTolerance?: boolean; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Search for entries around a given location + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + */ + aroundLatLng?: string; + /** + * Search for entries around a given latitude/longitude automatically computed from user IP address. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + */ + aroundLatLngViaIP?: string; + /** + * Control the radius associated with a geo search. Defined in meters. + * default: null + * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area + * https://github.com/algolia/algoliasearch-client-js#aroundradius + */ + aroundRadius?: any; + /** + * Control the precision of a geo search + * default: null + * https://github.com/algolia/algoliasearch-client-js#aroundprecision + */ + aroundPrecision?: number; + /** + * Define the minimum radius used for a geo search when aroundRadius is not set. + * default: null + * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + */ + minimumAroundRadius?: number; + /** + * Search entries inside a given area defined by the two extreme points of a rectangle + * default: null + * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + */ + insideBoundingBox?: string; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * Search entries inside a given area defined by a set of points + * defauly: '' + * https://github.com/algolia/algoliasearch-client-js#insidepolygon + */ + insidePolygon?: string; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. + * https://github.com/algolia/algoliasearch-client-js#distinct + */ + distinct?: any; + /** + * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. + * default: false + * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + */ + getRankingInfo?: boolean; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * @deprecated please use filters instead + * A string that contains the comma separated list of numeric filters you want to apply. + * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + */ + numericFilters?: string[]; + /** + * @deprecated + * Filter the query by a set of tags. + * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + */ + tagFilters?: string; + /** + * @deprecated + * Filter the query by a set of facets. + * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + */ + facetFilters?: string; + /** + * If set to false, this query will not be taken into account in the analytics feature. + * default true + * https://github.com/algolia/algoliasearch-client-js#analytics + */ + analytics?: boolean; + /** + * If set, tag your query with the specified identifiers + * default: null + * https://github.com/algolia/algoliasearch-client-js#analyticstags + */ + analyticsTags?: string[]; + /** + * If set to false, the search will not use the synonyms defined for the targeted index. + * default: true + * https://github.com/algolia/algoliasearch-client-js#synonyms + */ + synonyms?: boolean; + /** + * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. + * default: true + * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + */ + replaceSynonymsInHighlight?: boolean; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + } +} + +declare function algoliasearch(applicationId: string, apiKey: string, options?: algoliasearch.ClientOptions): algoliasearch.AlgoliaClient; +export = algoliasearch; diff --git a/algoliasearch-client-js/tsconfig.json b/algoliasearch/tsconfig.json similarity index 89% rename from algoliasearch-client-js/tsconfig.json rename to algoliasearch/tsconfig.json index d8c5e4f8f1..323a28e879 100644 --- a/algoliasearch-client-js/tsconfig.json +++ b/algoliasearch/tsconfig.json @@ -14,6 +14,6 @@ }, "files": [ "index.d.ts", - "algoliasearch-client-js-tests.ts" + "algoliasearch-tests.ts" ] } \ No newline at end of file diff --git a/amcharts/index.d.ts b/amcharts/index.d.ts index fbc2ee4ac9..45c848e5af 100644 --- a/amcharts/index.d.ts +++ b/amcharts/index.d.ts @@ -24,6 +24,9 @@ declare namespace AmCharts { /** Set it to true if you want UTC time to be used instead of local time. */ var useUTC: boolean; + /** Object with themes */ + var themes: any; + /** Clears all the charts on page, removes listeners and intervals. */ function clear(): void; diff --git a/amplify-deferred/amplify-deferred-tests.ts b/amplify-deferred/amplify-deferred-tests.ts index 9482a8ef02..a4c7c656c4 100644 --- a/amplify-deferred/amplify-deferred-tests.ts +++ b/amplify-deferred/amplify-deferred-tests.ts @@ -1,265 +1,5 @@ - -/// - -// Copied examples directly from AmplifyJs site - -// Subscribe and publish with no data - -amplify.subscribe("nodataexample", function () { - alert("nodataexample topic published!"); -}); - -// Subscribe and publish with data - -amplify.publish("nodataexample"); - -amplify.subscribe("dataexample", function (data) { - alert(data.foo); // bar -}); - - -amplify.publish("dataexample", { foo: "bar" }); - -amplify.subscribe("dataexample2", function (param1, param2) { - alert(param1 + param2); // barbaz -}); - -//... - -amplify.publish("dataexample2", "bar", "baz"); - -// Subscribe and publish with context and data - -amplify.subscribe("datacontextexample", $("p:first"), function (data) { - this.text(data.exampleText); // first p element would have "foo bar baz" as text -}); - -amplify.publish("datacontextexample", { exampleText: "foo bar baz" }); - -// Subscribe to a topic with high priority - -amplify.subscribe("priorityexample", function (data) { - alert(data.foo); -}); - -amplify.subscribe("priorityexample", function (data) { - if (data.foo === "oops") { - return false; - } -}, 1); - - -// Store data with amplify storage picking the default storage technology: - -amplify.publish("priorityexample", { foo: "bar" }); -amplify.publish("priorityexample", { foo: "oops" }); - -amplify.store("storeExample1", { foo: "bar" }); -amplify.store("storeExample2", "baz"); -// retrieve the data later via the key -var myStoredValue = amplify.store("storeExample1"), - myStoredValue2 = amplify.store("storeExample2"), - myStoredValues = amplify.store(); -myStoredValue.foo; // bar -myStoredValue2; // baz -myStoredValues.storeExample1.foo; // bar -myStoredValues.storeExample2; // baz - -// Store data explicitly with session storage - -amplify.store.sessionStorage("explicitExample", { foo2: "baz" }); -// retrieve the data later via the key -var myStoredValue2 = amplify.store.sessionStorage("explicitExample"); -myStoredValue2.foo2; // baz - - -// REQUEST - -// Set up and use a request utilizing Ajax - - -amplify.request.define("ajaxExample1", "ajax", { - url: "/myApiUrl", - dataType: "json", - type: "GET" -}); - -// later in code -amplify.request("ajaxExample1", function (data) { - data.foo; // bar -}); - -// Set up and use a request utilizing Ajax and Caching - -amplify.request.define("ajaxExample2", "ajax", { - url: "/myApiUrl", - dataType: "json", - type: "GET", - cache: "persist" -}); - -// later in code -amplify.request("ajaxExample2", function (data) { - data.foo; // bar -}); - -// a second call will result in pulling from the cache -amplify.request("ajaxExample2", function (data) { - data.baz; // qux -}) - -// Set up and use a RESTful request utilizing Ajax - -amplify.request.define("ajaxRESTFulExample", "ajax", { - url: "/myRestFulApi/{type}/{id}", - type: "GET" -}) - -// later in code -amplify.request("ajaxRESTFulExample", - { - type: "foo", - id: "bar" - }, - function (data) { - // /myRESTFulApi/foo/bar was the URL used - data.foo; // bar - } - ); - -// POST data with Ajax - -amplify.request.define("ajaxPostExample", "ajax", { - url: "/myRestFulApi", - type: "POST" -}) - -// later in code -amplify.request("ajaxPostExample", - { - type: "foo", - id: "bar" - }, - function (data) { - data.foo; // bar - } - ); -// Using data maps - -// When searching Twitter, the key for the search phrase is q.If we want a more descriptive name, such as term, we can use a data map: - -amplify.request.define("twitter-search", "ajax", { - url: "http://search.twitter.com/search.json", - dataType: "jsonp", - dataMap: { - term: "q" - } -}); - -amplify.request("twitter-search", { term: "amplifyjs" }); - -// Similarly, we can create a request that searches for mentions, by accepting a username: - -amplify.request.define("twitter-mentions", "ajax", { - url: "http://search.twitter.com/search.json", - dataType: "jsonp", - dataMap: function (data) { - return { - q: "@" + data.user - }; - } -}); - -amplify.request("twitter-mentions", { user: "amplifyjs" }); - -// Setting up and using decoders - -//Example: - -var appEnvelopeDecoder: amplifyDecoder = function (data, status, xhr, success, error) { - if (data.status === "success") { - success(data.data); - } else if (data.status === "fail" || data.status === "error") { - error(data.message, data.status); - } else { - error(data.message, "fatal"); - } -}; - -//a new decoder can be added to the amplifyDecoders interface -interface amplifyDecoders { - appEnvelope: amplifyDecoder; -} - -amplify.request.decoders.appEnvelope = appEnvelopeDecoder; - -//but you can also just add it via an index -amplify.request.decoders['appEnvelopeStr'] = appEnvelopeDecoder; - - -amplify.request.define("decoderExample", "ajax", { - url: "/myAjaxUrl", - type: "POST", - decoder: "appEnvelope" -}); - -amplify.request({ - resourceId: "decoderExample", - success: function (data) { - data.foo; // bar - }, - error: function (message, level) { - alert("always handle errors with alerts."); - } -}); - -// POST with caching and single - use decoder - -// Example: - -amplify.request.define("decoderSingleExample", "ajax", { - url: "/myAjaxUrl", - type: "POST", - decoder: function (data, status, xhr, success, error) { - if (data.status === "success") { - success(data.data); - } else if (data.status === "fail" || data.status === "error") { - error(data.message, data.status); - } else { - error(data.message, "fatal"); - } - } -}); - -amplify.request({ - resourceId: "decoderSingleExample", - success: function (data) { - data.foo; // bar - }, - error: function (message, level) { - alert("always handle errors with alerts."); - } -}); -// Handling Status -// Status in Success and Error Callbacks - -// amplify.request comes with built in support for status.The status parameter appears in the default success or error callbacks when using an ajax definition. - -amplify.request.define("statusExample1", "ajax", { - //... -}); - -amplify.request({ - resourceId: "statusExample1", - success: function (data, status) { - }, - error: function (data, status) { - } -}); - amplify.request({ resourceId: "statusExample1" }).done(function (data, status) { }).fail(function (data, status) { }).always(function (data, status) { }); - diff --git a/amplify-deferred/index.d.ts b/amplify-deferred/index.d.ts index 3736a6644b..24f88455e9 100644 --- a/amplify-deferred/index.d.ts +++ b/amplify-deferred/index.d.ts @@ -5,178 +5,26 @@ /// -interface amplifyRequestSettings { - resourceId: string; - data?: any; - success?: (...args: any[]) => void; - error?: (...args: any[]) => void; +import * as amplify from "amplify"; + +declare module "amplify" { + interface Request { + /*** + * Request a resource. + * resourceId: Identifier string for the resource. + * data: A set of key/value pairs of data to be sent to the resource. + * callback: A function to invoke if the resource is retrieved successfully. + */ + (resourceId: string, hash?: any, callback?: Function): JQueryPromise; + + /*** + * Request a resource. + * settings: A set of key/value pairs of settings for the request. + * resourceId: Identifier string for the resource. + * data (optional): Data associated with the request. + * success (optional): Function to invoke on success. + * error (optional): Function to invoke on error. + */ + (settings: RequestSettings): JQueryPromise; + } } - -interface amplifyDecoder { - ( - data?: any, - status?: string, - xhr?: JQueryXHR, - success?: (...args: any[]) => void, - error?: (...args: any[]) => void - ): void -} - -interface amplifyDecoders { - [decoderName: string]: amplifyDecoder; - jsSend: amplifyDecoder; -} - -interface amplifyAjaxSettings extends JQueryAjaxSettings { - cache?: any; - dataMap?: {} | ((data: any) => {}); - decoder?: any /* string or amplifyDecoder */; -} - -interface amplifyRequest { - - /*** - * Request a resource. - * resourceId: Identifier string for the resource. - * data: A set of key/value pairs of data to be sent to the resource. - * callback: A function to invoke if the resource is retrieved successfully. - */ - (resourceId: string, hash?: any, callback?: Function): JQueryPromise; - - /*** - * Request a resource. - * settings: A set of key/value pairs of settings for the request. - * resourceId: Identifier string for the resource. - * data (optional): Data associated with the request. - * success (optional): Function to invoke on success. - * error (optional): Function to invoke on error. - */ - (settings: amplifyRequestSettings): JQueryPromise; - - /*** - * Define a resource. - * resourceId: Identifier string for the resource. - * requestType: The type of data retrieval method from the server. See the request types sections for more information. - * settings: A set of key/value pairs that relate to the server communication technology. The following settings are available: - * Any settings found in jQuery.ajax(). - * cache: See the cache section for more details. - * decoder: See the decoder section for more details. - */ - define(resourceId: string, requestType: string, settings?: amplifyAjaxSettings): void; - - /*** - * Define a custom request. - * resourceId: Identifier string for the resource. - * resource: Function to handle requests. Receives a hash with the following properties: - * resourceId: Identifier string for the resource. - * data: Data provided by the user. - * success: Callback to invoke on success. - * error: Callback to invoke on error. - */ - define(resourceId: string, resource: (settings: amplifyRequestSettings) => void): void; - - decoders: amplifyDecoders; - cache: any; -} - -interface amplifySubscribe { - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * callback: Function to invoke when the message is published. - */ - (topic: string, callback: Function): void; - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * context: What this will be when the callback is invoked. - * callback: Function to invoke when the message is published. - * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. - */ - (topic: string, context: any, callback: Function, priority?: number): void; - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * callback: Function to invoke when the message is published. - * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. - */ - (topic: string, callback: Function, priority?: number): void; -} -interface amplifyStorageTypeStore { - /*** - * Stores a value for a given key using the default storage type. - * - * key: Identifier for the value being stored. - * value: The value to store. The value can be anything that can be serialized as JSON. - * [options]: A set of key/value pairs that relate to settings for storing the value. - */ - (key: string, value: any, options?: any): void; - - /*** - * Gets a stored value based on the key. - */ - (key: string): any; - - /*** - * Gets a hash of all stored values. - */ - (): any; -} - -interface amplifyStore extends amplifyStorageTypeStore { - - /*** - * IE 8+, Firefox 3.5+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ - */ - localStorage: amplifyStorageTypeStore; - - /*** - * IE 8+, Firefox 2+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ - */ - sessionStorage: amplifyStorageTypeStore; - - /*** - * Firefox 2+ - */ - globalStorage: amplifyStorageTypeStore; - - /*** - * IE 5 - 7 - */ - userData: amplifyStorageTypeStore; - - /*** - * An in-memory store is provided as a fallback if none of the other storage types are available. - */ - memory: amplifyStorageTypeStore; - - -} - -interface amplifyStatic { - - subscribe: amplifySubscribe; - - /*** - * Remove a subscription. - * topic: The topic being unsubscribed from. - * callback: The callback that was originally subscribed. - */ - unsubscribe(topic: string, callback: Function): void; - - /*** - * Publish a message. - * topic: The name of the message to publish. - * Any additional parameters will be passed to the subscriptions. - * amplify.publish returns a boolean indicating whether any subscriptions returned false. The return value is true if none of the subscriptions returned false, and false otherwise. Note that only one subscription can return false because doing so will prevent additional subscriptions from being invoked. - */ - publish(topic: string, ...args: any[]): boolean; - - store: amplifyStore; - - request: amplifyRequest; - -} - -declare var amplify: amplifyStatic; - diff --git a/amplify-deferred/tslint.json b/amplify-deferred/tslint.json new file mode 100644 index 0000000000..0f47deabb4 --- /dev/null +++ b/amplify-deferred/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} \ No newline at end of file diff --git a/amplify/amplifyjs-tests.ts b/amplify/amplifyjs-tests.ts index ec3807435d..f844642b8e 100644 --- a/amplify/amplifyjs-tests.ts +++ b/amplify/amplifyjs-tests.ts @@ -1,6 +1,8 @@ /// +import amplify = require("amplify"); + // Copied examples directly from AmplifyJs site // Subscribe and publish with no data @@ -176,7 +178,7 @@ amplify.request("twitter-mentions", { user: "amplifyjs" }); //Example: -var appEnvelopeDecoder: amplifyDecoder = function (data, status, xhr, success, error) { +var appEnvelopeDecoder: amplify.Decoder = function (data, status, xhr, success, error) { if (data.status === "success") { success(data.data); } else if (data.status === "fail" || data.status === "error") { @@ -187,8 +189,10 @@ var appEnvelopeDecoder: amplifyDecoder = function (data, status, xhr, success, e }; //a new decoder can be added to the amplifyDecoders interface -interface amplifyDecoders { - appEnvelope: amplifyDecoder; +declare module "amplify" { + interface Decoders { + appEnvelope: amplify.Decoder; + } } amplify.request.decoders.appEnvelope = appEnvelopeDecoder; diff --git a/amplify/index.d.ts b/amplify/index.d.ts index 8955fdc7de..ee14a6891e 100644 --- a/amplify/index.d.ts +++ b/amplify/index.d.ts @@ -5,178 +5,173 @@ /// -interface amplifyRequestSettings { - resourceId: string; - data?: any; - success?: (...args: any[]) => void; - error?: (...args: any[]) => void; +declare namespace amplify { + interface RequestSettings { + resourceId: string; + data?: any; + success?: (...args: any[]) => void; + error?: (...args: any[]) => void; + } + + type Decoder = + ( + data?: any, + status?: string, + xhr?: JQueryXHR, + success?: (...args: any[]) => void, + error?: (...args: any[]) => void + ) => void; + + interface Decoders { + [decoderName: string]: Decoder; + jsSend: Decoder; + } + + interface AjaxSettings extends JQueryAjaxSettings { + cache?: any; + dataMap?: {} | ((data: any) => {}); + decoder?: any /* string or amplifyDecoder */; + } + + interface Request { + + /*** + * Request a resource. + * resourceId: Identifier string for the resource. + * data: A set of key/value pairs of data to be sent to the resource. + * callback: A function to invoke if the resource is retrieved successfully. + */ + (resourceId: string, hash?: any, callback?: Function): void; + + /*** + * Request a resource. + * settings: A set of key/value pairs of settings for the request. + * resourceId: Identifier string for the resource. + * data (optional): Data associated with the request. + * success (optional): Function to invoke on success. + * error (optional): Function to invoke on error. + */ + (settings: RequestSettings): any; + + /*** + * Define a resource. + * resourceId: Identifier string for the resource. + * requestType: The type of data retrieval method from the server. See the request types sections for more information. + * settings: A set of key/value pairs that relate to the server communication technology. The following settings are available: + * Any settings found in jQuery.ajax(). + * cache: See the cache section for more details. + * decoder: See the decoder section for more details. + */ + define(resourceId: string, requestType: string, settings?: AjaxSettings): void; + + /*** + * Define a custom request. + * resourceId: Identifier string for the resource. + * resource: Function to handle requests. Receives a hash with the following properties: + * resourceId: Identifier string for the resource. + * data: Data provided by the user. + * success: Callback to invoke on success. + * error: Callback to invoke on error. + */ + define(resourceId: string, resource: (settings: RequestSettings) => void): void; + + decoders: Decoders; + cache: any; + } + + interface Subscribe { + /*** + * Subscribe to a message. + * topic: Name of the message to subscribe to. + * callback: Function to invoke when the message is published. + * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. + */ + (topic: string, callback: Function, priority?: number): void; + /*** + * Subscribe to a message. + * topic: Name of the message to subscribe to. + * context: What this will be when the callback is invoked. + * callback: Function to invoke when the message is published. + * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. + */ + (topic: string, context: any, callback: Function, priority?: number): void; + } + interface StorageTypeStore { + /*** + * Stores a value for a given key using the default storage type. + * + * key: Identifier for the value being stored. + * value: The value to store. The value can be anything that can be serialized as JSON. + * [options]: A set of key/value pairs that relate to settings for storing the value. + */ + (key: string, value: any, options?: any): void; + + /*** + * Gets a stored value based on the key. + */ + (key: string): any; + + /*** + * Gets a hash of all stored values. + */ + (): any; + } + + interface Store extends StorageTypeStore { + + /*** + * IE 8+, Firefox 3.5+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ + */ + localStorage: StorageTypeStore; + + /*** + * IE 8+, Firefox 2+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ + */ + sessionStorage: StorageTypeStore; + + /*** + * Firefox 2+ + */ + globalStorage: StorageTypeStore; + + /*** + * IE 5 - 7 + */ + userData: StorageTypeStore; + + /*** + * An in-memory store is provided as a fallback if none of the other storage types are available. + */ + memory: StorageTypeStore; + + + } + + interface Static { + + subscribe: Subscribe; + + /*** + * Remove a subscription. + * topic: The topic being unsubscribed from. + * callback: The callback that was originally subscribed. + */ + unsubscribe(topic: string, callback: Function): void; + + /*** + * Publish a message. + * topic: The name of the message to publish. + * Any additional parameters will be passed to the subscriptions. + * amplify.publish returns a boolean indicating whether any subscriptions returned false. The return value is true if none of the subscriptions returned false, and false otherwise. Note that only one subscription can return false because doing so will prevent additional subscriptions from being invoked. + */ + publish(topic: string, ...args: any[]): boolean; + + store: Store; + + request: Request; + } } -interface amplifyDecoder { - ( - data?: any, - status?: string, - xhr?: JQueryXHR, - success?: (...args: any[]) => void, - error?: (...args: any[]) => void - ): void -} - -interface amplifyDecoders { - [decoderName: string]: amplifyDecoder; - jsSend: amplifyDecoder; -} - -interface amplifyAjaxSettings extends JQueryAjaxSettings { - cache?: any; - dataMap?: {} | ((data: any) => {}); - decoder?: any /* string or amplifyDecoder */; -} - -interface amplifyRequest { - - /*** - * Request a resource. - * resourceId: Identifier string for the resource. - * data: A set of key/value pairs of data to be sent to the resource. - * callback: A function to invoke if the resource is retrieved successfully. - */ - (resourceId: string, hash?: any, callback?: Function): void; - - /*** - * Request a resource. - * settings: A set of key/value pairs of settings for the request. - * resourceId: Identifier string for the resource. - * data (optional): Data associated with the request. - * success (optional): Function to invoke on success. - * error (optional): Function to invoke on error. - */ - (settings: amplifyRequestSettings): any; - - /*** - * Define a resource. - * resourceId: Identifier string for the resource. - * requestType: The type of data retrieval method from the server. See the request types sections for more information. - * settings: A set of key/value pairs that relate to the server communication technology. The following settings are available: - * Any settings found in jQuery.ajax(). - * cache: See the cache section for more details. - * decoder: See the decoder section for more details. - */ - define(resourceId: string, requestType: string, settings?: amplifyAjaxSettings): void; - - /*** - * Define a custom request. - * resourceId: Identifier string for the resource. - * resource: Function to handle requests. Receives a hash with the following properties: - * resourceId: Identifier string for the resource. - * data: Data provided by the user. - * success: Callback to invoke on success. - * error: Callback to invoke on error. - */ - define(resourceId: string, resource: (settings: amplifyRequestSettings) => void): void; - - decoders: amplifyDecoders; - cache: any; -} - -interface amplifySubscribe { - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * callback: Function to invoke when the message is published. - */ - (topic: string, callback: Function): void; - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * context: What this will be when the callback is invoked. - * callback: Function to invoke when the message is published. - * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. - */ - (topic: string, context: any, callback: Function, priority?: number): void; - /*** - * Subscribe to a message. - * topic: Name of the message to subscribe to. - * callback: Function to invoke when the message is published. - * [priority]: Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10. - */ - (topic: string, callback: Function, priority?: number): void; -} -interface amplifyStorageTypeStore { - /*** - * Stores a value for a given key using the default storage type. - * - * key: Identifier for the value being stored. - * value: The value to store. The value can be anything that can be serialized as JSON. - * [options]: A set of key/value pairs that relate to settings for storing the value. - */ - (key: string, value: any, options?: any): void; - - /*** - * Gets a stored value based on the key. - */ - (key: string): any; - - /*** - * Gets a hash of all stored values. - */ - (): any; -} - -interface amplifyStore extends amplifyStorageTypeStore{ - - /*** - * IE 8+, Firefox 3.5+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ - */ - localStorage: amplifyStorageTypeStore; - - /*** - * IE 8+, Firefox 2+, Safari 4+, Chrome, Opera 10.5+, iPhone 2+, Android 2+ - */ - sessionStorage: amplifyStorageTypeStore; - - /*** - * Firefox 2+ - */ - globalStorage: amplifyStorageTypeStore; - - /*** - * IE 5 - 7 - */ - userData: amplifyStorageTypeStore; - - /*** - * An in-memory store is provided as a fallback if none of the other storage types are available. - */ - memory: amplifyStorageTypeStore; - - -} - -interface amplifyStatic { - - subscribe: amplifySubscribe; - - /*** - * Remove a subscription. - * topic: The topic being unsubscribed from. - * callback: The callback that was originally subscribed. - */ - unsubscribe(topic: string, callback: Function): void; - - /*** - * Publish a message. - * topic: The name of the message to publish. - * Any additional parameters will be passed to the subscriptions. - * amplify.publish returns a boolean indicating whether any subscriptions returned false. The return value is true if none of the subscriptions returned false, and false otherwise. Note that only one subscription can return false because doing so will prevent additional subscriptions from being invoked. - */ - publish(topic: string, ...args: any[]): boolean; - - store: amplifyStore; - - request: amplifyRequest; - -} - -declare var amplify: amplifyStatic; -declare module "amplify" { export =amplify; } +declare var amplify: amplify.Static; +export = amplify; +export as namespace amplify; diff --git a/amplify/tslint.json b/amplify/tslint.json new file mode 100644 index 0000000000..2d6cd90f81 --- /dev/null +++ b/amplify/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "unified-signatures": false + } +} \ No newline at end of file diff --git a/angular-bootstrap-calendar/index.d.ts b/angular-bootstrap-calendar/index.d.ts index 5c6b4f1fec..a451ee9b03 100644 --- a/angular-bootstrap-calendar/index.d.ts +++ b/angular-bootstrap-calendar/index.d.ts @@ -7,7 +7,35 @@ import * as moment from 'moment'; import * as angular from 'angular'; declare module 'angular' { - export namespace bootstrap.calendar { + export namespace bootstrap.calendar { + interface IEventAction { + /** + * The label of the action + */ + label: string; + /** + * CSS class to be added to the action element + */ + cssClass?: string; + /** + * The action that occurs when it's clicked + * @param args - the IEvent whose action was clicked + */ + onClick: (args: any) => void; + } + + interface IEventColor { + /** + * The primary color of the event, should be darker than secondary + */ + primary: string; + + /** + * The secondary color of the event, should be lighter than primary + */ + secondary: string; + } + interface IEvent { /** * The title of the event @@ -16,7 +44,7 @@ declare module 'angular' { /** * The type of the event (determines its color). Can be important, warning, info, inverse, success or special */ - type: string; + type?: string; /** * A javascript date object for when the event starts */ @@ -25,6 +53,14 @@ declare module 'angular' { * Optional - a javascript date object for when the event ends */ endsAt?: Date; + /** + * Color of the Event + */ + color?: IEventColor; + /** + * Actions of the Event + */ + actions?: Array; /** * If edit-event-html is set and this field is explicitly set to false then dont make it editable. */ @@ -53,6 +89,10 @@ declare module 'angular' { * A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc */ cssClass?: string; + /** + * If set the event will display as all-day event + */ + allDay?: boolean; } interface ICalendarConfig { @@ -134,7 +174,7 @@ declare module 'angular' { } interface IOnViewChangeClick { - (calendarDate: Date, calendarNextView: string): void; + (calendarDate: Date, calendarNextView: string): boolean; } } } diff --git a/angular-breadcrumb/index.d.ts b/angular-breadcrumb/index.d.ts index 81bb8a1d37..a21d7f7ce0 100644 --- a/angular-breadcrumb/index.d.ts +++ b/angular-breadcrumb/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-breadcrumb 0.4.1 +// Type definitions for angular-breadcrumb 0.4.1 // Project: https://github.com/ncuillery/angular-breadcrumb // Definitions by: Marc Talary // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -76,4 +76,4 @@ declare namespace ncy { **/ getLastStep(): angular.ui.IState; } -} \ No newline at end of file +} diff --git a/angular-file-saver/angular-file-saver-tests.ts b/angular-file-saver/angular-file-saver-tests.ts new file mode 100644 index 0000000000..24a31470a1 --- /dev/null +++ b/angular-file-saver/angular-file-saver-tests.ts @@ -0,0 +1,10 @@ +class ExampleCtrl { + constructor(FileSaver: angular.FileSaver) { + var data = new Blob(["Hey ho lets go!"], { type: "text/plain;charset=utf-8" }); + FileSaver.saveAs(data, "text.txt"); + } +} + +angular + .module("fileSaverExample", ["ngFileSaver"]) + .controller("ExampleCtrl", ExampleCtrl); \ No newline at end of file diff --git a/angular-file-saver/index.d.ts b/angular-file-saver/index.d.ts new file mode 100644 index 0000000000..ef834f4dcb --- /dev/null +++ b/angular-file-saver/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for angular-file-saver 1.2.0 +// Project: https://github.com/alferov/angular-file-saver +// Definitions by: Donald Nairn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace angular { + /** + * A core Angular factory proving FileSaver functionality. + */ + interface FileSaver { + /** + * Immediately starts saving a file + * @param data: a Blob instance; + * @param filename: a String custom filename (an extension is optional); + * @param disableAutoBOM : (optional) Boolean Disable automatically provided Unicode text encoding hints; + */ + saveAs(blob: Blob, fileName: string, disableBOM?: boolean): void; + } +} \ No newline at end of file diff --git a/angular-file-saver/tsconfig.json b/angular-file-saver/tsconfig.json new file mode 100644 index 0000000000..f77f15a782 --- /dev/null +++ b/angular-file-saver/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "angular-file-saver-tests.ts" + ] +} \ No newline at end of file diff --git a/angular-idle/index.d.ts b/angular-idle/index.d.ts index 668aef866f..782d3b4ec2 100644 --- a/angular-idle/index.d.ts +++ b/angular-idle/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ng-idle v1.1.1 +// Type definitions for ng-idle v1.1.1 // Project: http://hackedbychinese.github.io/ng-idle/ // Definitions by: mthamil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-jwt/index.d.ts b/angular-jwt/index.d.ts index 8c31b2d463..fd58699c79 100644 --- a/angular-jwt/index.d.ts +++ b/angular-jwt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-jwt 0.0.8 +// Type definitions for angular-jwt 0.0.8 // Project: https://github.com/auth0/angular-jwt // Definitions by: Reto Rezzonico // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-material/index.d.ts b/angular-material/index.d.ts index 7895732ada..ffdab5839b 100644 --- a/angular-material/index.d.ts +++ b/angular-material/index.d.ts @@ -76,7 +76,7 @@ declare module 'angular' { } interface IColorService { - applyThemeColors(element: Element|JQuery, colorExpression: IColorExpression): void; + applyThemeColors(element: Element | JQuery, colorExpression: IColorExpression): void; getThemeColor(expression: string): string; hasTheme(): boolean; } @@ -158,7 +158,7 @@ declare module 'angular' { hideDelay(delay: number): T; position(position: string): T; parent(parent?: string | Element | JQuery): T; // default: root node - toastClass(toastClass: string): T; + toastClass(toastClass: string): T; } interface ISimpleToastPreset extends IToastPreset { @@ -225,7 +225,7 @@ declare module 'angular' { hues: IThemeHues; } - interface IBrowserColors{ + interface IBrowserColors { theme: string; palette: string; hue: string; @@ -264,6 +264,7 @@ declare module 'angular' { definePalette(name: string, palette: IPalette): IThemingProvider; enableBrowserColor(browserColors: IBrowserColors): Function; extendPalette(name: string, palette: IPalette): IPalette; + registerStyles(styles: String): void; setDefaultTheme(theme: string): void; setNonce(nonce: string): void; theme(name: string, inheritFrom?: string): ITheme; @@ -414,7 +415,7 @@ declare module 'angular' { ESCAPE: string, }; absPosition: { - TOP: string, + TOP: string, RIGHT: string, BOTTOM: string, LEFT: string, diff --git a/angular-media-queries/index.d.ts b/angular-media-queries/index.d.ts index 328d4de27b..1b0cf67d60 100644 --- a/angular-media-queries/index.d.ts +++ b/angular-media-queries/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular matchMedia 0.6.0 (angular.matchMedia module) +// Type definitions for Angular matchMedia 0.6.0 (angular.matchMedia module) // Project: https://github.com/jacopotarantino/angular-match-media // Definitions by: Joao Monteiro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-mocks/angular-mocks-tests.ts b/angular-mocks/angular-mocks-tests.ts index d0d1dc5dce..8ea42e4122 100644 --- a/angular-mocks/angular-mocks-tests.ts +++ b/angular-mocks/angular-mocks-tests.ts @@ -106,6 +106,7 @@ $componentController<{}, { test: boolean }>('Test controller', { $scope: ('Test controller', { $scope: {} }, {}); $componentController<{}, {}>('Test controller', { $scope: {} }, {}, 'identity'); $componentController<{ cb: () => void }, {}>('Test controller', { $scope: {} }); +$componentController<{}, { test: {name: string} }>('Test controller', { test: {name: 'Test Local'} }); /////////////////////////////////////// // IHttpBackendService @@ -451,11 +452,11 @@ requestHandler.passThrough().passThrough(); requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']); requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({}); requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; }); -requestHandler.respond((method, url, data, headers, params) => { +requestHandler.respond((method, url, data, headers, params) => { if(params.id === 1) { return [200, { key: 'value'}, { header: 'value'}, 'responseText']; } else { - return [404, { key: 'value' }, { header: 'value' }, 'responseText']; + return [404, { key: 'value' }, { header: 'value' }, 'responseText']; } }); requestHandler.respond('data'); diff --git a/angular-mocks/index.d.ts b/angular-mocks/index.d.ts index 3c24ed1cf6..e657589f2f 100644 --- a/angular-mocks/index.d.ts +++ b/angular-mocks/index.d.ts @@ -117,10 +117,13 @@ declare module 'angular' { /////////////////////////////////////////////////////////////////////////// interface IHttpBackendService { /** - * Flushes all pending requests using the trained responses. - * @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed. + * Flushes pending requests using the trained responses. Requests are flushed in the order they were made, but it is also possible to skip one or more requests (for example to have them flushed later). This is useful for simulating scenarios where responses arrive from the server in any order. + * + * If there are no pending requests to flush when the method is called, an exception is thrown (as this is typically a sign of programming error). + * @param count Number of responses to flush. If undefined/null, all pending requests (starting after `skip`) will be flushed. + * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_ */ - flush(count?: number): void; + flush(count?: number, skip?: number): void; /** * Resets all request expectations, but preserves all backend definitions. @@ -301,6 +304,25 @@ declare module 'angular' { whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; } + /////////////////////////////////////////////////////////////////////////// + // AnimateService + // see https://docs.angularjs.org/api/ngMock/service/$animate + /////////////////////////////////////////////////////////////////////////// + module animate { + interface IAnimateService { + + /** + * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks. + */ + closeAndFlush(): void; + + /** + * This method is used to flush the pending callbacks and animation frames to either start an animation or conclude an animation. Note that this will not actually close an actively running animation (see `closeAndFlush()` for that). + */ + flush(): void; + } + } + export module mock { // returned interface by the the mocked HttpBackendService expect/when methods interface IRequestHandler { diff --git a/angular-resource/index.d.ts b/angular-resource/index.d.ts index e8726cc089..afde3cad14 100644 --- a/angular-resource/index.d.ts +++ b/angular-resource/index.d.ts @@ -162,6 +162,8 @@ declare module 'angular' { * Really just a regular Array object with $promise and $resolve attached to it */ interface IResourceArray extends Array> { + $cancelRequest(): void; + /** the promise of the original server interaction that created this collection. **/ $promise: angular.IPromise>; $resolved: boolean; diff --git a/angular-spinner/angular-spinner-tests.ts b/angular-spinner/angular-spinner-tests.ts index 9ac20eed0c..c8d9e42479 100644 --- a/angular-spinner/angular-spinner-tests.ts +++ b/angular-spinner/angular-spinner-tests.ts @@ -1,4 +1,4 @@ - +/// var myApp = angular.module('testModule'); diff --git a/angular-spinner/index.d.ts b/angular-spinner/index.d.ts index e81901ef90..e7710e60e2 100644 --- a/angular-spinner/index.d.ts +++ b/angular-spinner/index.d.ts @@ -3,23 +3,21 @@ // Definitions by: Marcin Biegała // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - /** -* SpinnerService +* SpinnerService * see https://github.com/urish/angular-spinner */ -interface ISpinnerService { +declare interface ISpinnerService { /** * Start selected spinner - * + * * @param spinner key */ spin(key: string): void; /** * Stop selected spinner - * + * * @param spinner key */ stop(key: string): void; diff --git a/angular-strap/index.d.ts b/angular-strap/index.d.ts index 49a1c310b4..3f279619dc 100644 --- a/angular-strap/index.d.ts +++ b/angular-strap/index.d.ts @@ -42,6 +42,7 @@ declare namespace mgcrea.ngStrap { show?: boolean; container?: string | boolean; template?: string; + templateUrl?: string; contentTemplate?: string; prefixEvent?: string; id?: string; diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index f4773975aa..7163bef4be 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular UI Bootstrap 0.13.3 +// Type definitions for Angular UI Bootstrap 0.13.3 // Project: https://github.com/angular-ui/bootstrap // Definitions by: Brian Surowiec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-ui-router/index.d.ts b/angular-ui-router/index.d.ts index 4bbd94d641..035dc93430 100644 --- a/angular-ui-router/index.d.ts +++ b/angular-ui-router/index.d.ts @@ -110,7 +110,7 @@ declare module 'angular' { interface IUrlMatcher { concat(pattern: string): IUrlMatcher; - exec(path: string, searchParams: {}): {}; + exec(path: string, search?: any, hash?: string, options?: any): {}; parameters(): string[]; format(values: {}): string; } diff --git a/angulartics/angulartics-tests.ts b/angulartics/angulartics-tests.ts index a7d8ba5971..02888b0cc5 100644 --- a/angulartics/angulartics-tests.ts +++ b/angulartics/angulartics-tests.ts @@ -10,6 +10,10 @@ namespace Analytics { $analyticsProvider.withAutoBase(true); $analyticsProvider.developerMode(true); + $analyticsProvider.trackExceptions(true); + $analyticsProvider.trackRoutes(true); + $analyticsProvider.trackStates(true); + $analyticsProvider.registerEventTrack((action: string, properties?: any) => { console.log(action); }); @@ -19,5 +23,16 @@ namespace Analytics { }); $analyticsProvider.settings.pageTracking.basePath = "/my/base/path"; - }]); + }]) + .run(($analytics: angulartics.IAnalyticsService) => { + let isOptedOut = $analytics.getOptOut(); + + $analytics.eventTrack('eventName', { label: 'test' }); + $analytics.pageTrack('/'); + $analytics.setAlias('alias'); + $analytics.setOptOut(false); + $analytics.setUsername('username'); + $analytics.setUserProperties({ id: 1 }); + $analytics.setSuperProperties({ role: 'admin' }); + }); } diff --git a/angulartics/index.d.ts b/angulartics/index.d.ts index 11938c9679..561da3cfad 100644 --- a/angulartics/index.d.ts +++ b/angulartics/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angulartics v0.20.2 +// Type definitions for Angulartics v1.3.0 // Project: http://luisfarzati.github.io/angulartics/ // Definitions by: Steven Fan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,8 +12,10 @@ declare namespace angulartics { interface IAnalyticsService { eventTrack(eventName: string, properties?: any): any; + getOptOut(): boolean; pageTrack(path:string, location?:angular.ILocationService): any; setAlias(alias: string): any; + setOptOut(value: boolean): void; setUsername(username: string): any; setUserProperties(properties: any): any; setSuperProperties(properties: any): any; @@ -26,13 +28,16 @@ declare namespace angulartics { withBase(value: boolean): void; withAutoBase(value: boolean): void; developerMode(value: boolean): void; + trackExceptions(value: boolean): void; + trackRoutes(value: boolean): void; + trackStates(value: boolean): void; registerPageTrack(callback:(path:string, location?:angular.ILocationService) => any): void; registerEventTrack(callback: (eventName: string, properties?: any) => any): void; - registerSetAlias(callback: (alias: string) => any): void - registerSetUsername(callback: (username: string) => any): void - registerSetUserProperties(callback: (userProperties: any) => any): void - registerSetSuperProperties(callback: (superProperties: any) => any): void + registerSetAlias(callback: (alias: string) => any): void; + registerSetUsername(callback: (username: string) => any): void; + registerSetUserProperties(callback: (userProperties: any) => any): void; + registerSetSuperProperties(callback: (superProperties: any) => any): void; settings: { pageTracking: { diff --git a/archiver/index.d.ts b/archiver/index.d.ts index f11d0070ef..ea117239ac 100644 --- a/archiver/index.d.ts +++ b/archiver/index.d.ts @@ -32,7 +32,7 @@ declare namespace archiver { export interface Archiver extends STREAM.Transform { pipe(writeStream: FS.WriteStream): void; - append(source: FS.ReadStream | Buffer | string, name: nameInterface): void; + append(source: STREAM.Readable | Buffer | string, name: nameInterface): void; directory(dirpath: string, destpath: nameInterface | string): void; directory(dirpath: string, destpath: nameInterface | string, data: any | Function): void; diff --git a/argon2/argon2-tests.ts b/argon2/argon2-tests.ts new file mode 100644 index 0000000000..566292b4fa --- /dev/null +++ b/argon2/argon2-tests.ts @@ -0,0 +1,35 @@ + +import { defaults, limits, hash, verify, generateSalt } from 'argon2'; + +main(); + +async function main() { + + const defaultTimeCost: number = defaults.timeCost; + const defaultMemoryCost: number = defaults.memoryCost; + const defaultParallelism: number = defaults.parallelism; + const defaultArgon2d: boolean = defaults.argon2d; + + const minMemoryCost: number = limits.memoryCost.min; + const maxMemoryCost: number = limits.memoryCost.max; + const minTimeCost: number = limits.timeCost.min; + const maxTimeCost: number = limits.timeCost.max; + const minParallelism: number = limits.parallelism.min; + const maxParallelism: number = limits.parallelism.max; + + const options = { + timeCost: 4, + memoryCost: 13, + parallelism: 2, + argon2d: true, + }; + + const hash1: string = await hash('secret', new Buffer(''), options); + const hash2: string = await hash('secret', new Buffer(''), {}); + const hash3: string = await hash('secret', new Buffer('')); + + const verified: boolean = await verify('long-hash', 'secret'); + + const salt1: Buffer = await generateSalt(); + const salt2: Buffer = await generateSalt(32); +} diff --git a/argon2/index.d.ts b/argon2/index.d.ts new file mode 100644 index 0000000000..f4e4c41d1f --- /dev/null +++ b/argon2/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for argon2 0.14 +// Project: https://github.com/ranisalt/node-argon2#readme +// Definitions by: Peter Safranek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace argon2 { + + export var defaults: { + timeCost: number; + memoryCost: number; + parallelism: number; + argon2d: boolean; + }; + + export var limits: { + memoryCost: { + min: number; + max: number; + }; + timeCost: { + min: number; + max: number; + }; + parallelism: { + min: number; + max: number; + }; + }; + + export function hash(plain: string, salt: Buffer, options?: { + timeCost?: number; + memoryCost?: number; + parallelism?: number; + argon2d?: boolean; + }): Promise; + + export function verify(hash: string, plain: string): Promise; + + export function generateSalt(length?: number): Promise; +} + +export = argon2; diff --git a/argon2/tsconfig.json b/argon2/tsconfig.json new file mode 100644 index 0000000000..5af6cc5d73 --- /dev/null +++ b/argon2/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "argon2-tests.ts" + ] +} diff --git a/argon2/tslint.json b/argon2/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/argon2/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/assert/index.d.ts b/assert/index.d.ts index f358833165..23536f9597 100644 --- a/assert/index.d.ts +++ b/assert/index.d.ts @@ -3,7 +3,13 @@ // Definitions by: vvakame // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// copy from assert external module in node.d.ts +// Definitions for commonjs-assert match that of node.js' assert module, +// but commonjs-assert is intended to be used as an independent module, +// for instance when making a stand-alone site or app that doesn't have +// access to node modules. For that reason, these definitions define a +// "assert" module. This will conflict with node.d.ts and other assert +// modules such as "power-assert", but a project should realistically +// only be using one of these at a time. declare function assert(value:any, message?:string):void; declare namespace assert { @@ -50,3 +56,4 @@ declare namespace assert { export function ifError(value:any):void; } + diff --git a/async/async-tests.ts b/async/async-tests.ts index c4a3506415..2a21a6cabb 100644 --- a/async/async-tests.ts +++ b/async/async-tests.ts @@ -7,22 +7,23 @@ declare var path: { exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void; }; +function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} function callback() { } -async.map(['file1', 'file2', 'file3'], fs.stat, function (err, results) { }); -async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err, results) { }); -async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err, results) { }); +async.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); +async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); +async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err:Error, results:Array) { }); -async.filter(['file1', 'file2', 'file3'], path.exists, function (results) { }); -async.filterSeries(['file1', 'file2', 'file3'], path.exists, function (results) { }); -async.filterLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { }); -async.select(['file1', 'file2', 'file3'], path.exists, function (results) { }); -async.selectSeries(['file1', 'file2', 'file3'], path.exists, function (results) { }); -async.selectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { }); +async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.reject(['file1', 'file2', 'file3'], path.exists, function (results) { }); -async.rejectSeries(['file1', 'file2', 'file3'], path.exists, function (results) { }); -async.rejectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { }); +async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); async.parallel([ function () { }, @@ -46,9 +47,9 @@ var openFilesObj = { file2: "fileTwo" } -var saveFile = function () { } -async.each(openFiles, saveFile, function (err) { }); -async.eachSeries(openFiles, saveFile, function (err) { }); +var saveFile = function (file:string,cb:(err:Error)=>void) { } +async.each(openFiles, saveFile, function (err:Error) { }); +async.eachSeries(openFiles, saveFile, function (err:Error) { }); var documents: any, requestApi: any; async.eachLimit(documents, 20, requestApi, function (err) { }); @@ -77,9 +78,9 @@ async.foldl(numArray, 0, reducer, function (err, result) { }); async.reduceRight(numArray, 0, reducer, function (err, result) { }); async.foldr(numArray, 0, reducer, function (err, result) { }); -async.detect(['file1', 'file2', 'file3'], path.exists, function (result) { }); -async.detectSeries(['file1', 'file2', 'file3'], path.exists, function (result) { }); -async.detectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { }); +async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err: Error,result:string) { }); +async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err,result) { }); +async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err,result) { }); async.sortBy(['file1', 'file2', 'file3'], function (file, callback) { fs.stat(file, function (err, stats) { @@ -87,13 +88,13 @@ async.sortBy(['file1', 'file2', 'file3'], function (file, callback) { }); }, function (err, results) { }); -async.some(['file1', 'file2', 'file3'], path.exists, function (result) { }); -async.someLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { }); -async.any(['file1', 'file2', 'file3'], path.exists, function (result) { }); +async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.every(['file1', 'file2', 'file3'], path.exists, function (result) { }); -async.everyLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { }); -async.all(['file1', 'file2', 'file3'], path.exists, function (result) { }); +async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); @@ -111,7 +112,7 @@ async.series([ ], function (err, results) { }); -async.series([ +async.series([ function (callback) { callback(undefined, 'one'); }, @@ -135,7 +136,7 @@ async.series({ }, function (err, results) { }); -async.series({ +async.series({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -175,7 +176,7 @@ async.parallel([ ], function (err, results) { }); -async.parallel([ +async.parallel([ function (callback) { setTimeout(function () { callback(undefined, 'one'); @@ -204,7 +205,7 @@ async.parallel({ }, function (err, results) { }); -async.parallel({ +async.parallel({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -270,7 +271,7 @@ async.waterfall([ ], function (err, result) { }); -var q = async.queue(function (task: any, callback: any) { +var q = async.queue(function (task: any, callback: () => void) { console.log('hello ' + task.name); callback(); }, 2); @@ -323,7 +324,7 @@ q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = async.queue(function (task: string, callback: any) { +var q2 = async.queue(function (task: string, callback: () => void) { console.log('Task: ' + task); callback(); }, 1); @@ -386,10 +387,10 @@ async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } } async.parallel([ - function (callback) { }, + function (callback: ( err:Error, val:string ) => void ) { }, function (callback) { } ], -function (results) { +function (err:Error,results:Array) { async.series([ function (callback) { }, function email_link(callback) { } @@ -442,10 +443,10 @@ async.dir(function (name: string, callback: any) { // each -async.each({ +async.each({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function(val: number, next: ErrorCallback): void { setTimeout(function(): void { @@ -461,10 +462,10 @@ async.each({ }); -async.eachSeries({ +async.eachSeries({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function(val: number, next: ErrorCallback): void { setTimeout(function(): void { @@ -480,14 +481,14 @@ async.eachSeries({ }); -async.eachLimit({ +async.eachLimit({ "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6 -}, 2, function(val: number, next: ErrorCallback): void { +}, 2, function(val: number, next: ErrorCallback): void { setTimeout(function(): void { @@ -505,10 +506,10 @@ async.eachLimit({ // forEachOf/eachOf -async.eachOf({ +async.eachOf({ "a": 1, "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { +}, function(val: number, key: string, next: ErrorCallback): void { setTimeout(function(): void { @@ -524,10 +525,10 @@ async.eachOf({ }); -async.forEachOfSeries({ +async.forEachOfSeries({ "a": 1, "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { +}, function(val: number, key: string, next: ErrorCallback): void { setTimeout(function(): void { @@ -543,14 +544,14 @@ async.forEachOfSeries({ }); -async.forEachOfLimit({ +async.forEachOfLimit({ "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6 -}, 2, function(val: number, key: string, next: ErrorCallback): void { +}, 2, function(val: number, key: string, next: ErrorCallback): void { setTimeout(function(): void { @@ -568,11 +569,11 @@ async.forEachOfLimit({ // map -async.map({ +async.map({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncResultCallback): void { +}, function(val: number, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -588,11 +589,11 @@ async.map({ }); -async.mapSeries({ +async.mapSeries({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncResultCallback): void { +}, function(val: number, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -608,14 +609,14 @@ async.mapSeries({ }); -async.mapLimit({ +async.mapLimit({ "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6 -}, 2, function(val: number, next: AsyncResultCallback): void { +}, 2, function(val: number, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -633,11 +634,11 @@ async.mapLimit({ // mapValues -async.mapValues({ +async.mapValues({ "a": 1, "b": 2, "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { +}, function(val: number, key: string, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -653,11 +654,11 @@ async.mapValues({ }); -async.mapValuesSeries({ +async.mapValuesSeries({ "a": 1, "b": 2, "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { +}, function(val: number, key: string, next: AsyncResultCallback): void { setTimeout(function(): void { @@ -675,11 +676,11 @@ async.mapValuesSeries({ // filter/select/reject -async.filter({ +async.filter({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { +}, function(val: number, next: AsyncBooleanResultCallback): void { setTimeout(function(): void { @@ -695,11 +696,11 @@ async.filter({ }); -async.reject({ +async.reject({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { +}, function(val: number, next: AsyncBooleanResultCallback): void { setTimeout(function(): void { @@ -717,11 +718,11 @@ async.reject({ // concat -async.concat({ +async.concat({ "a": "1", "b": "2", "c": "3" -}, function(item: string, next: AsyncResultCallback): void { +}, function(item: string, next: AsyncResultCallback): void { console.log(`async.concat: ${item}`); @@ -735,11 +736,11 @@ async.concat({ // detect/find -async.detect({ +async.detect({ "a": 1, "b": 2, "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { +}, function(item: number, next: AsyncBooleanResultCallback): void { console.log(`async.detect/find: ${item}`); @@ -760,11 +761,11 @@ async.detect({ // every/all -async.every({ +async.every({ "a": 1, "b": 2, "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { +}, function(item: number, next: AsyncBooleanResultCallback): void { console.log(`async.every/all: ${item}`); @@ -778,11 +779,11 @@ async.every({ // some/any -async.some({ +async.some({ "a": 1, "b": 2, "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { +}, function(item: number, next: AsyncBooleanResultCallback): void { console.log(`async.some/any: ${item}`); diff --git a/async/index.d.ts b/async/index.d.ts index 8b564fbd80..45d39ea955 100644 --- a/async/index.d.ts +++ b/async/index.d.ts @@ -5,22 +5,22 @@ interface Dictionary { [key: string]: T; } -interface ErrorCallback { (err?: Error): void; } -interface AsyncWaterfallCallback { (err: Error, ...args: any[]): void; } -interface AsyncBooleanResultCallback { (err: Error, truthValue: boolean): void; } -interface AsyncResultCallback { (err: Error, result: T): void; } -interface AsyncResultArrayCallback { (err: Error, results: T[]): void; } -interface AsyncResultObjectCallback { (err: Error, results: Dictionary): void; } +interface ErrorCallback { (err?: T): void; } +interface AsyncWaterfallCallback { (err: E, ...args: any[]): void; } +interface AsyncBooleanResultCallback { (err: E, truthValue: boolean): void; } +interface AsyncResultCallback { (err: E, result: T): void; } +interface AsyncResultArrayCallback { (err: E, results: T[]): void; } +interface AsyncResultObjectCallback { (err: E, results: Dictionary): void; } -interface AsyncFunction { (callback: (err?: Error, result?: T) => void): void; } -interface AsyncIterator { (item: T, callback: ErrorCallback): void; } -interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } -interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } -interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } -interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } +interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } +interface AsyncIterator { (item: T, callback: ErrorCallback): void; } +interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } +interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } +interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } +interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } -interface AsyncWorker { (task: T, callback: ErrorCallback): void; } -interface AsyncVoidFunction { (callback: ErrorCallback): void; } +interface AsyncWorker { (task: T, callback: ErrorCallback): void; } +interface AsyncVoidFunction { (callback: ErrorCallback): void; } interface AsyncQueue { length(): number; @@ -28,10 +28,10 @@ interface AsyncQueue { running(): number; idle(): boolean; concurrency: number; - push(task: T, callback?: ErrorCallback): void; - push(task: T[], callback?: ErrorCallback): void; - unshift(task: T, callback?: ErrorCallback): void; - unshift(task: T[], callback?: ErrorCallback): void; + push(task: T, callback?: ErrorCallback): void; + push(task: T[], callback?: ErrorCallback): void; + unshift(task: T, callback?: ErrorCallback): void; + unshift(task: T[], callback?: ErrorCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -53,8 +53,8 @@ interface AsyncPriorityQueue { concurrency: number; started: boolean; paused: boolean; - push(task: T, priority: number, callback?: AsyncResultArrayCallback): void; - push(task: T[], priority: number, callback?: AsyncResultArrayCallback): void; + push(task: T, priority: number, callback?: AsyncResultArrayCallback): void; + push(task: T[], priority: number, callback?: AsyncResultArrayCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -90,122 +90,122 @@ interface AsyncCargo { interface Async { // Collections - each(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; - each(arr: Dictionary, iterator: AsyncIterator, callback?: ErrorCallback): void; + each(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; + each(arr: Dictionary, iterator: AsyncIterator, callback?: ErrorCallback): void; eachSeries: typeof async.each; - eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; - eachLimit(arr: Dictionary, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; + eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; + eachLimit(arr: Dictionary, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; forEach: typeof async.each; forEachSeries: typeof async.each; forEachLimit: typeof async.eachLimit; - forEachOf(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOf(obj: Dictionary, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; + forEachOf(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; + forEachOf(obj: Dictionary, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; forEachOfSeries: typeof async.forEachOf; - forEachOfLimit(obj: T[], limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfLimit(obj: Dictionary, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; + forEachOfLimit(obj: T[], limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; + forEachOfLimit(obj: Dictionary, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; eachOf: typeof async.forEachOf; eachOfSeries: typeof async.forEachOf; eachOfLimit: typeof async.forEachOfLimit; - map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; mapSeries: typeof async.map; - mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - mapLimit(arr: Dictionary, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; - mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; + mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + mapLimit(arr: Dictionary, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; + mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; mapValuesSeries: typeof async.mapValues; - filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; - filter(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; + filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; + filter(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; filterSeries: typeof async.filter; - filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; - filterLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; + filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; + filterLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; select: typeof async.filter; selectSeries: typeof async.filter; selectLimit: typeof async.filterLimit; reject: typeof async.filter; rejectSeries: typeof async.filter; rejectLimit: typeof async.filterLimit; - reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): void; + reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): void; inject: typeof async.reduce; foldl: typeof async.reduce; reduceRight: typeof async.reduce; foldr: typeof async.reduce; - detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; - detect(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; + detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; + detect(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; detectSeries: typeof async.detect; - detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; - detectLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; + detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; + detectLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; find: typeof async.detect; findSeries: typeof async.detect; findLimit: typeof async.detectLimit; - sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - some(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - some(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + some(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + some(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; someSeries: typeof async.some; - someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - someLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + someLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; any: typeof async.some; anySeries: typeof async.someSeries; anyLimit: typeof async.someLimit; - every(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - every(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + every(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + every(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; everySeries: typeof async.every; - everyLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; - everyLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + everyLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; + everyLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; all: typeof async.every; allSeries: typeof async.every; allLimit: typeof async.everyLimit; - concat(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; - concat(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + concat(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; + concat(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; concatSeries: typeof async.concat; // Control Flow - series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; - series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; - parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; - parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; - parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; - parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; - whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; - doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; - until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; - doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; - during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; - doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; - forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; - waterfall(tasks: Function[], callback?: AsyncResultCallback): void; + series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; + series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; + parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; + parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; + parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; + parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; + whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; + doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; + until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; + doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; + during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; + doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; + forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; + waterfall(tasks: Function[], callback?: AsyncResultCallback): void; compose(...fns: Function[]): Function; seq(...fns: Function[]): Function; applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. - queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; - priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; - cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; - auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback): void; - autoInject(tasks: any, callback?: AsyncResultCallback): void; - retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; - retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; - retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; - apply(fn: Function, ...arguments: any[]): AsyncFunction; + queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; + priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; + cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; + auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback): void; + autoInject(tasks: any, callback?: AsyncResultCallback): void; + retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; + retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; + retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; + apply(fn: Function, ...arguments: any[]): AsyncFunction; nextTick(callback: Function, ...args: any[]): void; setImmediate: typeof async.nextTick; - reflect(fn: AsyncFunction) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void; - reflectAll(tasks: AsyncFunction[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[]; + reflect(fn: AsyncFunction) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void; + reflectAll(tasks: AsyncFunction[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[]; - timeout(fn: AsyncFunction, milliseconds: number, info: any): AsyncFunction; + timeout(fn: AsyncFunction, milliseconds: number, info: any): AsyncFunction; - times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; + times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; + timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; + timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - transform(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void; - transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void; - transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void; - transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void; + transform(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; + transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; + transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; + transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; - race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; + race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; // Utils memoize(fn: Function, hasher?: Function): Function; diff --git a/atpl/index.d.ts b/atpl/index.d.ts index 1a97a957ff..869de67bc3 100644 --- a/atpl/index.d.ts +++ b/atpl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for atpl +// Type definitions for atpl // Project: https://github.com/soywiz/atpl.js // Definitions by: Carlos Ballesteros Velasco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/auth0-angular/index.d.ts b/auth0-angular/index.d.ts index 0a91269942..16203813e1 100644 --- a/auth0-angular/index.d.ts +++ b/auth0-angular/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-angular +// Type definitions for auth0-angular // Project: https://github.com/auth0/auth0-angular // Definitions by: Matt Emory // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 7e49961475..2907eba686 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js +// Type definitions for Auth0.js // Project: https://github.com/auth0/auth0.js // Definitions by: Robert McLaws // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -22,7 +22,7 @@ interface Auth0Static { logout(query: string): void; getConnections(callback?: Function): void; refreshToken(refreshToken: string, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; - getDelegationToken(targetClientId: string, id_token: string, options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; + getDelegationToken(options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; getProfile(id_token: string, callback?: Function): Auth0UserProfile; getSSOData(withActiveDirectories: any, callback?: Function): void; parseHash(hash: string): Auth0DecodedHash; @@ -84,7 +84,7 @@ interface Auth0Identity { interface Auth0DecodedHash { access_token: string; - id_token: string; + idToken: string; profile: Auth0UserProfile; state: any; } @@ -96,6 +96,7 @@ interface Auth0PopupOptions { interface Auth0LoginOptions { auto_login?: boolean; + responseType?: string; connection?: string; email?: string; username?: string; diff --git a/auth0-lock/index.d.ts b/auth0-lock/index.d.ts index e9d7420917..1a05d3f913 100644 --- a/auth0-lock/index.d.ts +++ b/auth0-lock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-lock v10.0.1 +// Type definitions for auth0-lock v10.0.1 // Project: http://auth0.com // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/auth0.widget/index.d.ts b/auth0.widget/index.d.ts index 24d978ab9d..1c30d83b6f 100644 --- a/auth0.widget/index.d.ts +++ b/auth0.widget/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0Widget.js +// Type definitions for Auth0Widget.js // Project: http://auth0.com // Definitions by: Robert McLaws // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/auth0/auth0-tests.ts b/auth0/auth0-tests.ts index 391dee655a..502a72eec1 100644 --- a/auth0/auth0-tests.ts +++ b/auth0/auth0-tests.ts @@ -49,3 +49,30 @@ auth }).catch((err) => { // Handle the error. }); + + +// Update a user +management + .updateUser({id: "user_id"}, {"email": "hi@me.co"}); + +// Update a user using callback +management + .updateUser({id: "user_id"}, {"email": "hi@me.co"}, (err: Error, users: auth0.User) => {}); + + +// Update user metadata +management + .updateUserMetadata({id: "user_id"}, {"key": "value"}); + +// Update user metadata using callback +management + .updateUserMetadata({id: "user_id"}, {"key": "value"}, (err: Error, users: auth0.User) => {}); + + +// Update app metadata +management + .updateAppMetadata({id: "user_id"}, {"key": "value"}); + +// Update app metadata using callback +management + .updateAppMetadata({id: "user_id"}, {"key": "value"}, (err: Error, users: auth0.User) => {}); diff --git a/auth0/index.d.ts b/auth0/index.d.ts index 019d9edc38..b24b808529 100644 --- a/auth0/index.d.ts +++ b/auth0/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0 v2.3.1 +// Type definitions for auth0 v2.3.1 // Project: https://github.com/auth0/node-auth0 // Definitions by: Seth Westphal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,15 +10,18 @@ export interface ManagementClientOptions { domain?: string; } +export type UserMetadata = {}; +export type AppMetadata = {}; + export interface UserData { connection: string; email?: string; username?: string; password?: string; phone_number?: string; - user_metadata?: {}; + user_metadata?: UserMetadata; email_verified?: boolean; - app_metadata?: {}; + app_metadata?: AppMetadata; } export interface GetUsersData { @@ -43,8 +46,8 @@ export interface User { created_at?: string; updated_at?: string; identities?: Identity[]; - app_metadata?: {}; - user_metadata?: {}; + app_metadata?: AppMetadata; + user_metadata?: UserMetadata; picture?: string; name?: string; nickname?: string; @@ -53,6 +56,8 @@ export interface User { last_login?: string; logins_count?: number; blocked?: boolean; + given_name?: string; + family_name?: string; } export interface Identity { @@ -62,6 +67,10 @@ export interface Identity { isSocial: boolean; } +export interface UpdateUserParameters { + id: string; +} + export class ManagementClient { constructor(options: ManagementClientOptions); @@ -69,6 +78,12 @@ export class ManagementClient { getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void; createUser(data: UserData): Promise; createUser(data: UserData, cb: (err: Error, data: User) => void): void; + updateUser(params: UpdateUserParameters, data: User): Promise; + updateUser(params: UpdateUserParameters, data: User, cb: (err: Error, data: User) => void): void; + updateUserMetadata(params: UpdateUserParameters, data: UserMetadata): Promise; + updateUserMetadata(params: UpdateUserParameters, data: UserMetadata, cb: (err: Error, data: User) => void): void + updateAppMetadata(params: UpdateUserParameters, data: AppMetadata): Promise; + updateAppMetadata(params: UpdateUserParameters, data: AppMetadata, cb: (err: Error, data: User) => void): void } export interface AuthenticationClientOptions { @@ -86,4 +101,4 @@ export class AuthenticationClient { requestChangePasswordEmail(data: RequestChangePasswordEmailData): Promise; requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void; -} \ No newline at end of file +} diff --git a/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts b/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts new file mode 100644 index 0000000000..10eeed099d --- /dev/null +++ b/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts @@ -0,0 +1,103 @@ +// Code adapted from +// https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b468d59e02e2f6a1dce321000d914cb47894/examples/device-example.js +// and +// https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b468d59e02e2f6a1dce321000d914cb47894/examples/thing-example.js + +import * as awsIot from "aws-iot-device-sdk"; +import * as mqtt from "mqtt"; + +const device = new awsIot.device({ + keyPath: "", + certPath: "", + caPath: "", + clientId: "", + region: "", + baseReconnectTimeMs: 1000, + keepalive: 10, + protocol: "wss", + port: 443, + host: "", + debug: false +}); + +device.subscribe("topic_1"); + +device + .on("connect", function() { + console.log("connect"); + }); + device + .on("close", function() { + console.log("close"); + }); + device + .on("reconnect", function() { + console.log("reconnect"); + }); + device + .on("offline", function() { + console.log("offline"); + }); + device + .on("error", function(error) { + console.log("error", error); + }); + device + .on("message", function(topic: string, payload: any) { + console.log("message", topic, payload.toString()); + }); + + +const thingShadows = new awsIot.thingShadow({ + keyPath: "", + certPath: "", + caPath: "", + clientId: "", + region: "", + baseReconnectTimeMs: 1000, + keepalive: 10, + protocol: "mqtts", + port: 0, + host: "", + debug: false + }); + + thingShadows.register( + "thingName", + { ignoreDeltas: false }, + (err: Error, failedTopics: mqtt.Granted[]) => { } + ); + + thingShadows.on("connect", function() { + console.log("connected to AWS IoT"); + }); + + thingShadows.on("close", function() { + console.log("close"); + thingShadows.unregister("thingName"); + }); + + thingShadows.on("reconnect", function() { + console.log("reconnect"); + }); + + thingShadows.on("offline", function() { + console.log("offline"); + }); + + thingShadows.on("error", function(error) { + console.log("error", error); + }); + + thingShadows.on("message", function(topic: string, payload: any) { + console.log("message", topic, payload.toString()); + }); + + thingShadows.on("status", function(thingName: string, stat: "accepted" | "rejected", clientToken: string, stateObject: any) { + }); + + thingShadows.on("delta", function(thingName, stateObject) { + }); + + thingShadows.on("timeout", function(thingName, clientToken) { + }); diff --git a/aws-iot-device-sdk/index.d.ts b/aws-iot-device-sdk/index.d.ts new file mode 100644 index 0000000000..b165089f82 --- /dev/null +++ b/aws-iot-device-sdk/index.d.ts @@ -0,0 +1,396 @@ +// Type definitions for aws-iot-device-sdk 1.0.13 +// Project: https://github.com/aws/aws-iot-device-sdk-js +// Definitions by: Markus Olsson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as mqtt from "mqtt"; +import * as WebSocket from "ws"; + +export interface DeviceOptions extends mqtt.ClientOptions { + /** the AWS IoT region you will operate in (default "us-east-1") */ + region?: string; + + /** the client ID you will use to connect to AWS IoT */ + clientId?: string; + + /** + * path of the client certificate file path of the private key file + * associated with the client certificate + */ + certPath?: string; + + /** path of the private key file associated with the client certificate */ + keyPath?: string; + + /** path of your CA certificate file */ + caPath?: string; + + /** + * same as certPath, but can also accept a buffer containing client + * certificate data + */ + clientCert?: string; + + /** + * same as keyPath, but can also accept a buffer containing private key + * data + */ + privateKey?: string; + + /** + * same as caPath, but can also accept a buffer containing CA certificate + * data + */ + caCert?: string; + + /** + * set to "true" to automatically re-subscribe to topics after + * reconnection (default "true") + */ + autoResubscribe?: boolean; + + /** set to "true" to automatically queue published messages while + * offline (default "true") + */ + offlineQueueing?: boolean; + + /** + * enforce a maximum size for the offline message queue + * (default 0, e.g. no maximum) + */ + offlineQueueMaxSize?: number; + + /** + * set to "oldest" or "newest" to define drop behavior on a full + * queue when offlineQueueMaxSize > 0 + */ + offlineQueueDropBehavior?: "oldest" | "newest"; + + /** + * the minimum time in milliseconds between publishes when draining + * after reconnection (default 250) + */ + drainTimeMs?: number; + + /** the base reconnection time in milliseconds (default 1000) */ + baseReconnectTimeMs?: number; + + /** the maximum reconnection time in milliseconds (default 128000) */ + maximumReconnectTimeMs?: number; + + /** + * the minimum time in milliseconds that a connection must be maintained + * in order to be considered stable (default 20000) + */ + minimumConnectionTimeMs?: number; + + /** + * the connection type, either "mqtts" (default) or "wss" (WebSocket/TLS). + * Note that when set to "wss", values must be provided for the + * Access Key ID and Secret Key in either the following options or in + * environment variables as specified in WebSocket Configuration[1]. + * + * 1. https://github.com/aws/aws-iot-device-sdk-js#websockets + */ + protocol?: "mqtts" | "wss"; + /** + * if protocol is set to "wss", you can use this parameter to pass + * additional options to the underlying WebSocket object; + * these options are documented here. + */ + websocketOptions?: WebSocket.IClientOptions; + + /** + * used to specify the Access Key ID when protocol is set to "wss". + * Overrides the environment variable AWS_ACCESS_KEY_ID if set. + */ + accessKeyId?: string; + /** + * used to specify the Secret Key when protocol is set to "wss". + * Overrides the environment variable AWS_SECRET_ACCESS_KEY if set. + */ + secretKey?: string; + /** + * (required when authenticating via Cognito, optional otherwise) used + * to specify the Session Token when protocol is set to "wss". Overrides + * the environment variable AWS_SESSION_TOKEN if set. + */ + sessionToken?: string; + + /** + * optional hostname, if not specified a hostname will be constructed + * from the region option + */ + // NB Not documented but present in examples, see + // https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b468d/device/index.js#L376 + // https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b468d/device/index.js#L149 + host?: string; + + /** optional port, will be appended to hostname if present and not 443 */ + // NB Not documented but present in examples, see + // https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b468d/device/index.js#L154 + port?: number; + + /** enable console logging, default false */ + // NB Not documented but present in examples, see + // https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b468d/device/index.js#L436 + debug?: boolean; +} + +export class device extends NodeJS.EventEmitter { + /** + * Returns a wrapper for the mqtt.Client() class, configured for a TLS + * connection with the AWS IoT platform and with arguments as specified + * in options. + */ + constructor(options?: DeviceOptions); + + /** + * Update the credentials set used to authenticate via WebSocket/SigV4. + * + * This method is designed to be invoked during the callback of the + * getCredentialsForIdentity method in the AWS SDK for JavaScript. + */ + updateWebSocketCredentials(accessKeyId: string, secretKey: string, sessionToken: string, expiration: Date): void; + + on(event: "connect" | "close" | "reconnect" | "offline", listener: () => void): this; + + // Error | string comes from: + // https://github.com/aws/aws-iot-device-sdk-js/blob/97b0b46/device/index.js#L744 + // Remove when https://github.com/aws/aws-iot-device-sdk-js/issues/95 is fixed + on(event: "error", listener: (error: Error | string) => void): this; + + /** Emitted when a message is received on a topic not related to any Thing Shadows */ + on(event: "message", listener: (topic: string, payload: any) => void): this; + + // The following publish, subscribe, unsubscribe and end Definitions + // are derived from the mqtt definition as they are re-surfaced through + // thingShadow + // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e7772769fab8c206449ce9673cac417370330aa9/mqtt/mqtt.d.ts#L199 + + /** + * Publish a message to a topic + * + * @param topic to publish to + * @param message to publish + * @param publish options + * @param called when publish succeeds or fails + */ + publish(topic: string, message: Buffer | string, options?: mqtt.ClientPublishOptions, callback?: (error?: Error) => void): mqtt.Client; + + /** + * Subscribe to a topic or topics + * @param topic to subscribe to or an Array of topics to subscribe to. It can also be an object. + * @param the options to subscribe with + * @param callback fired on suback + */ + subscribe(topic: string | string[] | mqtt.Topic, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + + /** + * Unsubscribe from a topic or topics + * + * @param topic is a String topic or an array of topics to unsubscribe from + * @param options + * @param callback fired on unsuback + */ + unsubscribe(topic: string | string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + + /** + * end - close connection + * + * @param force passing it to true will close the client right away, without waiting for the in-flight messages to be acked. + * This parameter is optional. + * @param callback + */ + end(force?: boolean, callback?: Function): mqtt.Client; +} + +export interface ThingShadowOptions extends DeviceOptions { + /** the timeout for thing operations (default 10 seconds) */ + operationTimeout?: number; +} + +export interface RegisterOptions { + /** + * set to true to not subscribe to the delta sub-topic for this + * Thing Shadow; used in cases where the application is not interested in + * changes (e.g. update only.) (default false) + */ + ignoreDeltas?: boolean; + + /** + * set to false to unsubscribe from all operation sub-topics while not + * performing an operation (default true) + */ + persistentSubscribe?: boolean; + + /** + * set to false to allow receiving messages with old version + * numbers (default true) + */ + discardStale?: boolean; + + /** set to true to send version numbers with shadow updates (default true) */ + enableVersioning?: boolean; +} + +/** + * The thingShadow class wraps an instance of the device class with + * additional functionality to operate on Thing Shadows via the AWS IoT API. + */ +export class thingShadow extends NodeJS.EventEmitter { + + constructor(options?: ThingShadowOptions); + + /** + * Register interest in the Thing Shadow named thingName. + * + * The thingShadow class will subscribe to any applicable topics, and will + * fire events for the Thing Shadow until awsIot.thingShadow#unregister() + * is called with thingName + * + * If the callback parameter is provided, it will be invoked after + * registration is complete (i.e., when subscription ACKs have been received + * for all shadow topics). Applications should wait until shadow + * registration is complete before performing update/get/delete operations. + */ + register(thingName: string, options?: RegisterOptions, callback?: (error: Error, failedTopics: mqtt.Granted[]) => void): void + + /** + * Unregister interest in the Thing Shadow named thingName. + * + * The thingShadow class will unsubscribe from all applicable topics + * and no more events will be fired for thingName. + */ + unregister(thingName: string): void + + /** + * Update the Thing Shadow named thingName with the state specified in the + * JavaScript object stateObject. thingName must have been previously + * registered using awsIot.thingShadow#register(). + * + * The thingShadow class will subscribe to all applicable topics and + * publish stateObject on the update sub-topic. + * + * This function returns a clientToken, which is a unique value associated + * with the update operation. When a "status" or "timeout" event is emitted, + * the clientToken will be supplied as one of the parameters, allowing the + * application to keep track of the status of each operation. The caller may + * create their own clientToken value; if stateObject contains a clientToken + * property, that will be used rather than the internally generated value. + * Note that it should be of atomic type (i.e. numeric or string). + * This function returns "null" if an operation is already in progress. + */ + update(thingName: string, stateObject: any): string | null; + + /** + * Get the current state of the Thing Shadow named thingName, which must + * have been previously registered using awsIot.thingShadow#register(). + * The thingShadow class will subscribe to all applicable topics and + * publish on the get sub-topic. + * + * This function returns a clientToken, which is a unique value + * associated with the get operation. When a "status or "timeout" event + * is emitted, the clientToken will be supplied as one of the parameters, + * allowing the application to keep track of the status of each operation. + * The caller may supply their own clientToken value (optional); if + * supplied, the value of clientToken will be used rather than the + * internally generated value. Note that this value should be of atomic + * type (i.e. numeric or string). This function returns "null" if an + * operation is already in progress. + */ + get(thingName: string, clientToken?: string): string | null; + + /** + * Delete the Thing Shadow named thingName, which must have been previously + * registered using awsIot.thingShadow#register(). The thingShadow class + * will subscribe to all applicable topics and publish on the delete sub-topic. + * + * This function returns a clientToken, which is a unique value associated + * with the delete operation. When a "status" or "timeout" event is + * emitted, the clientToken will be supplied as one of the parameters, + * allowing the application to keep track of the status of each operation. + * The caller may supply their own clientToken value (optional); if + * supplied, the value of clientToken will be used rather than the + * internally generated value. Note that this value should be of atomic + * type (i.e. numeric or string). This function returns "null" if an + * operation is already in progress. + */ + delete(thingName: string, clientToken?: string): string | null; + + // The following publish, subscribe, unsubscribe and end Definitions + // are copied from the mqtt definition as they are re-surfaced through + // thingShadow + // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e7772769fab8c206449ce9673cac417370330aa9/mqtt/mqtt.d.ts#L199 + + /** + * Publish a message to a topic + * + * @param topic + * @param message + * @param options + * @param callback + */ + publish(topic: string, message: Buffer, options?: mqtt.ClientPublishOptions, callback?: Function): mqtt.Client; + publish(topic: string, message: string, options?: mqtt.ClientPublishOptions, callback?: Function): mqtt.Client; + + /** + * Subscribe to a topic or topics + * @param topic to subscribe to or an Array of topics to subscribe to. It can also be an object. + * @param the options to subscribe with + * @param callback fired on suback + */ + subscribe(topic: string, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + subscribe(topic: string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + subscribe(topic: mqtt.Topic, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + + /** + * Unsubscribe from a topic or topics + * + * @param topic is a String topic or an array of topics to unsubscribe from + * @param options + * @param callback fired on unsuback + */ + unsubscribe(topic: string, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + unsubscribe(topic: string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + + /** + * end - close connection + * + * @param force passing it to true will close the client right away, without waiting for the in-flight messages to be acked. + * This parameter is optional. + * @param callback + */ + end(force?: boolean, callback?: Function): mqtt.Client; + + on(event: "connect" | "close" | "reconnect" | "offline", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + + /** Emitted when a message is received on a topic not related to any Thing Shadows */ + on(event: "message", listener: (topic: string, payload: any) => void): this; + + /** + * Emitted when an operation update|get|delete completes. + * + * thingName - name of the Thing Shadow for which the operation has completed + * stat - status of the operation accepted|rejected + * clientToken - the operation"s clientToken + * stateObject - the stateObject returned for the operation + * + * Applications can use clientToken values to correlate status events with + * the operations that they are associated with by saving the clientTokens + * returned from each operation. + */ + on(event: "status", listener: (thingName: string, operationStatus: "accepted" | "rejected", clientToken: string, stateObject: any) => void): this; + + /** Emitted when an operation update|get|delete has timed out. */ + on(event: "timeout", listener: (thingName: string, clientToken: string) => void): this; + + /** Emitted when a delta has been received for a registered Thing Shadow. */ + on(event: "delta", listener: (thingName: string, stateObject: any) => void): this; + + /** Emitted when a different client"s update or delete operation is accepted on the shadow. */ + on(event: "foreignStateChange", listener: (thingName: string, operation: "update" | "delete", stateObject: any) => void): this; +} diff --git a/aws-iot-device-sdk/tsconfig.json b/aws-iot-device-sdk/tsconfig.json new file mode 100644 index 0000000000..fff2d523e8 --- /dev/null +++ b/aws-iot-device-sdk/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "aws-iot-device-sdk-tests.ts" + ] +} diff --git a/aws4/index.d.ts b/aws4/index.d.ts index 88f54f2a3f..6028be5334 100644 --- a/aws4/index.d.ts +++ b/aws4/index.d.ts @@ -30,4 +30,4 @@ export class RequestSigner { formatPath(): string; } -export function sign(options?: any, credentials?: any): RequestSigner; +export function sign(options?: any, credentials?: any): any; diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index a321e97f19..eb98e2710c 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -80,7 +80,11 @@ var axiosInstance = axios.create({ timeout: 1000 }); -axiosInstance.request({url: "issues/1"}); +axiosInstance.request({url: "issues/1"}).then(res => { + if (res.headers['content-type'].startsWith('application/json')) { + throw new Error('Unexpected content-type'); + } +}); axios.all([getRepoDetails, getRepoDetails]).then(([repo1, repo2]) => { var sumIds = repo1.data.id + repo2.data.id; diff --git a/axios/index.d.ts b/axios/index.d.ts index a2c5bfbd45..d66dc3d48c 100644 --- a/axios/index.d.ts +++ b/axios/index.d.ts @@ -159,7 +159,7 @@ declare namespace Axios { /** * headers that the server responded with */ - headers: Object; + headers: {[index: string]: any}; /** * config that was provided to `axios` for the request diff --git a/azure-mobile-apps/index.d.ts b/azure-mobile-apps/index.d.ts index b13bfbb803..53dd5edae3 100644 --- a/azure-mobile-apps/index.d.ts +++ b/azure-mobile-apps/index.d.ts @@ -237,7 +237,7 @@ declare namespace Azure.MobileApps { interface SqlParameterDefinition { name: string; value: any; - } + } interface TableDefinition { access?: AccessType; diff --git a/babylon/index.d.ts b/babylon/index.d.ts index 112e6be7be..45b929264d 100644 --- a/babylon/index.d.ts +++ b/babylon/index.d.ts @@ -43,5 +43,5 @@ export interface BabylonOptions { export type PluginName = 'jsx' | 'flow' | 'asyncFunctions' | 'classConstructorCall' | 'doExpressions' | 'trailingFunctionCommas' | 'objectRestSpread' | 'decorators' | 'classProperties' | 'exportExtensions' - | 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent'; + | 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent' | '*'; diff --git a/backbone.radio/index.d.ts b/backbone.radio/index.d.ts index 9bb47391b1..7596722342 100644 --- a/backbone.radio/index.d.ts +++ b/backbone.radio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Backbone.Radio v0.8.3 +// Type definitions for Backbone.Radio v0.8.3 // Project: https://github.com/marionettejs/backbone.radio // Definitions by: Peter Palotas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bcrypt/index.d.ts b/bcrypt/index.d.ts index d9eafce4ef..e8d26bf0d0 100644 --- a/bcrypt/index.d.ts +++ b/bcrypt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bcrypt +// Type definitions for bcrypt // Project: https://www.npmjs.org/package/bcrypt // Definitions by: Peter Harris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bgiframe/index.d.ts b/bgiframe/index.d.ts index 4959783f72..f8af8990f6 100644 --- a/bgiframe/index.d.ts +++ b/bgiframe/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bgiframe 1.0 +// Type definitions for bgiframe 1.0 // Project: https://github.com/sumegizoltan/BgiFrame // Definitions by: Zoltan Sumegi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bigint/index.d.ts b/bigint/index.d.ts index 98cb205992..fb252bd57c 100644 --- a/bigint/index.d.ts +++ b/bigint/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for BigInt v5.5.3 +// Type definitions for BigInt v5.5.3 // Project: https://github.com/Evgenus/BigInt // Definitions by: Eugene Chernyshov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bingmaps/index.d.ts b/bingmaps/index.d.ts index 1e7e464930..95644801c5 100644 --- a/bingmaps/index.d.ts +++ b/bingmaps/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Microsoft.Maps 7.0 +// Type definitions for Microsoft.Maps 7.0 // Project: http://msdn.microsoft.com/en-us/library/gg427611.aspx // Definitions by: Eric Todd // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bintrees/bintrees-tests.ts b/bintrees/bintrees-tests.ts new file mode 100644 index 0000000000..707d8e0adf --- /dev/null +++ b/bintrees/bintrees-tests.ts @@ -0,0 +1,14 @@ +import { BinTree, RBTree } from 'bintrees'; + +let treeA = new RBTree((a:number, b:number) => a - b); + +treeA.insert(5); +treeA.insert(3); +treeA.remove(3); + +let treeB = new BinTree((a:string, b:string) => a.length - b.length); + +treeB.insert('hi'); +treeB.insert('there'); +treeB.insert('how'); +treeB.insert('are'); diff --git a/bintrees/index.d.ts b/bintrees/index.d.ts new file mode 100644 index 0000000000..9853be67dc --- /dev/null +++ b/bintrees/index.d.ts @@ -0,0 +1,61 @@ +// Type definitions for bintrees 1.0.1 +// Project: https://github.com/vadimg/js_bintrees +// Definitions by: Cayle Sharrock +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'bintrees' { + + type Callback = (err: Error, item: T) => void; + type Comparator = (a: T, b: T) => number; + + class Iterator { + constructor(tree: TreeBase); + + data(): T; + + next(): T; + + prev(): T; + } + + class TreeBase { + size: number; + + clear(): void; + + find(data: T): T; + + findIter(data: T): Iterator; + + lowerBound(item: T): Iterator; + + upperBound(item: T): Iterator; + + min(): T; + + max(): T; + + iterator(): Iterator; + + each(cb: Callback): void; + + reach(cb: Callback): void; + } + + + export class RBTree extends TreeBase { + constructor(comparator: Comparator); + + insert(item: T): boolean; + + remove(item: T): boolean; + } + + export class BinTree extends TreeBase { + constructor(comparator: Comparator); + + insert(item: T): boolean; + + remove(item: T): boolean; + } +} diff --git a/bintrees/tsconfig.json b/bintrees/tsconfig.json new file mode 100644 index 0000000000..afbad4af37 --- /dev/null +++ b/bintrees/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bintrees-tests.ts" + ] +} diff --git a/bitwise-xor/index.d.ts b/bitwise-xor/index.d.ts index c0a129fa70..9960023c97 100644 --- a/bitwise-xor/index.d.ts +++ b/bitwise-xor/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bitwise-xor 0.0.0 +// Type definitions for bitwise-xor 0.0.0 // Project: https://github.com/czzarr/node-bitwise-xor // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bluebird-retry/index.d.ts b/bluebird-retry/index.d.ts index 2881d2065c..22c7b1c95e 100644 --- a/bluebird-retry/index.d.ts +++ b/bluebird-retry/index.d.ts @@ -16,6 +16,7 @@ declare namespace retry { max_interval?: number; timeout?: number; max_tries?: number; + predicate?: any; } } diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 1591d1c3a5..ea1ea69882 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -336,6 +336,29 @@ fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + class CustomError extends Error { + public customField: number; + } + fooProm = fooProm.catch(CustomError, reason => { + let a: number = reason.customField + }) +} + +{ + class CustomErrorWithConstructor extends Error { + constructor(public arg1: boolean, public arg2: number) { + super(); + }; + } + fooProm = fooProm.catch(CustomErrorWithConstructor, reason => { + let a: boolean = reason.arg1; + let b: number = reason.arg2; + }) +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + barProm = fooProm.error((reason: any) => { return bar; }); diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts index 10077179e8..3087abb2e5 100644 --- a/bluebird/index.d.ts +++ b/bluebird/index.d.ts @@ -65,14 +65,19 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection boolean, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; caught(predicate: (error: any) => boolean, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + catch(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; caught(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - catch(ErrorClass: Function, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - caught(ErrorClass: Function, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - catch(ErrorClass: Function, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - caught(ErrorClass: Function, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; + + catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + caught(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + + catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; + caught(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; + catch(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; caught(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + catch(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; caught(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; diff --git a/bootstrap-fileinput/index.d.ts b/bootstrap-fileinput/index.d.ts index 139ca2c490..b7dcd6fd16 100644 --- a/bootstrap-fileinput/index.d.ts +++ b/bootstrap-fileinput/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bootstrap-fileinput +// Type definitions for bootstrap-fileinput // Project: https://github.com/kartik-v/bootstrap-fileinput // Definitions by: Ché Coxshall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bootstrap-switch/index.d.ts b/bootstrap-switch/index.d.ts index fe6d5f5a0c..302e4f8735 100644 --- a/bootstrap-switch/index.d.ts +++ b/bootstrap-switch/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap Switch +// Type definitions for Bootstrap Switch // Project: http://www.bootstrap-switch.org/ // Definitions by: John M. Baughman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bootstrap-touchspin/index.d.ts b/bootstrap-touchspin/index.d.ts index 268a33df38..3026560f02 100644 --- a/bootstrap-touchspin/index.d.ts +++ b/bootstrap-touchspin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap TouchSpin +// Type definitions for Bootstrap TouchSpin // Project: http://www.virtuosoft.eu/code/bootstrap-touchspin/ // Definitions by: Albin Sunnanbo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bootstrap.timepicker/index.d.ts b/bootstrap.timepicker/index.d.ts index b1325323af..417f385526 100644 --- a/bootstrap.timepicker/index.d.ts +++ b/bootstrap.timepicker/index.d.ts @@ -5,9 +5,12 @@ /// -interface TimeickerOptions { - defaultTime?: string; +interface TimepickerOptions { + defaultTime?: string|boolean; disableFocus?: boolean; + disableMousewheel?: boolean; + explicitMode?: boolean; + icons?: TimepickerIconOptions; isOpen?: boolean; minuteStep?: number; modalBackdrop?: boolean; @@ -15,13 +18,32 @@ interface TimeickerOptions { showSeconds?: boolean; showInputs?: boolean; showMeridian?: boolean; - template?: string; + template?: string|boolean; appendWidgetTo?: string; + maxHours?: number; + snapToStep?: boolean; +} + +interface TimepickerIconOptions { + up?: string; + down?: string; +} + +interface TimepickerTime { + value?: string; + hours?: number; + minutes?: number; + seconds?: number; + meridian?: string; } interface JQuery { timepicker(): JQuery; timepicker(methodName: string): JQuery; timepicker(methodName: string, params: any): JQuery; - timepicker(options: TimeickerOptions): JQuery; + timepicker(options: TimepickerOptions): JQuery; +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { + time?: TimepickerTime; } diff --git a/bootstrap.v3.datetimepicker/index.d.ts b/bootstrap.v3.datetimepicker/index.d.ts index 942a9da56d..565ad9a356 100644 --- a/bootstrap.v3.datetimepicker/index.d.ts +++ b/bootstrap.v3.datetimepicker/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap 3 Datepicker v4.17.37 +// Type definitions for Bootstrap 3 Datepicker v4.17.37 // Project: http://eonasdan.github.io/bootstrap-datetimepicker // Definitions by: Katona Péter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/braintree-web/index.d.ts b/braintree-web/index.d.ts index e58cf7455b..d62ec01fd1 100644 --- a/braintree-web/index.d.ts +++ b/braintree-web/index.d.ts @@ -97,7 +97,7 @@ declare namespace BraintreeWeb { // billingContact // Billing contact information for the user. // countryCode -//Required.The merchant’s two- letter ISO 3166 country code. +//Required.The merchant’s two- letter ISO 3166 country code. // currencyCode // Required.The three- letter ISO 4217 currency code for the payment. // lineItems @@ -782,7 +782,7 @@ declare namespace BraintreeWeb { * }); * @returns {void} */ - on(event: string, handler: (() => any)): void; + on(event: string, handler: ((event: any) => any)): void; /** * Cleanly tear down anything set up by {@link module:braintree-web/hosted-fields.create|create} @@ -1740,4 +1740,4 @@ interface BraintreeStatic { VERSION: string; } -declare var braintree: BraintreeStatic; \ No newline at end of file +declare var braintree: BraintreeStatic; diff --git a/bunyan-prettystream/index.d.ts b/bunyan-prettystream/index.d.ts index 04c328b058..c82d444f76 100644 --- a/bunyan-prettystream/index.d.ts +++ b/bunyan-prettystream/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bunyan-prettystream 0.1.3 +// Type definitions for bunyan-prettystream 0.1.3 // Project: https://www.npmjs.com/package/bunyan-prettystream // Definitions by: Jason Swearingen , Vadim Macagon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/bunyan/index.d.ts b/bunyan/index.d.ts index 2983d8bb62..6886aade90 100644 --- a/bunyan/index.d.ts +++ b/bunyan/index.d.ts @@ -11,7 +11,7 @@ import { EventEmitter } from 'events'; declare class Logger extends EventEmitter { constructor(options: LoggerOptions); addStream(stream: Stream): void; - addSerializers(serializers:Serializers | StdSerializers):void; + addSerializers(serializers:Serializers | StdSerializers):void; child(options: LoggerOptions, simple?: boolean): Logger; child(obj: Object, simple?: boolean): Logger; reopenFileStreams(): void; @@ -56,20 +56,21 @@ interface LoggerOptions { stream?: NodeJS.WritableStream; serializers?: Serializers | StdSerializers; src?: boolean; + [custom: string]: any; } - interface Serializer { - (input:any): any; - } +interface Serializer { + (input:any): any; +} interface Serializers { - [key:string]: Serializer; - } + [key: string]: Serializer +} - interface StdSerializers { - err: Serializer; - res: Serializer; - req: Serializer; +interface StdSerializers { + err: Serializer; + res: Serializer; + req: Serializer; } interface Stream { @@ -82,7 +83,7 @@ interface Stream { count?: number; } - export var stdSerializers:StdSerializers; +export declare var stdSerializers: StdSerializers; export declare var TRACE: number; export declare var DEBUG: number; diff --git a/bytes/index.d.ts b/bytes/index.d.ts index cc9b5975b7..fd0a65c365 100644 --- a/bytes/index.d.ts +++ b/bytes/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bytes v2.4.0 +// Type definitions for bytes v2.4.0 // Project: https://github.com/visionmedia/bytes.js // Definitions by: Zhiyuan Wang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cal-heatmap/index.d.ts b/cal-heatmap/index.d.ts index 356487c3e9..4ecc4d3d87 100644 --- a/cal-heatmap/index.d.ts +++ b/cal-heatmap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cal-heatmap v3.5.4 +// Type definitions for cal-heatmap v3.5.4 // Project: https://github.com/wa0x6e/cal-heatmap // Definitions by: Chris Baker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/canvasjs/index.d.ts b/canvasjs/index.d.ts index bfb4dd03cd..79a168f2d0 100644 --- a/canvasjs/index.d.ts +++ b/canvasjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CanvasJS v1.5.1 +// Type definitions for CanvasJS v1.5.1 // Project: http://canvasjs.com/ // Definitions by: Mark Overholt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cassandra-driver/index.d.ts b/cassandra-driver/index.d.ts index 041f9f84e2..9bf5fb7137 100644 --- a/cassandra-driver/index.d.ts +++ b/cassandra-driver/index.d.ts @@ -134,7 +134,7 @@ export namespace types { var LocalTime: LocalTimeStatic; var Long: _Long; var ResultSet: ResultSetStatic; - // var ResultStream: ResultStreamStatic; + // var ResultStream: ResultStreamStatic; var Row: RowStatic; var TimeUuid: TimeUuidStatic; var Tuple: TupleStatic; diff --git a/chai-oequal/index.d.ts b/chai-oequal/index.d.ts index bf5f9e201f..78160c255e 100644 --- a/chai-oequal/index.d.ts +++ b/chai-oequal/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai-oequal +// Type definitions for chai-oequal 0.0 // Project: https://github.com/wrwrwr/chai-oequal // Definitions by: Mizunashi Mana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -23,5 +23,6 @@ declare namespace Chai { declare module 'chai-oequal' { function chaiOequal(chai: any, utils: any): void; + namespace chaiOequal {} export = chaiOequal; } diff --git a/chosen/index.d.ts b/chosen/index.d.ts index 4f413a39de..c7ffa437bc 100644 --- a/chosen/index.d.ts +++ b/chosen/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chosen.JQuery 1.6.1 +// Type definitions for Chosen.JQuery 1.6.1 // Project: http://harvesthq.github.com/chosen/ // Definitions by: Boris Yankov , denis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/chrome/index.d.ts b/chrome/index.d.ts index af3dbdc15d..ed9e3e9ef2 100644 --- a/chrome/index.d.ts +++ b/chrome/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chrome extension development +// Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ // Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ckeditor/index.d.ts b/ckeditor/index.d.ts index 72e56cd253..f95875501c 100644 --- a/ckeditor/index.d.ts +++ b/ckeditor/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CKEditor +// Type definitions for CKEditor // Project: http://ckeditor.com/ // Definitions by: Ondrej Sevcik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cli-color/index.d.ts b/cli-color/index.d.ts index fdb0c471d1..a857ced28a 100644 --- a/cli-color/index.d.ts +++ b/cli-color/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cli-color 0.3.2 +// Type definitions for cli-color 0.3.2 // Project: https://github.com/medikoo/cli-color // Definitions by: Joel Spadin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/codemirror/codemirror-tests.ts b/codemirror/codemirror-tests.ts index c7b4e32ac6..b46604b1bb 100644 --- a/codemirror/codemirror-tests.ts +++ b/codemirror/codemirror-tests.ts @@ -48,5 +48,9 @@ myCodeMirror.getValue(); myCodeMirror.getValue("foo") myCodeMirror.setValue("bar"); -CodeMirror.registerHelper("lint", "javascript", {}); +myCodeMirror.on( + "renderLine", + (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => { } +); +CodeMirror.registerHelper("lint", "javascript", {}); diff --git a/codependency/codependency-tests.ts b/codependency/codependency-tests.ts new file mode 100644 index 0000000000..46f2db8d6d --- /dev/null +++ b/codependency/codependency-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +let requirePeer = codependency.register(module), package: any; + requirePeer = codependency.register(module, {index: ["dependencies", "devDependencies"]}); + requirePeer = codependency.get("some-middleware"); + package = requirePeer("some-peer-dependency-package"); + package = requirePeer("some-peer-dependency-package", {optional: true}); + package = requirePeer("some-peer-dependency-package", {dontThrow: true}); + package = requirePeer("some-peer-dependency-package", {optional: true, dontThrow: true}); + package = requirePeer.resolve("peer-package-name"); \ No newline at end of file diff --git a/codependency/index.d.ts b/codependency/index.d.ts new file mode 100644 index 0000000000..0376bee4bb --- /dev/null +++ b/codependency/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for codependency v0.1.3 +// Project: https://github.com/Wizcorp/codependency +// Definitions by: Morgan Benton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export as namespace codependency; + +interface DependencyInfo { + supportedRange: string|null; + installedVersion: string|null; + isInstalled: boolean|null; + isValid: boolean|null; + pkgPath: string; +} + +interface RequirePeerFunctionOptions { + optional?: boolean; + dontThrow?: boolean; +} + +interface RequirePeerFunction { + (name: string, options?: RequirePeerFunctionOptions): any; + resolve: (name: string) => DependencyInfo; +} + +export function register(baseModule: NodeModule, options?: {index: string[]}): RequirePeerFunction; +export function get(middlewareName: string): RequirePeerFunction; \ No newline at end of file diff --git a/codependency/package.json b/codependency/package.json new file mode 100644 index 0000000000..2fa5bde2e9 --- /dev/null +++ b/codependency/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@types/node": "^6.0.0" + } +} \ No newline at end of file diff --git a/codependency/tsconfig.json b/codependency/tsconfig.json new file mode 100644 index 0000000000..34636ce3d3 --- /dev/null +++ b/codependency/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "codependency-tests.ts" + ] +} \ No newline at end of file diff --git a/config/index.d.ts b/config/index.d.ts index a9cb505f0e..98dda3448a 100644 --- a/config/index.d.ts +++ b/config/index.d.ts @@ -31,6 +31,9 @@ declare namespace c { // Get the current value of a config environment variable getEnv(varName: string): string; + + // Return the config for the project based on directory param if not directory then return default one (config). + loadFileConfigs(configDir: string): any; } interface IConfig { diff --git a/connect-mongo/index.d.ts b/connect-mongo/index.d.ts index df6a79b5ed..b469d08d00 100644 --- a/connect-mongo/index.d.ts +++ b/connect-mongo/index.d.ts @@ -74,6 +74,7 @@ declare namespace connectMongo { * (Default: 10) */ autoRemoveInterval?: number; + /** * don't save session if unmodified */ diff --git a/continuation-local-storage/continuation-local-storage-tests.ts b/continuation-local-storage/continuation-local-storage-tests.ts new file mode 100644 index 0000000000..3d85886d73 --- /dev/null +++ b/continuation-local-storage/continuation-local-storage-tests.ts @@ -0,0 +1,466 @@ +import * as cls from 'continuation-local-storage'; + +import EventEmitter = NodeJS.EventEmitter; + +class Test { + test(topic: string, callback: (t: Test) => any): any {} + plan(n: number): any {} + equal(a: any, b: any, c?: any): any {} + ok(a: any, b: any): any {} + notOk(a: any, b: any): any {} + comment(a: any): any {} + end(): any {} + doesNotThrow(a: any): any {} + throws(a: any): any {} +} + +function test(topic: string, callback: (t: Test) => any) { +} + +// from test/async-context.tap.js +test("asynchronously propagating state with local-context-domains", function (t) { + t.plan(2); + + var namespace = cls.createNamespace('namespace'); + // t.ok(process.namespaces.namespace, "namespace has been created"); + + namespace.run(function () { + namespace.set('test', 1337); + t.equal(namespace.get('test'), 1337, "namespace is working"); + }); +}); + +// from test/async-no-run-queue-multiple.tap.js + +test("minimized test case that caused #6011 patch to fail", function (t) { + t.plan(3); + + console.log('+'); + // when the flaw was in the patch, commenting out this line would fix things: + process.nextTick(function () { console.log('!'); }); + + var n = cls.createNamespace("test"); + t.ok(!n.get('state'), "state should not yet be visible"); + + n.run(function () { + n.set('state', true); + t.ok(n.get('state'), "state should be visible"); + + process.nextTick(function () { + t.ok(n.get('state'), "state should be visible"); + }); + }); +}); + +// from test/bind-emitter.tap.js +test("event emitters bound to CLS context", function (t) { + t.plan(13); + + t.test("handler registered in context, emit out of context", function (t) { + t.plan(1); + + var n = cls.createNamespace('in') + , ee = new EventEmitter() + ; + + n.run(function () { + n.set('value', 'hello'); + n.bindEmitter(ee); + ee.on('event', function () { + t.equal(n.get('value'), 'hello', "value still set in EE."); + cls.destroyNamespace('in'); + }); + }); + + ee.emit('event'); + }); + + t.test("once handler registered in context", function (t) { + t.plan(1); + + var n = cls.createNamespace('inOnce') + , ee = new EventEmitter() + ; + + n.run(function () { + n.set('value', 'hello'); + n.bindEmitter(ee); + ee.once('event', function () { + t.equal(n.get('value'), 'hello', "value still set in EE."); + cls.destroyNamespace('inOnce'); + }); + }); + + ee.emit('event'); + }); + + t.test("handler registered out of context, emit in context", function (t) { + t.plan(1); + + var n = cls.createNamespace('out') + , ee = new EventEmitter() + ; + + ee.on('event', function () { + t.equal(n.get('value'), 'hello', "value still set in EE."); + cls.destroyNamespace('out'); + }); + + n.run(function () { + n.set('value', 'hello'); + n.bindEmitter(ee); + + ee.emit('event'); + }); + }); + + t.test("once handler registered out of context", function (t) { + t.plan(1); + + var n = cls.createNamespace('outOnce') + , ee = new EventEmitter() + ; + + ee.once('event', function () { + t.equal(n.get('value'), 'hello', "value still set in EE."); + cls.destroyNamespace('outOnce'); + }); + + n.run(function () { + n.set('value', 'hello'); + n.bindEmitter(ee); + + ee.emit('event'); + }); + }); + + t.test("handler registered out of context, emit out of context", function (t) { + t.plan(1); + + var n = cls.createNamespace('out') + , ee = new EventEmitter() + ; + + ee.on('event', function () { + t.equal(n.get('value'), undefined, "no context."); + cls.destroyNamespace('out'); + }); + + n.run(function () { + n.set('value', 'hello'); + n.bindEmitter(ee); + }); + + ee.emit('event'); + }); + + t.test("once handler registered out of context on Readable", function (t) { + var Readable = require('stream').Readable; + + if (Readable) { + t.plan(12); + + var n = cls.createNamespace('outOnceReadable') + , re = new Readable() + ; + + re._read = function () {}; + + t.ok(n.name, "namespace has a name"); + t.equal(n.name, 'outOnceReadable', "namespace has a name"); + + re.once('data', function (data: any) { + t.equal(n.get('value'), 'hello', "value still set in EE"); + t.equal(data, 'blah', "emit still works"); + cls.destroyNamespace('outOnceReadable'); + }); + + n.run(function () { + n.set('value', 'hello'); + + t.notOk(re.emit.__wrapped, "emit is not wrapped"); + t.notOk(re.on.__wrapped, "on is not wrapped"); + t.notOk(re.addListener.__wrapped, "addListener is not wrapped"); + + n.bindEmitter(re); + + t.ok(re.emit.__wrapped, "emit is wrapped"); + t.ok(re.on.__wrapped, "on is wrapped"); + t.ok(re.addListener.__wrapped, "addListener is wrapped"); + + t.equal(typeof re._events.data, 'function', 'only the one data listener'); + t.notOk(re._events.data['context@outOnceReadable'], "context isn't on listener"); + + re.emit('data', 'blah'); + }); + } + else { + t.comment("this test requires node 0.10+"); + t.end(); + } + }); + + t.test("emitter with newListener that removes handler", function (t) { + t.plan(3); + + var n = cls.createNamespace('newListener') + , ee = new EventEmitter() + ; + + // add monkeypatching to ee + n.bindEmitter(ee); + + function listen() { + ee.on('data', function (chunk: any) { + t.equal(chunk, 'chunk', 'listener still works'); + }); + } + + ee.on('newListener', function handler(event: any) { + if (event !== 'data') return; + + this.removeListener('newListener', handler); + t.notOk(this.listeners('newListener').length, 'newListener was removed'); + process.nextTick(listen); + }); + + ee.on('drain', function (chunk: any) { + process.nextTick(function () { + ee.emit('data', chunk); + }); + }); + + ee.on('data', function (chunk: any) { + t.equal(chunk, 'chunk', 'got data event'); + cls.destroyNamespace('newListener'); + }); + + ee.emit('drain', 'chunk'); + }); + + t.test("handler registered in context on Readable", function (t) { + var Readable = require('stream').Readable; + + if (Readable) { + t.plan(12); + + var n = cls.createNamespace('outOnReadable') + , re = new Readable() + ; + + re._read = function () {}; + + t.ok(n.name, "namespace has a name"); + t.equal(n.name, 'outOnReadable', "namespace has a name"); + + n.run(function () { + n.set('value', 'hello'); + + n.bindEmitter(re); + + t.ok(re.emit.__wrapped, "emit is wrapped"); + t.ok(re.on.__wrapped, "on is wrapped"); + t.ok(re.addListener.__wrapped, "addListener is wrapped"); + + re.on('data', function (data: any) { + t.equal(n.get('value'), 'hello', "value still set in EE"); + t.equal(data, 'blah', "emit still works"); + cls.destroyNamespace('outOnReadable'); + }); + }); + + t.ok(re.emit.__wrapped, "emit is still wrapped"); + t.ok(re.on.__wrapped, "on is still wrapped"); + t.ok(re.addListener.__wrapped, "addListener is still wrapped"); + + t.equal(typeof re._events.data, 'function', 'only the one data listener'); + t.ok(re._events.data['cls@contexts']['context@outOnReadable'], + "context is bound to listener"); + + re.emit('data', 'blah'); + } + else { + t.comment("this test requires node 0.10+"); + t.end(); + } + }); + + t.test("handler added but used entirely out of context", function (t) { + t.plan(2); + + var n = cls.createNamespace('none') + , ee = new EventEmitter() + ; + + n.run(function () { + n.set('value', 'hello'); + n.bindEmitter(ee); + }); + + ee.on('event', function () { + t.ok(n, "n is set"); + t.notOk(n.get('value'), "value shouldn't be visible"); + cls.destroyNamespace('none'); + }); + + ee.emit('event'); + }); + + t.test("handler added but no listeners registered", function (t) { + t.plan(3); + + var http = require('http') + , n = cls.createNamespace('no_listener') + ; + + // only fails on Node < 0.10 + var server = http.createServer(function (req: any, res: any) { + n.bindEmitter(req); + + t.doesNotThrow(function () { + req.emit('event'); + }); + + res.writeHead(200, {"Content-Length" : 4}); + res.end('WORD'); + }); + server.listen(8080); + + http.get('http://localhost:8080/', function (res: any) { + t.equal(res.statusCode, 200, "request came back OK"); + + res.setEncoding('ascii'); + res.on('data', function (body: any) { + t.equal(body, 'WORD'); + + server.close(); + cls.destroyNamespace('no_listener'); + }); + }); + }); + + t.test("listener with parameters added but not bound to context", function (t) { + t.plan(2); + + var ee = new EventEmitter() + , n = cls.createNamespace('param_list') + ; + + function sent(value: any) { + t.equal(value, 3, "sent value is correct"); + cls.destroyNamespace('param_list'); + } + + ee.on('send', sent); + n.bindEmitter(ee); + t.doesNotThrow(function () { + ee.emit('send', 3); + }); + }); + + t.test("listener that throws doesn't leave removeListener wrapped", function (t) { + t.plan(4); + + var ee = new EventEmitter() + , n = cls.createNamespace('kaboom') + ; + + n.bindEmitter(ee); + + function kaboom() { + throw new Error('whoops'); + } + + n.run(function () { + ee.on('bad', kaboom); + + t.throws(function () { ee.emit('bad'); }); + t.equal(typeof ee.removeListener, 'function', 'removeListener is still there'); + // t.notOk(ee.removeListener.__wrapped, "removeListener got unwrapped"); + // t.equal(ee._events.bad, kaboom, "listener isn't still bound"); + cls.destroyNamespace('kaboom'); + }); + }); + + t.test("emitter bound to multiple namespaces handles them correctly", function (t) { + t.plan(8); + + var ee = new EventEmitter() + , ns1 = cls.createNamespace('1') + , ns2 = cls.createNamespace('2') + ; + + // emulate an incoming data emitter + setTimeout(function () { + ee.emit('data', 'hi'); + }, 10); + + t.doesNotThrow(function () { ns1.bindEmitter(ee); }); + t.doesNotThrow(function () { ns2.bindEmitter(ee); }); + + ns1.run(function () { + ns2.run(function () { + ns1.set('name', 'tom1'); + ns2.set('name', 'tom2'); + + t.doesNotThrow(function () { ns1.bindEmitter(ee); }); + t.doesNotThrow(function () { ns2.bindEmitter(ee); }); + + ns1.run(function () { + process.nextTick(function () { + t.equal(ns1.get('name'), 'tom1', "ns1 value correct"); + t.equal(ns2.get('name'), 'tom2', "ns2 value correct"); + + ns1.set('name', 'bob'); + ns2.set('name', 'alice'); + + ee.on('data', function () { + t.equal(ns1.get('name'), 'bob', "ns1 value bound onto emitter"); + t.equal(ns2.get('name'), 'alice', "ns2 value bound onto emitter"); + }); + }); + }); + }); + }); + }); +}); + + +// from test/bind.tap.js + +// multiple contexts in use +test("simple tracer built on contexts", function (t) { + var tracer = cls.createNamespace('tracer'); + + class Trace { + harvester: any; + constructor(harvester: any) { + this.harvester = harvester; + } + runHandler(callback: any) { + var wrapped = tracer.bind(function () { + callback(); + this.harvester.emit('finished', tracer.get('transaction')); + }.bind(this)); + wrapped(); + } + } + + t.plan(6); + + var harvester = new EventEmitter(); + var trace = new Trace(harvester); + + harvester.on('finished', function (transaction: any) { + t.ok(transaction, "transaction should have been passed in"); + t.equal(transaction.status, 'ok', "transaction should have finished OK"); + // t.equal(Object.keys(process.namespaces).length, 1, "Should only have one namespace."); + }); + + trace.runHandler(function inScope() { + t.ok(tracer.active, "tracer should have an active context"); + tracer.set('transaction', {status : 'ok'}); + t.ok(tracer.get('transaction'), "can retrieve newly-set value"); + t.equal(tracer.get('transaction').status, 'ok', "value should be correct"); + }); +}); diff --git a/continuation-local-storage/index.d.ts b/continuation-local-storage/index.d.ts new file mode 100644 index 0000000000..131f9c748c --- /dev/null +++ b/continuation-local-storage/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for continuation-local-storage v3.2.0 +// Project: https://github.com/othiym23/node-continuation-local-storage +// Definitions by: Jang-Ho Hwang , Kei Son +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export type Context = any; + +export interface Namespace { + active(): Context; + set(key: string, value: T): T; + get(key: string): any; + run(callback: any): void; + runAndReturn(callback: any): any; + bind(callback: any, context?: Context): any; + bindEmitter(emitter: NodeJS.EventEmitter): any; + createContext(): Context; + name: string; + context: Context; +} +export function createNamespace(name: string): Namespace; +export function getNamespace(name: string): Namespace; +export function destroyNamespace(name: string): void; +export function reset(): void; + +// declare namespace process { +// var namespaces: ContinuationLocalStorage.Namespace[]; +// } diff --git a/continuation-local-storage/tsconfig.json b/continuation-local-storage/tsconfig.json new file mode 100644 index 0000000000..b3c3e10409 --- /dev/null +++ b/continuation-local-storage/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "continuation-local-storage-tests.ts" + ] +} diff --git a/cordova-plugin-app-version/index.d.ts b/cordova-plugin-app-version/index.d.ts index ac250ae765..e295724474 100644 --- a/cordova-plugin-app-version/index.d.ts +++ b/cordova-plugin-app-version/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cordova-plugin-app-version v0.1.7 +// Type definitions for cordova-plugin-app-version v0.1.7 // Project: https://github.com/whiteoctober/cordova-plugin-app-version // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cordova-plugin-ibeacon/index.d.ts b/cordova-plugin-ibeacon/index.d.ts index f33cc62c73..bfbfe607d4 100644 --- a/cordova-plugin-ibeacon/index.d.ts +++ b/cordova-plugin-ibeacon/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cordova-plugin-ibeacon v3.3.0 +// Type definitions for cordova-plugin-ibeacon v3.3.0 // Project: https://github.com/petermetz/cordova-plugin-ibeacon // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cordova-plugin-insomnia/index.d.ts b/cordova-plugin-insomnia/index.d.ts index 2d3ca2e9e4..3b5fbd9e4d 100644 --- a/cordova-plugin-insomnia/index.d.ts +++ b/cordova-plugin-insomnia/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Insomnia-PhoneGap-Plugin v4.0.1 +// Type definitions for Insomnia-PhoneGap-Plugin v4.0.1 // Project: https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/ // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cordova-plugin-x-socialsharing/index.d.ts b/cordova-plugin-x-socialsharing/index.d.ts index e99aa3a44f..e68a072ee2 100644 --- a/cordova-plugin-x-socialsharing/index.d.ts +++ b/cordova-plugin-x-socialsharing/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SocialSharing-PhoneGap-Plugin v5.0.12 +// Type definitions for SocialSharing-PhoneGap-Plugin v5.0.12 // Project: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts index 6b4c03352c..08370370a0 100644 --- a/core-js/core-js-tests.ts +++ b/core-js/core-js-tests.ts @@ -334,15 +334,15 @@ b = Reflect.setPrototypeOf(a, a); // ############################################################################################# // ECMAScript 7 -// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad, +// Modules: es7.array.includes, es7.string.at, ees7.string.pad-start, es7.string.pad-end, // es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape, // es7.map.to-json, and es7.set.to-json // ############################################################################################# b = arrayOfPoint.includes(point, i); s = s.at(i); -s = s.lpad(i, s); -s = s.rpad(i, s); +s = s.padStart(i, s); +s = s.padEnd(i, s); arrayOfAny = Object.values(a); arrayOfStringAny = Object.entries(a); pdm = Object.getOwnPropertyDescriptors(a); diff --git a/core-js/index.d.ts b/core-js/index.d.ts index 1ad88ff41a..7dda59aab3 100644 --- a/core-js/index.d.ts +++ b/core-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for core-js v0.9.7 +// Type definitions for core-js v0.9.7 // Project: https://github.com/zloirock/core-js/ // Definitions by: Ron Buckton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -890,7 +890,7 @@ declare namespace Reflect { // ############################################################################################# // ECMAScript 7 -// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad, +// Modules: es7.array.includes, es7.string.at, es7.string.pad-start, es7.string.pad-end, // es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape, // es7.map.to-json, and es7.set.to-json // ############################################################################################# @@ -901,8 +901,8 @@ interface Array { interface String { at(index: number): string; - lpad(length: number, fillStr?: string): string; - rpad(length: number, fillStr?: string): string; + padStart(length: number, fillStr?: string): string; + padEnd(length: number, fillStr?: string): string; } interface ObjectConstructor { diff --git a/csv-stringify/index.d.ts b/csv-stringify/index.d.ts index 21f1c1a399..6525bd9e15 100644 --- a/csv-stringify/index.d.ts +++ b/csv-stringify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for csv-stringify 0.0.6 +// Type definitions for csv-stringify 0.0.6 // Project: https://github.com/wdavidw/node-csv-stringify // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/d3.cloud.layout/index.d.ts b/d3.cloud.layout/index.d.ts index 474af57828..70e2140bd5 100644 --- a/d3.cloud.layout/index.d.ts +++ b/d3.cloud.layout/index.d.ts @@ -1,4 +1,4 @@ -// 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.2 // Project: https://github.com/jasondavies/d3-cloud // Definitions by: hans windhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts index d49891822b..8e524a1f69 100644 --- a/d3kit/d3kit-tests.ts +++ b/d3kit/d3kit-tests.ts @@ -1,1111 +1,196 @@ /// -/// -/// - -/* jshint expr: true */ - -var expect = chai.expect; -describe('Skeleton', function(){ - var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; - - beforeEach(function(done){ - element = document.body.appendChild(document.createElement('div')) as Element; - skeleton = new d3kit.Skeleton(element, null, ['custom1', 'custom2']); - $element = d3.select(element); - $svg = $element.select('svg'); - done(); - }); - - describe('new Skeleton()', function(){ - it('should create inside the element', function(){ - expect($element.select('svg').size()).to.be.equal(1); - }); - it('should create inside inside the element', function(){ - expect($element.select('svg').select('g').size()).to.be.equal(1); - }); - }); - - describe('#getCustomEventNames()', function(){ - it('should return custom event names', function(){ - expect(skeleton.getCustomEventNames()).to.deep.equal(['custom1', 'custom2']); - }); - }); - - describe('#getDispatcher()', function(){ - it('should return event dispatcher', function(){ - expect(skeleton.getDispatcher()).to.be.an('Object'); - expect(skeleton.getDispatcher().data).to.be.a('Function'); - }); - }); - - describe('#getInnerWidth()', function(){ - it('should return width of the skeleton excluding margin', function(){ - skeleton.options({ - margin: {left: 10, right: 10} - }); - skeleton.width(100); - expect(skeleton.getInnerWidth()).to.equal(80); - }); - }); - - describe('#getInnerHeight()', function(){ - it('should return height of the skeleton excluding margin', function(){ - skeleton.options({ - margin: {top: 10, bottom: 20} - }); - skeleton.height(100); - expect(skeleton.getInnerHeight()).to.equal(70); - }); - }); - - describe('#getLayerOrganizer()', function(){ - it('should return the LayerOrganizer', function(){ - expect(skeleton.getLayerOrganizer()).to.be.an('Object'); - }); - }); - - describe('#getRootG()', function(){ - it('should return d3 selection of the root ', function(){ - var g = skeleton.getRootG(); - expect(g.size()).to.equal(1); - expect((g[0][0] as Element).tagName).to.equal('g'); - }); - }); - - describe('#getSvg()', function(){ - it('should return d3 selection of the ', function(){ - var svg = skeleton.getSvg(); - expect(svg.size()).to.equal(1); - expect((svg[0][0] as Element).tagName).to.equal('svg'); - }); - }); - - describe('#data(data, doNotDispatch)', function(){ - it('should return data when called without argument', function(){ - skeleton.data({a: 1}); - expect(skeleton.data()).to.deep.equal({a: 1}); - }); - it('should set data when called with at least one argument', function(){ - skeleton.data('test'); - expect(skeleton.data()).to.equal('test'); - }); - it('after setting, should dispatch "data" event', function(done){ - skeleton.on('data.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.data({a: 1}); - }); - it('after setting, should not dispatch "data" event if doNotDispatch is true', function(done){ - skeleton.on('data.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.data({a: 1}, true); - setTimeout(done, 100); - }); - }); - - describe('#options(options, doNotDispatch)', function(){ - it('should return options when called without argument', function(){ - skeleton.options({a: 2}); - expect(skeleton.options()).to.include.keys(['a']); - expect(skeleton.options().a).to.equal(2); - }); - it('should set options when called with at least one argument', function(){ - skeleton.options({a: 1}); - expect(skeleton.options()).to.include.keys(['a']); - expect(skeleton.options().a).to.equal(1); - }); - it('should not overwrite but extend existing options when setting', function(){ - skeleton.options({a: 1}); - skeleton.options({b: 2}); - expect(skeleton.options()).to.include.keys(['a', 'b']); - expect(skeleton.options().a).to.equal(1); - expect(skeleton.options().b).to.equal(2); - }); - it('after setting, should dispatch "options" event', function(done){ - skeleton.on('options.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.options({a: 1}); - }); - it('after setting, should not dispatch "options" event if doNotDispatch is true', function(done){ - skeleton.on('options.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.options({a: 1}, true); - setTimeout(done, 100); - }); - }); - - describe('#margin(margin, doNotDispatch)', function(){ - it('should return margin when called without argument', function(){ - var margin = {left: 10, right: 10, top: 10, bottom: 10}; - skeleton.margin(margin); - expect(skeleton.margin()).to.deep.equal(margin); - }); - it('should set margin when called with at least one argument', function(){ - var margin = {left: 10, right: 10, top: 10, bottom: 10}; - skeleton.margin(margin); - - skeleton.margin({left: 20}); - expect(skeleton.margin().left).to.equal(20); - expect(skeleton.margin().right).to.equal(10); - skeleton.margin({right: 20}); - expect(skeleton.margin().right).to.equal(20); - skeleton.margin({top: 20}); - expect(skeleton.margin().top).to.equal(20); - skeleton.margin({bottom: 20}); - expect(skeleton.margin().bottom).to.equal(20); - }); - it('should update innerWidth after setting margin', function(){ - skeleton.width(100); - skeleton.margin({left: 10, right:10}); - expect(skeleton.getInnerWidth()).to.equal(80); - skeleton.margin({left: 15, right:15}); - expect(skeleton.getInnerWidth()).to.equal(70); - }); - it('should update innerHeight after setting margin', function(){ - skeleton.height(100); - skeleton.margin({top: 10, bottom:10}); - expect(skeleton.getInnerHeight()).to.equal(80); - skeleton.margin({top: 15, bottom:15}); - expect(skeleton.getInnerHeight()).to.equal(70); - }); - it('should update the root transform/translate', function(){ - skeleton.margin({left: 30, top: 30}); - skeleton.offset([0.5, 0.5]); - skeleton.margin({left: 10, top: 10}); - var translate = skeleton.getRootG().attr('transform'); - expect(translate).to.equal('translate(10.5,10.5)'); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.margin({left: 33}); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.margin({left: 33}, true); - setTimeout(done, 100); - }); - }); - - describe('#offset(offset)', function(){ - it('should return offset when called without argument', function(){ - var offset = [1,1]; - skeleton.offset(offset); - expect(skeleton.offset()).to.deep.equal(offset); - }); - it('should set offset when called with at least one argument', function(){ - var offset = [1,1]; - skeleton.offset(offset); - skeleton.offset([2,3]); - expect(skeleton.offset()).to.deep.equal([2,3]); - }); - it('should update the root transform/translate', function(){ - skeleton.offset([0.5, 0.5]); - skeleton.margin({left: 10, top: 10}); - skeleton.offset([2,3]); - var translate = skeleton.getRootG().attr('transform'); - expect(translate).to.equal('translate(12,13)'); - }); - }); - - describe('#width(width, doNotDispatch)', function(){ - it('should return width when called without argument', function(){ - var w = $svg.attr('width'); - expect(skeleton.width()).to.equal(+w); - }); - it('should set width when called with Number as the first argument', function(){ - skeleton.width(300); - expect(+$svg.attr('width')).to.equal(300); - }); - it('should set width when called with a Number and "px" such as "100px" as the first argument', function(){ - skeleton.width('299px'); - expect(+$svg.attr('width')).to.equal(299); - }); - it('should set width to container\'s width when called with "auto" as the first argument', function(){ - var w = element.clientWidth; - skeleton.width('auto'); - expect(+$svg.attr('width')).to.equal(w); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.width(200); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.width(200, true); - setTimeout(done, 100); - }); - }); - - describe('#height(height, doNotDispatch)', function(){ - it('should return height when called without argument', function(){ - var w = $svg.attr('height'); - expect(skeleton.height()).to.equal(+w); - }); - it('should set height when called with Number as the first argument', function(){ - skeleton.height(300); - expect(+$svg.attr('height')).to.equal(300); - }); - it('should set height when called with a Number and "px" such as "100px" as the first argument', function(){ - skeleton.height('299px'); - expect(+$svg.attr('height')).to.equal(299); - }); - it('should set height to container\'s height when called with "auto" as the first argument', function(){ - var w = element.clientHeight; - skeleton.height('auto'); - expect(+$svg.attr('height')).to.equal(w); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.height(200); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.height(200, true); - setTimeout(done, 100); - }); - }); - - describe('#dimension(dimension, doNotDispatch)', function(){ - it('should return an array [width, height] when called without argument', function(){ - var dim = [+$svg.attr('width'), +$svg.attr('height')]; - expect(skeleton.dimension()).to.deep.equal(dim); - }); - it('should set width and height of the when called with an array [width, height] as the first argument', function(){ - skeleton.dimension([118, 118]); - expect([+$svg.attr('width'), +$svg.attr('height')]).to.deep.equal([118, 118]); - }); - it('after setting, should dispatch "resize" event', function(done){ - skeleton.on('resize.test', function(){ - // This block should be reached to pass the test. - expect(true).to.be.true; - done(); - }); - skeleton.dimension([150, 150]); - }); - it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ - skeleton.on('resize.test', function(){ - // This block should not be reached. - expect(true).to.be.false; - done(); - }); - skeleton.dimension([150, 150], true); - setTimeout(done, 100); - }); - }); - - describe('#hasData()', function(){ - it('should return true when data are not null nor undefined', function(){ - skeleton.data({}); - expect(skeleton.hasData()).to.be.true; - skeleton.data({test: 1}); - expect(skeleton.hasData()).to.be.true; - skeleton.data([]); - expect(skeleton.hasData()).to.be.true; - skeleton.data(['test']); - expect(skeleton.hasData()).to.be.true; - }); - it('should return false when data are null or undefined', function(){ - skeleton.data(null); - expect(skeleton.hasData()).to.be.false; - skeleton.data(undefined); - expect(skeleton.hasData()).to.be.false; - }); - }); - - describe('#hasNonZeroArea()', function(){ - it('should return true if \'s width & height excluding margin is more than zero', function(){ - skeleton.options({ - margin: {left: 10, right: 10} - }); - skeleton.width(80); - skeleton.options({ - margin: {top: 10, bottom: 20} - }); - skeleton.height(50); - expect(skeleton.hasNonZeroArea()).to.be.true; - }); - it('should return false otherwise', function(){ - skeleton.options({ - margin: {left: 10, right: 10} - }); - skeleton.width(20); - skeleton.options({ - margin: {top: 10, bottom: 20} - }); - skeleton.height(30); - expect(skeleton.hasNonZeroArea()).to.be.false; - }); - }); - - describe('#mixin({})', function(){ - it('should extend this skeleton with new fields/functions', function(){ - skeleton.mixin({ - a: 1, - b: 2 - }); - expect(skeleton).to.include.keys(['a', 'b']); - expect((skeleton).a).to.equal(1); - expect((skeleton).b).to.equal(2); - }); - it('should overwrite existing fields', function(){ - skeleton.mixin({ - b: 2 - }); - skeleton.mixin({ - b: 3 - }); - expect(skeleton).to.include.keys(['b']); - expect((skeleton).b).to.equal(3); - }); - it('should keep original fields if not overwritten', function(){ - skeleton.mixin({ - a: 1, - b: 2 - }); - skeleton.mixin({ - c: 20, - b: 3 - }); - expect(skeleton).to.include.keys(['a', 'b', 'c']); - expect((skeleton).a).to.equal(1); - expect((skeleton).b).to.equal(3); - expect((skeleton).c).to.equal(20); - }); - }); - - describe('#resizeToFitContainer(mode)', function(){ - it('when mode is "all" should resize to fit both width and height', function(){ - skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); - var w = element.clientWidth; - var h = element.clientHeight; - skeleton.resizeToFitContainer('all'); - expect(skeleton.dimension()).to.deep.equal([w, h]); - }); - it('when mode is "both" should resize to fit both width and height', function(){ - skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); - var w = element.clientWidth; - var h = element.clientHeight; - skeleton.resizeToFitContainer('both'); - expect(skeleton.dimension()).to.deep.equal([w, h]); - }); - it('when mode is "full" should resize to fit both width and height', function(){ - skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); - var w = element.clientWidth; - var h = element.clientHeight; - skeleton.resizeToFitContainer('full'); - expect(skeleton.dimension()).to.deep.equal([w, h]); - }); - it('when mode is "width" should resize width to fit container but keep original height', function(){ - var w1 = element.clientWidth/2; - var h1 = element.clientHeight/2; - - skeleton.dimension([w1, h1]); - - var w2 = element.clientWidth; - var h2 = element.clientHeight; - - skeleton.resizeToFitContainer('width'); - - expect(skeleton.width()).to.equal(Math.floor(w2)); - expect(skeleton.height()).to.equal(Math.floor(h1)); - expect(skeleton.width()).to.not.equal(w1); - expect(skeleton.height()).to.not.equal(h2); - }); - it('when mode is "height" should resize height to fit container but keep original width', function(){ - var w1 = element.clientWidth/2; - var h1 = element.clientHeight*2; - - skeleton.dimension([w1, h1]); - - var w2 = element.clientWidth; - var h2 = element.clientHeight; - - skeleton.resizeToFitContainer('height'); - - expect(skeleton.width()).to.equal(Math.floor(w1)); - expect(skeleton.height()).to.equal(Math.floor(h2)); - expect(skeleton.width()).to.not.equal(w2); - expect(skeleton.height()).to.not.equal(h1); - }); - }); - - describe('#resizeToAspectRatio(ratio)', function(){ - // todo - }); - - describe('#autoResize(mode)', function(){ - it('should return current mode when called without argument', function(){ - skeleton.autoResize(false); - expect(skeleton.autoResize()).to.be.false; - skeleton.autoResize('width'); - expect(skeleton.autoResize()).to.equal('width'); - }); - it('should enable auto resize when set mode to "width/height/both/etc.", similar to parameters of resizeToFitContainer()', function(done){ - // set initial size - skeleton.width(50); - skeleton.autoResize('width'); - setTimeout(function(){ - expect(skeleton.width()).to.equal(element.clientWidth); - done(); - }, 500); - }); - it('should disable auto resize when set mode to false', function(done){ - // set initial size - skeleton.width(50); - skeleton.autoResize('width'); - setTimeout(function(){ - expect(skeleton.width()).to.equal(element.clientWidth); - // disable resize and - skeleton.autoResize(false); - skeleton.width(50); - setTimeout(function(){ - expect(skeleton.width()).to.not.equal(element.clientWidth); - done(); - }, 500); - }, 500); - }); - }); - - describe('#autoResizeDetection(detection)', function(){ - // todo - }); - - describe('#autoResizeToAspectRatio(ratio)', function(){ - // todo - }); - - -}); - -describe.only('LayerOrganizer', function(){ - - describe('new LayerOrganizer(container) will create layers as by default', function(){ - var container: d3.Selection, layers: d3kit.LayerOrganizer; - before(function(done){ - container = d3.select('body').append('svg').append('g'); - layers = new d3kit.LayerOrganizer(container); - done(); - }); - - describe('#create(names)', function(){ - it('should create single layer given a String', function(){ - layers.create('single'); - expect(container.select('g.single-layer').size()).to.be.equal(1); - }); - - it('should create multiple layers given an array', function(){ - layers.create(['a', 'b', 'c']); - expect(container.select('g.a-layer').size()).to.be.equal(1); - expect(container.select('g.b-layer').size()).to.be.equal(1); - expect(container.select('g.c-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with a String inside', function(){ - layers.create({d: 'e'}); - expect(container.select('g.d-layer').size()).to.be.equal(1); - expect(container.select('g.d-layer g.e-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with an Array inside', function(){ - layers.create({f: ['g', 'h']}); - expect(container.select('g.f-layer').size()).to.be.equal(1); - expect(container.select('g.f-layer g.g-layer').size()).to.be.equal(1); - expect(container.select('g.f-layer g.h-layer').size()).to.be.equal(1); - }); - - it('should create multiple nested layers given an array of objects', function(){ - layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); - expect(container.select('g.i-layer').size()).to.be.equal(1); - expect(container.select('g.j-layer').size()).to.be.equal(1); - expect(container.select('g.k-layer').size()).to.be.equal(1); - expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); - expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); - expect(container.select('g.k-layer g.x-layer').size()).to.be.equal(1); - expect(container.select('g.k-layer g.y-layer').size()).to.be.equal(1); - }); - - it('should create multi-level nested layers given a nested plain Object', function(){ - layers.create({ - l: [ - 'm', - {'n': [ - {'o': ['p']}, 'q' - ]} - ] - }); - expect(container.select('g.l-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.m-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer g.o-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer g.o-layer g.p-layer').size()).to.be.equal(1); - expect(container.select('g.l-layer g.n-layer g.q-layer').size()).to.be.equal(1); - }); - - }); - - describe('#has(name)', function(){ - it('should be able to check first-level layer', function(){ - expect(layers.has('single')).to.be.true; - expect(layers.has('test')).to.be.false; - }); - it('should be able to check second-level layer', function(){ - expect(layers.has('l.m')).to.be.true; - expect(layers.has('l.x')).to.be.false; - }); - it('should be able to check third-level layer', function(){ - expect(layers.has('l.n.q')).to.be.true; - expect(layers.has('l.n.x')).to.be.false; - }); - }); - - describe('#get(name)', function(){ - it('should be able to get first-level layer', function(){ - expect(layers.get('single')).to.exist; - expect(layers.get('test')).to.be.not.exist; - }); - it('should be able to get second-level layer', function(){ - expect(layers.get('l.m')).to.exist; - expect(layers.get('l.x')).to.not.exist; - }); - it('should be able to get third-level layer', function(){ - expect(layers.get('l.n.o')).to.exist; - expect(layers.get('l.n.x')).to.not.exist; - }); - }); - }); - - describe('new LayerOrganizer(container, tag) will create layers with the given tag instead of ', function(){ - var container: d3.Selection, layers: d3kit.LayerOrganizer; - before(function(done){ - container = d3.select('body').append('div'); - layers = new d3kit.LayerOrganizer(container, 'div'); - done(); - }); - - describe('#create(names)', function(){ - it('should create single layer given a String', function(){ - layers.create('single'); - expect(container.select('div.single-layer').size()).to.be.equal(1); - }); - - it('should create multiple layers given an array', function(){ - layers.create(['a', 'b', 'c']); - expect(container.select('div.a-layer').size()).to.be.equal(1); - expect(container.select('div.b-layer').size()).to.be.equal(1); - expect(container.select('div.c-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with a String inside', function(){ - layers.create({d: 'e'}); - expect(container.select('div.d-layer').size()).to.be.equal(1); - expect(container.select('div.d-layer div.e-layer').size()).to.be.equal(1); - }); - - it('should create nested layers given a plain Object with an Array inside', function(){ - layers.create({f: ['g', 'h']}); - expect(container.select('div.f-layer').size()).to.be.equal(1); - expect(container.select('div.f-layer div.g-layer').size()).to.be.equal(1); - expect(container.select('div.f-layer div.h-layer').size()).to.be.equal(1); - }); - - it('should create multiple nested layers given an array of objects', function(){ - layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); - expect(container.select('div.i-layer').size()).to.be.equal(1); - expect(container.select('div.j-layer').size()).to.be.equal(1); - expect(container.select('div.k-layer').size()).to.be.equal(1); - expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); - expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); - expect(container.select('div.k-layer div.x-layer').size()).to.be.equal(1); - expect(container.select('div.k-layer div.y-layer').size()).to.be.equal(1); - }); - - it('should create multi-level nested layers given a nested plain Object', function(){ - layers.create({ - l: [ - 'm', - {'n': [ - {'o': ['p']}, 'q' - ]} - ] - }); - expect(container.select('div.l-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.m-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer div.o-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer div.o-layer div.p-layer').size()).to.be.equal(1); - expect(container.select('div.l-layer div.n-layer div.q-layer').size()).to.be.equal(1); - }); - - }); - - describe('#has(name)', function(){ - it('should be able to check first-level layer', function(){ - expect(layers.has('single')).to.be.true; - expect(layers.has('test')).to.be.false; - }); - it('should be able to check second-level layer', function(){ - expect(layers.has('l.m')).to.be.true; - expect(layers.has('l.x')).to.be.false; - }); - it('should be able to check third-level layer', function(){ - expect(layers.has('l.n.q')).to.be.true; - expect(layers.has('l.n.x')).to.be.false; - }); - }); - - describe('#get(name)', function(){ - it('should be able to get first-level layer', function(){ - expect(layers.get('single')).to.exist; - expect(layers.get('test')).to.be.not.exist; - }); - it('should be able to get second-level layer', function(){ - expect(layers.get('l.m')).to.exist; - expect(layers.get('l.x')).to.not.exist; - }); - it('should be able to get third-level layer', function(){ - expect(layers.get('l.n.o')).to.exist; - expect(layers.get('l.n.x')).to.not.exist; - }); - }); - }); - -}); - -describe('Chartlet', function(){ - interface ConfigureFunction { - (parent: d3kit.Chartlet, child: d3kit.Chartlet): void; - } - var enter: d3kit.ChartletEventFunction, update: d3kit.ChartletEventFunction, exit: d3kit.ChartletEventFunction, chartlet: d3kit.Chartlet; - var customEvents: Array = ['fooEvent']; - var ChildChartlet: () => d3kit.Chartlet; - var ParentChartlet: (configureFunction: ConfigureFunction) => d3kit.Chartlet; - - var callback = function(selection?: d3.Selection, done?: any) { return (sel: d3.Selection) => {done();};}; - beforeEach(function(done){ - ChildChartlet = function() { - var chartlet = new d3kit.Chartlet(callback, callback, callback); - (chartlet).runTest = function (testFunction: any) { - testFunction(chartlet); - }; - return chartlet; - }; - - ParentChartlet = function(configureFunction: ConfigureFunction) { - var chartlet = new d3kit.Chartlet(callback, callback, callback); - var child = ChildChartlet(); - configureFunction(chartlet, child); - (chartlet).runTest = (child).runTest; - return chartlet; - }; - - enter = callback; - update = callback; - exit = callback; - chartlet = new d3kit.Chartlet(enter, update, exit, customEvents); - done(); - }); - - describe('new Chartlet(enter, update, exit, customEvents)', function(){ - it('should create a chartlet', function(){ - expect(chartlet).to.be.an('Object'); - expect(chartlet).to.include.keys(['property', 'on']); - expect(chartlet.enter).to.be.a('Function'); - expect(chartlet.update).to.be.a('Function'); - expect(chartlet.exit).to.be.a('Function'); - expect(function(){ chartlet.enter(); }).to.not.throw(Error); - expect(function(){ chartlet.update(); }).to.not.throw(Error); - expect(function(){ chartlet.exit(); }).to.not.throw(Error); - expect(chartlet.getCustomEventNames()).to.deep.equal(customEvents); - }); - it('arguments "update", "exit" and "customEvents" are optional', function(){ - var comp = new d3kit.Chartlet(enter); - expect(comp).to.be.an('Object'); - expect(comp).to.include.keys(['property', 'on']); - expect(comp.enter).to.be.a('Function'); - expect(comp.update).to.be.a('Function'); - expect(comp.exit).to.be.a('Function'); - expect(function(){ comp.enter(); }).to.not.throw(Error); - expect(function(){ comp.update(); }).to.not.throw(Error); - expect(function(){ comp.exit(); }).to.not.throw(Error); - }); - }); - - describe('#getDispatcher()', function(){ - it('should return a dispatcher', function(){ - var dispatcher = chartlet.getDispatcher(); - expect(dispatcher).to.exist; - }); - it('returned dispatcher should handle enter/update/exit events', function(){ - var dispatcher = chartlet.getDispatcher(); - expect(dispatcher).to.include.keys(['enterDone', 'updateDone', 'exitDone'].concat(customEvents)); - }); - }); - - describe('#getPropertyValue(name, d, i)', function(){ - it('should return computed value for specified property name, d and i', function(){ - var d = {a: 99}; - var i = 2; - - chartlet.property('foo', 1); - chartlet.property('bar', 'two'); - chartlet.property('baz', function(d:{a:number}, i: number) {return 3;}); - chartlet.property('qux', function(d:{a:number}, i: number) {return 'four';}); - chartlet.property('nux', function(d:{a:number}, i: number) {return d.a * i;}); - - expect(chartlet.getPropertyValue('foo', d, i)).to.equal(1); - expect(chartlet.getPropertyValue('bar', d, i)).to.equal('two'); - expect(chartlet.getPropertyValue('baz', d, i)).to.equal(3); - expect(chartlet.getPropertyValue('qux', d, i)).to.equal('four'); - expect(chartlet.getPropertyValue('nux', d, i)).to.equal(198); - }); - }); - - describe('#property(name, valueOrFn)', function(){ - describe('should act as a getter when called with one argument', function(){ - it('should always return a function', function(){ - chartlet.property('foo', 1); - expect(chartlet.property('foo')).to.be.a('Function'); - chartlet.property('bar', function(){ return 100; }); - expect(chartlet.property('bar')).to.be.a('Function'); - }); - it('should return a function that return undefined for unknown property name', function(){ - expect(chartlet.property('unknown name')).to.be.a('Function'); - expect(chartlet.property('unknown name')()).to.equal(undefined); - }); - }); - - describe('should act as a setter when called with two arguments', function(){ - it('should set specified property to a functor of given value', function(){ - chartlet.property('foo', 1); - expect(chartlet.property('foo')).to.be.a('Function'); - expect(chartlet.property('foo')()).to.equal(1); - chartlet.property('bar', function(){ return 100; }); - expect(chartlet.property('bar')).to.be.a('Function'); - expect(chartlet.property('bar')()).to.equal(100); - }); - it('should overwrite previous value when set property with the same name', function(){ - chartlet.property('foo', 1); - expect(chartlet.property('foo')()).to.equal(1); - chartlet.property('foo', 100); - expect(chartlet.property('foo')()).to.equal(100); - }); - }); - }); - - describe('#on(eventName, listener)', function(){ - it('event "enterDone" should be triggered after chartlet.enter() is completed.', function(done){ - chartlet.on('enterDone', function(){ return (sel: d3.Selection) => {done();} }); - chartlet.enter(); - }); - it('event "updateDone" should be triggered after chartlet.update() is completed.', function(done){ - chartlet.on('updateDone', function(){ return (sel: d3.Selection) => {done();} }); - chartlet.update(); - }); - it('event "exitDone" should be triggered after chartlet.exit() is completed.', function(done){ - chartlet.on('exitDone', function(){ return (sel: d3.Selection) => {done();} }); - chartlet.exit(); - }); - }); - - describe('#inheritPropertyFrom(parentChartlet, parentPropertyName, childPropertyName)', function(){ - it('it should cause a child to inherit a parent property', function() { - var parent = ParentChartlet(function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertyFrom(parent, 'foo', 'bar'); - }) - .property('foo', function(d:number) {return 2 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('bar', 4, 0)).to.be.equal(8); - }); - }); - - it('it should default to the parent property name', function() { - var parent = ParentChartlet( - function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertyFrom(parent, 'foo'); - }) - .property('foo', function(d:number) {return 2 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('foo', 4, 0)).to.be.equal(8); - }); - }); - }); - - describe('#inheritProperties(parentChartlet, parentPropertyNames, childPropertyNames)', function(){ - it('it should cause a child to inherit many parent properties', function() { - var parent = ParentChartlet( - function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz'], ['foo-x', 'bar-x', 'baz-x']); - }) - .property('foo', function(d:number) {return 2 * d;}) - .property('bar', function(d:number) {return 3 * d;}) - .property('baz', function(d:number) {return 4 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('foo-x', 1, 0)).to.be.equal(2); - expect(child.getPropertyValue('bar-x', 1, 0)).to.be.equal(3); - expect(child.getPropertyValue('baz-x', 1, 0)).to.be.equal(4); - }); - }); - - it('it should default to the parent property names', function() { - var parent = ParentChartlet( - function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { - child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz']); - }) - .property('foo', function(d:number) {return 2 * d;}) - .property('bar', function(d:number) {return 3 * d;}) - .property('baz', function(d:number) {return 4 * d;}); - - (parent).runTest(function(child: d3kit.Chartlet) { - expect(child.getPropertyValue('foo', 1, 0)).to.be.equal(2); - expect(child.getPropertyValue('bar', 1, 0)).to.be.equal(3); - expect(child.getPropertyValue('baz', 1, 0)).to.be.equal(4); - }); - }); - }); - - describe('#publishEventsTo(foreignDispatcher)', function(){ - it('should map events to a foreignDispatcher', function(done) { - - var parent = new d3kit.Chartlet(callback, callback, callback, ['foo']); - parent.getDispatcher().on('foo', function(value:number) { - expect(value).to.be.equal(99); - done(); - }); - - var child = new d3kit.Chartlet(callback, callback, callback, ['foo']) - .publishEventsTo(parent.getDispatcher()); - - (child.getDispatcher()).foo(99); - }); - }); -}); - -describe('#createChart', function(){ - var Chart = d3kit.factory.createChart({}, ['test'], function(skeleton: d3kit.Skeleton){ - return skeleton; - }); - - it('should return a function to create a chart', function(){ - expect(Chart).to.be.a('Function'); - }); - - // // Don't think it's possible to define these in a d.ts file; skipping - // it('results should have function getCustomEvents()', function(){ - // expect(Chart.getCustomEvents).to.exist; - // expect(Chart.getCustomEvents()).to.deep.equal(['test']); - // }); -}); - -describe('d3kit.helper', function(){ - - describe('#dasherize(str)', function(){ - it('should convert input to dash-case', function(){ - expect(d3kit.helper.dasherize('camelCase')).to.equal('camel-case'); - }); - }); - - describe('#deepExtend(target, src1, src2, ...)', function(){ - it('should copy fields from sources into target', function(){ - expect(d3kit.helper.deepExtend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - })).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - - expect(d3kit.helper.deepExtend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - }, null)).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - }); - - it('should copy arrays and functions correctly from sources into target', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.deepExtend({}, { - a: fn1, - b: [1,2] - },{ - b: [3,4], - c: fn2 - })).to.deep.equal({ - a: fn1, - b: [3,4], - c: fn2 - }); - }); - - it('should perform "deep" copy', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.deepExtend({}, { - a: { d: fn1 }, - b: [1,2], - c: { f: 3 }, - h: { i: [1,2,3], j: [3,4,5] } - },{ - a: { e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } - })).to.deep.equal({ - a: { d: fn1, e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], j: [3,4,5], k: [3,4,5], l: {m: 2} } - }); - }); - }); - - describe('#extend(target, src1, src2, ...)', function(){ - it('should copy fields from sources into target', function(){ - expect(d3kit.helper.extend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - })).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - - expect(d3kit.helper.extend({}, { - a: 1, - b: 2 - },{ - b: 3, - c: 4 - }, null)).to.deep.equal({ - a: 1, - b: 3, - c: 4 - }); - }); - - it('should copy arrays and functions correctly from sources into target', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.extend({}, { - a: fn1, - b: [1,2] - },{ - b: [3,4], - c: fn2 - })).to.deep.equal({ - a: fn1, - b: [3,4], - c: fn2 - }); - }); - - it('should NOT perform "deep" copy', function(){ - var fn1 = function(d:number){return d + 1;}; - var fn2 = function(d:number){return d + 2;}; - expect(d3kit.helper.extend({}, { - a: { d: fn1 }, - b: [1,2], - c: { f: 3 }, - h: { i: [1,2,3], j: [3,4,5] } - },{ - a: { e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } - })).to.deep.equal({ - a: { e: 2 }, - b: [3,4], - c: { f: 4, g: fn2 }, - h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } - }); - }); - }); - - describe('#isFunction(function)', function(){ - it('should return true if the value is a function', function(){ - var fn1 = function(d:number){return d + 1;}; - function fn2(d:number){return d + 2;} - - expect(d3kit.helper.isFunction(fn1)).to.be.true; - expect(d3kit.helper.isFunction(fn2)).to.be.true; - }); - it('should return false if the value is not a function', function(){ - expect(d3kit.helper.isFunction(0)).to.be.false; - expect(d3kit.helper.isFunction(1)).to.be.false; - expect(d3kit.helper.isFunction(true)).to.be.false; - expect(d3kit.helper.isFunction('what')).to.be.false; - expect(d3kit.helper.isFunction(null)).to.be.false; - expect(d3kit.helper.isFunction(undefined)).to.be.false; - }); - }); - - describe('#isNumber(value)', function(){ - it('should return true for number', function(){ - expect(d3kit.helper.isNumber(1)).to.be.true; - expect(d3kit.helper.isNumber(0)).to.be.true; - expect(d3kit.helper.isNumber(-1)).to.be.true; - }); - it('should return false for string even if it is a number', function(){ - expect(d3kit.helper.isNumber('')).to.be.false; - expect(d3kit.helper.isNumber('1')).to.be.false; - expect(d3kit.helper.isNumber('0')).to.be.false; - expect(d3kit.helper.isNumber('what')).to.be.false; - }); - it('should return false for null and undefined', function(){ - expect(d3kit.helper.isNumber(null)).to.be.false; - expect(d3kit.helper.isNumber(undefined)).to.be.false; - }); - }); -}); +function test_abstract_chart() { + let el: Element, + chart: d3kit.AbstractChart, + options: d3kit.ChartOptions, + margins: d3kit.ChartMargin, + offsets: d3kit.ChartOffset, + defopts: d3kit.ChartOptions, + fitopts: d3kit.FitOptions, + watchop: d3kit.WatchOptions, + events: string[], + w: number, h:number, d: [number, number], a: any, b: boolean; + + // create a div, append to body, return Node as type Element + el = document.body.appendChild(document.createElement('div')) as Element; + + // create examples of margins, offsets, options, fit options, watch options + margins = { top: 20, right: 20, bottom: 20, left: 20}; + offsets = { x: 0.5, y: 0.5 }; + options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; + fitopts = { mode: 'basic', width: '90%', ratio: 4/3 }; + watchop = { mode: 'window', target: null, interval: 500 }; + + /** + * Test constructor + */ + chart = new d3kit.AbstractChart(el); // with element + chart = new d3kit.AbstractChart('div#chart'); // with selector + chart = new d3kit.AbstractChart(el, options); // with element+options + chart = new d3kit.AbstractChart('div#chart', options); // with selector+options + + /** + * Test static functions + */ + defopts = d3kit.AbstractChart.getDefaultOptions(); + events = d3kit.AbstractChart.getCustomEventNames(); + + /** + * Test getters + */ + w = chart.getInnerWidth(); + h = chart.getInnerHeight(); + w = chart.width(); + h = chart.height(); + d = chart.dimension(); + a = chart.data(); + margins = chart.margin(); + offsets = chart.offset(); + options = chart.options(); + events = chart.getCustomEventNames(); + + /** + * Test setters + */ + chart.width(w); + chart.height(h); + chart.dimension(d); + chart.data([1, 2, 3, 4, 5, 6]); + chart.margin(margins); + chart.offset(offsets); + chart.options(options); + + /** + * Test booleans + */ + b = chart.hasData(); + b = chart.hasNonZeroArea(); + + /** + * Test events + */ + chart.dimension(d).updateDimensionNow(); + chart.setupDispatcher(['click', 'mouseover']); + chart.fit(fitopts); // without watch options + chart.fit(fitopts, watchop); // with watch options + chart.stopFitWatcher(); + chart.on('mouseover', () => { chart.stopFitWatcher(); }); + chart.off('mouseover'); + chart.destroy(); +} + +function test_svgchart() { + let el: Element, + chart: d3kit.SvgChart, + options: d3kit.ChartOptions, + margins: d3kit.ChartMargin, + offsets: d3kit.ChartOffset, + svg: d3.Selection, + rootg: d3.Selection, + layers: d3kit.LayerOrganizer; + + // create a div, append to body, return Node as type Element + el = document.body.appendChild(document.createElement('div')) as Element; + + // create examples of margins, offsets, options, fit options, watch options + margins = { top: 20, right: 20, bottom: 20, left: 20}; + offsets = { x: 0.5, y: 0.5 }; + options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; + + /** + * Test constructor + */ + chart = new d3kit.SvgChart(el); // with element + chart = new d3kit.SvgChart('div#chart'); // with selector + chart = new d3kit.SvgChart(el, options); // with element+options + chart = new d3kit.SvgChart('div#chart', options); // with selector+options + + /** + * Test properties + */ + svg = chart.svg; + rootg = chart.rootG; + layers = chart.layers; +} + +function test_canvaschart() { + let el: Element, + chart: d3kit.CanvasChart, + options: d3kit.ChartOptions, + margins: d3kit.ChartMargin, + offsets: d3kit.ChartOffset, + context: CanvasRenderingContext2D; + + // create a div, append to body, return Node as type Element + el = document.body.appendChild(document.createElement('div')) as Element; + + // create examples of margins, offsets, options, fit options, watch options + margins = { top: 20, right: 20, bottom: 20, left: 20}; + offsets = { x: 0.5, y: 0.5 }; + options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets, pixelRatio: 1 }; + + /** + * Test constructor + */ + chart = new d3kit.CanvasChart(el); // with element + chart = new d3kit.CanvasChart('div#chart'); // with selector + chart = new d3kit.CanvasChart(el, options); // with element+options + chart = new d3kit.CanvasChart('div#chart', options); // with selector+options + + /** + * Test canvas chart functions + */ + context = chart.getContext2d(); + options = d3kit.CanvasChart.getDefaultOptions(); + chart.clear(); +} + +function test_layer_organizer() { + let selection: d3.Selection, + layer: d3.Selection, + layers: d3kit.LayerOrganizer, + hasXAxis: boolean; + + selection = d3.select('svg'); + + /** + * Test constructor + */ + layers = new d3kit.LayerOrganizer(selection); // without specifying tag + layers = new d3kit.LayerOrganizer(selection, 'div'); // specifying tag + + /** + * Test layer creation + */ + layers.create('graph'); + layers.create(['graph', 'highlight']); + layers.create({'graph': [{'axes':['x-axis', 'y-axis']}, {'labels':['x-label', 'y-label', 'title']}]}); + layers.create([{'axes':['x-axis', 'y-axis']}, {'labels':['x-label', 'y-label', 'title']}]); + + /** + * Test other layer organizer functions + */ + layer = layers.get('x-axis'); + hasXAxis = layers.has('x-axis'); +} + +function test_helper() { + let simple1: Object = { "one": 1 }, + simple2: Object = { "two": 2 }, + complex: Object = { "fruit": ["apple", "pear", "grape"], "prez": { "fn": "Barack", "ln": "Obama" } }, + merged1: Object, merged2: Object, + anObject: Object = {"this": "isanobject"}, isObj: boolean, + aFuncxn = () => "this is a function", isFunc: boolean, + kebabed: string, dbouncd: any, throtld: any; + + dbouncd = d3kit.helper.debounce(aFuncxn, 300); + merged1 = d3kit.helper.extend(simple1, simple2); + merged2 = d3kit.helper.deepExtend(simple1, complex); + aFuncxn = d3kit.helper.functor(aFuncxn); // with a function argument + aFuncxn = d3kit.helper.functor(simple1); // with a value argument + isObj = d3kit.helper.isObject(anObject); + isFunc = d3kit.helper.isFunction(aFuncxn); + kebabed = d3kit.helper.kebabCase("a string to convert to kebab case"); + throtld = d3kit.helper.throttle(aFuncxn, 300); +} diff --git a/d3kit/d3kit-v1.1.0-tests.ts b/d3kit/d3kit-v1.1.0-tests.ts new file mode 100644 index 0000000000..5eab2a4e79 --- /dev/null +++ b/d3kit/d3kit-v1.1.0-tests.ts @@ -0,0 +1,1112 @@ +/// +/// +/// +/// + +/* jshint expr: true */ + +var expect = chai.expect; +describe('Skeleton', function(){ + var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; + + beforeEach(function(done){ + element = document.body.appendChild(document.createElement('div')) as Element; + skeleton = new d3kit.Skeleton(element, null, ['custom1', 'custom2']); + $element = d3.select(element); + $svg = $element.select('svg'); + done(); + }); + + describe('new Skeleton()', function(){ + it('should create inside the element', function(){ + expect($element.select('svg').size()).to.be.equal(1); + }); + it('should create inside inside the element', function(){ + expect($element.select('svg').select('g').size()).to.be.equal(1); + }); + }); + + describe('#getCustomEventNames()', function(){ + it('should return custom event names', function(){ + expect(skeleton.getCustomEventNames()).to.deep.equal(['custom1', 'custom2']); + }); + }); + + describe('#getDispatcher()', function(){ + it('should return event dispatcher', function(){ + expect(skeleton.getDispatcher()).to.be.an('Object'); + expect(skeleton.getDispatcher().data).to.be.a('Function'); + }); + }); + + describe('#getInnerWidth()', function(){ + it('should return width of the skeleton excluding margin', function(){ + skeleton.options({ + margin: {left: 10, right: 10} + }); + skeleton.width(100); + expect(skeleton.getInnerWidth()).to.equal(80); + }); + }); + + describe('#getInnerHeight()', function(){ + it('should return height of the skeleton excluding margin', function(){ + skeleton.options({ + margin: {top: 10, bottom: 20} + }); + skeleton.height(100); + expect(skeleton.getInnerHeight()).to.equal(70); + }); + }); + + describe('#getLayerOrganizer()', function(){ + it('should return the LayerOrganizer', function(){ + expect(skeleton.getLayerOrganizer()).to.be.an('Object'); + }); + }); + + describe('#getRootG()', function(){ + it('should return d3 selection of the root ', function(){ + var g = skeleton.getRootG(); + expect(g.size()).to.equal(1); + expect((g[0][0] as Element).tagName).to.equal('g'); + }); + }); + + describe('#getSvg()', function(){ + it('should return d3 selection of the ', function(){ + var svg = skeleton.getSvg(); + expect(svg.size()).to.equal(1); + expect((svg[0][0] as Element).tagName).to.equal('svg'); + }); + }); + + describe('#data(data, doNotDispatch)', function(){ + it('should return data when called without argument', function(){ + skeleton.data({a: 1}); + expect(skeleton.data()).to.deep.equal({a: 1}); + }); + it('should set data when called with at least one argument', function(){ + skeleton.data('test'); + expect(skeleton.data()).to.equal('test'); + }); + it('after setting, should dispatch "data" event', function(done){ + skeleton.on('data.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.data({a: 1}); + }); + it('after setting, should not dispatch "data" event if doNotDispatch is true', function(done){ + skeleton.on('data.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.data({a: 1}, true); + setTimeout(done, 100); + }); + }); + + describe('#options(options, doNotDispatch)', function(){ + it('should return options when called without argument', function(){ + skeleton.options({a: 2}); + expect(skeleton.options()).to.include.keys(['a']); + expect(skeleton.options().a).to.equal(2); + }); + it('should set options when called with at least one argument', function(){ + skeleton.options({a: 1}); + expect(skeleton.options()).to.include.keys(['a']); + expect(skeleton.options().a).to.equal(1); + }); + it('should not overwrite but extend existing options when setting', function(){ + skeleton.options({a: 1}); + skeleton.options({b: 2}); + expect(skeleton.options()).to.include.keys(['a', 'b']); + expect(skeleton.options().a).to.equal(1); + expect(skeleton.options().b).to.equal(2); + }); + it('after setting, should dispatch "options" event', function(done){ + skeleton.on('options.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.options({a: 1}); + }); + it('after setting, should not dispatch "options" event if doNotDispatch is true', function(done){ + skeleton.on('options.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.options({a: 1}, true); + setTimeout(done, 100); + }); + }); + + describe('#margin(margin, doNotDispatch)', function(){ + it('should return margin when called without argument', function(){ + var margin = {left: 10, right: 10, top: 10, bottom: 10}; + skeleton.margin(margin); + expect(skeleton.margin()).to.deep.equal(margin); + }); + it('should set margin when called with at least one argument', function(){ + var margin = {left: 10, right: 10, top: 10, bottom: 10}; + skeleton.margin(margin); + + skeleton.margin({left: 20}); + expect(skeleton.margin().left).to.equal(20); + expect(skeleton.margin().right).to.equal(10); + skeleton.margin({right: 20}); + expect(skeleton.margin().right).to.equal(20); + skeleton.margin({top: 20}); + expect(skeleton.margin().top).to.equal(20); + skeleton.margin({bottom: 20}); + expect(skeleton.margin().bottom).to.equal(20); + }); + it('should update innerWidth after setting margin', function(){ + skeleton.width(100); + skeleton.margin({left: 10, right:10}); + expect(skeleton.getInnerWidth()).to.equal(80); + skeleton.margin({left: 15, right:15}); + expect(skeleton.getInnerWidth()).to.equal(70); + }); + it('should update innerHeight after setting margin', function(){ + skeleton.height(100); + skeleton.margin({top: 10, bottom:10}); + expect(skeleton.getInnerHeight()).to.equal(80); + skeleton.margin({top: 15, bottom:15}); + expect(skeleton.getInnerHeight()).to.equal(70); + }); + it('should update the root transform/translate', function(){ + skeleton.margin({left: 30, top: 30}); + skeleton.offset([0.5, 0.5]); + skeleton.margin({left: 10, top: 10}); + var translate = skeleton.getRootG().attr('transform'); + expect(translate).to.equal('translate(10.5,10.5)'); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.margin({left: 33}); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.margin({left: 33}, true); + setTimeout(done, 100); + }); + }); + + describe('#offset(offset)', function(){ + it('should return offset when called without argument', function(){ + var offset = [1,1]; + skeleton.offset(offset); + expect(skeleton.offset()).to.deep.equal(offset); + }); + it('should set offset when called with at least one argument', function(){ + var offset = [1,1]; + skeleton.offset(offset); + skeleton.offset([2,3]); + expect(skeleton.offset()).to.deep.equal([2,3]); + }); + it('should update the root transform/translate', function(){ + skeleton.offset([0.5, 0.5]); + skeleton.margin({left: 10, top: 10}); + skeleton.offset([2,3]); + var translate = skeleton.getRootG().attr('transform'); + expect(translate).to.equal('translate(12,13)'); + }); + }); + + describe('#width(width, doNotDispatch)', function(){ + it('should return width when called without argument', function(){ + var w = $svg.attr('width'); + expect(skeleton.width()).to.equal(+w); + }); + it('should set width when called with Number as the first argument', function(){ + skeleton.width(300); + expect(+$svg.attr('width')).to.equal(300); + }); + it('should set width when called with a Number and "px" such as "100px" as the first argument', function(){ + skeleton.width('299px'); + expect(+$svg.attr('width')).to.equal(299); + }); + it('should set width to container\'s width when called with "auto" as the first argument', function(){ + var w = element.clientWidth; + skeleton.width('auto'); + expect(+$svg.attr('width')).to.equal(w); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.width(200); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.width(200, true); + setTimeout(done, 100); + }); + }); + + describe('#height(height, doNotDispatch)', function(){ + it('should return height when called without argument', function(){ + var w = $svg.attr('height'); + expect(skeleton.height()).to.equal(+w); + }); + it('should set height when called with Number as the first argument', function(){ + skeleton.height(300); + expect(+$svg.attr('height')).to.equal(300); + }); + it('should set height when called with a Number and "px" such as "100px" as the first argument', function(){ + skeleton.height('299px'); + expect(+$svg.attr('height')).to.equal(299); + }); + it('should set height to container\'s height when called with "auto" as the first argument', function(){ + var w = element.clientHeight; + skeleton.height('auto'); + expect(+$svg.attr('height')).to.equal(w); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.height(200); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.height(200, true); + setTimeout(done, 100); + }); + }); + + describe('#dimension(dimension, doNotDispatch)', function(){ + it('should return an array [width, height] when called without argument', function(){ + var dim = [+$svg.attr('width'), +$svg.attr('height')]; + expect(skeleton.dimension()).to.deep.equal(dim); + }); + it('should set width and height of the when called with an array [width, height] as the first argument', function(){ + skeleton.dimension([118, 118]); + expect([+$svg.attr('width'), +$svg.attr('height')]).to.deep.equal([118, 118]); + }); + it('after setting, should dispatch "resize" event', function(done){ + skeleton.on('resize.test', function(){ + // This block should be reached to pass the test. + expect(true).to.be.true; + done(); + }); + skeleton.dimension([150, 150]); + }); + it('after setting, should not dispatch "resize" event if doNotDispatch is true', function(done){ + skeleton.on('resize.test', function(){ + // This block should not be reached. + expect(true).to.be.false; + done(); + }); + skeleton.dimension([150, 150], true); + setTimeout(done, 100); + }); + }); + + describe('#hasData()', function(){ + it('should return true when data are not null nor undefined', function(){ + skeleton.data({}); + expect(skeleton.hasData()).to.be.true; + skeleton.data({test: 1}); + expect(skeleton.hasData()).to.be.true; + skeleton.data([]); + expect(skeleton.hasData()).to.be.true; + skeleton.data(['test']); + expect(skeleton.hasData()).to.be.true; + }); + it('should return false when data are null or undefined', function(){ + skeleton.data(null); + expect(skeleton.hasData()).to.be.false; + skeleton.data(undefined); + expect(skeleton.hasData()).to.be.false; + }); + }); + + describe('#hasNonZeroArea()', function(){ + it('should return true if \'s width & height excluding margin is more than zero', function(){ + skeleton.options({ + margin: {left: 10, right: 10} + }); + skeleton.width(80); + skeleton.options({ + margin: {top: 10, bottom: 20} + }); + skeleton.height(50); + expect(skeleton.hasNonZeroArea()).to.be.true; + }); + it('should return false otherwise', function(){ + skeleton.options({ + margin: {left: 10, right: 10} + }); + skeleton.width(20); + skeleton.options({ + margin: {top: 10, bottom: 20} + }); + skeleton.height(30); + expect(skeleton.hasNonZeroArea()).to.be.false; + }); + }); + + describe('#mixin({})', function(){ + it('should extend this skeleton with new fields/functions', function(){ + skeleton.mixin({ + a: 1, + b: 2 + }); + expect(skeleton).to.include.keys(['a', 'b']); + expect((skeleton).a).to.equal(1); + expect((skeleton).b).to.equal(2); + }); + it('should overwrite existing fields', function(){ + skeleton.mixin({ + b: 2 + }); + skeleton.mixin({ + b: 3 + }); + expect(skeleton).to.include.keys(['b']); + expect((skeleton).b).to.equal(3); + }); + it('should keep original fields if not overwritten', function(){ + skeleton.mixin({ + a: 1, + b: 2 + }); + skeleton.mixin({ + c: 20, + b: 3 + }); + expect(skeleton).to.include.keys(['a', 'b', 'c']); + expect((skeleton).a).to.equal(1); + expect((skeleton).b).to.equal(3); + expect((skeleton).c).to.equal(20); + }); + }); + + describe('#resizeToFitContainer(mode)', function(){ + it('when mode is "all" should resize to fit both width and height', function(){ + skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); + var w = element.clientWidth; + var h = element.clientHeight; + skeleton.resizeToFitContainer('all'); + expect(skeleton.dimension()).to.deep.equal([w, h]); + }); + it('when mode is "both" should resize to fit both width and height', function(){ + skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); + var w = element.clientWidth; + var h = element.clientHeight; + skeleton.resizeToFitContainer('both'); + expect(skeleton.dimension()).to.deep.equal([w, h]); + }); + it('when mode is "full" should resize to fit both width and height', function(){ + skeleton.dimension([element.clientWidth/2, element.clientHeight/2]); + var w = element.clientWidth; + var h = element.clientHeight; + skeleton.resizeToFitContainer('full'); + expect(skeleton.dimension()).to.deep.equal([w, h]); + }); + it('when mode is "width" should resize width to fit container but keep original height', function(){ + var w1 = element.clientWidth/2; + var h1 = element.clientHeight/2; + + skeleton.dimension([w1, h1]); + + var w2 = element.clientWidth; + var h2 = element.clientHeight; + + skeleton.resizeToFitContainer('width'); + + expect(skeleton.width()).to.equal(Math.floor(w2)); + expect(skeleton.height()).to.equal(Math.floor(h1)); + expect(skeleton.width()).to.not.equal(w1); + expect(skeleton.height()).to.not.equal(h2); + }); + it('when mode is "height" should resize height to fit container but keep original width', function(){ + var w1 = element.clientWidth/2; + var h1 = element.clientHeight*2; + + skeleton.dimension([w1, h1]); + + var w2 = element.clientWidth; + var h2 = element.clientHeight; + + skeleton.resizeToFitContainer('height'); + + expect(skeleton.width()).to.equal(Math.floor(w1)); + expect(skeleton.height()).to.equal(Math.floor(h2)); + expect(skeleton.width()).to.not.equal(w2); + expect(skeleton.height()).to.not.equal(h1); + }); + }); + + describe('#resizeToAspectRatio(ratio)', function(){ + // todo + }); + + describe('#autoResize(mode)', function(){ + it('should return current mode when called without argument', function(){ + skeleton.autoResize(false); + expect(skeleton.autoResize()).to.be.false; + skeleton.autoResize('width'); + expect(skeleton.autoResize()).to.equal('width'); + }); + it('should enable auto resize when set mode to "width/height/both/etc.", similar to parameters of resizeToFitContainer()', function(done){ + // set initial size + skeleton.width(50); + skeleton.autoResize('width'); + setTimeout(function(){ + expect(skeleton.width()).to.equal(element.clientWidth); + done(); + }, 500); + }); + it('should disable auto resize when set mode to false', function(done){ + // set initial size + skeleton.width(50); + skeleton.autoResize('width'); + setTimeout(function(){ + expect(skeleton.width()).to.equal(element.clientWidth); + // disable resize and + skeleton.autoResize(false); + skeleton.width(50); + setTimeout(function(){ + expect(skeleton.width()).to.not.equal(element.clientWidth); + done(); + }, 500); + }, 500); + }); + }); + + describe('#autoResizeDetection(detection)', function(){ + // todo + }); + + describe('#autoResizeToAspectRatio(ratio)', function(){ + // todo + }); + + +}); + +describe.only('LayerOrganizer', function(){ + + describe('new LayerOrganizer(container) will create layers as by default', function(){ + var container: d3.Selection, layers: d3kit.LayerOrganizer; + before(function(done){ + container = d3.select('body').append('svg').append('g'); + layers = new d3kit.LayerOrganizer(container); + done(); + }); + + describe('#create(names)', function(){ + it('should create single layer given a String', function(){ + layers.create('single'); + expect(container.select('g.single-layer').size()).to.be.equal(1); + }); + + it('should create multiple layers given an array', function(){ + layers.create(['a', 'b', 'c']); + expect(container.select('g.a-layer').size()).to.be.equal(1); + expect(container.select('g.b-layer').size()).to.be.equal(1); + expect(container.select('g.c-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with a String inside', function(){ + layers.create({d: 'e'}); + expect(container.select('g.d-layer').size()).to.be.equal(1); + expect(container.select('g.d-layer g.e-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with an Array inside', function(){ + layers.create({f: ['g', 'h']}); + expect(container.select('g.f-layer').size()).to.be.equal(1); + expect(container.select('g.f-layer g.g-layer').size()).to.be.equal(1); + expect(container.select('g.f-layer g.h-layer').size()).to.be.equal(1); + }); + + it('should create multiple nested layers given an array of objects', function(){ + layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); + expect(container.select('g.i-layer').size()).to.be.equal(1); + expect(container.select('g.j-layer').size()).to.be.equal(1); + expect(container.select('g.k-layer').size()).to.be.equal(1); + expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); + expect(container.select('g.i-layer g.x-layer').size()).to.be.equal(1); + expect(container.select('g.k-layer g.x-layer').size()).to.be.equal(1); + expect(container.select('g.k-layer g.y-layer').size()).to.be.equal(1); + }); + + it('should create multi-level nested layers given a nested plain Object', function(){ + layers.create({ + l: [ + 'm', + {'n': [ + {'o': ['p']}, 'q' + ]} + ] + }); + expect(container.select('g.l-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.m-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer g.o-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer g.o-layer g.p-layer').size()).to.be.equal(1); + expect(container.select('g.l-layer g.n-layer g.q-layer').size()).to.be.equal(1); + }); + + }); + + describe('#has(name)', function(){ + it('should be able to check first-level layer', function(){ + expect(layers.has('single')).to.be.true; + expect(layers.has('test')).to.be.false; + }); + it('should be able to check second-level layer', function(){ + expect(layers.has('l.m')).to.be.true; + expect(layers.has('l.x')).to.be.false; + }); + it('should be able to check third-level layer', function(){ + expect(layers.has('l.n.q')).to.be.true; + expect(layers.has('l.n.x')).to.be.false; + }); + }); + + describe('#get(name)', function(){ + it('should be able to get first-level layer', function(){ + expect(layers.get('single')).to.exist; + expect(layers.get('test')).to.be.not.exist; + }); + it('should be able to get second-level layer', function(){ + expect(layers.get('l.m')).to.exist; + expect(layers.get('l.x')).to.not.exist; + }); + it('should be able to get third-level layer', function(){ + expect(layers.get('l.n.o')).to.exist; + expect(layers.get('l.n.x')).to.not.exist; + }); + }); + }); + + describe('new LayerOrganizer(container, tag) will create layers with the given tag instead of ', function(){ + var container: d3.Selection, layers: d3kit.LayerOrganizer; + before(function(done){ + container = d3.select('body').append('div'); + layers = new d3kit.LayerOrganizer(container, 'div'); + done(); + }); + + describe('#create(names)', function(){ + it('should create single layer given a String', function(){ + layers.create('single'); + expect(container.select('div.single-layer').size()).to.be.equal(1); + }); + + it('should create multiple layers given an array', function(){ + layers.create(['a', 'b', 'c']); + expect(container.select('div.a-layer').size()).to.be.equal(1); + expect(container.select('div.b-layer').size()).to.be.equal(1); + expect(container.select('div.c-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with a String inside', function(){ + layers.create({d: 'e'}); + expect(container.select('div.d-layer').size()).to.be.equal(1); + expect(container.select('div.d-layer div.e-layer').size()).to.be.equal(1); + }); + + it('should create nested layers given a plain Object with an Array inside', function(){ + layers.create({f: ['g', 'h']}); + expect(container.select('div.f-layer').size()).to.be.equal(1); + expect(container.select('div.f-layer div.g-layer').size()).to.be.equal(1); + expect(container.select('div.f-layer div.h-layer').size()).to.be.equal(1); + }); + + it('should create multiple nested layers given an array of objects', function(){ + layers.create([{'i': ['x']}, {'j': 'x'}, {'k': ['x','y']}]); + expect(container.select('div.i-layer').size()).to.be.equal(1); + expect(container.select('div.j-layer').size()).to.be.equal(1); + expect(container.select('div.k-layer').size()).to.be.equal(1); + expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); + expect(container.select('div.i-layer div.x-layer').size()).to.be.equal(1); + expect(container.select('div.k-layer div.x-layer').size()).to.be.equal(1); + expect(container.select('div.k-layer div.y-layer').size()).to.be.equal(1); + }); + + it('should create multi-level nested layers given a nested plain Object', function(){ + layers.create({ + l: [ + 'm', + {'n': [ + {'o': ['p']}, 'q' + ]} + ] + }); + expect(container.select('div.l-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.m-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer div.o-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer div.o-layer div.p-layer').size()).to.be.equal(1); + expect(container.select('div.l-layer div.n-layer div.q-layer').size()).to.be.equal(1); + }); + + }); + + describe('#has(name)', function(){ + it('should be able to check first-level layer', function(){ + expect(layers.has('single')).to.be.true; + expect(layers.has('test')).to.be.false; + }); + it('should be able to check second-level layer', function(){ + expect(layers.has('l.m')).to.be.true; + expect(layers.has('l.x')).to.be.false; + }); + it('should be able to check third-level layer', function(){ + expect(layers.has('l.n.q')).to.be.true; + expect(layers.has('l.n.x')).to.be.false; + }); + }); + + describe('#get(name)', function(){ + it('should be able to get first-level layer', function(){ + expect(layers.get('single')).to.exist; + expect(layers.get('test')).to.be.not.exist; + }); + it('should be able to get second-level layer', function(){ + expect(layers.get('l.m')).to.exist; + expect(layers.get('l.x')).to.not.exist; + }); + it('should be able to get third-level layer', function(){ + expect(layers.get('l.n.o')).to.exist; + expect(layers.get('l.n.x')).to.not.exist; + }); + }); + }); + +}); + +describe('Chartlet', function(){ + interface ConfigureFunction { + (parent: d3kit.Chartlet, child: d3kit.Chartlet): void; + } + var enter: d3kit.ChartletEventFunction, update: d3kit.ChartletEventFunction, exit: d3kit.ChartletEventFunction, chartlet: d3kit.Chartlet; + var customEvents: Array = ['fooEvent']; + var ChildChartlet: () => d3kit.Chartlet; + var ParentChartlet: (configureFunction: ConfigureFunction) => d3kit.Chartlet; + + var callback = function(selection?: d3.Selection, done?: any) { return (sel: d3.Selection) => {done();};}; + beforeEach(function(done){ + ChildChartlet = function() { + var chartlet = new d3kit.Chartlet(callback, callback, callback); + (chartlet).runTest = function (testFunction: any) { + testFunction(chartlet); + }; + return chartlet; + }; + + ParentChartlet = function(configureFunction: ConfigureFunction) { + var chartlet = new d3kit.Chartlet(callback, callback, callback); + var child = ChildChartlet(); + configureFunction(chartlet, child); + (chartlet).runTest = (child).runTest; + return chartlet; + }; + + enter = callback; + update = callback; + exit = callback; + chartlet = new d3kit.Chartlet(enter, update, exit, customEvents); + done(); + }); + + describe('new Chartlet(enter, update, exit, customEvents)', function(){ + it('should create a chartlet', function(){ + expect(chartlet).to.be.an('Object'); + expect(chartlet).to.include.keys(['property', 'on']); + expect(chartlet.enter).to.be.a('Function'); + expect(chartlet.update).to.be.a('Function'); + expect(chartlet.exit).to.be.a('Function'); + expect(function(){ chartlet.enter(); }).to.not.throw(Error); + expect(function(){ chartlet.update(); }).to.not.throw(Error); + expect(function(){ chartlet.exit(); }).to.not.throw(Error); + expect(chartlet.getCustomEventNames()).to.deep.equal(customEvents); + }); + it('arguments "update", "exit" and "customEvents" are optional', function(){ + var comp = new d3kit.Chartlet(enter); + expect(comp).to.be.an('Object'); + expect(comp).to.include.keys(['property', 'on']); + expect(comp.enter).to.be.a('Function'); + expect(comp.update).to.be.a('Function'); + expect(comp.exit).to.be.a('Function'); + expect(function(){ comp.enter(); }).to.not.throw(Error); + expect(function(){ comp.update(); }).to.not.throw(Error); + expect(function(){ comp.exit(); }).to.not.throw(Error); + }); + }); + + describe('#getDispatcher()', function(){ + it('should return a dispatcher', function(){ + var dispatcher = chartlet.getDispatcher(); + expect(dispatcher).to.exist; + }); + it('returned dispatcher should handle enter/update/exit events', function(){ + var dispatcher = chartlet.getDispatcher(); + expect(dispatcher).to.include.keys(['enterDone', 'updateDone', 'exitDone'].concat(customEvents)); + }); + }); + + describe('#getPropertyValue(name, d, i)', function(){ + it('should return computed value for specified property name, d and i', function(){ + var d = {a: 99}; + var i = 2; + + chartlet.property('foo', 1); + chartlet.property('bar', 'two'); + chartlet.property('baz', function(d:{a:number}, i: number) {return 3;}); + chartlet.property('qux', function(d:{a:number}, i: number) {return 'four';}); + chartlet.property('nux', function(d:{a:number}, i: number) {return d.a * i;}); + + expect(chartlet.getPropertyValue('foo', d, i)).to.equal(1); + expect(chartlet.getPropertyValue('bar', d, i)).to.equal('two'); + expect(chartlet.getPropertyValue('baz', d, i)).to.equal(3); + expect(chartlet.getPropertyValue('qux', d, i)).to.equal('four'); + expect(chartlet.getPropertyValue('nux', d, i)).to.equal(198); + }); + }); + + describe('#property(name, valueOrFn)', function(){ + describe('should act as a getter when called with one argument', function(){ + it('should always return a function', function(){ + chartlet.property('foo', 1); + expect(chartlet.property('foo')).to.be.a('Function'); + chartlet.property('bar', function(){ return 100; }); + expect(chartlet.property('bar')).to.be.a('Function'); + }); + it('should return a function that return undefined for unknown property name', function(){ + expect(chartlet.property('unknown name')).to.be.a('Function'); + expect(chartlet.property('unknown name')()).to.equal(undefined); + }); + }); + + describe('should act as a setter when called with two arguments', function(){ + it('should set specified property to a functor of given value', function(){ + chartlet.property('foo', 1); + expect(chartlet.property('foo')).to.be.a('Function'); + expect(chartlet.property('foo')()).to.equal(1); + chartlet.property('bar', function(){ return 100; }); + expect(chartlet.property('bar')).to.be.a('Function'); + expect(chartlet.property('bar')()).to.equal(100); + }); + it('should overwrite previous value when set property with the same name', function(){ + chartlet.property('foo', 1); + expect(chartlet.property('foo')()).to.equal(1); + chartlet.property('foo', 100); + expect(chartlet.property('foo')()).to.equal(100); + }); + }); + }); + + describe('#on(eventName, listener)', function(){ + it('event "enterDone" should be triggered after chartlet.enter() is completed.', function(done){ + chartlet.on('enterDone', function(){ return (sel: d3.Selection) => {done();} }); + chartlet.enter(); + }); + it('event "updateDone" should be triggered after chartlet.update() is completed.', function(done){ + chartlet.on('updateDone', function(){ return (sel: d3.Selection) => {done();} }); + chartlet.update(); + }); + it('event "exitDone" should be triggered after chartlet.exit() is completed.', function(done){ + chartlet.on('exitDone', function(){ return (sel: d3.Selection) => {done();} }); + chartlet.exit(); + }); + }); + + describe('#inheritPropertyFrom(parentChartlet, parentPropertyName, childPropertyName)', function(){ + it('it should cause a child to inherit a parent property', function() { + var parent = ParentChartlet(function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertyFrom(parent, 'foo', 'bar'); + }) + .property('foo', function(d:number) {return 2 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('bar', 4, 0)).to.be.equal(8); + }); + }); + + it('it should default to the parent property name', function() { + var parent = ParentChartlet( + function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertyFrom(parent, 'foo'); + }) + .property('foo', function(d:number) {return 2 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('foo', 4, 0)).to.be.equal(8); + }); + }); + }); + + describe('#inheritProperties(parentChartlet, parentPropertyNames, childPropertyNames)', function(){ + it('it should cause a child to inherit many parent properties', function() { + var parent = ParentChartlet( + function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz'], ['foo-x', 'bar-x', 'baz-x']); + }) + .property('foo', function(d:number) {return 2 * d;}) + .property('bar', function(d:number) {return 3 * d;}) + .property('baz', function(d:number) {return 4 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('foo-x', 1, 0)).to.be.equal(2); + expect(child.getPropertyValue('bar-x', 1, 0)).to.be.equal(3); + expect(child.getPropertyValue('baz-x', 1, 0)).to.be.equal(4); + }); + }); + + it('it should default to the parent property names', function() { + var parent = ParentChartlet( + function(parent: d3kit.Chartlet, child: d3kit.Chartlet) { + child.inheritPropertiesFrom(parent, ['foo', 'bar', 'baz']); + }) + .property('foo', function(d:number) {return 2 * d;}) + .property('bar', function(d:number) {return 3 * d;}) + .property('baz', function(d:number) {return 4 * d;}); + + (parent).runTest(function(child: d3kit.Chartlet) { + expect(child.getPropertyValue('foo', 1, 0)).to.be.equal(2); + expect(child.getPropertyValue('bar', 1, 0)).to.be.equal(3); + expect(child.getPropertyValue('baz', 1, 0)).to.be.equal(4); + }); + }); + }); + + describe('#publishEventsTo(foreignDispatcher)', function(){ + it('should map events to a foreignDispatcher', function(done) { + + var parent = new d3kit.Chartlet(callback, callback, callback, ['foo']); + parent.getDispatcher().on('foo', function(value:number) { + expect(value).to.be.equal(99); + done(); + }); + + var child = new d3kit.Chartlet(callback, callback, callback, ['foo']) + .publishEventsTo(parent.getDispatcher()); + + (child.getDispatcher()).foo(99); + }); + }); +}); + +describe('#createChart', function(){ + var Chart = d3kit.factory.createChart({}, ['test'], function(skeleton: d3kit.Skeleton){ + return skeleton; + }); + + it('should return a function to create a chart', function(){ + expect(Chart).to.be.a('Function'); + }); + + // // Don't think it's possible to define these in a d.ts file; skipping + // it('results should have function getCustomEvents()', function(){ + // expect(Chart.getCustomEvents).to.exist; + // expect(Chart.getCustomEvents()).to.deep.equal(['test']); + // }); +}); + +describe('d3kit.helper', function(){ + + describe('#dasherize(str)', function(){ + it('should convert input to dash-case', function(){ + expect(d3kit.helper.dasherize('camelCase')).to.equal('camel-case'); + }); + }); + + describe('#deepExtend(target, src1, src2, ...)', function(){ + it('should copy fields from sources into target', function(){ + expect(d3kit.helper.deepExtend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + })).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + + expect(d3kit.helper.deepExtend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + }, null)).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + }); + + it('should copy arrays and functions correctly from sources into target', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.deepExtend({}, { + a: fn1, + b: [1,2] + },{ + b: [3,4], + c: fn2 + })).to.deep.equal({ + a: fn1, + b: [3,4], + c: fn2 + }); + }); + + it('should perform "deep" copy', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.deepExtend({}, { + a: { d: fn1 }, + b: [1,2], + c: { f: 3 }, + h: { i: [1,2,3], j: [3,4,5] } + },{ + a: { e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } + })).to.deep.equal({ + a: { d: fn1, e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], j: [3,4,5], k: [3,4,5], l: {m: 2} } + }); + }); + }); + + describe('#extend(target, src1, src2, ...)', function(){ + it('should copy fields from sources into target', function(){ + expect(d3kit.helper.extend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + })).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + + expect(d3kit.helper.extend({}, { + a: 1, + b: 2 + },{ + b: 3, + c: 4 + }, null)).to.deep.equal({ + a: 1, + b: 3, + c: 4 + }); + }); + + it('should copy arrays and functions correctly from sources into target', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.extend({}, { + a: fn1, + b: [1,2] + },{ + b: [3,4], + c: fn2 + })).to.deep.equal({ + a: fn1, + b: [3,4], + c: fn2 + }); + }); + + it('should NOT perform "deep" copy', function(){ + var fn1 = function(d:number){return d + 1;}; + var fn2 = function(d:number){return d + 2;}; + expect(d3kit.helper.extend({}, { + a: { d: fn1 }, + b: [1,2], + c: { f: 3 }, + h: { i: [1,2,3], j: [3,4,5] } + },{ + a: { e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } + })).to.deep.equal({ + a: { e: 2 }, + b: [3,4], + c: { f: 4, g: fn2 }, + h: { i: [2,3,4], k: [3,4,5], l: {m: 2} } + }); + }); + }); + + describe('#isFunction(function)', function(){ + it('should return true if the value is a function', function(){ + var fn1 = function(d:number){return d + 1;}; + function fn2(d:number){return d + 2;} + + expect(d3kit.helper.isFunction(fn1)).to.be.true; + expect(d3kit.helper.isFunction(fn2)).to.be.true; + }); + it('should return false if the value is not a function', function(){ + expect(d3kit.helper.isFunction(0)).to.be.false; + expect(d3kit.helper.isFunction(1)).to.be.false; + expect(d3kit.helper.isFunction(true)).to.be.false; + expect(d3kit.helper.isFunction('what')).to.be.false; + expect(d3kit.helper.isFunction(null)).to.be.false; + expect(d3kit.helper.isFunction(undefined)).to.be.false; + }); + }); + + describe('#isNumber(value)', function(){ + it('should return true for number', function(){ + expect(d3kit.helper.isNumber(1)).to.be.true; + expect(d3kit.helper.isNumber(0)).to.be.true; + expect(d3kit.helper.isNumber(-1)).to.be.true; + }); + it('should return false for string even if it is a number', function(){ + expect(d3kit.helper.isNumber('')).to.be.false; + expect(d3kit.helper.isNumber('1')).to.be.false; + expect(d3kit.helper.isNumber('0')).to.be.false; + expect(d3kit.helper.isNumber('what')).to.be.false; + }); + it('should return false for null and undefined', function(){ + expect(d3kit.helper.isNumber(null)).to.be.false; + expect(d3kit.helper.isNumber(undefined)).to.be.false; + }); + }); +}); + diff --git a/d3kit/d3kit-v1.1.0.d.ts b/d3kit/d3kit-v1.1.0.d.ts new file mode 100644 index 0000000000..ef6405b04d --- /dev/null +++ b/d3kit/d3kit-v1.1.0.d.ts @@ -0,0 +1,155 @@ +// Type definitions for d3Kit v1.1.0 +// Project: https://www.npmjs.com/package/d3kit +// Definitions by: Morgan Benton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace d3kit { + + export interface ChartMargin { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + export interface ChartOptions { + margin?: ChartMargin; + offset?: [number,number]; + initialWidth?: number; + initialHeight?: number; + [name: string]: any; + } + + export interface ChartMixin { + [name: string]: any; + } + + export class Skeleton { + + constructor(selector: string|Element, options?: ChartOptions, customEvents?: Array); + + // Getters + getCustomEventNames(): Array; + getDispatcher(): any; // should be d3.Dispatch but this throws error for user-created events + getInnerWidth(): number; + getInnerHeight(): number; + getLayerOrganizer(): LayerOrganizer; + getRootG(): d3.Selection; + getSvg(): d3.Selection; + + // Getter/Setters + data(): any; + data(data?: any, doNotDispatch?: boolean): Skeleton; + options(): any; // wish this could be ChartOptions + options(options: ChartOptions, doNotDispatch?: boolean): Skeleton; + margin(): ChartMargin; + margin(margin: ChartMargin, doNotDispatch?: boolean): Skeleton; + offset(): [number, number]; + offset(offset: Array, doNotDispatch?: boolean): Skeleton; + width(): number; + width(value: number|string, doNotDispatch?: boolean): Skeleton; + height(): number; + height(value: number|string, doNotDispatch?: boolean): Skeleton; + dimension(): [number, number]; + dimension(dimension: [number|string, number|string], doNotDispatch?: boolean): Skeleton; + autoResize(mode?: string|boolean): string|boolean|void; + autoResizeDetection(method?:string): string|void; + autoResizeToAspectRatio(ratio?: number|boolean): number|boolean|void; + + // Other functions + on(eventName: string, listener: (...args: Array) => void): void; + hasData(): boolean; + hasNonZeroArea(): boolean; + mixin(fn: ChartMixin): void; + resizeToFitContainer(mode: string|boolean, doNotDispatch?: boolean): void; + resizeToAspectRatio(ratio: number, doNotDispatch?: boolean): void; + } + + interface ChartletPropertyCallback { + (datum?: any, datum_index?: number): any; + } + + export interface ChartletEventFunction { + (sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + } + + export class Chartlet { + + constructor( + enterFunction?: ChartletEventFunction, + updateFunction?: ChartletEventFunction, + exitFunction?: ChartletEventFunction, + customEventName?: Array); + + // Getter functions + getDispatcher(): d3.Dispatch; + getCustomEventNames(): Array; + getPropertyValue(name: string, datum: any, datum_index: number): any; + + // Getter/Setter functions + property(name: string): ChartletPropertyCallback; + property(name: string, value: any): Chartlet; + + // Enter/Update/Exit functions + enter( sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + update(sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + exit( sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; + + // Inheritance functions + inheritPropertyFrom(parent_chartlet: Chartlet, parent_property_name: string, child_property_name?: string): void; + inheritPropertiesFrom(parent_chartlet: Chartlet, parent_property_names: Array, child_property_names?: Array): void; + publishEventsTo(dispatcher: d3.Dispatch): Chartlet; + + // Events + on(eventName: string, handlerFunction: ChartletEventFunction): void; + } + + interface LayerConfig { + name?: string, + names?: Array, + sublayers?: LayerConfig + } + + export class LayerOrganizer { + + constructor(container: d3.Selection, tag?: string); + + create(config: string|Array|LayerConfig|Array|any): d3.Selection|Array>; + get(name: string): d3.Selection; + has(name: string): boolean; + } + + export namespace factory { + export function createChart( + defaultOptions: ChartOptions, + customEvents: Array, + constructor: (skeleton: Skeleton) => void + ): (selector: string|Element, options?: ChartOptions, customEvents?: Array) => Skeleton; + } + + export namespace helper { + export function debounce(fn: (...args: Array) => void, wait: number, immediate: boolean): (...args: Array) => void; + export function extend(target: Object, ...args: Object[]): Object; + export function deepExtend(target: Object, ...args: Object[]): Object; + export function bindMouseEventsToDispatcher(selection: d3.Selection, dispatch: d3.Dispatch, prefix: string): void; + export function removeAllChildren(selection: d3.Selection, noTransition: boolean): d3.Selection; + export function on(element: Element, type: string, listener: (...args: Array) => void): void; + export function off(element: Element, type: string, listener: (...args: Array) => void): void; + export function trim(str: string, characters: string): string; + export function dasherize(str: string): string; + export function $(s: Element|string): Element; + export function $$(s: Array|NodeList): Array; + export function isArray(value: any): boolean; + export function isNumber(value: any): boolean; + export function isObject(value: any): boolean; + export function isElement(o: any): boolean; + export function isFunction(functionToCheck: any): boolean; + } + +} + +declare module 'd3kit' { + export = d3kit; +} diff --git a/d3kit/index.d.ts b/d3kit/index.d.ts index ef6405b04d..18adf3c6c0 100644 --- a/d3kit/index.d.ts +++ b/d3kit/index.d.ts @@ -1,155 +1,115 @@ -// Type definitions for d3Kit v1.1.0 -// Project: https://www.npmjs.com/package/d3kit -// Definitions by: Morgan Benton +// Type definitions for d3Kit v3.1.2 +// Project: https://github.com/twitter/d3kit +// Definitions by: Morgan Benton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare namespace d3kit { - - export interface ChartMargin { - top?: number; - right?: number; - bottom?: number; - left?: number; - } - - export interface ChartOptions { - margin?: ChartMargin; - offset?: [number,number]; - initialWidth?: number; - initialHeight?: number; - [name: string]: any; - } - - export interface ChartMixin { - [name: string]: any; - } - - export class Skeleton { - - constructor(selector: string|Element, options?: ChartOptions, customEvents?: Array); - - // Getters - getCustomEventNames(): Array; - getDispatcher(): any; // should be d3.Dispatch but this throws error for user-created events - getInnerWidth(): number; - getInnerHeight(): number; - getLayerOrganizer(): LayerOrganizer; - getRootG(): d3.Selection; - getSvg(): d3.Selection; - - // Getter/Setters - data(): any; - data(data?: any, doNotDispatch?: boolean): Skeleton; - options(): any; // wish this could be ChartOptions - options(options: ChartOptions, doNotDispatch?: boolean): Skeleton; - margin(): ChartMargin; - margin(margin: ChartMargin, doNotDispatch?: boolean): Skeleton; - offset(): [number, number]; - offset(offset: Array, doNotDispatch?: boolean): Skeleton; - width(): number; - width(value: number|string, doNotDispatch?: boolean): Skeleton; - height(): number; - height(value: number|string, doNotDispatch?: boolean): Skeleton; - dimension(): [number, number]; - dimension(dimension: [number|string, number|string], doNotDispatch?: boolean): Skeleton; - autoResize(mode?: string|boolean): string|boolean|void; - autoResizeDetection(method?:string): string|void; - autoResizeToAspectRatio(ratio?: number|boolean): number|boolean|void; - - // Other functions - on(eventName: string, listener: (...args: Array) => void): void; - hasData(): boolean; - hasNonZeroArea(): boolean; - mixin(fn: ChartMixin): void; - resizeToFitContainer(mode: string|boolean, doNotDispatch?: boolean): void; - resizeToAspectRatio(ratio: number, doNotDispatch?: boolean): void; - } - - interface ChartletPropertyCallback { - (datum?: any, datum_index?: number): any; - } - - export interface ChartletEventFunction { - (sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; - } - - export class Chartlet { - - constructor( - enterFunction?: ChartletEventFunction, - updateFunction?: ChartletEventFunction, - exitFunction?: ChartletEventFunction, - customEventName?: Array); - - // Getter functions - getDispatcher(): d3.Dispatch; - getCustomEventNames(): Array; - getPropertyValue(name: string, datum: any, datum_index: number): any; - - // Getter/Setter functions - property(name: string): ChartletPropertyCallback; - property(name: string, value: any): Chartlet; - - // Enter/Update/Exit functions - enter( sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; - update(sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; - exit( sel?: d3.Selection, done?: string): (sel: d3.Selection) => void; - - // Inheritance functions - inheritPropertyFrom(parent_chartlet: Chartlet, parent_property_name: string, child_property_name?: string): void; - inheritPropertiesFrom(parent_chartlet: Chartlet, parent_property_names: Array, child_property_names?: Array): void; - publishEventsTo(dispatcher: d3.Dispatch): Chartlet; - - // Events - on(eventName: string, handlerFunction: ChartletEventFunction): void; - } - - interface LayerConfig { - name?: string, - names?: Array, - sublayers?: LayerConfig - } - - export class LayerOrganizer { - - constructor(container: d3.Selection, tag?: string); - - create(config: string|Array|LayerConfig|Array|any): d3.Selection|Array>; - get(name: string): d3.Selection; - has(name: string): boolean; - } - - export namespace factory { - export function createChart( - defaultOptions: ChartOptions, - customEvents: Array, - constructor: (skeleton: Skeleton) => void - ): (selector: string|Element, options?: ChartOptions, customEvents?: Array) => Skeleton; - } - - export namespace helper { - export function debounce(fn: (...args: Array) => void, wait: number, immediate: boolean): (...args: Array) => void; - export function extend(target: Object, ...args: Object[]): Object; - export function deepExtend(target: Object, ...args: Object[]): Object; - export function bindMouseEventsToDispatcher(selection: d3.Selection, dispatch: d3.Dispatch, prefix: string): void; - export function removeAllChildren(selection: d3.Selection, noTransition: boolean): d3.Selection; - export function on(element: Element, type: string, listener: (...args: Array) => void): void; - export function off(element: Element, type: string, listener: (...args: Array) => void): void; - export function trim(str: string, characters: string): string; - export function dasherize(str: string): string; - export function $(s: Element|string): Element; - export function $$(s: Array|NodeList): Array; - export function isArray(value: any): boolean; - export function isNumber(value: any): boolean; - export function isObject(value: any): boolean; - export function isElement(o: any): boolean; - export function isFunction(functionToCheck: any): boolean; - } +export as namespace d3kit; +export class AbstractChart { + container: Element; + constructor(selector: string|Element, options?: ChartOptions); + static getDefaultOptions(): ChartOptions; + static getCustomEventNames(): string[]; + setupDispatcher(customEventNames?: string[]): void; + getCustomEventNames(): string[]; + getInnerWidth(): number; + getInnerHeight(): number; + width(value: number): this; + width(): number; + height(value: number): this; + height(): number; + dimension(dimensions: [number, number]): this; + dimension(): [number, number]; + data(data: any): this; + data(): any; + margin(margins: ChartMargin): this; + margin(): ChartMargin; + offset(offset: ChartOffset): this; + offset(): ChartOffset; + options(options: ChartOptions): this; + options(): ChartOptions; + updateDimensionNow(): this; + hasData(): boolean; + hasNonZeroArea(): boolean; + fit(fitOptions: FitOptions, watchOptions?: WatchOptions): this; + stopFitWatcher(): this; + on(name: string, listener: () => void): this; + off(name: string): this; + destroy(): void; } -declare module 'd3kit' { - export = d3kit; +export interface ChartMargin { + top?: number; + right?: number; + bottom?: number; + left?: number; +} + +export interface ChartOffset { + x: number; + y: number; +} + +export interface ChartOptions { + initialWidth?: number; + initialHeight?: number; + margin?: ChartMargin; + offset?: ChartOffset; + pixelRatio?: number; +} + +// from https://github.com/kristw/slimfit +export interface FitOptions { + mode?: string; + width?: string|number; + height?: string|number; + ratio?: number; + maxWidth?: string|number; + maxHeight?: string|number; +} + +// from https://github.com/kristw/slimfit +export interface WatchOptions { + mode?: string; + target?: any; // lazy + interval?: number; +} + +export class SvgChart extends AbstractChart { + svg: d3.Selection; + rootG: d3.Selection; + layers: LayerOrganizer; + constructor(selector: string|Element, options?: ChartOptions); +} + +export class CanvasChart extends AbstractChart { + constructor(selector: string|Element, options?: ChartOptions); + static getDefaultOptions(): ChartOptions; + getContext2d(): CanvasRenderingContext2D; + clear(): this; +} + +export class LayerOrganizer { + constructor(container: d3.Selection, defaultTag?: string); + create(layerNames: string|Array|LayerConfig|Array): d3.Selection|Array>; + get(name: string): d3.Selection; + has(name: string): boolean; +} + +export interface LayerConfig { + [layerName: string]: string|string[]|LayerConfig|Array; +} + +export namespace helper { + function debounce(fn: (...args: Array) => void, delay: number): (...args: Array) => void; + function deepExtend(dest: Object, ...args: Object[]): Object; + function extend(dest: Object, ...args: Object[]): Object; + function functor(value: any): (...args: Array) => any; + function rebind(target: Object, source: Object): Object; + function isFunction(value: any): boolean; + function isObject(value: any): boolean; + function kebabCase(str: string): string; + function throttle(fn: (...args: Array) => void, delay: number): (...args: Array) => void; } diff --git a/d3kit/package.json b/d3kit/package.json index 5e771f4dcd..8eabdc01d2 100644 --- a/d3kit/package.json +++ b/d3kit/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@types/d3": "^3.5.36" + "@types/d3": "^4.2.38" } } diff --git a/d3kit/tsconfig.json b/d3kit/tsconfig.json index a60dcbb573..ba1073cccf 100644 --- a/d3kit/tsconfig.json +++ b/d3kit/tsconfig.json @@ -6,7 +6,6 @@ "strictNullChecks": false, "baseUrl": "../", "typeRoots": [ - "node_modules/@types", "../" ], "types": [], diff --git a/dat-gui/index.d.ts b/dat-gui/index.d.ts index 7d1e2147d7..a38699e0bb 100644 --- a/dat-gui/index.d.ts +++ b/dat-gui/index.d.ts @@ -43,20 +43,15 @@ declare namespace dat { updateDisplay(): void; // gui properties in dat/gui/GUI.js - parent(): GUI; - scrollable(): boolean; - autoPlace(): boolean; - preset(): string; - preset(s: string): void; - width(): number; - width(n: number): void; - name(): string; - name(s: string): void; - closed(): boolean; - closed(b: boolean): void; - load(): Object; - useLocalStorage(): boolean; - useLocalStorage(b: boolean): void; + readonly parent: GUI; + readonly scrollable: boolean; + readonly autoPlace: boolean; + preset: string; + width: number; + name: string; + closed: boolean; + readonly load: Object; + useLocalStorage: boolean; } export interface GUIParams{ diff --git a/data-driven/index.d.ts b/data-driven/index.d.ts index fc21425b54..e6fc06051d 100644 --- a/data-driven/index.d.ts +++ b/data-driven/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for data-driven.js +// Type definitions for data-driven.js // Project: https://github.com/fluentsoftware/data-driven // Definitions by: Adam Babcock // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/datejs/index.d.ts b/datejs/index.d.ts index 856cdcaded..d7c1854253 100644 --- a/datejs/index.d.ts +++ b/datejs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DateJS +// Type definitions for DateJS // Project: http://www.datejs.com/ // Definitions by: David Khristepher Santos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/datejs/sugarpak.d.ts b/datejs/sugarpak.d.ts index 5ed410740d..b4077960ad 100644 --- a/datejs/sugarpak.d.ts +++ b/datejs/sugarpak.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DateJS - SugarPak Extensions +// Type definitions for DateJS - SugarPak Extensions // Project: http://www.datejs.com/ // Definitions by: David Khristepher Santos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/db.js/db.js-tests.ts b/db.js/db.js-tests.ts index e7fb297aed..169d5725d1 100644 --- a/db.js/db.js-tests.ts +++ b/db.js/db.js-tests.ts @@ -1,4 +1,4 @@ -// Test file for db.js Definition file +import db = require("db.js"); /* Type for use in tests */ diff --git a/db.js/index.d.ts b/db.js/index.d.ts index 83e21fa529..fa962dc0a3 100644 --- a/db.js/index.d.ts +++ b/db.js/index.d.ts @@ -7,7 +7,7 @@ declare module DbJs { interface ErrorListener { (err: Error): void; } - + interface OpenOptions { server: string; version: number; @@ -29,14 +29,14 @@ declare module DbJs { interface CountableQuery { count(): ExecutableQuery; } - + interface KeysQuery extends DescableQuery, ExecutableQuery, FilterableQuery, DistinctableQuery, MappableQuery { - } + } interface KeyableQuery { keys(): KeysQuery; } - + interface FilterQuery extends KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, DistinctableQuery, ModifiableQuery, LimitableQuery, MappableQuery { } @@ -44,14 +44,14 @@ declare module DbJs { filter(index: string, value: TValue): FilterQuery; filter(filter: (value: T) => boolean): FilterQuery; } - - interface DescQuery extends KeyableQuery, CountableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery { + + interface DescQuery extends KeyableQuery, CountableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery { } interface DescableQuery { desc(): DescQuery; } - + interface DistinctQuery extends KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery, CountableQuery { } @@ -71,7 +71,7 @@ declare module DbJs { interface MappableQuery { map(fn: (value: T) => TMap): Query; } - + interface Query extends Promise, KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, DistinctableQuery, ModifiableQuery, LimitableQuery, MappableQuery, CountableQuery { } @@ -93,11 +93,11 @@ declare module DbJs { getIndexedDB(): IDBDatabase; close(): void; } - + interface IndexAccessibleServer { [store: string]: TypedObjectStoreServer; } - + interface ObjectStoreServer { add(table: string, entity: T): Promise; add(table: string, ...entities: T[]): Promise; @@ -142,11 +142,11 @@ declare module DbJs { query(index: string): IndexQuery; count(key: any): Promise; } - + type Server = DbJs.IndexAccessibleServer & DbJs.ObjectStoreServer & DbJs.BaseServer; } -declare module "db" { +declare module "db.js" { var db: DbJs.DbJsStatic; export = db; } diff --git a/dc/dc-1.6.0.d.ts b/dc/dc-1.6.0.d.ts index 03b5e9039b..9938d3bc45 100644 --- a/dc/dc-1.6.0.d.ts +++ b/dc/dc-1.6.0.d.ts @@ -58,7 +58,15 @@ export interface ILegendwidget { export var events: IEvents; export interface IListener { - on: (eventName: string, fnctn: (c:T) => void) => T; + on: { + (event: "preRender", fnctn: (c: T) => any): T; + (event: "postRender", fnctn: (c: T) => any): T; + (event: "preRedraw", fnctn: (c: T) => any): T; + (event: "postRedraw", fnctn: (c: T) => any): T; + (event: "filtered", fnctn: (c: T, filter: any) => any): T; + (event: "zoomed", fnctn: (c: T, filter: any) => any): T; + (event: string, fnctn: (c: T, ...args: any[]) => any): T; + }; } export interface ImarginObj { diff --git a/dc/index.d.ts b/dc/index.d.ts index ffea80fa05..b0291d703c 100644 --- a/dc/index.d.ts +++ b/dc/index.d.ts @@ -160,7 +160,16 @@ declare namespace DC { legend: IGetSet; options(optionsObject: any): T; renderlet(fn: (chart: T) => any): T; - on(event: string, fn: (chart: T) => any): T; + + on(event: "renderlet", fn: (chart: T, filter: any) => any): T; + on(event: "pretransition", fn: (chart: T, filter: any) => any): T; + on(event: "preRender", fn: (chart: T) => any): T; + on(event: "postRender", fn: (chart: T) => any): T; + on(event: "preRedraw", fn: (chart: T) => any): T; + on(event: "postRedraw", fn: (chart: T) => any): T; + on(event: "filtered", fn: (chart: T, filter: any) => any): T; + on(event: "zoomed", fn: (chart: T, filter: any) => any): T; + on(event: string, fn: (chart: T, ...args: any[]) => any): T; } export interface Margins { diff --git a/depd/index.d.ts b/depd/index.d.ts index 499cd99b88..147393a332 100644 --- a/depd/index.d.ts +++ b/depd/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for depd 1.1.0 +// Type definitions for depd 1.1.0 // Project: https://github.com/dougwilson/nodejs-depd // Definitions by: Zhiyuan Wang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/devexpress-web/index.d.ts b/devexpress-web/index.d.ts index 7c3eeda936..b52c31759d 100644 --- a/devexpress-web/index.d.ts +++ b/devexpress-web/index.d.ts @@ -2295,14 +2295,11 @@ interface ASPxClientDateEdit extends ASPxClientDropDownEditBase { */ GetTimeEdit(): ASPxClientTimeEdit; /** - * Sets the date editor's value. - * @param date A date object specifying the value to assign to the date editor. + * + * @param date */ - SetDate(date: Object): void; - /** - * Returns a date that is the date editor's value. - */ - GetDate(): Object; + SetDate(date: Date): void; + GetDate(): Date; /** * Returns the number of days in a range selected within a date edit. */ @@ -3000,14 +2997,11 @@ interface ASPxClientTimeEdit extends ASPxClientSpinEditBase { */ DateChanged: ASPxClientEvent>; /** - * Sets the time editor's value. - * @param date A date-time object specifying the value to assign to the time editor. + * + * @param date */ - SetDate(date: Object): void; - /** - * Returns a date that is the time editor's value. - */ - GetDate(): Object; + SetDate(date: Date): void; + GetDate(): Date; } /** * Represents a base for client-side static editors whose values cannot be visually changed by end users. @@ -4446,9 +4440,10 @@ interface ASPxClientCardViewBatchEditCardDeletingEventArgs extends ASPxClientCan */ interface ASPxClientCardViewBatchEditApi { /** - * Performs validation of CardView data when the CardView operates in Batch Edit mode. + * Performs validation of CardView data contained in the cards when the CardView operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified cards should be validated; otherwise, false. */ - ValidateCards(): boolean; + ValidateCards(validateOnlyModified?: boolean): boolean; /** * Performs validation of CardView data contained in the specified card when the CardView operates in Batch Edit mode. * @param visibleIndex An integer value specifying the visible index of the validated card. @@ -6038,9 +6033,10 @@ interface ASPxClientGridViewCellInfo { */ interface ASPxClientGridViewBatchEditApi { /** - * Performs validation of grid data when the grid operates in Batch Edit mode. + * Performs validation of grid data contained in all rows when the grid operates in Batch Edit mode. + * @param validateOnlyModified true, if only modified rows should be validated; otherwise, false. */ - ValidateRows(): boolean; + ValidateRows(validateOnlyModified?: boolean): boolean; /** * Performs validation of grid data contained in the specified row when the grid operates in Batch Edit mode. * @param visibleIndex An integer value specifying the visible index of the validated row. @@ -7074,9 +7070,10 @@ interface ASPxClientVerticalGridCellInfo { */ interface ASPxClientVerticalGridBatchEditApi { /** - * Performs validation of grid data when the grid operates in Batch Edit mode. + * Performs validation of grid data contained in all records when the grid operates in batch edit mode. + * @param validateOnlyModified true, if only modified records should be validated; otherwise, false. */ - ValidateRecords(): boolean; + ValidateRecords(validateOnlyModified?: boolean): boolean; /** * Performs validation of grid data contained in the specified record when the grid operates in batch edit mode. * @param visibleIndex An integer value specifying the visible index of the validated record. @@ -8249,6 +8246,7 @@ interface ASPxClientRichEdit extends ASPxClientControl { * Value: A object that lists methods to work with the selection. */ selection: RichEditSelection; + unitConverter: RichEditUnitConverter; /** * Occurs after a custom command has been executed on the client side. */ @@ -8622,6 +8620,7 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ deleteBookmark: DeleteBookmarkCommand; + goToBookmark: GoToBookmarkCommand; /** * Gets a command to invoke the Hyperlink dialog window. * Value: A object that provides methods for executing the command and checking its state. @@ -8672,6 +8671,7 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ changePageOrientation: ChangePageOrientationCommand; + setPageSizeDialog: SetPageSizeDialogCommand; /** * Gets a command to invoke the Paper tab of the Page Setup dialog window. * Value: A object that provides methods for executing the command and checking its state. @@ -9022,6 +9022,7 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ changeTableCellPreferredWidth: ChangeTableCellPreferredWidthCommand; + toggleTableCellInsideBorders: ToggleTableCellInsideBordersCommand; /** * Gets a command to change the selected table columns' preferred width. * Value: A object that provides methods for executing the command and checking its state. @@ -9187,6 +9188,10 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ toggleTableCellBottomBorder: ToggleTableCellBottomBorderCommand; + /** + * Gets a command to toggle left borders for selected cells on/off. + * Value: A object that provides methods for executing the command and checking its state. + */ toggleTableCellLeftBorder: ToggleTableCellLeftBorderCommand; /** * Gets a command to remove the borders of the selected table cells. @@ -9263,7 +9268,12 @@ interface RichEditCommands { * Value: A object that provides methods for executing the command and checking its state. */ replaceNext: ReplaceNextCommand; + /** + * Gets a command to invoke the Spelling dialog window. + * Value: A object that provides methods for executing the command and checking its state. + */ openSpellingDialog: OpenSpellingDialogCommand; + assignShortcut: AssignShortcutCommand; } /** * Serves as a base for objects that implement different client command functionalities. @@ -9347,6 +9357,7 @@ interface RichEditDocument { * Value: An array of TableStyle objects storing information about table styles. */ tableStylesInfo: TableStyle[]; + spellingInfo: SpellingInfo; } /** * An abstract numbering list definition that defines the appearance and behavior of numbered paragraphs in a document. @@ -9354,43 +9365,6 @@ interface RichEditDocument { interface AbstractNumberingList { deleted: boolean; } -/** - * Exposes the settings providing the information about the essential document functionality. - */ -interface SubDocument { - id: number; - type: any; - /** - * Provides information about paragraphs contained in the document. - * Value: An array of Paragraph objects storing information about document paragraphs. - */ - paragraphsInfo: Paragraph[]; - /** - * Provides information about fields in the current document. - * Value: An array of Field objects storing information about document fields. - */ - fieldsInfo: Field[]; - /** - * Provides information about tables contained in the document. - * Value: An array of Table objects storing information about document tables. - */ - tablesInfo: Table[]; - /** - * Provides information about document bookmarks. - * Value: An array of Bookmark objects storing information about document bookmarks. - */ - bookmarksInfo: Bookmark[]; - /** - * Gets the document's textual representation. - * Value: A string value specifying the document's text. - */ - text: string; - /** - * Gets the character length of the document. - * Value: An integer that is the number of character positions in the document. - */ - length: number; -} /** * Defines a paragraph in the document. */ @@ -9405,6 +9379,7 @@ interface Paragraph { * Value: An integer value specifying the start position. */ start: number; + interval: Interval; /** * Gets the name of the paragraph style applied to the current paragraph (see name). * Value: A string value specifying the style name. @@ -9435,6 +9410,7 @@ interface Field { * Value: An integer value specifying the field length. */ length: number; + interval: Interval; /** * Gets or sets a URI to navigate to when the hyperlink (represented by the current field) is activated. * Value: A string representing an URI. @@ -9450,66 +9426,7 @@ interface Field { * Value: A string representing the bookmark's name. */ hyperlinkAnchor: string; -} -/** - * Defines a table in the document. - */ -interface Table { - /** - * Gets the table's start position in the document. - * Value: An integer value specifying the start position. - */ - start: number; - /** - * Gets the table length in characters. - * Value: A integer value specifying the character length of the table. - */ - length: number; - /** - * Provides access to a collection of table rows. - * Value: An array of TableRow objects storing information about individual table rows. - */ - rows: TableRow[]; - /** - * Gets the name of the style applied to the table (see name). - * Value: A string value specifying the style name. - */ - styleName: string; -} -/** - * Defines a table row in the document. - */ -interface TableRow { - /** - * Gets the table row's start position in the document. - * Value: An integer value specifying the start position. - */ - start: number; - /** - * Gets the table row's character length. - * Value: An integer value specifying the element length in characters. - */ - length: number; - /** - * Provides information about the table row's cells. - * Value: An array of TableCell objects storing information about cells. - */ - cells: TableCell[]; -} -/** - * Defines a table cell in the document. - */ -interface TableCell { - /** - * Gets the table cell's start position in the document. - * Value: An integer value specifying the start position. - */ - start: number; - /** - * Gets the table cell's character length. - * Value: An integer value specifying the element length in characters. - */ - length: number; + showCode: boolean; } /** * Defines a bookmark in the document. @@ -9525,6 +9442,7 @@ interface Bookmark { * Value: An integer value specifying the length of the bookmark. */ length: number; + interval: Interval; /** * Gets the name of a bookmark in the document. * Value: A string that is the unique bookmark's name. @@ -9545,6 +9463,7 @@ interface Section { * Value: An integer value specifying the element length in characters. */ length: number; + interval: Interval; /** * Provides access to the section's headers. * Value: An array of HeaderFooter objects storing information about the section's headers. @@ -9571,75 +9490,15 @@ interface HeaderFooter { */ subDocument: SubDocument; } -/** - * Serves as a base for objects implementing different element styles. - */ -interface StyleBase { - /** - * Gets or sets the name of the style. - * Value: A string specifying the style name. - */ - name: string; - /** - * Gets whether the specified style is marked as deleted. - * Value: true, if the style is deleted; otherwise, false. - */ - isDeleted: boolean; -} -/** - * Defines the paragraph style settings. - */ -interface ParagraphStyle extends StyleBase { - /** - * Gets or sets the linked style for the current style. - * Value: A object representing a character style linked to a current style. - */ - linkedStyle: CharacterStyle; - /** - * Gets or sets the default style for a paragraph that immediately follows the current paragraph. - * Value: A object specifying the style for the next paragraph. - */ - nextStyle: ParagraphStyle; - /** - * Gets the index of the list item associated with the paragraph formatted with the current style. - * Value: An integer value specifying the list item index. - */ - listIndex: number; - /** - * Gets the index of the list level applied to the paragraph formatted with the current style. - * Value: An integer that is the list level index. - */ - listLevelIndex: number; - /** - * Gets or sets the style from which the current style inherits. - * Value: A object representing the parent style. - */ - parent: ParagraphStyle; -} -/** - * Contains characteristics of a character style in a document. - */ -interface CharacterStyle extends StyleBase { - /** - * Gets or sets the linked style for the current style. - * Value: A object representing a paragraph style linked to a current style. - */ - linkedStyle: ParagraphStyle; - /** - * Gets the style form which the current style inherits. - * Value: A object representing the parent style. - */ - parent: CharacterStyle; -} -/** - * Defines the table style settings. - */ -interface TableStyle extends StyleBase { - /** - * Gets or sets the style from which the current style inherits. - * Value: A object that is the parent style. - */ - parent: TableStyle; +interface InlinePictureInfo { + id: number; + position: number; + initialWidth: number; + initialHeight: number; + scaleX: number; + scaleY: number; + actualWidth: number; + actualHeigth: number; } declare enum HeaderFooterType { First=0, @@ -9647,11 +9506,17 @@ declare enum HeaderFooterType { Primary=1, Even=2 } -declare enum SubDocumentType { - Main=0, - Header=1, - Footer=2, - TextBox=3 +declare enum DocumentFormat { + Undefined=0, + PlainText=1, + Rtf=2, + Html=3, + OpenXml=4, + Mht=5, + WordML=6, + OpenDocument=7, + ePub=9, + Doc=10 } /** * Contains a set of methods and properties to work with the document selection. @@ -9833,8 +9698,19 @@ interface RichEditSelection { * Selects the editor's entire content. */ selectAll(): void; + /** + * Moves the cursor to the main sub-document. + */ setMainSubDocumentAsActive(): void; + /** + * Moves the cursor to the footer of the specified document page. + * @param pageIndex An integer value specifying the page index. + */ setFooterSubDocumentAsActiveByPageIndex(pageIndex: number): void; + /** + * Moves the cursor to the header of the specified document page. + * @param pageIndex An integer value specifying the page index. + */ setHeaderSubDocumentAsActiveByPageIndex(pageIndex: number): void; } /** @@ -9852,6 +9728,216 @@ interface Interval { */ length: number; } +interface SpellingInfo { + spellCheckerState: any; + misspelledIntervals: MisspelledInterval[]; +} +declare enum SpellCheckerState { + Disabled=0, + InProgress=1, + Done=2 +} +interface MisspelledInterval { + start: number; + length: number; + interval: Interval; + errorType: any; + word: string; + suggestions: string[]; +} +declare enum SpellingErrorType { + Misspelling=0, + Repeating=1 +} +/** + * Serves as a base for objects implementing different element styles. + */ +interface StyleBase { + /** + * Gets or sets the name of the style. + * Value: A string specifying the style name. + */ + name: string; + /** + * Gets whether the specified style is marked as deleted. + * Value: true, if the style is deleted; otherwise, false. + */ + isDeleted: boolean; +} +/** + * Defines the paragraph style settings. + */ +interface ParagraphStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a character style linked to a current style. + */ + linkedStyle: CharacterStyle; + /** + * Gets or sets the default style for a paragraph that immediately follows the current paragraph. + * Value: A object specifying the style for the next paragraph. + */ + nextStyle: ParagraphStyle; + /** + * Gets the index of the list item associated with the paragraph formatted with the current style. + * Value: An integer value specifying the list item index. + */ + listIndex: number; + /** + * Gets the index of the list level applied to the paragraph formatted with the current style. + * Value: An integer that is the list level index. + */ + listLevelIndex: number; + /** + * Gets or sets the style from which the current style inherits. + * Value: A object representing the parent style. + */ + parent: ParagraphStyle; +} +/** + * Contains characteristics of a character style in a document. + */ +interface CharacterStyle extends StyleBase { + /** + * Gets or sets the linked style for the current style. + * Value: A object representing a paragraph style linked to a current style. + */ + linkedStyle: ParagraphStyle; + /** + * Gets the style form which the current style inherits. + * Value: A object representing the parent style. + */ + parent: CharacterStyle; +} +/** + * Defines the table style settings. + */ +interface TableStyle extends StyleBase { + /** + * Gets or sets the style from which the current style inherits. + * Value: A object that is the parent style. + */ + parent: TableStyle; +} +/** + * Exposes the settings providing the information about the essential document functionality. + */ +interface SubDocument { + id: number; + type: any; + /** + * Provides information about paragraphs contained in the document. + * Value: An array of Paragraph objects storing information about document paragraphs. + */ + paragraphsInfo: Paragraph[]; + /** + * Provides information about fields in the current document. + * Value: An array of Field objects storing information about document fields. + */ + fieldsInfo: Field[]; + /** + * Provides information about tables contained in the document. + * Value: An array of Table objects storing information about document tables. + */ + tablesInfo: Table[]; + /** + * Provides information about document bookmarks. + * Value: An array of Bookmark objects storing information about document bookmarks. + */ + bookmarksInfo: Bookmark[]; + inlinePicturesInfo: InlinePictureInfo[]; + /** + * Gets the document's textual representation. + * Value: A string value specifying the document's text. + */ + text: string; + /** + * Gets the character length of the document. + * Value: An integer that is the number of character positions in the document. + */ + length: number; +} +declare enum SubDocumentType { + Main=0, + Header=1, + Footer=2, + TextBox=3 +} +/** + * Defines a table in the document. + */ +interface Table { + /** + * Gets the table's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table length in characters. + * Value: A integer value specifying the character length of the table. + */ + length: number; + interval: Interval; + /** + * Provides access to a collection of table rows. + * Value: An array of TableRow objects storing information about individual table rows. + */ + rows: TableRow[]; + /** + * Gets the name of the style applied to the table (see name). + * Value: A string value specifying the style name. + */ + styleName: string; +} +/** + * Defines a table row in the document. + */ +interface TableRow { + /** + * Gets the table row's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table row's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + interval: Interval; + /** + * Provides information about the table row's cells. + * Value: An array of TableCell objects storing information about cells. + */ + cells: TableCell[]; +} +/** + * Defines a table cell in the document. + */ +interface TableCell { + /** + * Gets the table cell's start position in the document. + * Value: An integer value specifying the start position. + */ + start: number; + /** + * Gets the table cell's character length. + * Value: An integer value specifying the element length in characters. + */ + length: number; + interval: Interval; +} +interface RichEditUnitConverter { + pixelsToTwips(value: number): number; + inchesToTwips(value: number): number; + pointsToTwips(value: number): number; + centimetersToTwips(value: number): number; + twipsToCentimeters(value: number): number; + pixelsToCentimeters(value: number): number; + twipsToInches(value: number): number; + pixelsToInches(value: number): number; + pixelsToPoints(value: number): number; + twipsToPoints(value: number): number; +} /** * A command to invoke the Bookmark dialog. */ @@ -10011,6 +10097,11 @@ interface GoToDataRecordCommand extends CommandBase { * @param activeRecordIndex An integer value specifying index of the next data record. */ execute(activeRecordIndex: number): boolean; + getState(): any; +} +interface DataRecordOptions { + activeRecordIndex: number; + recordCount: number; } /** * A command to navigate to the first data record of the bound data source. @@ -10957,9 +11048,10 @@ interface OpenSectionColumnsDialogCommand extends CommandWithSimpleStateBase { */ interface ChangeSectionColumnsCommand extends CommandBase { /** - * Executes the ChangeSectionColumnsCommand command by imitating the corresponding end-user action made in the RichEdit's UI. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state. + * + * @param columns */ - execute(): boolean; + execute(columns: SectionColumn[]): boolean; /** * Gets information about the command state. */ @@ -11496,6 +11588,9 @@ declare enum ParagraphFirstLineIndent { Indented=1, Hanging=2 } +interface AssignShortcutCommand extends CommandWithSimpleStateBase { + execute(keyCode: number, callback: (arg1: string) => void): boolean; +} interface OpenSpellingDialogCommand extends CommandWithSimpleStateBase { execute(): boolean; } @@ -12756,7 +12851,7 @@ interface FontFormattingSettings { * Value: true, if characters are italicized; otherwise, false. */ italic: boolean; - boolean: boolean; + strikeout: boolean; /** * Gets or sets whether only word characters are underlined. * Value: true to underline only characters in words; false to underline all characters. @@ -16892,9 +16987,17 @@ interface ASPxClientControlsInitializedEventArgs extends ASPxClientEventArgs { isCallback: boolean; } interface ASPxClientControlPredicate { + /** + * + * @param control + */ (control: Object): boolean; } interface ASPxClientControlAction { + /** + * + * @param control + */ (control: Object): void; } /** @@ -16936,18 +17039,18 @@ interface ASPxClientControlCollection { */ GetByName(name: string): Object; /** - * - * @param predicate + * Returns all controls in the collection that satisfy the specified predicate. + * @param predicate An ASPxClientControlPredicate object that is a predicate used to search for controls in the collection. */ GetControlsByPredicate(predicate: ASPxClientControlPredicate): Object[]; /** - * - * @param type + * Returns all controls of the specified type. + * @param type The object specifying the client control type. */ GetControlsByType(type: Object): Object[]; /** - * - * @param action + * Performs the specified action for each control in the collection. + * @param action An ASPxClientControlAction object specifying an action to perform. */ ForEachControl(action: ASPxClientControlAction): void; } @@ -17900,6 +18003,10 @@ interface ASPxClientFileManagerFile extends ASPxClientFileManagerItem { * A client-side equivalent of the FileManagerFolder object. */ interface ASPxClientFileManagerFolder extends ASPxClientFileManagerItem { + /** + * Gets a value specifying whether an item is a parent folder. + * Value: true if an item is a parent folder; false if an item is a file or folder. + */ isParentFolder: boolean; } /** @@ -22329,7 +22436,7 @@ interface ASPxClientWebChartHitInfo { */ inChartTitle: boolean; /** - * Gets a value indicating whether the test point is within the . + * Gets a value indicating whether the test point is within the axis. * Value: true if the test point is within an axis; otherwise, false. */ inAxis: boolean; @@ -22559,17 +22666,17 @@ interface ASPxClientDiagramCoordinates { */ dateTimeValue: Date; /** - * Gets the X- of the diagram point. + * Gets the X-axis of the diagram point. * Value: An ASPxClientAxisBase descendant, representing the axis of arguments (X-axis). */ axisX: ASPxClientAxisBase; /** - * Gets the Y- of the diagram point. + * Gets the Y-axis of the diagram point. * Value: An ASPxClientAxisBase descendant, representing the axis of values (Y-axis). */ axisY: ASPxClientAxisBase; /** - * Gets the of the diagram point. + * Gets the pane of the diagram point. * Value: An ASPxClientXYDiagramPane descendant, representing the pane. */ pane: ASPxClientXYDiagramPane; @@ -22788,12 +22895,12 @@ interface ASPxClientXYDiagram2D extends ASPxClientXYDiagramBase { */ secondaryAxesY: ASPxClientAxis[]; /** - * Provides access to a default object. + * Provides access to a default pane object. * Value: An ASPxClientXYDiagramPane object which represents the default pane of a chart. */ defaultPane: ASPxClientXYDiagramPane; /** - * Provides access to an array of a diagram's . + * Provides access to an array of a diagram's panes. * Value: An array of ASPxClientXYDiagramPane objects. */ panes: ASPxClientXYDiagramPane[]; @@ -22925,7 +23032,7 @@ interface ASPxClientRadarAxis extends ASPxClientAxisBase { */ interface ASPxClientAxisTitle extends ASPxClientWebChartRequiredElement { /** - * Gets the to which the axis title belongs. + * Gets the axis to which the axis title belongs. * Value: An ASPxClientAxisBase descendant, which identifies the axis. */ axis: ASPxClientAxisBase; @@ -22940,7 +23047,7 @@ interface ASPxClientAxisTitle extends ASPxClientWebChartRequiredElement { */ interface ASPxClientAxisLabelItem extends ASPxClientWebChartRequiredElement { /** - * Gets the to which an axis label item belongs. + * Gets the axis to which an axis label item belongs. * Value: An ASPxClientAxisBase descendant, which identifies the axis. */ axis: ASPxClientAxisBase; @@ -24252,6 +24359,10 @@ interface ASPxClientReportDesigner extends ASPxClientControl { * Occurs each time a standard editor is created for a report parameter based on a parameter type. */ CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: ASPxClientEvent>; /** * Occurs on the client side when the Report Designer is being closed. */ @@ -24392,6 +24503,9 @@ interface ASPxClientReportDesignerCustomizeMenuActionsEventArgs extends ASPxClie */ interface ASPxClientReportDesignerExitDesignerEventArgs extends ASPxClientEventArgs { } +interface ASPxClientReportDesignerCustomizeParameterLookUpSourceEventHandler { + (source: S, e: ASPxClientCustomizeParameterLookUpSourceEventArgs): void; +} /** * A method that will handle the CustomizeParameterEditors event. */ @@ -24565,6 +24679,11 @@ interface ASPxClientCustomizeParameterEditorsEventArgs extends ASPxClientEventAr */ info: ASPxDesignerElementSerializationInfo; } +interface ASPxClientCustomizeParameterLookUpSourceEventArgs extends ASPxClientEventArgs { + parameter: ASPxDesignerElementParameterDescriptor; + items: ASPxDesignerElementEditorItem[]; + dataSource: Object; +} /** * Provides general information about a report parameter. */ @@ -24707,6 +24826,10 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { * Occurs each time a standard editor is created for a report parameter based on a parameter type. */ CustomizeParameterEditors: ASPxClientEvent>; + /** + * Occurs each time a look-up editor is created for a report parameter. + */ + CustomizeParameterLookUpSource: ASPxClientEvent>; /** * Provides access to the preview model of the ASPxClientWebDocumentViewer. */ @@ -24739,17 +24862,6 @@ interface ASPxClientWebDocumentViewer extends ASPxClientControl { */ UpdateLocalization(localization: { [key: string]: string; }): void; } -/** - * A method that will handle the CustomizeMenuActions event. - */ -interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventHandler { - /** - * A method that will handle the CustomizeMenuActions event. - * @param source The event sender. - * @param e An ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs object that contains data related to the event. - */ - (source: S, e: ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs): void; -} /** * Provides settings to the actions listed in a Web Document Viewer menu. */ @@ -24810,6 +24922,17 @@ interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs extends ASPxC */ GetById(actionId: string): ASPxClientWebDocumentViewerMenuAction; } +/** + * A method that will handle the CustomizeMenuActions event. + */ +interface ASPxClientWebDocumentViewerCustomizeMenuActionsEventHandler { + /** + * A method that will handle the CustomizeMenuActions event. + * @param source The event sender. + * @param e An ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs object that contains data related to the event. + */ + (source: S, e: ASPxClientWebDocumentViewerCustomizeMenuActionsEventArgs): void; +} /** * A method that will handle the CustomizeParameterEditors event. */ @@ -24821,6 +24944,9 @@ interface ASPxClientWebDocumentViewerCustomizeParameterEditorsEventHandler { */ (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; } +interface ASPxClientWebDocumentViewerCustomizeParameterLookUpSourceEventHandler { + (source: S, e: ASPxClientCustomizeParameterEditorsEventArgs): void; +} interface MVCxClientDashboardViewerStatic extends ASPxClientDashboardViewerStatic { } @@ -25354,6 +25480,10 @@ interface ASPxClientButtonEditStatic extends ASPxClientButtonEditBaseStatic { Cast(obj: Object): ASPxClientButtonEdit; } interface ASPxClientTokenBoxStatic extends ASPxClientComboBoxStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ Cast(obj: Object): ASPxClientTokenBox; } interface ASPxClientTrackBarStatic extends ASPxClientEditStatic { @@ -26136,6 +26266,10 @@ interface ASPxClientPivotGridStatic extends ASPxClientControlStatic { interface ASPxClientPivotCustomizationStatic extends ASPxClientControlStatic { } interface ASPxClientRichEditStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ Cast(obj: Object): ASPxClientRichEdit; } interface ASPxSchedulerDateTimeHelperStatic { @@ -26207,6 +26341,10 @@ interface ASPxClientSpellCheckerStatic extends ASPxClientControlStatic { Cast(obj: Object): ASPxClientSpellChecker; } interface ASPxClientSpreadsheetStatic extends ASPxClientControlStatic { + /** + * Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress. + * @param obj The client object to be type cast. Represents an instance of a DevExpress web control's client object. + */ Cast(obj: Object): ASPxClientSpreadsheet; } interface ASPxClientTreeListStatic extends ASPxClientControlStatic { diff --git a/devextreme/devextreme-15.1.4.d.ts b/devextreme/devextreme-15.1.4.d.ts index 44881ea912..9f9ae875ed 100644 --- a/devextreme/devextreme-15.1.4.d.ts +++ b/devextreme/devextreme-15.1.4.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExtreme 15.1.4 +// Type definitions for DevExtreme 15.1.4 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/devextreme/devextreme-15.2.10.d.ts b/devextreme/devextreme-15.2.10.d.ts new file mode 100644 index 0000000000..d8b1149efd --- /dev/null +++ b/devextreme/devextreme-15.2.10.d.ts @@ -0,0 +1,7504 @@ +// Type definitions for DevExtreme 15.2.10 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: any; + /** The element within which the widget is positioned. */ + boundary?: Object; + /** Specifies the horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: any; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: any; + /** The target element that the widget is positioned against. */ + of?: Object; + /** Specifies horizontal and vertical offset in pixels. */ + offset?: any; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + /** A bag for holding any options that require two-way binding (Angular approach specific) */ + bindingOptions?: { [key: string]: any; }; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** Specifies whether or not the store combines the search expression with the filter expression. */ + useDefaultSearch?: boolean; + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ + customQueryParams?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(...expr: Object[]): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + /** Cancels the load operation associated with the specified identifier. */ + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: any; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated Use the DataSource paging opportunities instead. + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupButtonOptions { + /** Specifies whether or not a toolbar item must be displayed disabled. */ + disabled?: boolean; + /** Specifies html code inserted into the toolbar item element. */ + html?: string; + /** Specifies a location for the item on the toolbar. */ + location?: string; + /** Specifies a configuration object for the widget that presents a toolbar item. */ + options?: Object; + /** Specifies an item template that should be used to render this item only. */ + template?: any; + /** Specifies text displayed for the toolbar item. */ + text?: string; + /** Specifies whether the item is displayed on a top or bottom toolbar. */ + toolbar?: string; + /** Specifies whether or not a widget item must be displayed. */ + visible?: boolean; + /** A widget that presents a toolbar item. */ + widget?: string; + } + export interface dxPopupOptions extends dxOverlayOptions { + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + applyValueMode?: string; + /** An object that defines widget animation options. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated Use the pageLoadMode option instead. + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + /** An object containing items for a context menu called for a list item. */ + export interface ListOptionsMenuItem { + /** Specifies the menu item text. */ + text?: string; + /** Specifies the function called when the menu item is clicked. */ + action?: (itemElement: Element, itemData: any) => void; + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use the pickerType option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use the pickerType option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** An object or a value, specifying the date and time currently selected in the calendar. */ + value?: any; + /** The latest date the widget allows to select. */ + max?: any; + /** The earliest date the widget allows to select. */ + min?: any; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidgetOptions { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + /** Resets the editor's value to undefined. */ + resetValues(): void; + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: any; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the useColorAsDefault option instead. + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode options instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode options instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow(rowIndex) method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies the series elements to highlight when the series is selected. */ + selectionMode?: string; + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + closeValueField?: string; + /** Specifies a radius for bar corners. */ + cornerRadius?: number; + /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + highValueField?: string; + /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + innerColor?: string; + /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + lowValueField?: string; + /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + openValueField?: string; + /** Specifies the pane that will be used to display a series. */ + pane?: string; + /** An object defining configuration options for points in line-, scatter- and area-like series. */ + point?: ChartCommonPointOptions; + /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + rangeValue1Field?: string; + /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + rangeValue2Field?: string; + /** Specifies reduction options for the stock or candleStick series. */ + reduction?: { + /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + color?: string; + /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + level?: string; + }; + /** Specifies the data source field that defines the size of bubbles. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + area?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the bubble type in the chart. */ + bubble?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + candlestick?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + fullstackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + fullstackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + fullstackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + fullstackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + rangearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + rangebar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + spline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + splinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + stackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + stackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + stackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + stackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + steparea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + stepline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + stock?: CommonSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** Specifies a precision for the percentage values displayed in labels. */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated Use the innerRadius option instead. + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated Use the segmentsDirection option instead. + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated Use the startAngle option instead. + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated Use the type option instead. + */ + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated Use the type option instead. + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + /** Specifies the position of the constant line label relative to the chart plot. */ + position?: string; + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartCommonConstantLineLabel; + /** Specifies the space between the constant line label and the left/right side of the constant line. */ + paddingLeftRight?: number; + /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Specifies the label's position relative to the tick (grid line). */ + alignment?: string; + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: { + /** Specifies how to arrange axis labels. */ + mode?: string; + /** Specifies the angle used to rotate axis labels. */ + rotationAngle?: number; + /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for an axis title. */ + font?: viz.core.Font; + /** Specifies a margin for an axis title in pixels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + label?: ChartCommonAxisLabel; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + /** Specifies, in pixels, the space reserved for an axis. */ + placeholderSize?: number; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + /** Specifies the label's position on a strip. */ + horizontalAlignment?: string; + /** Specifies a label's position on a strip. */ + verticalAlignment?: string; + }; + /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + paddingLeftRight?: number; + /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + paddingTopBottom?: number; + }; + /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + title?: CommonAxisTitle; + /** Indicates whether or not to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Specifies the horizontal alignment of a constant line label. */ + horizontalAlignment?: string; + /** Specifies the vertical alignment of a constant line label. */ + verticalAlignment?: string; + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the axis labels. */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text for the value axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Specifies the pane on which the current value axis will be displayed. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies the appearance options for the constant lines of the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Specifies options for value axis labels. */ + label?: ChartAxisLabel; + /** Specifies the maximum value on the value axis. */ + max?: any; + /** Specifies the minimum value on the value axis. */ + min?: any; + /** Specifies the position of the value axis on a chart. */ + position?: string; + /** Specifies the title for a value axis. */ + title?: any; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + multipleAxesSpacing?: number; + /** Specifies the value by which the chart's value axes are synchronized. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies a background color in a pane. */ + backgroundColor?: string; + /** Specifies the border options of a chart's pane. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of a pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies the bottom border's visibility state in a pane. */ + bottom?: boolean; + /** Specifies the left border's visibility state in a pane. */ + left?: boolean; + /** Specifies the right border's visibility state in a pane. */ + right?: boolean; + /** Specifies the top border's visibility state in a pane. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies the maximum series point count in the chart that the animation supports. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: string; + /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentPrecision?: number; + /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ + margin?: viz.core.Margins; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a title for the chart. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Hides all widget tooltips. */ + hideTooltip(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies a default pane for the chart series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated Use the getAllSeries() method instead. + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated Use the scale | customMinorTicks option instead. + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This feature is no longer available. + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated Use the scale | minorTickInterval option instead. + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This feature is no longer available. + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This feature is no longer available. + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated Use the tick option instead. + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated Use the title | subtitle option instead. + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated Use the title | subtitle | font option instead. + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated Use the title | subtitle | text option instead. + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated Use the horizontalAlignment and verticalAlignment options instead. + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated Use the tickInterval option instead. + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated Use the minorTick | visible option instead. + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the placeholderHeight and indent options instead. + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the Layer Element instead. + */ + export interface Area { + /** + * Contains the element type. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the Layer Element instead. + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. + */ + text: string; + /** + * Contains the type of the element. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated Use the Layer Element | coordinates() method instead. + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + dataSource?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the dataSource attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated Use the layers | label | dataField option instead. + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated Use the layers | paletteSize option instead. + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Enables marker labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | maxSize option instead. + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | minSize option instead. + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | opacity option instead. + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated Use the layers | size option instead. + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated Use the layers | elementType option instead. + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated Use the layers | sizeGroups option instead. + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated Use the layers | sizeGroupingField option instead. + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the "area" type element of the layers array. + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the control bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the layers | dataSource option instead. + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the layers | dataSource option instead. + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the "marker" type element of the layers array. + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the onClick option instead. + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the onSelectionChanged option instead. + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the onClick option instead. + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the onSelecitonChanged option instead. + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the layer's getElements() method instead. + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the layer's getElements() method instead. + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: any; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} \ No newline at end of file diff --git a/devextreme/devextreme-15.2.12.d.ts b/devextreme/devextreme-15.2.12.d.ts new file mode 100644 index 0000000000..bdba712122 --- /dev/null +++ b/devextreme/devextreme-15.2.12.d.ts @@ -0,0 +1,7531 @@ +// Type definitions for DevExtreme 15.2.12 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: any; + /** The element within which the widget is positioned. */ + boundary?: Object; + /** Specifies the horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: any; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: any; + /** The target element that the widget is positioned against. */ + of?: Object; + /** Specifies horizontal and vertical offset in pixels. */ + offset?: any; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + /** A bag for holding any options that require two-way binding (Angular approach specific) */ + bindingOptions?: { [key: string]: any; }; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** Specifies whether or not the store combines the search expression with the filter expression. */ + useDefaultSearch?: boolean; + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ + customQueryParams?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(...expr: Object[]): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + /** Cancels the load operation associated with the specified identifier. */ + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: any; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated Use the DataSource paging opportunities instead. + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if tabs in the title are scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean indicating whether or not to add scrolling support for tabs in the title. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupButtonOptions { + /** Specifies whether or not a toolbar item must be displayed disabled. */ + disabled?: boolean; + /** Specifies html code inserted into the toolbar item element. */ + html?: string; + /** Specifies a location for the item on the toolbar. */ + location?: string; + /** Specifies a configuration object for the widget that presents a toolbar item. */ + options?: Object; + /** Specifies an item template that should be used to render this item only. */ + template?: any; + /** Specifies text displayed for the toolbar item. */ + text?: string; + /** Specifies whether the item is displayed on a top or bottom toolbar. */ + toolbar?: string; + /** Specifies whether or not a widget item must be displayed. */ + visible?: boolean; + /** A widget that presents a toolbar item. */ + widget?: string; + } + export interface dxPopupOptions extends dxOverlayOptions { + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + applyValueMode?: string; + /** An object that defines widget animation options. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated Use the pageLoadMode option instead. + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + /** An object containing items for a context menu called for a list item. */ + export interface ListOptionsMenuItem { + /** Specifies the menu item text. */ + text?: string; + /** Specifies the function called when the menu item is clicked. */ + action?: (itemElement: Element, itemData: any) => void; + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use the pickerType option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use the pickerType option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** An object or a value, specifying the date and time currently selected in the calendar. */ + value?: any; + /** The latest date the widget allows to select. */ + max?: any; + /** The earliest date the widget allows to select. */ + min?: any; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidgetOptions { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + /** Resets the editor's value to undefined. */ + resetValues(): void; + } + export interface dxDeferRenderingOptions extends WidgetOptions { + /** Indicates if a load indicator should be shown until the widget's content is rendered. */ + showLoadIndicator?: boolean; + /** Specifies a jQuery.Promise or a boolean value, which upon resolving forces widget content to render. */ + renderWhen?: any; + /** Specifies the animation to be used to show the rendered content. */ + animation?: fx.AnimationOptions; + /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ + staggerItemSelector?: string; + /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ + onRendered?: Function; + /** Specifies a callback function that is called when widget content is shown and animation has completed. */ + onShown?: Function; + } + /** A container for elements that must be rendered at a specified moment. */ + export class dxDeferRendering extends Widget { + constructor(element: JQuery, options?: dxDeferRenderingOptions); + constructor(element: Element, options?: dxDeferRenderingOptions); + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: any; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the useColorAsDefault option instead. + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode options instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode options instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + /** The group index of the row. Available when the rowType is "group". */ + groupIndex: number; + /** Indicates whether the row is expanded or collapsed. Available if rowType is "data", "detail" or "group". */ + isExpanded: boolean; + /** Indicates whether the row is selected. Available if rowType is "data". */ + isSelected: boolean; + /** Values of the row as they exist in the data source. */ + values: Array; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies the default filter operation of a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Customizes grid columns and data before exporting. */ + customizeExportData?: (columns: Array, rows: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): JQueryPromise; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow(rowIndex) method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): JQueryPromise; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies the series elements to highlight when the series is selected. */ + selectionMode?: string; + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + closeValueField?: string; + /** Specifies a radius for bar corners. */ + cornerRadius?: number; + /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + highValueField?: string; + /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + innerColor?: string; + /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + lowValueField?: string; + /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + openValueField?: string; + /** Specifies the pane that will be used to display a series. */ + pane?: string; + /** An object defining configuration options for points in line-, scatter- and area-like series. */ + point?: ChartCommonPointOptions; + /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + rangeValue1Field?: string; + /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + rangeValue2Field?: string; + /** Specifies reduction options for the stock or candleStick series. */ + reduction?: { + /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + color?: string; + /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + level?: string; + }; + /** Specifies the data source field that defines the size of bubbles. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + area?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the bubble type in the chart. */ + bubble?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + candlestick?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + fullstackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + fullstackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + fullstackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + fullstackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + rangearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + rangebar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + spline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + splinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + stackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + stackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + stackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + stackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + steparea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + stepline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + stock?: CommonSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** Specifies a precision for the percentage values displayed in labels. */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated Use the innerRadius option instead. + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated Use the segmentsDirection option instead. + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated Use the startAngle option instead. + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated Use the type option instead. + */ + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated Use the type option instead. + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + /** Specifies the position of the constant line label relative to the chart plot. */ + position?: string; + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartCommonConstantLineLabel; + /** Specifies the space between the constant line label and the left/right side of the constant line. */ + paddingLeftRight?: number; + /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Specifies the label's position relative to the tick (grid line). */ + alignment?: string; + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: { + /** Specifies how to arrange axis labels. */ + mode?: string; + /** Specifies the angle used to rotate axis labels. */ + rotationAngle?: number; + /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for an axis title. */ + font?: viz.core.Font; + /** Specifies a margin for an axis title in pixels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + label?: ChartCommonAxisLabel; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + /** Specifies, in pixels, the space reserved for an axis. */ + placeholderSize?: number; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + /** Specifies the label's position on a strip. */ + horizontalAlignment?: string; + /** Specifies a label's position on a strip. */ + verticalAlignment?: string; + }; + /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + paddingLeftRight?: number; + /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + paddingTopBottom?: number; + }; + /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + title?: CommonAxisTitle; + /** Indicates whether or not to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Specifies the horizontal alignment of a constant line label. */ + horizontalAlignment?: string; + /** Specifies the vertical alignment of a constant line label. */ + verticalAlignment?: string; + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the axis labels. */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text for the value axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Specifies the pane on which the current value axis will be displayed. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies the appearance options for the constant lines of the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Specifies options for value axis labels. */ + label?: ChartAxisLabel; + /** Specifies the maximum value on the value axis. */ + max?: any; + /** Specifies the minimum value on the value axis. */ + min?: any; + /** Specifies the position of the value axis on a chart. */ + position?: string; + /** Specifies the title for a value axis. */ + title?: any; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + multipleAxesSpacing?: number; + /** Specifies the value by which the chart's value axes are synchronized. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies a background color in a pane. */ + backgroundColor?: string; + /** Specifies the border options of a chart's pane. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of a pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies the bottom border's visibility state in a pane. */ + bottom?: boolean; + /** Specifies the left border's visibility state in a pane. */ + left?: boolean; + /** Specifies the right border's visibility state in a pane. */ + right?: boolean; + /** Specifies the top border's visibility state in a pane. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies the maximum series point count in the chart that the animation supports. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: string; + /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentPrecision?: number; + /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ + margin?: viz.core.Margins; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a title for the chart. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Hides all widget tooltips. */ + hideTooltip(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies a default pane for the chart series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into web applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for web applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated Use the getAllSeries() method instead. + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated Use the scale | customMinorTicks option instead. + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This feature is no longer available. + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated Use the scale | minorTickInterval option instead. + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This feature is no longer available. + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This feature is no longer available. + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated Use the tick option instead. + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated Use the title | subtitle option instead. + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated Use the title | subtitle | font option instead. + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated Use the title | subtitle | text option instead. + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated Use the horizontalAlignment and verticalAlignment options instead. + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated Use the tickInterval option instead. + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated Use the minorTick | visible option instead. + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the placeholderHeight and indent options instead. + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the Layer Element instead. + */ + export interface Area { + /** + * Contains the element type. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the Layer Element instead. + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. + */ + text: string; + /** + * Contains the type of the element. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated Use the Layer Element | coordinates() method instead. + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + dataSource?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the dataSource attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated Use the layers | label | dataField option instead. + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated Use the layers | paletteSize option instead. + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Enables marker labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | maxSize option instead. + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | minSize option instead. + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | opacity option instead. + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated Use the layers | size option instead. + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated Use the layers | elementType option instead. + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated Use the layers | sizeGroups option instead. + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated Use the layers | sizeGroupingField option instead. + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the "area" type element of the layers array. + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the control bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the layers | dataSource option instead. + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the layers | dataSource option instead. + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the "marker" type element of the layers array. + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the onClick option instead. + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the onSelectionChanged option instead. + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the onClick option instead. + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the onSelecitonChanged option instead. + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the layer's getElements() method instead. + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the layer's getElements() method instead. + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparklineOptions { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: any; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} diff --git a/devextreme/devextreme-15.2.13.d.ts b/devextreme/devextreme-15.2.13.d.ts new file mode 100644 index 0000000000..cb1ca8697b --- /dev/null +++ b/devextreme/devextreme-15.2.13.d.ts @@ -0,0 +1,7531 @@ +// Type definitions for DevExtreme 15.2.13 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: any; + /** The element within which the widget is positioned. */ + boundary?: Object; + /** Specifies the horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: any; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: any; + /** The target element that the widget is positioned against. */ + of?: Object; + /** Specifies horizontal and vertical offset in pixels. */ + offset?: any; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + /** A bag for holding any options that require two-way binding (Angular approach specific) */ + bindingOptions?: { [key: string]: any; }; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** Specifies whether or not the store combines the search expression with the filter expression. */ + useDefaultSearch?: boolean; + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ + customQueryParams?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(...expr: Object[]): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + /** Cancels the load operation associated with the specified identifier. */ + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate, and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: any; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated Use the DataSource paging opportunities instead. + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if tabs in the title are scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value that indicates whether or not to add scrolling support for tabs in the title. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupButtonOptions { + /** Specifies whether or not a toolbar item must be displayed disabled. */ + disabled?: boolean; + /** Specifies html code inserted into the toolbar item element. */ + html?: string; + /** Specifies a location for the item on the toolbar. */ + location?: string; + /** Specifies a configuration object for the widget that presents a toolbar item. */ + options?: Object; + /** Specifies an item template that should be used to render this item only. */ + template?: any; + /** Specifies text displayed for the toolbar item. */ + text?: string; + /** Specifies whether the item is displayed on a top or bottom toolbar. */ + toolbar?: string; + /** Specifies whether or not a widget item must be displayed. */ + visible?: boolean; + /** A widget that presents a toolbar item. */ + widget?: string; + } + export interface dxPopupOptions extends dxOverlayOptions { + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + applyValueMode?: string; + /** An object that defines widget animation options. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated Use the pageLoadMode option instead. + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + /** An object containing items for a context menu called for a list item. */ + export interface ListOptionsMenuItem { + /** Specifies the menu item text. */ + text?: string; + /** Specifies the function called when the menu item is clicked. */ + action?: (itemElement: Element, itemData: any) => void; + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use the pickerType option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use the pickerType option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** An object or a value, specifying the date and time currently selected in the calendar. */ + value?: any; + /** The latest date the widget allows to select. */ + max?: any; + /** The earliest date the widget allows to select. */ + min?: any; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidgetOptions { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field or name of the form item. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + /** Resets the editor's value to undefined. */ + resetValues(): void; + } + export interface dxDeferRenderingOptions extends WidgetOptions { + /** Indicates if a load indicator should be shown until the widget's content is rendered. */ + showLoadIndicator?: boolean; + /** Specifies a jQuery.Promise or a boolean value, which upon resolving forces widget content to render. */ + renderWhen?: any; + /** Specifies the animation to be used to show the rendered content. */ + animation?: fx.AnimationOptions; + /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ + staggerItemSelector?: string; + /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ + onRendered?: Function; + /** Specifies a callback function that is called when widget content is shown and animation has completed. */ + onShown?: Function; + } + /** A container for elements that must be rendered at a specified moment. */ + export class dxDeferRendering extends Widget { + constructor(element: JQuery, options?: dxDeferRenderingOptions); + constructor(element: Element, options?: dxDeferRenderingOptions); + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: any; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the useColorAsDefault option instead. + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode options instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode options instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not an alternative invocation mode is enabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + /** The group index of the row. Available when the rowType is "group". */ + groupIndex: number; + /** Indicates whether the row is expanded or collapsed. Available if rowType is "data", "detail" or "group". */ + isExpanded: boolean; + /** Indicates whether the row is selected. Available if rowType is "data". */ + isSelected: boolean; + /** Values of the row as they exist in the data source. */ + values: Array; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies the default filter operation of a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Customizes grid columns and data before exporting. */ + customizeExportData?: (columns: Array, rows: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): JQueryPromise; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow(rowIndex) method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): JQueryPromise; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label(s) of the series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies the series elements to highlight when the series is selected. */ + selectionMode?: string; + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + closeValueField?: string; + /** Specifies a radius for bar corners. */ + cornerRadius?: number; + /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + highValueField?: string; + /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + innerColor?: string; + /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + lowValueField?: string; + /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + openValueField?: string; + /** Specifies the pane that will be used to display a series. */ + pane?: string; + /** An object defining configuration options for points in line-, scatter- and area-like series. */ + point?: ChartCommonPointOptions; + /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + rangeValue1Field?: string; + /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + rangeValue2Field?: string; + /** Specifies reduction options for the stock or candleStick series. */ + reduction?: { + /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + color?: string; + /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + level?: string; + }; + /** Specifies the data source field that defines the size of bubbles. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + area?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the bubble type in the chart. */ + bubble?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + candlestick?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + fullstackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + fullstackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + fullstackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + fullstackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + rangearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + rangebar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + spline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + splinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + stackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + stackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + stackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + stackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + steparea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + stepline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + stock?: CommonSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** Specifies a precision for the percentage values displayed in labels. */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated Use the innerRadius option instead. + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated Use the segmentsDirection option instead. + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated Use the startAngle option instead. + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated Use the type option instead. + */ + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated Use the type option instead. + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + /** Specifies the position of the constant line label relative to the chart plot. */ + position?: string; + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartCommonConstantLineLabel; + /** Specifies the space between the constant line label and the left/right side of the constant line. */ + paddingLeftRight?: number; + /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Specifies the label's position relative to the tick (grid line). */ + alignment?: string; + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: { + /** Specifies how to arrange axis labels. */ + mode?: string; + /** Specifies the angle used to rotate axis labels. */ + rotationAngle?: number; + /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for an axis title. */ + font?: viz.core.Font; + /** Specifies a margin for an axis title in pixels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + label?: ChartCommonAxisLabel; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + /** Specifies, in pixels, the space reserved for an axis. */ + placeholderSize?: number; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + /** Specifies the label's position on a strip. */ + horizontalAlignment?: string; + /** Specifies a label's position on a strip. */ + verticalAlignment?: string; + }; + /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + paddingLeftRight?: number; + /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + paddingTopBottom?: number; + }; + /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + title?: CommonAxisTitle; + /** Indicates whether or not to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Specifies the horizontal alignment of a constant line label. */ + horizontalAlignment?: string; + /** Specifies the vertical alignment of a constant line label. */ + verticalAlignment?: string; + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the axis labels. */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text for the value axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Specifies the pane on which the current value axis will be displayed. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies the appearance options for the constant lines of the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Specifies options for value axis labels. */ + label?: ChartAxisLabel; + /** Specifies the maximum value on the value axis. */ + max?: any; + /** Specifies the minimum value on the value axis. */ + min?: any; + /** Specifies the position of the value axis on a chart. */ + position?: string; + /** Specifies the title for a value axis. */ + title?: any; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + multipleAxesSpacing?: number; + /** Specifies the value by which the chart's value axes are synchronized. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies a background color in a pane. */ + backgroundColor?: string; + /** Specifies the border options of a chart's pane. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of a pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies the bottom border's visibility state in a pane. */ + bottom?: boolean; + /** Specifies the left border's visibility state in a pane. */ + left?: boolean; + /** Specifies the right border's visibility state in a pane. */ + right?: boolean; + /** Specifies the top border's visibility state in a pane. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies the maximum series point count in the chart that the animation supports. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: string; + /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentPrecision?: number; + /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ + margin?: viz.core.Margins; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a title for the chart. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Hides all widget tooltips. */ + hideTooltip(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies a default pane for the chart series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into web applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for web applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated Use the getAllSeries() method instead. + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated Use the scale | customMinorTicks option instead. + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This feature is no longer available. + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated Use the scale | minorTickInterval option instead. + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This feature is no longer available. + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This feature is no longer available. + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated Use the tick option instead. + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated Use the title | subtitle option instead. + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated Use the title | subtitle | font option instead. + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated Use the title | subtitle | text option instead. + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated Use the horizontalAlignment and verticalAlignment options instead. + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated Use the tickInterval option instead. + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated Use the minorTick | visible option instead. + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the placeholderHeight and indent options instead. + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the Layer Element instead. + */ + export interface Area { + /** + * Contains the element type. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the Layer Element instead. + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. + */ + text: string; + /** + * Contains the type of the element. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated Use the Layer Element | coordinates() method instead. + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + dataSource?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the dataSource attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated Use the layers | label | dataField option instead. + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated Use the layers | paletteSize option instead. + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Enables marker labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | maxSize option instead. + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | minSize option instead. + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | opacity option instead. + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated Use the layers | size option instead. + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated Use the layers | elementType option instead. + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated Use the layers | sizeGroups option instead. + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated Use the layers | sizeGroupingField option instead. + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the "area" type element of the layers array. + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the control bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the layers | dataSource option instead. + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the layers | dataSource option instead. + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the "marker" type element of the layers array. + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the onClick option instead. + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the onSelectionChanged option instead. + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the onClick option instead. + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the onSelecitonChanged option instead. + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the layer's getElements() method instead. + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the layer's getElements() method instead. + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparklineOptions { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: any; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} diff --git a/devextreme/devextreme-16.1.6.d.ts b/devextreme/devextreme-16.1.6.d.ts new file mode 100644 index 0000000000..7e612e69d1 --- /dev/null +++ b/devextreme/devextreme-16.1.6.d.ts @@ -0,0 +1,8043 @@ +// Type definitions for DevExtreme 16.1.6 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** Formats values. */ + export interface Format { + /** Specifies a predefined format. */ + type?: String; + /** Specifies the currency code for the 'currency' format. */ + currency?: String; + /** Specifies a precision for values of a numeric format. */ + precision?: number; + /** Parses string values into numeric or date-time values. */ + parser?: (value: any) => any; + /** Specifies a custom format. */ + formatter?: (value: any) => any; + } + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects extending fields of the specified ViewModel. */ + export function registerModelForValidation(model: Object): void; + /** Unregisters all the dxValidator objects extending fields of the specified ViewModel. */ + export function unregisterModelForValidation(model: Object): void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** + * Specifies whether or not the entire application/site supports right-to-left representation. + * @deprecated Use the config(config) method instead. + */ + export var rtlEnabled: boolean; + /** Gets the current global configuration object. */ + export function config(): Object; + /** Sets the global configuration object. */ + export function config(config: Object): void; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** An object used to manage OData endpoints in your application. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns an endpoint for the specified key. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on a specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: any; + /** The element within which the widget is positioned. */ + boundary?: Object; + /** Specifies the horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: any; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: any; + /** The target element that the widget is positioned against. */ + of?: Object; + /** Specifies horizontal and vertical offset in pixels. */ + offset?: any; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate() method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate() method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + /** A bag for holding any options that require two-way binding (Angular approach specific) */ + bindingOptions?: { [key: string]: any; }; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** Specifies whether or not the store combines the search expression with the filter expression. */ + useDefaultSearch?: boolean; + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ + customQueryParams?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(...expr: Object[]): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + /** Cancels the load operation associated with the specified identifier. */ + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, Boolean, Single, Decimal and Guid. */ + keyType?: any; + /** Specifies whether or not dates in a response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Allows you to export widgets using their SVG markup. */ + export function exportFromMarkup(markup: string, options: Object): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorValidationAdapter { + /** A function that returns the value to be validated. */ + getValue?: Function; + /** The jQuery.Callbacks() object that is fired when the specified value should be validated. */ + validationRequestsCallbacks?: JQueryCallback; + /** A function that the dxValidator widget calls after validating a specified value. */ + applyValidationResults?: (params: validationEngine.ValidatorValidationResult) => void; + /** A function that resets the validated values. */ + reset?: Function; + /** A function that sets focus to the validated editors when the dxValidationSummary is focused. */ + focus?: Function; + /** A function that returns a Boolean value specifying whether or not to bypass validation. */ + bypass?: Function; + } + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: dxValidatorValidationAdapter; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: any; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated Use the DataSource paging opportunities instead. + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies the minimum height of the widget. */ + minHeight?: any; + /** Specifies the maximum height of the widget. */ + maxHeight?: any; + /** A Boolean value specifying whether or not the auto resizing mode is enabled. */ + autoResizeEnabled?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if tabs in the title are scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean indicating whether or not to add scrolling support for tabs in the title. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + acceptCustomValue?: boolean; + /** Specifies whether or not to display selection controls. */ + showSelectionControls?: boolean; + /** A handler for the customItemCreating event. */ + onCustomItemCreating?: Function; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + values?: Array; + /** Specifies the selected items. */ + value?: Array; + /** Gets the currently selected items. */ + selectedItems?: Array; + /** Specifies how the widget applies values. */ + applyValueMode?: string; + /** A Boolean value specifying whether or not to hide selected items. */ + hideSelectedItems?: boolean; + /** A handler for the selectAllValueChanged event. */ + onSelectAllValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is multiline. */ + multiline?: boolean; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The template to be used for rendering tags. */ + tagTemplate?: any; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupToolbarItemOptions { + /** Specifies whether or not a toolbar item must be displayed disabled. */ + disabled?: boolean; + /** Specifies html code inserted into the toolbar item element. */ + html?: string; + /** Specifies a location for the item on the toolbar. */ + location?: string; + /** Specifies a configuration object for the widget that presents a toolbar item. */ + options?: Object; + /** Specifies an item template that should be used to render this item only. */ + template?: any; + /** Specifies text displayed for the toolbar item. */ + text?: string; + /** Specifies whether the item is displayed on a top or bottom toolbar. */ + toolbar?: string; + /** Specifies whether or not a widget item must be displayed. */ + visible?: boolean; + /** A widget that presents a toolbar item. */ + widget?: string; + } + export interface dxPopupOptions extends dxOverlayOptions { + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + toolbarItems?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object defining the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + /** Specifies the text of the message displayed if the specified value is not a number. */ + invalidValueMessage?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapLocation { + /** The latitude location of the widget. */ + lat?: number; + /** The longitude location of the widget. */ + lng?: number; + } + export interface dxMapMarker { + /** A URL pointing to the custom icon to be used for the marker. */ + iconSrc?: string; + /** Specifies the marker location. */ + location?: dxMapLocation; + /** A callback function performed when the marker is clicked. */ + onClick?: Function; + /** A tooltip to be used for the marker. */ + tooltip?: { + /** Specifies whether a tooltip is visible by default or not. */ + isShown?: boolean; + /** Specifies the tooltip text. */ + text?: string; + } + } + export interface dxMapRoute { + /** Specifies the color of the line displaying the route. */ + color?: string; + /** Specifies a transportation mode to be used in the displayed route. */ + mode?: string; + /** Specifies the opacity of the line displaying the route. */ + opacity?: number; + /** Contains an array of objects making up the route. */ + locations?: Array; + /** Specifies the thickness of the line displaying the route in pixels. */ + weight?: number; + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: dxMapLocation; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + applyValueMode?: string; + /** An object that defines widget animation options. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated Use the pageLoadMode option instead. + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface ListOptionsMenuItem { + /** Specifies the menu item text. */ + text?: string; + /** Holds on a function called when the item is clicked. */ + action?: (itemElement: Element, itemData: any) => void; + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + /** A handler for the selectAllValueChanged event. */ + onSelectAllValueChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + fieldEditEnabled?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + acceptCustomValue?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + formatString?: any; + /** Specifies the date display format. Applies only if the pickerType option is 'native' */ + displayFormat?: any; + format?: string; + /** A format used to display date/time information. */ + type?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use the pickerType option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use the pickerType option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ + adaptivityEnabled?: boolean; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** An object or a value, specifying the date and time currently selected in the calendar. */ + value?: any; + /** The latest date the widget allows to select. */ + max?: any; + /** The earliest date the widget allows to select. */ + min?: any; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidgetOptions { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: Array; + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** Specifies the method for the upload request. */ + uploadMethod?: string; + /** Specifies headers for the upload request. */ + uploadHeaders?: Object; + /** A handler for the uploadStarted event. */ + onUploadStarted?: Function; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the uploadAborted event. */ + onUploadAborted?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + /** Specifies dependency between the screen factor and the count of columns. */ + export interface ColCountResponsible { + /** The count of columns for an extra small-sized screen. */ + xs?: number; + /** The count of columns for a small-sized screen. */ + sm?: number; + /** The count of columns for a middle-sized screen. */ + md?: number; + /** The count of columns for a large screen size. */ + lg?: number; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering a group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies dependency between the screen factor and the count of columns in the tab layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies dependency between the screen factor and the count of columns in the group layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies dependency between the screen factor and the count of columns in the form layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + /** Resets the editor's value to undefined. */ + resetValues(): void; + } + export interface dxDeferRenderingOptions extends WidgetOptions { + /** Indicates if a load indicator should be shown until the widget's content is rendered. */ + showLoadIndicator?: boolean; + /** Specifies the jQuery.Promise or boolean value, which when resolved, forces widget content to render. */ + renderWhen?: any; + /** Specifies the animation to be used to show the rendered content. */ + animation?: fx.AnimationOptions; + /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ + staggerItemSelector?: string; + /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ + onRendered?: Function; + /** Specifies a callback function that is called when widget content is shown and animation has completed. */ + onShown?: Function; + } + /** A container for elements that must be rendered at a specified moment. */ + export class dxDeferRendering extends Widget { + constructor(element: JQuery, options?: dxDeferRenderingOptions); + constructor(element: Element, options?: dxDeferRenderingOptions); + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser and field panel to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies whether or not long text in header items should be wrapped. */ + wordWrapEnabled?: boolean; + /** Specifies a display format for field values. */ + format?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** + * Specifies a precision for formatted field values. + * @deprecated Use the format | precision option instead. + */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: any; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the useColorAsDefault option instead. + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** + * The name of the appointment object field that specifies a resource of this kind. + * @deprecated Use the fieldExpr option instead. + */ + field?: string; + /** The name of the appointment object field that specifies a resource of this kind. */ + fieldExpr?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** A handler for the contentReady event. */ + onContentReady?: Function; + horizontalScrollingEnabled?: boolean; + /** Specifies whether or not an end-user can scroll the view in both directions at the same time. */ + crossScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies the name of the data source item field that defines the timezone of the appointment start date. */ + startDateTimeZoneExpr?: string; + /** Specifies the name of the data source item field that defines the timezone of the appointment end date. */ + endDateTimeZoneExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + /** Specifies the timezone of the widget. */ + timeZone?: string; + /** The text or HTML markup displayed by the widget if the item collection is empty. Available for the Agenda view only. */ + noDataText?: string; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + /** Returns the start date of the current view. */ + getStartViewDate(): Date; + /** Returns the end date of the current view. */ + getEndViewDate(): Date; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode options instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is displayed expanded. */ + expandedExpr?: any; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode options instead. + */ + selectAllEnabled?: boolean; + /** Specifies whether or not an item becomes selected if a user clicks it. */ + selectByClick?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies the name of the data source item field for holding the parent key of the corresponding node. */ + parentIdExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: Object; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelectionChanged event. */ + onItemSelectionChanged?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** + * Specifies whether or not an item becomes selected if an end-user clicks it. + * @deprecated Use the selectByClick option instead. + */ + selectionByClick?: boolean; + /** Specifies whether or not an item becomes selected if a user clicks it. */ + selectByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ + adaptivityEnabled?: boolean; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + data: Object; + key: any; + rowIndex: number; + rowType: string; + groupIndex: number; + isExpanded: boolean; + isSelected: boolean; + values: Array; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether the user can group data by values of this column. Applies only when grouping is enabled. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string; target: string; groupInterval: any }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the order according to which grid columns must be concealed when the widget adapts to the screen or container size. */ + hidingPriority?: number; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: any; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** + * Specifies a precision for formatted values displayed in a column. + * @deprecated Use the format | precision option instead. + */ + precision?: number; + /** Specifies the default filter operation of a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + /** An array of grid columns. */ + columns?: Array; + /** Specifies the band column that owns the current column. Accepts the index of the band column in the columns array. */ + ownerBand?: number; + /** Specifies whether the column bands other columns or not. */ + isBand?: boolean; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not the widget should hide columns in order to adapt to the screen or container size. */ + columnHidingEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** A handler for the adaptiveDetailRowPreparing event. */ + onAdaptiveDetailRowPreparing?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies how the end-user chooses columns. */ + mode?: string; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Customizes grid columns and data before exporting. */ + customizeExportData?: (columns: Array, rows: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies grouping settings and the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Enables the user to group data using the context menu. */ + contextMenuEnabled?: boolean; + /** Specifies the event on which a group will be expanded/collapsed. */ + expandMode?: string; + groupContinuedMessage?: string; + groupContinuesMessage?: string; + /** Defines the texts of grouping-related visual elements. */ + texts?: { + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + /** Specifies the text of the context menu item that groups data by a specific column. */ + groupByThisColumn?: string; + /** Specifies the text of the context menu item that clears grouping settings of a specific column. */ + ungroup?: string; + /** Specifies the text of the context menu item that clears grouping settings of all columns. */ + ungroupAll?: string; + } + }; + /** Configures the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: any; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: any; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies whether to search all columns or only visible ones. */ + searchVisibleColumnsOnly?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Configures client-side export. */ + export?: { + /** Enables the client-side export feature. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE9 and Safari browsers. */ + proxyUrl?: string; + /** Allows an end user to export selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies the hint of the Export button when the allowExportSelectedData option is true. */ + exportTo?: string; + exportToExcel?: string; + excelFormat?: string; + selectedRows?: string; + /** Specifies the text of the command that exports all data. */ + exportAll?: string; + /** Specifies the text of the drop-down menu command that exports selected rows. */ + exportSelectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** + * Specifies a precision for the summary item value of a numeric format. + * @deprecated Use the valueFormat | precision option instead. + */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: any; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** + * Specifies a precision for the summary item value of a numeric format. + * @deprecated Use the valueFormat | precision option instead. + */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: any; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Checks whether a specific adaptive detail row is expanded or collapsed. */ + isAdaptiveDetailRowExpanded(key: any): void; + /** Expands an adaptive detail row by the key of its parent data row. */ + expandAdaptiveDetailRow(key: any): void; + /** Collapses the currently expanded adaptive detail row (if there is one). */ + collapseAdaptiveDetailRow(): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): JQueryPromise; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow(rowIndex) method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): JQueryPromise; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns how many pages the grid contains. */ + pageCount(): number; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Specifies the area to which data field headers must belong. */ + dataFieldArea?: string; + /** Configures the field panel. */ + fieldPanel?: { + /** Makes fields on the field panel draggable. */ + allowFieldDragging?: boolean; + /** Shows/hides filter fields on the field panel. */ + showFilterFields?: boolean; + /** Shows/hides data fields on the field panel. */ + showDataFields?: boolean; + /** Shows/hides column fields on the field panel. */ + showColumnFields?: boolean; + /** Shows/hides row fields on the field panel. */ + showRowFields?: boolean; + /** Shows/hides the field panel. */ + visible?: boolean; + /** Specifies the placeholders of the field areas. */ + texts?: { + /** Specifies the placeholder of the column field area. */ + columnFieldArea?: string; + /** Specifies the placeholder of the row field area. */ + rowFieldArea?: string; + /** Specifies the placeholder of the filter field area. */ + filterFieldArea?: string; + /** Specifies the placeholder of the data field area. */ + dataFieldArea?: string; + } + } + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether long text in header items should be wrapped. */ + wordWrapEnabled?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies the layout of items in the row header. */ + rowHeaderLayout?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Configures client-side export. */ + export?: { + /** Enables client-side export. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + /** Binds a dxChart to the dxPivotGrid. */ + bindChart(chart: any, integrationOptions?: { + inverted?: boolean; + dataFieldsDisplayMode?: string; + putDataFieldsInto?: string; + alternateDataFields?: boolean; + processCell?: Function; + customizeChart?: Function; + customizeSeries?: Function; + }): any; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies how transparent the vertical crosshair line should be. */ + opacity?: number; + } + export interface Font { + /** Colors the text displayed by the group labels. */ + color?: string; + /** Specifies the font family of the text displayed by the group labels. */ + family?: string; + /** Specifies how transparent the text displayed by the group labels should be. */ + opacity?: number; + /** Specifies the size of the text displayed by the group labels. */ + size?: any; + /** Specifies the font weight of the text displayed by the group labels. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the legend's bottom margin in pixels. */ + bottom?: number; + /** Specifies the legend's left margin in pixels. */ + left?: number; + /** Specifies the legend's right margin in pixels. */ + right?: number; + /** Specifies the legend's bottom margin in pixels. */ + top?: number; + } + export interface MarginOptions { + /** Generates space around the widget. */ + margin?: Margins; + } + export interface RedrawOnResizeOptions { + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + } + export interface TitleOptions { + /** Specifies the widget title. */ + title?: Title; + } + export interface ExportOptions { + /** Configures the exporting and printing features. */ + export?: Export; + } + export interface LoadingIndicatorOptions { + /** Configures the loading indicator. */ + loadingIndicator?: LoadingIndicator; + } + export interface LoadingIndicatorMethods { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + } + export interface Size { + /** Specifies the width of the widget in pixels. */ + width?: number; + /** Specifies the height of the widget in pixels. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the title's alignment in a horizontal direction. */ + horizontalAlignment?: string; + /** Specifies the title's alignment in a vertical direction. */ + verticalAlignment?: string; + /** Generates space around the title. */ + margin?: Margins; + /** Specifies the minimum height that the title occupies. */ + placeholderSize?: number; + /** Specifies the title text. */ + text?: string; + /** Specifies the widget subtitle. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Export { + /** Enables the client-side exporting in the widget. */ + enabled?: boolean; + /** Enables the printing feature in the widget. Applies only if the export | enabled option is true. */ + printingEnabled?: boolean; + /** Specifies a set of formats available for exporting into. */ + formats?: Array; + /** Specifies a default name for the file to which the widget will be exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable exporting in IE9 and Safari browsers. */ + proxyUrl?: string; + /** Specifies the color that will fill transparent regions in the resulting file or document. */ + backgroundColor?: string; + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: DashedBorderWithOpacity; + /** Specifies the color of tooltips. */ + color?: string; + /** Specifies the z-index of tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Allows you to change tooltip appearance. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + enabled?: boolean; + /** Specifies the font of the text displayed by a tooltip. */ + font?: Font; + /** Specifies the format of the value displayed by a tooltip. */ + format?: any; + /** Specifies the opacity of tooltips. */ + opacity?: number; + /** Generates space on the left and the right of the text displayed by a tooltip. */ + paddingLeftRight?: number; + /** Generates space above and below the text displayed by a tooltip. */ + paddingTopBottom?: number; + /** + * Specifies the precision of formatted values in a tooltip. + * @deprecated Use the tooltip | format | precision option instead. + */ + precision?: number; + /** Specifies the appearance of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip itself measured in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip itself measured in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Colors the background of the loading indicator. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies the text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** Specifies the size of the widget in pixels. */ + size?: Size; + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + /** Exports the widget into a document with a specified name and format. */ + exportTo(): void; + /** Opens the browser's print window. */ + print(): void; + /** Redraws the widget. */ + render(): void; + } +} +declare module DevExpress.viz { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: any; + /** + * Specifies a precision for formatted point arguments displayed in point labels. + * @deprecated Use the series | label | argumentFormat | precision instead. + */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: any; + position?: string; + /** + * Specifies a precision for formatted point values displayed in point labels. + * @deprecated Use the series | label | format | precision option instead. + */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show labels for points with zero value. Applies only to bar-like series. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Aligns point labels in relation to their points. */ + alignment?: string; + /** Along with verticalOffset, shifts point labels from their initial positions. */ + horizontalOffset?: number; + /** Along with horizontalOffset, shifts point labels from their initial positions. */ + verticalOffset?: number; + /** + * Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. + * @deprecated Use the series | label | format | percentPrecision instead. + */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + label?: ChartSeriesConfigLabel; + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies series elements to be highlighted when a user selects a point. */ + selectionMode?: string; + selectionStyle?: { + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** Substitutes the standard point symbols with an image. */ + image?: { + /** Specifies the height of the image used instead of a point marker. */ + height?: any; + /** Specifies the URL of the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies which data source field provides close values for points of a financial series. */ + closeValueField?: string; + /** Makes bars look rounded. Applies only to bar-like series. */ + cornerRadius?: number; + /** Specifies which data source field provides high values for points of a financial series. */ + highValueField?: string; + /** Specifies a filling color for the body of a series point that visualizes a non-reduced value. Applies only to candlestick series. */ + innerColor?: string; + /** Specifies which data source field provides low values for points of a financial series. */ + lowValueField?: string; + /** Specifies which data source field provides open values for points of a financial series. */ + openValueField?: string; + /** Specifies which pane the series should belong to. Accepts the name of the pane. */ + pane?: string; + point?: ChartCommonPointOptions; + /** Coupled with the rangeValue2Field option, specifies which data source field provides values for a range-like series. */ + rangeValue1Field?: string; + /** Coupled with the rangeValue1Field option, specifies which data source field provides values for a range-like series. */ + rangeValue2Field?: string; + /** Specifies reduction options for financial series. */ + reduction?: { + /** Specifies a color for the points whose price has decreased in comparison to the price of the previous point. */ + color?: string; + /** Specifies whether high, low, open or close prices of points should be compared. */ + level?: string; + }; + /** Specifies which data source field provides size values for bubbles. Required by and applies only to bubble series. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /** Defines common settings for all area series. */ + area?: CommonSeriesConfig; + /** Defines common settings for all bar series. */ + bar?: CommonSeriesConfig; + /** Defines common settings for all bubble series. */ + bubble?: CommonSeriesConfig; + /** Defines common settings for all candlestick series. */ + candlestick?: CommonSeriesConfig; + /** Defines common settings for all full-stacked area series. */ + fullstackedarea?: CommonSeriesConfig; + /** Defines common settings for all full-stacked spline area series. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** Defines common settings for all full-stacked bar series. */ + fullstackedbar?: CommonSeriesConfig; + /** Defines common settings for all full-stacked line series. */ + fullstackedline?: CommonSeriesConfig; + /** Defines common settings for all full-stacked spline series. */ + fullstackedspline?: CommonSeriesConfig; + /** Defines common settings for all line series. */ + line?: CommonSeriesConfig; + /** Defines common settings for all range area series. */ + rangearea?: CommonSeriesConfig; + /** Defines common settings for all range bar series. */ + rangebar?: CommonSeriesConfig; + /** Defines common settings for all scatter series. */ + scatter?: CommonSeriesConfig; + /** Defines common settings for all spline series. */ + spline?: CommonSeriesConfig; + /** Defines common settings for all spline area series. */ + splinearea?: CommonSeriesConfig; + /** Defines common settings for all stacked area series. */ + stackedarea?: CommonSeriesConfig; + /** Defines common settings for all stacked spline area series. */ + stackedsplinearea?: CommonSeriesConfig; + /** Defines common settings for all stacked bar series. */ + stackedbar?: CommonSeriesConfig; + /** Defines common settings for all stacked line series. */ + stackedline?: CommonSeriesConfig; + /** Defines common settings for all stacked spline series. */ + stackedspline?: CommonSeriesConfig; + /** Defines common settings for all step area series. */ + steparea?: CommonSeriesConfig; + /** Defines common settings for all step line series. */ + stepline?: CommonSeriesConfig; + /** Defines common settings for all stock series. */ + stock?: CommonSeriesConfig; + /** Specifies the type of the series. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** + * Specifies a precision for the percentage values displayed in labels. + * @deprecated Use the series | label | format | percentPrecision instead. + */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated Use the innerRadius option instead. + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated Use the segmentsDirection option instead. + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated Use the startAngle option instead. + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated Use the type option instead. + */ + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated Use the type option instead. + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for constant line labels. */ + font?: viz.core.Font; + /** Specifies the position of constant line labels on the chart plot. */ + position?: string; + /** Makes constant line labels visible. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** Configures constant line labels. */ + label?: ChartCommonConstantLineLabel; + /** Generates a pixel-measured empty space between the left/right side of a constant line and the constant line label. */ + paddingLeftRight?: number; + /** Generates a pixel-measured empty space between the top/bottom side of a constant line and the constant line label. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Aligns axis labels in relation to ticks. */ + alignment?: string; + /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ + overlappingBehavior?: { + /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ + mode?: string; + /** Specifies the rotation angle of axis labels. Applies only if the mode option is "rotate". */ + rotationAngle?: number; + /** Adds a pixel-measured empty space between two staggered rows of axis labels. Applies only if the mode option is "stagger". */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for the axis title. */ + font?: viz.core.Font; + /** Adds a pixel-measured empty space between the axis title and axis labels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Configures the appearance of all constant lines in the widget. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Configures axis labels. */ + label?: ChartCommonAxisLabel; + /** Controls the empty space between the maximum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ + maxValueMargin?: number; + /** Controls the empty space between the minimum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ + minValueMargin?: number; + /** Reserves a pixel-measured space for the axis. */ + placeholderSize?: number; + /** Configures the appearance of strips. */ + stripStyle?: { + /** Configures the appearance of strip labels. */ + label?: { + /** Specifies font options for strip labels. */ + font?: viz.core.Font; + /** Aligns strip labels in the horizontal direction. */ + horizontalAlignment?: string; + /** Aligns strip labels in the vertical direction. */ + verticalAlignment?: string; + }; + /** Generates a pixel-measured empty space between the left/right border of a strip and the strip label. */ + paddingLeftRight?: number; + /** Generates a pixel-measured empty space between the top/bottom border of a strip and the strip label. */ + paddingTopBottom?: number; + }; + /** Configures axis titles. */ + title?: CommonAxisTitle; + /** Adds an empty space between the axis and the minimum and maximum series points. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Aligns constant line labels in the horizontal direction. */ + horizontalAlignment?: string; + /** Aligns constant line labels in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the text of a constant line label. By default, equals to the value of the constant line. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the axis labels. + * @deprecated Use the valueAxis | label | format | precision option instead. + */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text of the axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** Specifies the appearance of the labels of those constant lines that belong to the value axis. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** Configures the constant line label. */ + label?: ChartConstantLineLabel; + /** Specifies the value indicated by a constant line. Setting this option is necessary. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Binds the value axis to a pane. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Declares a collection of constant lines belonging to the value axis. */ + constantLines?: Array; + /** Specifies the appearance of those constant lines that belong to the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Configures the labels of the value axis. */ + label?: ChartAxisLabel; + /** Coupled with the min option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ + max?: any; + /** Coupled with the max option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ + min?: any; + /** Relocates the value axis. */ + position?: string; + /** Configures the axis title. */ + title?: any; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Adds a pixel-measured empty space between two side-by-side value axes. Applies if several value axes are located on one side of the chart. */ + multipleAxesSpacing?: number; + /** Synchronizes two or more value axes with each other at a specific value. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies the color of the pane's background. */ + backgroundColor?: string; + /** Configures the pane border. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of the pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Shows/hides the bottom border of the pane. Applies only when the border | visible option is true. */ + bottom?: boolean; + /** Shows/hides the left border of the pane. Applies only when the border | visible option is true. */ + left?: boolean; + /** Shows/hides the right border of the pane. Applies only when the border | visible option is true. */ + right?: boolean; + /** Shows/hides the top border of the pane. Applies only when the border | visible option is true. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies how many series points the widget should have before the animation will be disabled. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: any; + /** + * Specifies a precision for formatted arguments displayed in tooltips. + * @deprecated Use the tooltip | argumentFormat | precision option instead. + */ + argumentPrecision?: number; + /** + * Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. + * @deprecated Use the tooltip | format | percentPrecision option instead. + */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the widget's width small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the widget's height small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels should be kept when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Customizes the appearance of an individual point label. */ + customizeLabel?: (pointInfo: Object) => Object; + /** Customizes the appearance of an individual series point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies the origin of data for the widget. */ + dataSource?: any; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Configures tooltips. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Hides all widget tooltips. */ + hideTooltip(): void; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a series point or on its edge. Applies to bar-like and bubble series only. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies whether or not to adjust the value axis when zooming the widget. */ + adjustOnZoom?: boolean; + /** Configures the argument axis. */ + argumentAxis?: ChartArgumentAxis; + /** Defines common settings for both the argument and value axis in a chart. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** Defines common settings for all panes in a chart. */ + commonPaneSettings?: CommonPane; + /** Specifies settings common for all series in the chart. */ + commonSeriesSettings?: CommonSeriesSettings; + /** Configures the crosshair feature. */ + crosshair?: { + /** Specifies the color of the crosshair lines. */ + color?: string; + /** Specifies the dash style of the crosshair lines. */ + dashStyle?: string; + /** Enables the crosshair. */ + enabled?: boolean; + /** Specifies how transparent the crosshair lines should be. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Configures the horizontal crosshair line individually. */ + horizontalLine?: CrosshaierWithLabel; + /** Configures the vertical crosshair line individually. */ + verticalLine?: CrosshaierWithLabel; + /** Configures the crosshair labels. */ + label?: { + /** Paints the background of the crosshair labels. */ + backgroundColor?: string; + /** Makes the crosshair labels visible. Applies only if the crosshair feature is enabled. */ + visible?: boolean; + /** Specifies font options for the crosshair labels. */ + font?: viz.core.Font; + /** Formats the point value/argument before it will be displayed in the crosshair label. */ + format?: any; + /** + * Specifies a precision for formatted values. + * @deprecated Use the crosshair | label | format | precision option instead. + */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies which pane should be used by default. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Declares a collection of panes. */ + panes?: Array; + /** Swaps the axes around making the value axis horizontal and the argument axis vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + onZoomStart?: (e: { + component: BaseChart; + element: Element; + }) => void; + onZoomEnd?: (e: { + component: BaseChart; + element: Element; + rangeStart: any; + rangeEnd: any; + }) => void; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + tooltip?: ChartTooltip; + /** Configures the value axis. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Paints the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Makes the label of the horizontal crosshair line visible. Applies only if the crosshair feature is enabled and the horizontal line is visible. */ + visible?: boolean; + /** Specifies font options for the label of the horizontal crosshair line. */ + font?: viz.core.Font; + /** Formats the point value before it will be displayed in the crosshair label. */ + format?: any; + /** + * Specifies a precision for formatted values. + * @deprecated Use the crosshair | horizontalLine | label | format | precision option instead. + */ + precision?: number; + /** Customizes the text displayed by the label that belongs to the horizontal crosshair line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } +} +declare module DevExpress.viz { + /** A widget providing charts of various types for web applications. */ + export class dxChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + /** A circular chart widget for web applications. */ + export class dxPieChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxPieChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated Use the getAllSeries() method instead. + */ + getSeries(): DevExpress.viz.charts.PieSeries; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxPolarChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxPolarChartOptions); + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated Use the scale | customMinorTicks option instead. + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This feature is no longer available. + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated Use the scale | minorTickInterval option instead. + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the scale labels. + * @deprecated Use the scale | label | format | precision option instead. + */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This feature is no longer available. + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This feature is no longer available. + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated Use the tick option instead. + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: any; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** + * Specifies a precision for the formatted value displayed by an indicator. + * @deprecated Use the text | format | precision option instead. + */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: any; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions extends viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** + * Specifies a subtitle for the widget. + * @deprecated Use the title | subtitle option instead. + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated Use the title | subtitle | font option instead. + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated Use the title | subtitle | text option instead. + */ + text?: string; + }; + /** Configures tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: any; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** + * Specifies a precision for the formatted value displayed by labels. + * @deprecated Use the label | format | precision option instead. + */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } +} +declare module DevExpress.viz { + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends DevExpress.viz.gauges.dxBaseGauge { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends DevExpress.viz.gauges.dxBaseGauge { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxBarGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxBarGaugeOptions); + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the scale labels. + * @deprecated Use the scale | label | format | precision option instead. + */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated Use the tickInterval option instead. + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: any; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated Use the minorTick | visible option instead. + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: any; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the placeholderHeight and indent options instead. + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** + * Specifies a precision for the formatted value displayed in slider markers. + * @deprecated Use the sliderMarker | format | precision option instead. + */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } +} +declare module DevExpress.viz { + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); + constructor(element: Element, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the Layer Element instead. + */ + export interface Area { + /** + * Contains the element type. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the Layer Element instead. + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. + */ + text: string; + /** + * Contains the type of the element. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated Use the Layer Element | coordinates() method instead. + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + dataSource?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the data source attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated Use the layers | label | dataField option instead. + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated Use the layers | paletteSize option instead. + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Enables marker labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | maxSize option instead. + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | minSize option instead. + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | opacity option instead. + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated Use the layers | size option instead. + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated Use the layers | elementType option instead. + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated Use the layers | sizeGroups option instead. + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated Use the layers | sizeGroupingField option instead. + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the "area" type element of the layers array. + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the control bar. */ + opacity?: number; + }; + /** + * Specifies a data source for the map area. + * @deprecated Use the layers | dataSource option instead. + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the layers | dataSource option instead. + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the "marker" type element of the layers array. + */ + markerSettings?: MarkerSettings; + /** Configures tooltips. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the onClick option instead. + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the onSelectionChanged option instead. + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the onClick option instead. + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the onSelecitonChanged option instead. + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies the shape of item markers. */ + markerShape?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +declare module DevExpress.viz{ + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.map.dxVectorMapOptions); + constructor(element: Element, options?: DevExpress.viz.map.dxVectorMapOptions); + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): DevExpress.viz.map.MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): DevExpress.viz.map.MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the layer's getElements() method instead. + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the layer's getElements() method instead. + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions { + /** Configures the tooltip. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + } + export interface dxBulletOptions extends BaseSparklineOptions { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: any; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } +} +declare module DevExpress.viz { + /** A bullet graph widget. */ + export class dxBullet extends DevExpress.viz.sparklines.BaseSparkline { + constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxBulletOptions); + constructor(element: Element, options?: DevExpress.viz.sparklines.dxBulletOptions); + } + /** A sparkline widget. */ + export class dxSparkline extends DevExpress.viz.sparklines.BaseSparkline { + constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxSparklineOptions); + constructor(element: Element, options?: DevExpress.viz.sparklines.dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.dxSparkline; +} +declare module DevExpress.viz.treeMap { + export interface dxTreeMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies the origin of data for the widget. */ + dataSource?: any; + /** Specifies the name of the data source field that provides nested items for a group. Applies to hierarchical data sources only. */ + childrenField?: string; + /** Specifies the name of the data source field that provides values for tiles. */ + valueField?: string; + /** Specifies the name of the data source field that provides colors for tiles. */ + colorField?: string; + /** Specifies the name of the data source field that provides texts for tile and group labels. */ + labelField?: string; + /** Specifies the name of the data source field that provides IDs for items. Applies to flat data sources only. */ + idField?: string; + /** Specifies the name of the data source field that provides parent IDs for items. Applies to flat data sources only. */ + parentField?: string; + /** Specifies the layout algorithm. */ + layoutAlgorithm?: any; + /** Specifies the direction in which the items will be laid out. */ + layoutDirection?: string; + /** Configures tiles. */ + tile?: { + /** Configures the tile borders. */ + border?: { + /** Specifies the width of the tile borders in pixels. */ + width?: number; + /** Colors the tile borders. */ + color?: string; + }; + /** Specifies a single color for all tiles. */ + color?: string; + /** Specifies the appearance of tiles in the hover state. */ + hoverStyle?: { + /** Configures the appearance of the tile borders in the hover state. */ + border?: { + /** Specifies the width of the tile borders in pixels. Applies to a tile in the hover state. */ + width?: number; + /** Colors the tile borders in the hover state. */ + color?: string; + }; + /** Colors tiles in the hover state. */ + color?: string; + }; + /** Specifies the appearance of tiles in the selected state. */ + selectionStyle?: { + /** Configures the appearance of the tile borders in the selected state. */ + border?: { + /** Specifies the width of the tile borders in pixels. Applies to a tile in the selected state. */ + width?: number; + /** Colors the tile borders in the selected state. */ + color?: string; + }; + /** Colors tiles in the selected state. */ + color?: string; + }; + /** Configures the tile labels. */ + label?: { + /** Changes the visibility of the tile labels. */ + visible?: boolean; + /** Specifies the font settings of the tile labels. */ + font?: viz.core.Font; + }; + }; + /** Configures groups. */ + group?: { + /** Specifies the height of the group headers in pixels. */ + headerHeight?: number; + /** Configures the group borders. */ + border?: { + /** Specifies the width of the group borders in pixels. */ + width?: number; + /** Colors the group borders. */ + color?: string; + }; + /** Colors the group headers. */ + color?: string; + /** Specifies the appearance of groups in the hover state. */ + hoverStyle?: { + /** Configures the appearance of the group borders in the hover state. */ + border?: { + /** Specifies the width of the group borders in pixels. Applies to a group in the hover state. */ + width?: number; + /** Colors the group borders in the hover state. */ + color?: string; + }; + /** Colors the group headers in the hover state. */ + color?: string; + }; + /** Specifies the appearance of groups in the selected state. */ + selectionStyle?: { + /** Configures the appearance of the group borders in the selected state. */ + border?: { + /** Specifies the width of the group borders in pixels. Applies to a group in the selected state. */ + width?: number; + /** Colors the group borders in the selected state. */ + color?: string; + }; + /** Colors the group headers in the selected state. */ + color?: string; + }; + /** Configures the group labels. */ + label?: { + /** Changes the visibility of the group labels. */ + visible?: boolean; + /** Specifies the font settings of the group labels. */ + font?: viz.core.Font; + }; + }; + /** Manages the color settings. */ + colorizer?: { + /** Specifies the colorizing algorithm. */ + type?: string; + /** Sets the palette to be used for colorizing tiles. */ + palette?: any; + /** Specifies whether or not all tiles in a group must be colored uniformly. Applies only if the type option is "discrete". */ + colorizeGroups?: boolean; + /** Allows you to paint tiles with similar values uniformly. Applies only if the type option is "gradient" or "range". */ + range?: Array; + /** Specifies the name of the data source field whose values define the color of a tile. Applies only if the type option is "gradient" or "range". */ + colorCodeField?: string; + }; + /** Specifies whether tiles and groups change their style in the hover state. */ + hoverEnabled?: boolean; + /** Specifies whether a single or multiple nodes can be in the selected state simultaneously. */ + selectionMode?: string; + /** Specifies how many hierarchical levels must be visualized. */ + maxDepth?: number; + /** Specifies whether the user will interact with a single tile or its group. */ + interactWithGroup?: boolean; + tooltip?: viz.core.Tooltip; + /** A handler for the nodesInitialized event. */ + onNodesInitialized?: (e: { + component: dxTreeMap; + element: Element; + root: TreeMapNode + }) => void; + /** A handler for the nodesRendering event. */ + onNodesRendering?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the hoverChanged event. */ + onHoverChanged?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode; + }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode; + }) => void; + /** A handler for the drill event. */ + onDrill?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode + }) => void; + } + /** This section describes fields and methods that can be used in code to manipulate a Node object. */ + export interface TreeMapNode { + /** The level that the current node occupies in the hierarchy of nodes. */ + level: number; + /** The index of the current node in the array of all nodes on the same level. */ + index: number; + /** The object from the data source visualized by the node. */ + data: Object; + /** Returns the parent node of the current node. */ + getParent(): TreeMapNode; + /** Indicates how many direct descendants the current node has. */ + getChildrenCount(): number; + /** Returns all nodes nested in the current node. */ + getAllChildren(): Array; + /** Returns all descendant nodes. */ + getAllNodes(): Array; + /** Gets a specific node from a collection of direct descendants. */ + getChild(index: number): TreeMapNode; + /** Gets the raw value of the node. */ + value(): number; + /** Returns the label of the node. */ + label(): string; + /** Sets the label to the node. */ + label(label: string): void; + /** Customizes the node. */ + customize(options: any): void; + /** Reverts the appearance of the node to the initial state. */ + resetCustomization(): void; + /** Indicates whether the node is in the hover state or not. */ + isHovered(): boolean; + /** Sets the selection state of a node. */ + select(state: boolean): void; + /** Indicates whether the node is selected or not. */ + isSelected(): boolean; + /** Indicates whether the node is visualized by a tile or a group of tiles. */ + isLeaf(): boolean; + /** Indicates whether the current node is active. */ + isActive(): boolean; + /** Shows the tooltip. */ + showTooltip(): void; + /** Drills down into the node. */ + drillDown(): void; + } +} +declare module DevExpress.viz { + /** A widget for displaying hierarchical data by using nested rectangles. */ + export class dxTreeMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.treeMap.dxTreeMapOptions); + constructor(element: Element, options?: DevExpress.viz.treeMap.dxTreeMapOptions); + /** Returns the root node. */ + getRootNode(): DevExpress.viz.treeMap.TreeMapNode; + /** Returns the current node. */ + getCurrentNode(): DevExpress.viz.treeMap.TreeMapNode; + /** Deselects all nodes in the widget. */ + clearSelection(): void; + /** Hides the tooltip. */ + hideTooltip(): void; + /** Drills one level up. */ + drillUp(): void; + /** Resets the drill down level. */ + resetDrillDown(): void; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + } +} +interface JQuery { + dxTreeMap(options?: DevExpress.viz.treeMap.dxTreeMapOptions): JQuery; + dxTreeMap(methodName: string, ...params: any[]): any; + dxTreeMap(methodName: "instance"): DevExpress.viz.dxTreeMap; +} diff --git a/devextreme/devextreme-16.1.7.d.ts b/devextreme/devextreme-16.1.7.d.ts new file mode 100644 index 0000000000..a3273c19dd --- /dev/null +++ b/devextreme/devextreme-16.1.7.d.ts @@ -0,0 +1,8052 @@ +// Type definitions for DevExtreme 16.1.7 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module DevExpress { + /** Formats values. */ + export interface Format { + /** Specifies a predefined format. */ + type?: String; + /** Specifies the currency code for the 'currency' format. */ + currency?: String; + /** Specifies a precision for values of a numeric format. */ + precision?: number; + /** Parses string values into numeric or date-time values. */ + parser?: (value: any) => any; + /** Specifies a custom format. */ + formatter?: (value: any) => any; + } + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects extending fields of the specified ViewModel. */ + export function registerModelForValidation(model: Object): void; + /** Unregisters all the dxValidator objects extending fields of the specified ViewModel. */ + export function unregisterModelForValidation(model: Object): void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** + * Specifies whether or not the entire application/site supports right-to-left representation. + * @deprecated Use the config(config) method instead. + */ + export var rtlEnabled: boolean; + /** Gets the current global configuration object. */ + export function config(): Object; + /** Sets the global configuration object. */ + export function config(config: Object): void; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** An object used to manage OData endpoints in your application. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns an endpoint for the specified key. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on a specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: any; + /** The element within which the widget is positioned. */ + boundary?: Object; + /** Specifies the horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: any; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: any; + /** The target element that the widget is positioned against. */ + of?: Object; + /** Specifies horizontal and vertical offset in pixels. */ + offset?: any; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate() method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate() method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + /** A bag for holding any options that require two-way binding (Angular approach specific) */ + bindingOptions?: { [key: string]: any; }; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** Specifies whether or not the store combines the search expression with the filter expression. */ + useDefaultSearch?: boolean; + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** The bag of custom parameters passed to the query executed when the DataSource load operation is invoked. */ + customQueryParams?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): OperationPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): OperationPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(...expr: Object[]): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + /** Cancels the load operation associated with the specified identifier. */ + cancel(operationId: number): boolean; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, Boolean, Single, Decimal and Guid. */ + keyType?: any; + /** Specifies whether or not dates in a response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Allows you to export widgets using their SVG markup. */ + export function exportFromMarkup(markup: string, options: Object): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorValidationAdapter { + /** A function that returns the value to be validated. */ + getValue?: Function; + /** The jQuery.Callbacks() object that is fired when the specified value should be validated. */ + validationRequestsCallbacks?: JQueryCallback; + /** A function that the dxValidator widget calls after validating a specified value. */ + applyValidationResults?: (params: validationEngine.ValidatorValidationResult) => void; + /** A function that resets the validated values. */ + reset?: Function; + /** A function that sets focus to the validated editors when the dxValidationSummary is focused. */ + focus?: Function; + /** A function that returns a Boolean value specifying whether or not to bypass validation. */ + bypass?: Function; + } + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate, and how to apply the validation result. */ + adapter?: dxValidatorValidationAdapter; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: any; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated Use the DataSource paging opportunities instead. + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies the minimum height of the widget. */ + minHeight?: any; + /** Specifies the maximum height of the widget. */ + maxHeight?: any; + /** A Boolean value specifying whether or not the auto resizing mode is enabled. */ + autoResizeEnabled?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if tabs in the title are scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean indicating whether or not to add scrolling support for tabs in the title. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + acceptCustomValue?: boolean; + /** Specifies whether or not to display selection controls. */ + showSelectionControls?: boolean; + /** A handler for the customItemCreating event. */ + onCustomItemCreating?: Function; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + values?: Array; + /** Specifies the selected items. */ + value?: Array; + /** Gets the currently selected items. */ + selectedItems?: Array; + /** Specifies how the widget applies values. */ + applyValueMode?: string; + /** A Boolean value specifying whether or not to hide selected items. */ + hideSelectedItems?: boolean; + /** A handler for the selectAllValueChanged event. */ + onSelectAllValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is multiline. */ + multiline?: boolean; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The template to be used for rendering tags. */ + tagTemplate?: any; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupToolbarItemOptions { + /** Specifies whether or not a toolbar item must be displayed disabled. */ + disabled?: boolean; + /** Specifies html code inserted into the toolbar item element. */ + html?: string; + /** Specifies a location for the item on the toolbar. */ + location?: string; + /** Specifies a configuration object for the widget that presents a toolbar item. */ + options?: Object; + /** Specifies an item template that should be used to render this item only. */ + template?: any; + /** Specifies text displayed for the toolbar item. */ + text?: string; + /** Specifies whether the item is displayed on a top or bottom toolbar. */ + toolbar?: string; + /** Specifies whether or not a widget item must be displayed. */ + visible?: boolean; + /** A widget that presents a toolbar item. */ + widget?: string; + } + export interface dxPopupOptions extends dxOverlayOptions { + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + toolbarItems?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object defining the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + /** Specifies the text of the message displayed if the specified value is not a number. */ + invalidValueMessage?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapLocation { + /** The latitude location of the widget. */ + lat?: number; + /** The longitude location of the widget. */ + lng?: number; + } + export interface dxMapMarker { + /** A URL pointing to the custom icon to be used for the marker. */ + iconSrc?: string; + /** Specifies the marker location. */ + location?: dxMapLocation; + /** A callback function performed when the marker is clicked. */ + onClick?: Function; + /** A tooltip to be used for the marker. */ + tooltip?: { + /** Specifies whether a tooltip is visible by default or not. */ + isShown?: boolean; + /** Specifies the tooltip text. */ + text?: string; + } + } + export interface dxMapRoute { + /** Specifies the color of the line displaying the route. */ + color?: string; + /** Specifies a transportation mode to be used in the displayed route. */ + mode?: string; + /** Specifies the opacity of the line displaying the route. */ + opacity?: number; + /** Contains an array of objects making up the route. */ + locations?: Array; + /** Specifies the thickness of the line displaying the route in pixels. */ + weight?: number; + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: dxMapLocation; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + applyValueMode?: string; + /** An object that defines widget animation options. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated Use the pageLoadMode option instead. + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface ListOptionsMenuItem { + /** Specifies the menu item text. */ + text?: string; + /** Holds on a function called when the item is clicked. */ + action?: (itemElement: Element, itemData: any) => void; + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + /** A handler for the selectAllValueChanged event. */ + onSelectAllValueChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + fieldEditEnabled?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + acceptCustomValue?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + formatString?: any; + /** Specifies the date display format. Applies only if the pickerType option is 'native' */ + displayFormat?: any; + format?: string; + /** A format used to display date/time information. */ + type?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use the pickerType option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use the pickerType option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ + adaptivityEnabled?: boolean; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** An object or a value, specifying the date and time currently selected in the calendar. */ + value?: any; + /** The latest date the widget allows to select. */ + max?: any; + /** The earliest date the widget allows to select. */ + min?: any; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidgetOptions { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: Array; + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** Specifies the method for the upload request. */ + uploadMethod?: string; + /** Specifies headers for the upload request. */ + uploadHeaders?: Object; + /** A handler for the uploadStarted event. */ + onUploadStarted?: Function; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the uploadAborted event. */ + onUploadAborted?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + /** Specifies dependency between the screen factor and the count of columns. */ + export interface ColCountResponsible { + /** The count of columns for an extra small-sized screen. */ + xs?: number; + /** The count of columns for a small-sized screen. */ + sm?: number; + /** The count of columns for a middle-sized screen. */ + md?: number; + /** The count of columns for a large screen size. */ + lg?: number; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering a group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies dependency between the screen factor and the count of columns in the tab layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies dependency between the screen factor and the count of columns in the group layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies dependency between the screen factor and the count of columns in the form layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users if a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Gets the value of the form item option. */ + itemOption(field: string): any; + /** Returns an editor instance associated with the specified formData field or name of the form item. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + /** Resets the editor's value to undefined. */ + resetValues(): void; + } + export interface dxDeferRenderingOptions extends WidgetOptions { + /** Indicates if a load indicator should be shown until the widget's content is rendered. */ + showLoadIndicator?: boolean; + /** Specifies the jQuery.Promise or boolean value, which when resolved, forces widget content to render. */ + renderWhen?: any; + /** Specifies the animation to be used to show the rendered content. */ + animation?: fx.AnimationOptions; + /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ + staggerItemSelector?: string; + /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ + onRendered?: Function; + /** Specifies a callback function that is called when widget content is shown and animation has completed. */ + onShown?: Function; + } + /** A container for elements that must be rendered at a specified moment. */ + export class dxDeferRendering extends Widget { + constructor(element: JQuery, options?: dxDeferRenderingOptions); + constructor(element: Element, options?: dxDeferRenderingOptions); + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser and field panel to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Sorts the header items of this field by the summary values of another field. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies whether or not long text in header items should be wrapped. */ + wordWrapEnabled?: boolean; + /** Specifies a display format for field values. */ + format?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** + * Specifies a precision for formatted field values. + * @deprecated Use the format | precision option instead. + */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSourceOptions); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: any; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurring appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the useColorAsDefault option instead. + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** + * The name of the appointment object field that specifies a resource of this kind. + * @deprecated Use the fieldExpr option instead. + */ + field?: string; + /** The name of the appointment object field that specifies a resource of this kind. */ + fieldExpr?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** A handler for the contentReady event. */ + onContentReady?: Function; + horizontalScrollingEnabled?: boolean; + /** Specifies whether or not an end-user can scroll the view in both directions at the same time. */ + crossScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies the name of the data source item field that defines the timezone of the appointment start date. */ + startDateTimeZoneExpr?: string; + /** Specifies the name of the data source item field that defines the timezone of the appointment end date. */ + endDateTimeZoneExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + /** Specifies the timezone of the widget. */ + timeZone?: string; + /** The text or HTML markup displayed by the widget if the item collection is empty. Available for the Agenda view only. */ + noDataText?: string; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + /** Returns the start date of the current view. */ + getStartViewDate(): Date; + /** Returns the end date of the current view. */ + getEndViewDate(): Date; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode options instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is displayed expanded. */ + expandedExpr?: any; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode options instead. + */ + selectAllEnabled?: boolean; + /** Specifies whether or not an item becomes selected if a user clicks it. */ + selectByClick?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies the name of the data source item field for holding the parent key of the corresponding node. */ + parentIdExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: Object; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelectionChanged event. */ + onItemSelectionChanged?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: { + /** An object that defines the animation options used when the widget is being shown. */ + show?: fx.AnimationOptions; + /** An object that defines the animation options used when the widget is being hidden. */ + hide?: fx.AnimationOptions; + }; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** + * Specifies whether or not an item becomes selected if an end-user clicks it. + * @deprecated Use the selectByClick option instead. + */ + selectionByClick?: boolean; + /** Specifies whether or not an item becomes selected if a user clicks it. */ + selectByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ + adaptivityEnabled?: boolean; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not an alternative invocation mode is enabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + data: Object; + key: any; + rowIndex: number; + rowType: string; + groupIndex: number; + isExpanded: boolean; + isSelected: boolean; + values: Array; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether the user can group data by values of this column. Applies only when grouping is enabled. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string; target: string; groupInterval: any }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the order according to which grid columns must be concealed when the widget adapts to the screen or container size. */ + hidingPriority?: number; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: any; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** + * Specifies a precision for formatted values displayed in a column. + * @deprecated Use the format | precision option instead. + */ + precision?: number; + /** Specifies the default filter operation of a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + /** An array of grid columns. */ + columns?: Array; + /** Specifies the band column that owns the current column. Accepts the index of the band column in the columns array. */ + ownerBand?: number; + /** Specifies whether the column bands other columns or not. */ + isBand?: boolean; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not the widget should hide columns in order to adapt to the screen or container size. */ + columnHidingEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** A handler for the adaptiveDetailRowPreparing event. */ + onAdaptiveDetailRowPreparing?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies how the end-user chooses columns. */ + mode?: string; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Customizes grid columns and data before exporting. */ + customizeExportData?: (columns: Array, rows: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. +#####See Also##### +- Validation Engine +- Validation Engine - MVVM Approach */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies grouping settings and the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Enables the user to group data using the context menu. */ + contextMenuEnabled?: boolean; + /** Specifies the event on which a group will be expanded/collapsed. */ + expandMode?: string; + groupContinuedMessage?: string; + groupContinuesMessage?: string; + /** Defines the texts of grouping-related visual elements. */ + texts?: { + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + /** Specifies the text of the context menu item that groups data by a specific column. */ + groupByThisColumn?: string; + /** Specifies the text of the context menu item that clears grouping settings of a specific column. */ + ungroup?: string; + /** Specifies the text of the context menu item that clears grouping settings of all columns. */ + ungroupAll?: string; + } + }; + /** Configures the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: any; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: any; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies whether to search all columns or only visible ones. */ + searchVisibleColumnsOnly?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Configures client-side export. */ + export?: { + /** Enables the client-side export feature. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE9 and Safari browsers. */ + proxyUrl?: string; + /** Allows an end user to export selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies the hint of the Export button when the allowExportSelectedData option is true. */ + exportTo?: string; + exportToExcel?: string; + excelFormat?: string; + selectedRows?: string; + /** Specifies the text of the command that exports all data. */ + exportAll?: string; + /** Specifies the text of the drop-down menu command that exports selected rows. */ + exportSelectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** + * Specifies a precision for the summary item value of a numeric format. + * @deprecated Use the valueFormat | precision option instead. + */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: any; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** + * Specifies a precision for the summary item value of a numeric format. + * @deprecated Use the valueFormat | precision option instead. + */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: any; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Checks whether a specific adaptive detail row is expanded or collapsed. */ + isAdaptiveDetailRowExpanded(key: any): void; + /** Expands an adaptive detail row by the key of its parent data row. */ + expandAdaptiveDetailRow(key: any): void; + /** Collapses the currently expanded adaptive detail row (if there is one). */ + collapseAdaptiveDetailRow(): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): JQueryPromise; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow(rowIndex) method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): JQueryPromise; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns how many pages the grid contains. */ + pageCount(): number; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Specifies the area to which data field headers must belong. */ + dataFieldArea?: string; + /** Configures the field panel. */ + fieldPanel?: { + /** Makes fields on the field panel draggable. */ + allowFieldDragging?: boolean; + /** Shows/hides filter fields on the field panel. */ + showFilterFields?: boolean; + /** Shows/hides data fields on the field panel. */ + showDataFields?: boolean; + /** Shows/hides column fields on the field panel. */ + showColumnFields?: boolean; + /** Shows/hides row fields on the field panel. */ + showRowFields?: boolean; + /** Shows/hides the field panel. */ + visible?: boolean; + /** Specifies the placeholders of the field areas. */ + texts?: { + /** Specifies the placeholder of the column field area. */ + columnFieldArea?: string; + /** Specifies the placeholder of the row field area. */ + rowFieldArea?: string; + /** Specifies the placeholder of the filter field area. */ + filterFieldArea?: string; + /** Specifies the placeholder of the data field area. */ + dataFieldArea?: string; + } + } + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether long text in header items should be wrapped. */ + wordWrapEnabled?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies the layout of items in the row header. */ + rowHeaderLayout?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Configures client-side export. */ + export?: { + /** Enables client-side export. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + /** Binds a dxChart to the dxPivotGrid. */ + bindChart(chart: any, integrationOptions?: { + inverted?: boolean; + dataFieldsDisplayMode?: string; + putDataFieldsInto?: string; + alternateDataFields?: boolean; + processCell?: Function; + customizeChart?: Function; + customizeSeries?: Function; + }): any; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies how transparent the vertical crosshair line should be. */ + opacity?: number; + } + export interface Font { + /** Colors the text displayed by the group labels. */ + color?: string; + /** Specifies the font family of the text displayed by the group labels. */ + family?: string; + /** Specifies how transparent the text displayed by the group labels should be. */ + opacity?: number; + /** Specifies the size of the text displayed by the group labels. */ + size?: any; + /** Specifies the font weight of the text displayed by the group labels. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the legend's bottom margin in pixels. */ + bottom?: number; + /** Specifies the legend's left margin in pixels. */ + left?: number; + /** Specifies the legend's right margin in pixels. */ + right?: number; + /** Specifies the legend's bottom margin in pixels. */ + top?: number; + } + export interface MarginOptions { + /** Generates space around the widget. */ + margin?: Margins; + } + export interface RedrawOnResizeOptions { + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + } + export interface TitleOptions { + /** Specifies the widget title. */ + title?: Title; + } + export interface ExportOptions { + /** Configures the exporting and printing features. */ + export?: Export; + } + export interface LoadingIndicatorOptions { + /** Configures the loading indicator. */ + loadingIndicator?: LoadingIndicator; + } + export interface LoadingIndicatorMethods { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + } + export interface Size { + /** Specifies the width of the widget in pixels. */ + width?: number; + /** Specifies the height of the widget in pixels. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the title's alignment in a horizontal direction. */ + horizontalAlignment?: string; + /** Specifies the title's alignment in a vertical direction. */ + verticalAlignment?: string; + /** Generates space around the title. */ + margin?: Margins; + /** Specifies the minimum height that the title occupies. */ + placeholderSize?: number; + /** Specifies the title text. */ + text?: string; + /** Specifies the widget subtitle. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Export { + /** Enables the client-side exporting in the widget. */ + enabled?: boolean; + /** Enables the printing feature in the widget. Applies only if the export | enabled option is true. */ + printingEnabled?: boolean; + /** Specifies a set of formats available for exporting into. */ + formats?: Array; + /** Specifies a default name for the file to which the widget will be exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable exporting in IE9 and Safari browsers. */ + proxyUrl?: string; + /** Specifies the color that will fill transparent regions in the resulting file or document. */ + backgroundColor?: string; + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: DashedBorderWithOpacity; + /** Specifies the color of tooltips. */ + color?: string; + /** Specifies the z-index of tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Allows you to change tooltip appearance. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + enabled?: boolean; + /** Specifies the font of the text displayed by a tooltip. */ + font?: Font; + /** Specifies the format of the value displayed by a tooltip. */ + format?: any; + /** Specifies the opacity of tooltips. */ + opacity?: number; + /** Generates space on the left and the right of the text displayed by a tooltip. */ + paddingLeftRight?: number; + /** Generates space above and below the text displayed by a tooltip. */ + paddingTopBottom?: number; + /** + * Specifies the precision of formatted values in a tooltip. + * @deprecated Use the tooltip | format | precision option instead. + */ + precision?: number; + /** Specifies the appearance of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip itself measured in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip itself measured in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Colors the background of the loading indicator. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies the text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** Specifies the size of the widget in pixels. */ + size?: Size; + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + /** Exports the widget into a document with a specified name and format. */ + exportTo(): void; + /** Opens the browser's print window. */ + print(): void; + /** Redraws the widget. */ + render(): void; + } +} +declare module DevExpress.viz { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label(s) of the series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: any; + /** + * Specifies a precision for formatted point arguments displayed in point labels. + * @deprecated Use the series | label | argumentFormat | precision instead. + */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: any; + position?: string; + /** + * Specifies a precision for formatted point values displayed in point labels. + * @deprecated Use the series | label | format | precision option instead. + */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show labels for points with zero value. Applies only to bar-like series. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Aligns point labels in relation to their points. */ + alignment?: string; + /** Along with verticalOffset, shifts point labels from their initial positions. */ + horizontalOffset?: number; + /** Along with horizontalOffset, shifts point labels from their initial positions. */ + verticalOffset?: number; + /** + * Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. + * @deprecated Use the series | label | format | percentPrecision instead. + */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + label?: ChartSeriesConfigLabel; + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies series elements to be highlighted when a user selects a point. */ + selectionMode?: string; + selectionStyle?: { + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** Substitutes the standard point symbols with an image. */ + image?: { + /** Specifies the height of the image used instead of a point marker. */ + height?: any; + /** Specifies the URL of the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies which data source field provides close values for points of a financial series. */ + closeValueField?: string; + /** Makes bars look rounded. Applies only to bar-like series. */ + cornerRadius?: number; + /** Specifies which data source field provides high values for points of a financial series. */ + highValueField?: string; + /** Specifies a filling color for the body of a series point that visualizes a non-reduced value. Applies only to candlestick series. */ + innerColor?: string; + /** Specifies which data source field provides low values for points of a financial series. */ + lowValueField?: string; + /** Specifies which data source field provides open values for points of a financial series. */ + openValueField?: string; + /** Specifies which pane the series should belong to. Accepts the name of the pane. */ + pane?: string; + point?: ChartCommonPointOptions; + /** Coupled with the rangeValue2Field option, specifies which data source field provides values for a range-like series. */ + rangeValue1Field?: string; + /** Coupled with the rangeValue1Field option, specifies which data source field provides values for a range-like series. */ + rangeValue2Field?: string; + /** Specifies reduction options for financial series. */ + reduction?: { + /** Specifies a color for the points whose price has decreased in comparison to the price of the previous point. */ + color?: string; + /** Specifies whether high, low, open or close prices of points should be compared. */ + level?: string; + }; + /** Specifies which data source field provides size values for bubbles. Required by and applies only to bubble series. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /** Defines common settings for all area series. */ + area?: CommonSeriesConfig; + /** Defines common settings for all bar series. */ + bar?: CommonSeriesConfig; + /** Defines common settings for all bubble series. */ + bubble?: CommonSeriesConfig; + /** Defines common settings for all candlestick series. */ + candlestick?: CommonSeriesConfig; + /** Defines common settings for all full-stacked area series. */ + fullstackedarea?: CommonSeriesConfig; + /** Defines common settings for all full-stacked spline area series. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** Defines common settings for all full-stacked bar series. */ + fullstackedbar?: CommonSeriesConfig; + /** Defines common settings for all full-stacked line series. */ + fullstackedline?: CommonSeriesConfig; + /** Defines common settings for all full-stacked spline series. */ + fullstackedspline?: CommonSeriesConfig; + /** Defines common settings for all line series. */ + line?: CommonSeriesConfig; + /** Defines common settings for all range area series. */ + rangearea?: CommonSeriesConfig; + /** Defines common settings for all range bar series. */ + rangebar?: CommonSeriesConfig; + /** Defines common settings for all scatter series. */ + scatter?: CommonSeriesConfig; + /** Defines common settings for all spline series. */ + spline?: CommonSeriesConfig; + /** Defines common settings for all spline area series. */ + splinearea?: CommonSeriesConfig; + /** Defines common settings for all stacked area series. */ + stackedarea?: CommonSeriesConfig; + /** Defines common settings for all stacked spline area series. */ + stackedsplinearea?: CommonSeriesConfig; + /** Defines common settings for all stacked bar series. */ + stackedbar?: CommonSeriesConfig; + /** Defines common settings for all stacked line series. */ + stackedline?: CommonSeriesConfig; + /** Defines common settings for all stacked spline series. */ + stackedspline?: CommonSeriesConfig; + /** Defines common settings for all step area series. */ + steparea?: CommonSeriesConfig; + /** Defines common settings for all step line series. */ + stepline?: CommonSeriesConfig; + /** Defines common settings for all stock series. */ + stock?: CommonSeriesConfig; + /** Specifies the type of the series. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** + * Specifies a precision for the percentage values displayed in labels. + * @deprecated Use the series | label | format | percentPrecision instead. + */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated Use the innerRadius option instead. + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated Use the segmentsDirection option instead. + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated Use the startAngle option instead. + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated Use the type option instead. + */ + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated Use the type option instead. + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for constant line labels. */ + font?: viz.core.Font; + /** Specifies the position of constant line labels on the chart plot. */ + position?: string; + /** Makes constant line labels visible. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** Configures constant line labels. */ + label?: ChartCommonConstantLineLabel; + /** Generates a pixel-measured empty space between the left/right side of a constant line and the constant line label. */ + paddingLeftRight?: number; + /** Generates a pixel-measured empty space between the top/bottom side of a constant line and the constant line label. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Aligns axis labels in relation to ticks. */ + alignment?: string; + /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ + overlappingBehavior?: { + /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ + mode?: string; + /** Specifies the rotation angle of axis labels. Applies only if the mode option is "rotate". */ + rotationAngle?: number; + /** Adds a pixel-measured empty space between two staggered rows of axis labels. Applies only if the mode option is "stagger". */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for the axis title. */ + font?: viz.core.Font; + /** Adds a pixel-measured empty space between the axis title and axis labels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Configures the appearance of all constant lines in the widget. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Configures axis labels. */ + label?: ChartCommonAxisLabel; + /** Controls the empty space between the maximum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ + maxValueMargin?: number; + /** Controls the empty space between the minimum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ + minValueMargin?: number; + /** Reserves a pixel-measured space for the axis. */ + placeholderSize?: number; + /** Configures the appearance of strips. */ + stripStyle?: { + /** Configures the appearance of strip labels. */ + label?: { + /** Specifies font options for strip labels. */ + font?: viz.core.Font; + /** Aligns strip labels in the horizontal direction. */ + horizontalAlignment?: string; + /** Aligns strip labels in the vertical direction. */ + verticalAlignment?: string; + }; + /** Generates a pixel-measured empty space between the left/right border of a strip and the strip label. */ + paddingLeftRight?: number; + /** Generates a pixel-measured empty space between the top/bottom border of a strip and the strip label. */ + paddingTopBottom?: number; + }; + /** Configures axis titles. */ + title?: CommonAxisTitle; + /** Adds an empty space between the axis and the minimum and maximum series points. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Aligns constant line labels in the horizontal direction. */ + horizontalAlignment?: string; + /** Aligns constant line labels in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the text of a constant line label. By default, equals to the value of the constant line. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the axis labels. + * @deprecated Use the valueAxis | label | format | precision option instead. + */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text of the axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** Specifies the appearance of the labels of those constant lines that belong to the value axis. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** Configures the constant line label. */ + label?: ChartConstantLineLabel; + /** Specifies the value indicated by a constant line. Setting this option is necessary. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Binds the value axis to a pane. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Declares a collection of constant lines belonging to the value axis. */ + constantLines?: Array; + /** Specifies the appearance of those constant lines that belong to the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Configures the labels of the value axis. */ + label?: ChartAxisLabel; + /** Coupled with the min option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ + max?: any; + /** Coupled with the max option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ + min?: any; + /** Relocates the value axis. */ + position?: string; + /** Configures the axis title. */ + title?: any; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Adds a pixel-measured empty space between two side-by-side value axes. Applies if several value axes are located on one side of the chart. */ + multipleAxesSpacing?: number; + /** Synchronizes two or more value axes with each other at a specific value. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies the color of the pane's background. */ + backgroundColor?: string; + /** Configures the pane border. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of the pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Shows/hides the bottom border of the pane. Applies only when the border | visible option is true. */ + bottom?: boolean; + /** Shows/hides the left border of the pane. Applies only when the border | visible option is true. */ + left?: boolean; + /** Shows/hides the right border of the pane. Applies only when the border | visible option is true. */ + right?: boolean; + /** Shows/hides the top border of the pane. Applies only when the border | visible option is true. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies how many series points the widget should have before the animation will be disabled. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: any; + /** + * Specifies a precision for formatted arguments displayed in tooltips. + * @deprecated Use the tooltip | argumentFormat | precision option instead. + */ + argumentPrecision?: number; + /** + * Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. + * @deprecated Use the tooltip | format | percentPrecision option instead. + */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the widget's width small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the widget's height small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels should be kept when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Customizes the appearance of an individual point label. */ + customizeLabel?: (pointInfo: Object) => Object; + /** Customizes the appearance of an individual series point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies the origin of data for the widget. */ + dataSource?: any; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Configures tooltips. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Hides all widget tooltips. */ + hideTooltip(): void; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a series point or on its edge. Applies to bar-like and bubble series only. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies whether or not to adjust the value axis when zooming the widget. */ + adjustOnZoom?: boolean; + /** Configures the argument axis. */ + argumentAxis?: ChartArgumentAxis; + /** Defines common settings for both the argument and value axis in a chart. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** Defines common settings for all panes in a chart. */ + commonPaneSettings?: CommonPane; + /** Specifies settings common for all series in the chart. */ + commonSeriesSettings?: CommonSeriesSettings; + /** Configures the crosshair feature. */ + crosshair?: { + /** Specifies the color of the crosshair lines. */ + color?: string; + /** Specifies the dash style of the crosshair lines. */ + dashStyle?: string; + /** Enables the crosshair. */ + enabled?: boolean; + /** Specifies how transparent the crosshair lines should be. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Configures the horizontal crosshair line individually. */ + horizontalLine?: CrosshaierWithLabel; + /** Configures the vertical crosshair line individually. */ + verticalLine?: CrosshaierWithLabel; + /** Configures the crosshair labels. */ + label?: { + /** Paints the background of the crosshair labels. */ + backgroundColor?: string; + /** Makes the crosshair labels visible. Applies only if the crosshair feature is enabled. */ + visible?: boolean; + /** Specifies font options for the crosshair labels. */ + font?: viz.core.Font; + /** Formats the point value/argument before it will be displayed in the crosshair label. */ + format?: any; + /** + * Specifies a precision for formatted values. + * @deprecated Use the crosshair | label | format | precision option instead. + */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies which pane should be used by default. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Declares a collection of panes. */ + panes?: Array; + /** Swaps the axes around making the value axis horizontal and the argument axis vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** A handler for the zoomStart event. */ + onZoomStart?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the zoomEnd event. */ + onZoomEnd?: (e: { + component: BaseChart; + element: Element; + rangeStart: any; + rangeEnd: any; + }) => void; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + tooltip?: ChartTooltip; + /** Configures the value axis. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Paints the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Makes the label of the horizontal crosshair line visible. Applies only if the crosshair feature is enabled and the horizontal line is visible. */ + visible?: boolean; + /** Specifies font options for the label of the horizontal crosshair line. */ + font?: viz.core.Font; + /** Formats the point value before it will be displayed in the crosshair label. */ + format?: any; + /** + * Specifies a precision for formatted values. + * @deprecated Use the crosshair | horizontalLine | label | format | precision option instead. + */ + precision?: number; + /** Customizes the text displayed by the label that belongs to the horizontal crosshair line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } +} +declare module DevExpress.viz { + /** A widget providing charts of various types for web applications. */ + export class dxChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + /** A circular chart widget for web applications. */ + export class dxPieChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxPieChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated Use the getAllSeries() method instead. + */ + getSeries(): DevExpress.viz.charts.PieSeries; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxPolarChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxPolarChartOptions); + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated Use the scale | customMinorTicks option instead. + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This feature is no longer available. + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated Use the scale | minorTickInterval option instead. + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated Use the overlappingBehavior | useAutoArrangement option instead. + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the scale labels. + * @deprecated Use the scale | label | format | precision option instead. + */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This feature is no longer available. + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This feature is no longer available. + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This feature is no longer available. + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated Use the tick option instead. + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: any; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** + * Specifies a precision for the formatted value displayed by an indicator. + * @deprecated Use the text | format | precision option instead. + */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: any; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions extends viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** + * Specifies a subtitle for the widget. + * @deprecated Use the title | subtitle option instead. + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated Use the title | subtitle | font option instead. + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated Use the title | subtitle | text option instead. + */ + text?: string; + }; + /** Configures tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: any; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** + * Specifies a precision for the formatted value displayed by labels. + * @deprecated Use the label | format | precision option instead. + */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } +} +declare module DevExpress.viz { + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends DevExpress.viz.gauges.dxBaseGauge { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends DevExpress.viz.gauges.dxBaseGauge { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxBarGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxBarGaugeOptions); + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the scale labels. + * @deprecated Use the scale | label | format | precision option instead. + */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated Use the tickInterval option instead. + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: any; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated Use the minorTick | visible option instead. + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: any; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the paddingTopBottom and paddingLeftRight options instead. + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the placeholderHeight and indent options instead. + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** + * Specifies a precision for the formatted value displayed in slider markers. + * @deprecated Use the sliderMarker | format | precision option instead. + */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } +} +declare module DevExpress.viz { + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); + constructor(element: Element, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the Layer Element instead. + */ + export interface Area { + /** + * Contains the element type. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the Layer Element instead. + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text using the Layer Element | attribute(name) method. The name parameter value for text is set at the dataField option. + */ + text: string; + /** + * Contains the type of the element. + * @deprecated Use the Layer | type instead. + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the image URL using the Layer Element | attribute(name) method. The name parameter value for the image URL is set at the dataField option. + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the bubble value using the Layer Element | attribute(name) method. The name parameter for the bubble value is set at the dataField option. + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the pie values using the Layer Element | attribute(name) method. The name parameter for pie values is set at the dataField option. + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated Use the Layer Element | attribute(name, value) method instead. + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated Use the Layer Element | coordinates() method instead. + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the Layer Element | selected() method instead. + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the Layer Element | selected(state) method instead. + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated Use the Layer Element | applySettings(settings) method instead. + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + dataSource?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the data source attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated Use the layers | label | dataField option instead. + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated Use the layers | paletteSize option instead. + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated Use the layers | borderColor option instead. + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated Use the layers | borderWidth option instead. + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated Use the layers | color option instead. + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated Use the layers | customize option instead. + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderWidth option instead. + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated Use the layers | hoveredBorderColor option instead. + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated Use the layers | hoveredColor option instead. + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated Use the layers | hoverEnabled option instead. + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated Use the layers | label option instead. + */ + label?: { + /** + * Enables marker labels. + * @deprecated Use the layers | label | enabled option instead. + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated Use the layers | label | font option instead. + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | maxSize option instead. + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | minSize option instead. + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated Use the layers | opacity option instead. + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderWidth option instead. + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated Use the layers | selectedBorderColor option instead. + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated Use the layers | selectedColor option instead. + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated Use the layers | selectionMode option instead. + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated Use the layers | size option instead. + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated Use the layers | elementType option instead. + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated Use the layers | palette option instead. + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated Use the layers | colorGroups option instead. + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated Use the layers | colorGroupingField option instead. + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated Use the layers | sizeGroups option instead. + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated Use the layers | sizeGroupingField option instead. + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the "area" type element of the layers array. + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the control bar. */ + opacity?: number; + }; + /** + * Specifies a data source for the map area. + * @deprecated Use the layers | dataSource option instead. + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the layers | dataSource option instead. + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the "marker" type element of the layers array. + */ + markerSettings?: MarkerSettings; + /** Configures tooltips. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the onClick option instead. + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the onSelectionChanged option instead. + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the onClick option instead. + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the onSelecitonChanged option instead. + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies the shape of item markers. */ + markerShape?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +declare module DevExpress.viz{ + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.map.dxVectorMapOptions); + constructor(element: Element, options?: DevExpress.viz.map.dxVectorMapOptions); + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the layer's clearSelection() method instead. + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): DevExpress.viz.map.MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): DevExpress.viz.map.MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the layer's getElements() method instead. + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the layer's getElements() method instead. + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no longer useful because the tooltips are aligned automatically. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions { + /** Configures the tooltip. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + } + export interface dxBulletOptions extends BaseSparklineOptions { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: any; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } +} +declare module DevExpress.viz { + /** A bullet graph widget. */ + export class dxBullet extends DevExpress.viz.sparklines.BaseSparkline { + constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxBulletOptions); + constructor(element: Element, options?: DevExpress.viz.sparklines.dxBulletOptions); + } + /** A sparkline widget. */ + export class dxSparkline extends DevExpress.viz.sparklines.BaseSparkline { + constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxSparklineOptions); + constructor(element: Element, options?: DevExpress.viz.sparklines.dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.dxSparkline; +} +declare module DevExpress.viz.treeMap { + export interface dxTreeMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies the origin of data for the widget. */ + dataSource?: any; + /** Specifies the name of the data source field that provides nested items for a group. Applies to hierarchical data sources only. */ + childrenField?: string; + /** Specifies the name of the data source field that provides values for tiles. */ + valueField?: string; + /** Specifies the name of the data source field that provides colors for tiles. */ + colorField?: string; + /** Specifies the name of the data source field that provides texts for tile and group labels. */ + labelField?: string; + /** Specifies the name of the data source field that provides IDs for items. Applies to flat data sources only. */ + idField?: string; + /** Specifies the name of the data source field that provides parent IDs for items. Applies to flat data sources only. */ + parentField?: string; + /** Specifies the layout algorithm. */ + layoutAlgorithm?: any; + /** Specifies the direction in which the items will be laid out. */ + layoutDirection?: string; + /** Configures tiles. */ + tile?: { + /** Configures the tile borders. */ + border?: { + /** Specifies the width of the tile borders in pixels. */ + width?: number; + /** Colors the tile borders. */ + color?: string; + }; + /** Specifies a single color for all tiles. */ + color?: string; + /** Specifies the appearance of tiles in the hover state. */ + hoverStyle?: { + /** Configures the appearance of the tile borders in the hover state. */ + border?: { + /** Specifies the width of the tile borders in pixels. Applies to a tile in the hover state. */ + width?: number; + /** Colors the tile borders in the hover state. */ + color?: string; + }; + /** Colors tiles in the hover state. */ + color?: string; + }; + /** Specifies the appearance of tiles in the selected state. */ + selectionStyle?: { + /** Configures the appearance of the tile borders in the selected state. */ + border?: { + /** Specifies the width of the tile borders in pixels. Applies to a tile in the selected state. */ + width?: number; + /** Colors the tile borders in the selected state. */ + color?: string; + }; + /** Colors tiles in the selected state. */ + color?: string; + }; + /** Configures the tile labels. */ + label?: { + /** Changes the visibility of the tile labels. */ + visible?: boolean; + /** Specifies the font settings of the tile labels. */ + font?: viz.core.Font; + }; + }; + /** Configures groups. */ + group?: { + /** Specifies the height of the group headers in pixels. */ + headerHeight?: number; + /** Configures the group borders. */ + border?: { + /** Specifies the width of the group borders in pixels. */ + width?: number; + /** Colors the group borders. */ + color?: string; + }; + /** Colors the group headers. */ + color?: string; + /** Specifies the appearance of groups in the hover state. */ + hoverStyle?: { + /** Configures the appearance of the group borders in the hover state. */ + border?: { + /** Specifies the width of the group borders in pixels. Applies to a group in the hover state. */ + width?: number; + /** Colors the group borders in the hover state. */ + color?: string; + }; + /** Colors the group headers in the hover state. */ + color?: string; + }; + /** Specifies the appearance of groups in the selected state. */ + selectionStyle?: { + /** Configures the appearance of the group borders in the selected state. */ + border?: { + /** Specifies the width of the group borders in pixels. Applies to a group in the selected state. */ + width?: number; + /** Colors the group borders in the selected state. */ + color?: string; + }; + /** Colors the group headers in the selected state. */ + color?: string; + }; + /** Configures the group labels. */ + label?: { + /** Changes the visibility of the group labels. */ + visible?: boolean; + /** Specifies the font settings of the group labels. */ + font?: viz.core.Font; + }; + }; + /** Manages the color settings. */ + colorizer?: { + /** Specifies the colorizing algorithm. */ + type?: string; + /** Sets the palette to be used for colorizing tiles. */ + palette?: any; + /** Specifies whether or not all tiles in a group must be colored uniformly. Applies only if the type option is "discrete". */ + colorizeGroups?: boolean; + /** Allows you to paint tiles with similar values uniformly. Applies only if the type option is "gradient" or "range". */ + range?: Array; + /** Specifies the name of the data source field whose values define the color of a tile. Applies only if the type option is "gradient" or "range". */ + colorCodeField?: string; + }; + /** Specifies whether tiles and groups change their style in the hover state. */ + hoverEnabled?: boolean; + /** Specifies whether a single or multiple nodes can be in the selected state simultaneously. */ + selectionMode?: string; + /** Specifies how many hierarchical levels must be visualized. */ + maxDepth?: number; + /** Specifies whether the user will interact with a single tile or its group. */ + interactWithGroup?: boolean; + tooltip?: viz.core.Tooltip; + /** A handler for the nodesInitialized event. */ + onNodesInitialized?: (e: { + component: dxTreeMap; + element: Element; + root: TreeMapNode + }) => void; + /** A handler for the nodesRendering event. */ + onNodesRendering?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the hoverChanged event. */ + onHoverChanged?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode; + }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode; + }) => void; + /** A handler for the drill event. */ + onDrill?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode + }) => void; + } + /** This section describes fields and methods that can be used in code to manipulate a Node object. */ + export interface TreeMapNode { + /** The level that the current node occupies in the hierarchy of nodes. */ + level: number; + /** The index of the current node in the array of all nodes on the same level. */ + index: number; + /** The object from the data source visualized by the node. */ + data: Object; + /** Returns the parent node of the current node. */ + getParent(): TreeMapNode; + /** Indicates how many direct descendants the current node has. */ + getChildrenCount(): number; + /** Returns all nodes nested in the current node. */ + getAllChildren(): Array; + /** Returns all descendant nodes. */ + getAllNodes(): Array; + /** Gets a specific node from a collection of direct descendants. */ + getChild(index: number): TreeMapNode; + /** Gets the raw value of the node. */ + value(): number; + /** Returns the label of the node. */ + label(): string; + /** Sets the label to the node. */ + label(label: string): void; + /** Customizes the node. */ + customize(options: any): void; + /** Reverts the appearance of the node to the initial state. */ + resetCustomization(): void; + /** Indicates whether the node is in the hover state or not. */ + isHovered(): boolean; + /** Sets the selection state of a node. */ + select(state: boolean): void; + /** Indicates whether the node is selected or not. */ + isSelected(): boolean; + /** Indicates whether the node is visualized by a tile or a group of tiles. */ + isLeaf(): boolean; + /** Indicates whether the current node is active. */ + isActive(): boolean; + /** Shows the tooltip. */ + showTooltip(): void; + /** Drills down into the node. */ + drillDown(): void; + } +} +declare module DevExpress.viz { + /** A widget for displaying hierarchical data by using nested rectangles. */ + export class dxTreeMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.treeMap.dxTreeMapOptions); + constructor(element: Element, options?: DevExpress.viz.treeMap.dxTreeMapOptions); + /** Returns the root node. */ + getRootNode(): DevExpress.viz.treeMap.TreeMapNode; + /** Returns the current node. */ + getCurrentNode(): DevExpress.viz.treeMap.TreeMapNode; + /** Deselects all nodes in the widget. */ + clearSelection(): void; + /** Hides the tooltip. */ + hideTooltip(): void; + /** Drills one level up. */ + drillUp(): void; + /** Resets the drill down level. */ + resetDrillDown(): void; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + } +} +interface JQuery { + dxTreeMap(options?: DevExpress.viz.treeMap.dxTreeMapOptions): JQuery; + dxTreeMap(methodName: string, ...params: any[]): any; + dxTreeMap(methodName: "instance"): DevExpress.viz.dxTreeMap; +} diff --git a/devextreme/devextreme-tests.ts b/devextreme/devextreme-tests.ts index a38aae1f05..8d9bd5bc5b 100644 --- a/devextreme/devextreme-tests.ts +++ b/devextreme/devextreme-tests.ts @@ -258,12 +258,12 @@ namespace Tests.viz { title: 'Long PieChart\'s Title' }; - new DevExpress.viz.charts.dxChart($("chart"), chartOptions); - new DevExpress.viz.charts.dxChart($("#chart").get(0), chartOptions); + new DevExpress.viz.dxChart($("chart"), chartOptions); + new DevExpress.viz.dxChart($("#chart").get(0), chartOptions); $("#chart").dxChart(chartOptions); - new DevExpress.viz.charts.dxPieChart($("#pie-chart"), pieChartOptions); - new DevExpress.viz.charts.dxPieChart($("#pie-chart").get(0), pieChartOptions); + new DevExpress.viz.dxPieChart($("#pie-chart"), pieChartOptions); + new DevExpress.viz.dxPieChart($("#pie-chart").get(0), pieChartOptions); $("#pie-chart").dxPieChart(pieChartOptions); } diff --git a/devextreme/index.d.ts b/devextreme/index.d.ts index bbf6eaad76..6aae49d6cd 100644 --- a/devextreme/index.d.ts +++ b/devextreme/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExtreme 15.2.10 +// Type definitions for DevExtreme 16.1.8 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,6 +6,19 @@ /// declare module DevExpress { + /** Formats values. */ + export interface Format { + /** Specifies a predefined format. */ + type?: String; + /** Specifies the currency code for the 'currency' format. */ + currency?: String; + /** Specifies a precision for values of a numeric format. */ + precision?: number; + /** Parses string values into numeric or date-time values. */ + parser?: (value: any) => any; + /** Specifies a custom format. */ + formatter?: (value: any) => any; + } /** A mixin that provides a capability to fire and subscribe to events. */ export interface EventsMixin { /** Subscribes to a specified event. */ @@ -55,25 +68,34 @@ declare module DevExpress { export function resetGroup(): void; /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ export function validateModel(model: Object): ValidationGroupValidationResult; - /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ - export function registerModelForValidation(model: Object) : void; + /** Registers all the dxValidator objects extending fields of the specified ViewModel. */ + export function registerModelForValidation(model: Object): void; + /** Unregisters all the dxValidator objects extending fields of the specified ViewModel. */ + export function unregisterModelForValidation(model: Object): void; } export var hardwareBackButton: JQueryCallback; /** Processes the hardware back button click. */ export function processHardwareBackButton(): void; /** Hides the last displayed overlay widget. */ export function hideTopOverlay(): boolean; - /** Specifies whether or not the entire application/site supports right-to-left representation. */ + /** + * Specifies whether or not the entire application/site supports right-to-left representation. + * @deprecated Use the config(config) method instead. + */ export var rtlEnabled: boolean; - /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + /** Gets the current global configuration object. */ + export function config(): Object; + /** Sets the global configuration object. */ + export function config(config: Object): void; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, AngularJS directive and Knockout binding. */ export function registerComponent(name: string, componentClass: Object): void; - /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + /** Registers a new component in the specified namespace as a jQuery plugin, AngularJS directive and Knockout binding. */ export function registerComponent(name: string, namespace: Object, componentClass: Object): void; export function requestAnimationFrame(callback: Function): number; export function cancelAnimationFrame(requestID: number): void; /** Custom Knockout binding that links an HTML element with a specific action. */ export class Action { } - /** Used to get URLs that vary in a locally running application and the application running on production. */ + /** An object used to manage OData endpoints in your application. */ export class EndpointSelector { constructor(options: { [key: string]: { @@ -81,7 +103,7 @@ declare module DevExpress { production?: string; } }); - /** Returns a local or a productional URL depending on how the application is currently running. */ + /** Returns an endpoint for the specified key. */ urlFor(key: string): string; } /** An object that serves as a namespace for the methods that are used to animate UI elements. */ @@ -96,7 +118,7 @@ declare module DevExpress { staggerDelay?: number; /** A number specifying the time in milliseconds spent on animation. */ duration?: number; - /** A string specifying the type of an easing function used for animation. */ + /** A string specifying the easing function for animation. */ easing?: string; /** Specifies the initial animation state. */ from?: any; @@ -170,7 +192,7 @@ declare module DevExpress { } export class Devices implements EventsMixin { constructor(options: { window: Window }); - /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + /** Overrides actual device information to force the application to operate as if it was running on a specified device. */ current(deviceName: any): void; /** Returns information about the current device. */ current(): Device; @@ -194,7 +216,7 @@ declare module DevExpress { /** The target element position that the widget is positioned against. */ at?: any; /** The element within which the widget is positioned. */ - boundary?: Object; + boundary?: any; /** Specifies the horizontal and vertical offset from the window's boundaries. */ boundaryOffset?: any; /** Specifies how to move the widget if it overflows the screen. */ @@ -202,7 +224,7 @@ declare module DevExpress { /** The position of the widget to align against the target element. */ my?: any; /** The target element that the widget is positioned against. */ - of?: Object; + of?: any; /** Specifies horizontal and vertical offset in pixels. */ offset?: any; } @@ -217,9 +239,9 @@ declare module DevExpress { /** A base class for all components and widgets. */ export class Component { constructor(options?: ComponentOptions) - /** Prevents the component from refreshing until the endUpdate method is called. */ + /** Prevents the component from refreshing until the endUpdate() method is called. */ beginUpdate(): void; - /** Enables the component to refresh after the beginUpdate method call. */ + /** Enables the component to refresh after the beginUpdate() method call. */ endUpdate(): void; /** Returns an instance of this component class. */ instance(): Component; @@ -460,7 +482,7 @@ declare module DevExpress { isLoading(): boolean; /** Returns the array of items currently operated by the DataSource. */ items(): Array; - /** Returns the key expression. */ + /** Returns the key expression specified by the key configuration option of the underlying Store. */ key(): any; /** Starts loading data. */ load(): OperationPromise>; @@ -585,9 +607,9 @@ declare module DevExpress { }) => void; /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ jsonp?: boolean; - /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, Boolean, Single, Decimal and Guid. */ keyType?: any; - /** Specifies whether or not dates found in the response are deserialized. */ + /** Specifies whether or not dates in a response are deserialized. */ deserializeDates?: boolean; /** Specifies the URL of the data service being accessed via the current ODataContext. */ url?: string; @@ -834,6 +856,8 @@ declare module DevExpress { export function currentTheme(platform: string, colorScheme: string): void; /** Registers a new theme based on the existing one. */ export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Allows you to export widgets using their SVG markup. */ + export function exportFromMarkup(markup: string, options: Object): void; /** Applies a predefined or registered custom palette to all visualization widgets at once. */ export function currentPalette(paletteName: string): void; /** Obtains the color sets of a predefined or registered palette. */ @@ -843,13 +867,27 @@ declare module DevExpress { } } declare module DevExpress.ui { + export interface dxValidatorValidationAdapter { + /** A function that returns the value to be validated. */ + getValue?: Function; + /** The jQuery.Callbacks() object that is fired when the specified value should be validated. */ + validationRequestsCallbacks?: JQueryCallback; + /** A function that the Validator widget calls after validating a specified value. */ + applyValidationResults?: (params: validationEngine.ValidatorValidationResult) => void; + /** A function that resets the validated values. */ + reset?: Function; + /** A function that sets focus to the validated editors when the ValidationSummary is focused. */ + focus?: Function; + /** A function that returns a Boolean value specifying whether or not to bypass validation. */ + bypass?: Function; + } export interface dxValidatorOptions extends DOMComponentOptions { /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ validationRules?: Array; /** Specifies the editor name to be used in the validation default messages. */ name?: string; - /** An object that specifies what and when to validate and how to apply the validation result. */ - adapter?: Object; + /** An object that specifies what and when to validate, and how to apply the validation result. */ + adapter?: dxValidatorValidationAdapter; /** Specifies the validation group the editor will be related to. */ validationGroup?: string; /** A handler for the validated event. */ @@ -864,7 +902,7 @@ declare module DevExpress.ui { /** Resets the value and validation result of the editor associated with the current dxValidator object. */ reset(): void; } - /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + /** The widget that is used in the Knockout and AngularJS approaches to combine the editors to be validated. */ export class dxValidationGroup extends DOMComponent { constructor(element: JQuery); constructor(element: Element); @@ -967,14 +1005,14 @@ declare module DevExpress.ui { /** An object that defines the animation options used when the widget is being hidden. */ hide?: fx.AnimationOptions; }; - /** The time span in milliseconds during which the dxToast widget is visible. */ + /** The time span in milliseconds during which the Toast widget is visible. */ displayTime?: number; height?: any; - /** The dxToast message text. */ + /** The Toast message text. */ message?: string; position?: PositionOptions; shading?: boolean; - /** Specifies the dxToast widget type. */ + /** Specifies the Toast widget type. */ type?: string; width?: any; closeOnBackButton?: boolean; @@ -1061,6 +1099,12 @@ declare module DevExpress.ui { export interface dxTextAreaOptions extends dxTextBoxOptions { /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ spellcheck?: boolean; + /** Specifies the minimum height of the widget. */ + minHeight?: any; + /** Specifies the maximum height of the widget. */ + maxHeight?: any; + /** A Boolean value specifying whether or not the auto resizing mode is enabled. */ + autoResizeEnabled?: boolean; } /** A widget used to display and edit multi-line text. */ export class dxTextArea extends dxTextBox { @@ -1091,9 +1135,9 @@ declare module DevExpress.ui { onTitleRendered?: Function; /** The template to be used for rendering an item title. */ itemTitleTemplate?: any; - /** A Boolean value specifying if the list is scrolled by content. */ + /** A Boolean value specifying if tabs in the title are scrolled by content. */ scrollByContent?: boolean; - /** A Boolean value specifying whether to enable or disable scrolling. */ + /** A Boolean indicating whether or not to add scrolling support for tabs in the title. */ scrollingEnabled?: boolean; /** A Boolean value that specifies the availability of navigation buttons. */ showNavButtons?: boolean; @@ -1111,7 +1155,11 @@ declare module DevExpress.ui { /** The text that is provided as a hint in the select box editor. */ placeholder?: string; /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - fieldEditEnabled?: boolean; + acceptCustomValue?: boolean; + /** Specifies whether or not to display selection controls. */ + showSelectionControls?: boolean; + /** A handler for the customItemCreating event. */ + onCustomItemCreating?: Function; } /** A widget that allows you to select an item in a dropdown list. */ export class dxSelectBox extends dxDropDownList { @@ -1119,10 +1167,23 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxSelectBoxOptions); } export interface dxTagBoxOptions extends dxSelectBoxOptions { - /** Holds the list of selected values. */ values?: Array; - /** A read-only option that holds the last selected value. */ - value?: Object; + /** Specifies the selected items. */ + value?: Array; + /** Gets the currently selected items. */ + selectedItems?: Array; + /** Specifies how the widget applies values. */ + applyValueMode?: string; + /** A Boolean value specifying whether or not to hide selected items. */ + hideSelectedItems?: boolean; + /** A handler for the selectAllValueChanged event. */ + onSelectAllValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is multiline. */ + multiline?: boolean; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The template to be used for rendering tags. */ + tagTemplate?: any; } /** A widget that allows you to select multiple items from a dropdown list. */ export class dxTagBox extends dxSelectBox { @@ -1223,7 +1284,7 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxRadioGroupOptions); constructor(element: Element, options?: dxRadioGroupOptions); } - export interface dxPopupButtonOptions { + export interface dxPopupToolbarItemOptions { /** Specifies whether or not a toolbar item must be displayed disabled. */ disabled?: boolean; /** Specifies html code inserted into the toolbar item element. */ @@ -1246,6 +1307,14 @@ declare module DevExpress.ui { export interface dxPopupOptions extends dxOverlayOptions { /** Specifies whether or not to allow a user to drag the popup window. */ dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ fullScreen?: boolean; position?: PositionOptions; @@ -1257,7 +1326,7 @@ declare module DevExpress.ui { titleTemplate?: any; width?: any; /** Specifies items displayed on the top or bottom toolbar of the popup window. */ - buttons?: Array; + toolbarItems?: Array; /** Specifies whether or not the widget displays the Close button. */ showCloseButton?: boolean; /** A handler for the titleRendered event. */ @@ -1269,7 +1338,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxPopupOptions); } export interface dxPopoverOptions extends dxPopupOptions { - /** An object that defines the animation options of the widget. */ + /** An object defining the animation options of the widget. */ animation?: { /** An object that defines the animation options used when the widget is being shown. */ show?: fx.AnimationOptions; @@ -1296,7 +1365,7 @@ declare module DevExpress.ui { show(target?: any): JQueryPromise; } export interface dxOverlayOptions extends WidgetOptions { - /** An object that defines the animation options of the widget. */ + /** An object defining the animation options of the widget. */ animation?: { /** An object that defines the animation options used when the widget is being shown. */ show?: fx.AnimationOptions; @@ -1313,8 +1382,6 @@ declare module DevExpress.ui { deferRendering?: boolean; /** Specifies whether or not an end-user can drag the widget. */ dragEnabled?: boolean; - /** Specifies whether or not an end user can resize the widget. */ - resizeEnabled?: boolean; /** The height of the widget in pixels. */ height?: any; /** Specifies the maximum height the widget can reach while resizing. */ @@ -1327,12 +1394,6 @@ declare module DevExpress.ui { minWidth?: any; /** A handler for the hidden event. */ onHidden?: Function; - /** A handler for the resizeStart event. */ - onResizeStart?: Function; - /** A handler for the resize event. */ - onResize?: Function; - /** A handler for the resizeEnd event. */ - onResizeEnd?: Function; /** A handler for the hiding event. */ onHiding?: Function; /** An object defining widget positioning options. */ @@ -1382,6 +1443,8 @@ declare module DevExpress.ui { value?: number; /** The "mode" attribute value of the actual HTML input element representing the widget. */ mode?: string; + /** Specifies the text of the message displayed if the specified value is not a number. */ + invalidValueMessage?: string; } /** A textbox widget that enables a user to enter numeric values. */ export class dxNumberBox extends dxTextEditor { @@ -1413,15 +1476,43 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxMultiViewOptions); constructor(element: Element, options?: dxMultiViewOptions); } + export interface dxMapLocation { + /** The latitude location of the widget. */ + lat?: number; + /** The longitude location of the widget. */ + lng?: number; + } + export interface dxMapMarker { + /** A URL pointing to the custom icon to be used for the marker. */ + iconSrc?: string; + /** Specifies the marker location. */ + location?: dxMapLocation; + /** A callback function performed when the marker is clicked. */ + onClick?: Function; + /** A tooltip to be used for the marker. */ + tooltip?: { + /** Specifies whether a tooltip is visible by default or not. */ + isShown?: boolean; + /** Specifies the tooltip text. */ + text?: string; + } + } + export interface dxMapRoute { + /** Specifies the color of the line displaying the route. */ + color?: string; + /** Specifies a transportation mode to be used in the displayed route. */ + mode?: string; + /** Specifies the opacity of the line displaying the route. */ + opacity?: number; + /** Contains an array of objects making up the route. */ + locations?: Array; + /** Specifies the thickness of the line displaying the route in pixels. */ + weight?: number; + } export interface dxMapOptions extends WidgetOptions { /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ autoAdjust?: boolean; - center?: { - /** The latitude location displayed in the center of the widget. */ - lat?: number; - /** The longitude location displayed in the center of the widget. */ - lng?: number; - }; + center?: dxMapLocation; /** A handler for the click event. */ onClick?: any; /** Specifies whether or not map widget controls are available. */ @@ -1444,7 +1535,7 @@ declare module DevExpress.ui { /** A handler for the markerRemoved event. */ onMarkerRemoved?: Function; /** An array of markers displayed on a map. */ - markers?: Array; + markers?: Array; /** The name of the current map data provider. */ provider?: string; /** A handler for the ready event. */ @@ -1454,7 +1545,7 @@ declare module DevExpress.ui { /** A handler for the routeRemoved event. */ onRouteRemoved?: Function; /** An array of routes shown on the map. */ - routes?: Array; + routes?: Array; /** The type of a map to display. */ type?: string; /** Specifies the width of the widget. */ @@ -1548,7 +1639,7 @@ declare module DevExpress.ui { titleTemplate?: any; /** Specifies whether or not the widget uses native scrolling. */ useNativeScrolling?: boolean; - /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + /** Specifies whether or not to show lookup contents in a Popover widget. */ usePopover?: boolean; /** A handler for the valueChanged event. */ onValueChanged?: Function; @@ -1581,6 +1672,8 @@ declare module DevExpress.ui { showPane?: boolean; /** The width of the widget. */ width?: number; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; } /** A widget used to indicate whether or not an element is loading. */ export class dxLoadPanel extends dxOverlay { @@ -1596,11 +1689,10 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxLoadIndicatorOptions); constructor(element: Element, options?: dxLoadIndicatorOptions); } - /** An object containing items for a context menu called for a list item. */ export interface ListOptionsMenuItem { /** Specifies the menu item text. */ text?: string; - /** Specifies the function called when the menu item is clicked. */ + /** Holds on a function called when the item is clicked. */ action?: (itemElement: Element, itemData: any) => void; } export interface dxListOptions extends CollectionWidgetOptions { @@ -1660,7 +1752,8 @@ declare module DevExpress.ui { /** Specifies item selection mode. */ selectionMode?: string; selectAllText?: string; - onSelectAllChanged?: Function; + /** A handler for the selectAllValueChanged event. */ + onSelectAllValueChanged?: Function; /** Specifies the array of items for a context menu called for a list item. */ menuItems?: Array; /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ @@ -1768,8 +1861,9 @@ declare module DevExpress.ui { onOpened?: Function; /** Specifies whether or not the drop-down editor is displayed. */ opened?: boolean; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ fieldEditEnabled?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + acceptCustomValue?: boolean; /** Specifies the way an end-user applies the selected value. */ applyValueMode?: string; /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ @@ -1792,10 +1886,12 @@ declare module DevExpress.ui { content(): JQuery; } export interface dxDateBoxOptions extends dxTextEditorOptions { - /** A format used to display date/time information. */ + formatString?: any; + /** Specifies the date display format. Applies only if the pickerType option is 'native' */ + displayFormat?: any; format?: string; - /** A Globalize format string specifying the date display format. */ - formatString?: string; + /** A format used to display date/time information. */ + type?: string; /** The last date that can be selected within the widget. */ max?: any; /** The minimum date that can be selected within the widget. */ @@ -1820,7 +1916,7 @@ declare module DevExpress.ui { maxZoomLevel?: string; /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ minZoomLevel?: string; - /** Specifies the type of date/time picker. */ + /** Specifies the type of the date/time picker. */ pickerType?: string; /** Specifies the message displayed if the typed value is not a valid date or time. */ invalidDateMessage?: string; @@ -1828,6 +1924,8 @@ declare module DevExpress.ui { dateOutOfRangeMessage?: string; /** The text displayed on the Apply button. */ applyButtonText?: string; + /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ + adaptivityEnabled?: boolean; /** The text displayed on the Cancel button. */ cancelButtonText?: string; } @@ -1884,7 +1982,7 @@ declare module DevExpress.ui { /** Specifies the icon to be displayed on the button. */ icon?: string; iconSrc?: string; - /** A template to be used for rendering the dxButton widget. */ + /** A template to be used for rendering the Button widget. */ template?: any; /** The text displayed on the button. */ text?: string; @@ -1954,12 +2052,10 @@ declare module DevExpress.ui { collapsible?: boolean; /** Specifies whether the widget can expand several items or only a single item at once. */ multiple?: boolean; - /** The template to be used for rendering dxAccordion items. */ + /** The template to be used for rendering Accordion items. */ itemTemplate?: any; /** A handler for the itemTitleClick event. */ onItemTitleClick?: any; - /** A handler for the itemTitleHold event. */ - onItemTitleHold?: Function; /** The template to be used for rendering an item title. */ itemTitleTemplate?: any; /** The index number of the currently selected item. */ @@ -1980,8 +2076,7 @@ declare module DevExpress.ui { } export interface dxFileUploaderOptions extends EditorOptions { /** A read-only option that holds a File instance representing the selected file. */ - value?: File; - /** Holds the File instances representing files selected in the widget. */ + value?: Array; values?: Array; buttonText?: string; /** The text displayed on the button that opens the file browser. */ @@ -2012,12 +2107,20 @@ declare module DevExpress.ui { uploadFailedMessage?: string; /** Specifies how the widget uploads files. */ uploadMode?: string; + /** Specifies the method for the upload request. */ + uploadMethod?: string; + /** Specifies headers for the upload request. */ + uploadHeaders?: Object; + /** A handler for the uploadStarted event. */ + onUploadStarted?: Function; /** A handler for the uploaded event. */ onUploaded?: Function; /** A handler for the uploaded event. */ onProgress?: Function; /** A handler for the uploadError event. */ onUploadError?: Function; + /** A handler for the uploadAborted event. */ + onUploadAborted?: Function; /** A handler for the valueChanged event. */ onValueChanged?: Function; } @@ -2147,13 +2250,26 @@ declare module DevExpress.ui { /** An array of validation rules to be checked for the form item editor. */ validationRules?: Array; } + /** Specifies dependency between the screen factor and the count of columns. */ + export interface ColCountResponsible { + /** The count of columns for an extra small-sized screen. */ + xs?: number; + /** The count of columns for a small-sized screen. */ + sm?: number; + /** The count of columns for a middle-sized screen. */ + md?: number; + /** The count of columns for a large screen size. */ + lg?: number; + } export interface dxFormGroupItem extends dxFormItem { /** Specifies the group caption. */ caption?: string; - /** A template to be used for rendering the group item. */ + /** A template to be used for rendering a group item. */ template?: any; /** The count of columns in the group layout. */ colCount?: number; + /** Specifies dependency between the screen factor and the count of columns in the tab layout. */ + colCountByScreen?: ColCountResponsible; /** Specifies whether or not all group item labels are aligned. */ alignItemLabels?: boolean; /** Holds an array of form items displayed within the group. */ @@ -2164,6 +2280,8 @@ declare module DevExpress.ui { title?: string; /** The count of columns in the tab layout. */ colCount?: number; + /** Specifies dependency between the screen factor and the count of columns in the group layout. */ + colCountByScreen?: ColCountResponsible; /** Specifies whether or not labels of items displayed within the current tab are aligned. */ alignItemLabels?: boolean; /** Holds an array of form items displayed within the tab. */ @@ -2180,7 +2298,7 @@ declare module DevExpress.ui { template?: any; } export interface dxFormTabbedItem extends dxFormItem { - /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + /** Holds a configuration object for the TabPanel widget used to display the current form item. */ tabPanelOptions?: Object; /** An array of tab configuration objects. */ tabs?: Array; @@ -2190,6 +2308,10 @@ declare module DevExpress.ui { formData?: Object; /** The count of columns in the form layout. */ colCount?: any; + /** Specifies dependency between the screen factor and the count of columns in the form layout. */ + colCountByScreen?: ColCountResponsible; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; /** Specifies the location of a label against the editor. */ labelLocation?: string; /** Specifies whether or not all editors on the form are read-only. */ @@ -2238,7 +2360,9 @@ declare module DevExpress.ui { itemOption(field: string, option: string, value: any): void; /** Updates the values of form item options. */ itemOption(field: string, options: Object): void; - /** Returns an editor instance associated with the specified formData field. */ + /** Gets the value of the form item option. */ + itemOption(field: string): any; + /** Returns an editor instance associated with the specified formData field or name of the form item. */ getEditor(field: string): Object; /** Updates the dimensions of the widget contents. */ updateDimensions(): JQueryPromise; @@ -2247,6 +2371,25 @@ declare module DevExpress.ui { /** Resets the editor's value to undefined. */ resetValues(): void; } + export interface dxDeferRenderingOptions extends WidgetOptions { + /** Indicates if a load indicator should be shown until the widget's content is rendered. */ + showLoadIndicator?: boolean; + /** Specifies the jQuery.Promise or boolean value, which when resolved, forces widget content to render. */ + renderWhen?: any; + /** Specifies the animation to be used to show the rendered content. */ + animation?: fx.AnimationOptions; + /** Specifies a jQuery selector of items that should be rendered using a staggered animation. */ + staggerItemSelector?: string; + /** Specifies a callback function that is called when the widget's content has finished rendering but is not yet shown. */ + onRendered?: Function; + /** Specifies a callback function that is called when widget content is shown and animation has completed. */ + onShown?: Function; + } + /** A container for elements that must be rendered at a specified moment. */ + export class dxDeferRendering extends Widget { + constructor(element: JQuery, options?: dxDeferRenderingOptions); + constructor(element: Element, options?: dxDeferRenderingOptions); + } } interface JQuery { dxProgressBar(): JQuery; @@ -2619,7 +2762,7 @@ declare module DevExpress.ui { items?: Array; /** The template to be used for rendering items. */ itemTemplate?: any; - /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + /** Specifies whether or not to show the drop down menu within a Popover widget. */ usePopover?: boolean; /** The width of the menu popup in pixels. */ popupWidth?: any; @@ -2652,9 +2795,9 @@ declare module DevExpress.ui { target?: any; /** The title of the action sheet. */ title?: string; - /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + /** Specifies whether or not to show the action sheet within a Popover widget. */ usePopover?: boolean; - /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + /** A Boolean value specifying whether or not the ActionSheet widget is visible. */ visible?: boolean; } /** A widget consisting of a set of choices related to a certain task. */ @@ -2727,7 +2870,7 @@ declare module DevExpress.data { visible?: boolean; /** Name of the data source field containing data for the pivot grid field. */ dataField?: string; - /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + /** A caption that will be displayed in the pivot grid's field chooser and field panel to identify the field. */ caption?: string; /** Specifies a type of field values. */ dataType?: string; @@ -2769,11 +2912,16 @@ declare module DevExpress.data { expanded?: boolean; /** Specifies whether the field should be treated as a Data Field. */ isMeasure?: boolean; + /** Specifies whether or not long text in header items should be wrapped. */ + wordWrapEnabled?: boolean; /** Specifies a display format for field values. */ - format?: string; + format?: any; /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ customizeText?: (cellInfo: { value: any; valueText: string }) => string; - /** Specifies a precision for formatted field values. */ + /** + * Specifies a precision for formatted field values. + * @deprecated Use the format | precision option instead. + */ precision?: number; /** Specifies how to sort the header items. */ sortingMethod?: (a: Object, b: Object) => number; @@ -2803,7 +2951,7 @@ declare module DevExpress.data { export class SummaryCell { /** Gets the parent cell in a specified direction. */ parent(direction: string): SummaryCell; - /** Gets all children cells in a specified direction. */ + /** Gets all child cells in a specified direction. */ children(direction: string): Array; /** Gets a partial Grand Total cell of a row or column. */ grandTotal(direction: string): SummaryCell; @@ -2821,7 +2969,7 @@ declare module DevExpress.data { child(direction: string, fieldValue: any): SummaryCell; /** Gets the cell located by the path of the source cell with one field value changed. */ slice(field: PivotGridField, value: any): SummaryCell; - /** Gets the header cell of a row or column field to which the current cell belongs. */ + /** Gets the row or column field to which the current cell belongs. */ field(area: string): PivotGridField; /** Gets the value of the current cell. */ value(): any; @@ -2850,9 +2998,9 @@ declare module DevExpress.data { /** A handler for the fieldsPrepared event. */ onFieldsPrepared?: (e?: Array) => void; } - /** An object that provides access to data for the dxPivotGrid widget. */ + /** An object that provides access to data for the PivotGrid widget. */ export class PivotGridDataSource implements EventsMixin { - constructor(options?: PivotGridDataSource); + constructor(options?: PivotGridDataSourceOptions); /** Starts reloading data from any store and updating the data source. */ reload(): JQueryPromise; /** Starts updating the data source. Reloads data from the XMLA store only. */ @@ -2965,8 +3113,13 @@ declare module DevExpress.ui { displayExpr?: any; /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ valueExpr?: any; - /** The name of the appointment object field that specifies a resource of this kind. */ + /** + * The name of the appointment object field that specifies a resource of this kind. + * @deprecated Use the fieldExpr option instead. + */ field?: string; + /** The name of the appointment object field that specifies a resource of this kind. */ + fieldExpr?: string; /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ label?: string; }>; @@ -2992,8 +3145,11 @@ declare module DevExpress.ui { onCellClick?: any; /** A handler for the appointmentFormCreated event. */ onAppointmentFormCreated?: Function; - /** Specifies whether or not an end-user can scroll the view horizontally. */ + /** A handler for the contentReady event. */ + onContentReady?: Function; horizontalScrollingEnabled?: boolean; + /** Specifies whether or not an end-user can scroll the view in both directions at the same time. */ + crossScrollingEnabled?: boolean; /** Specifies whether a user can switch views using tabs or a drop-down menu. */ useDropDownViewSwitcher?: boolean; /** Specifies the name of the data source item field that defines the start of an appointment. */ @@ -3010,8 +3166,16 @@ declare module DevExpress.ui { recurrenceRuleExpr?: string; /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ recurrenceExceptionExpr?: string; + /** Specifies the name of the data source item field that defines the timezone of the appointment start date. */ + startDateTimeZoneExpr?: string; + /** Specifies the name of the data source item field that defines the timezone of the appointment end date. */ + endDateTimeZoneExpr?: string; /** Specifies whether filtering is performed on the server or client side. */ remoteFiltering?: boolean; + /** Specifies the timezone of the widget. */ + timeZone?: string; + /** The text or HTML markup displayed by the widget if the item collection is empty. Available for the Agenda view only. */ + noDataText?: string; } /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ export class dxScheduler extends Widget { @@ -3027,6 +3191,10 @@ declare module DevExpress.ui { scrollToTime(hours: number, minutes: number, date: Date): void; /** Displayes the Appointment Details popup. */ showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; + /** Returns the start date of the current view. */ + getStartViewDate(): Date; + /** Returns the end date of the current view. */ + getEndViewDate(): Date; } export interface dxColorBoxOptions extends dxDropDownEditorOptions { /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ @@ -3055,10 +3223,6 @@ declare module DevExpress.ui { itemsExpr?: any; /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ disabledExpr?: any; - /** Specifies the name of the data source item field that holds the key of the parent item. */ - parentIdExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ - expandedExpr?: any; hoverStateEnabled?: boolean; focusStateEnabled?: boolean; } @@ -3078,6 +3242,8 @@ declare module DevExpress.ui { showCheckBoxes?: boolean; /** Specifies the current check boxes display mode. */ showCheckBoxesMode?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is displayed expanded. */ + expandedExpr?: any; /** Specifies whether or not to select nodes recursively. */ selectNodesRecursive?: boolean; /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ @@ -3087,20 +3253,26 @@ declare module DevExpress.ui { * @deprecated Use the showCheckBoxesMode options instead. */ selectAllEnabled?: boolean; + /** Specifies whether or not an item becomes selected if a user clicks it. */ + selectByClick?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; /** Specifies the text displayed at the "Select All" check box. */ selectAllText?: string; /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ hasItemsExpr?: any; + /** Specifies the name of the data source item field for holding the parent key of the corresponding node. */ + parentIdExpr?: any; /** Specifies if the virtual mode is enabled. */ virtualModeEnabled?: boolean; /** Specifies the parent ID value of the root item. */ - rootValue?: any; + rootValue?: Object; /** Specifies the current value used to filter tree view items. */ searchValue?: string; /** A string value specifying available scrolling directions. */ scrollDirection?: string; - /** A handler for the itemSelected event. */ - onItemSelected?: Function; + /** A handler for the itemSelectionChanged event. */ + onItemSelectionChanged?: Function; /** A handler for the itemExpanded event. */ onItemExpanded?: Function; /** A handler for the itemCollapsed event. */ @@ -3145,8 +3317,13 @@ declare module DevExpress.ui { cssClass?: string; /** Holds an array of menu items. */ items?: Array; - /** Specifies whether or not an item becomes selected if an end-user clicks it. */ - selectionByClick?: boolean; + /** + * Specifies whether or not an item becomes selected if an end-user clicks it. + * @deprecated Use the selectByClick option instead. + */ + selectionByClick?: boolean; + /** Specifies whether or not an item becomes selected if a user clicks it. */ + selectByClick?: boolean; /** Specifies the selection mode supported by the menu. */ selectionMode?: string; /** Specifies options of submenu showing and hiding. */ @@ -3191,6 +3368,8 @@ declare module DevExpress.ui { submenuDirection?: string; /** A handler for the submenuHidden event. */ onSubmenuHidden?: Function; + /** Specifies whether or not adaptive widget rendering is enabled on a small screen. */ + adaptivityEnabled?: boolean; /** A handler for the submenuHiding event. */ onSubmenuHiding?: Function; /** A handler for the submenuShowing event. */ @@ -3206,7 +3385,7 @@ declare module DevExpress.ui { export interface dxContextMenuOptions extends dxMenuBaseOptions { /** Holds an object that specifies options of alternative menu invocation. */ alternativeInvocationMode?: { - /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + /** Specifies whether or not an alternative invocation mode is enabled. */ enabled?: Boolean; /** Specifies the element used to invoke the context menu. */ invokingElement?: any; @@ -3254,14 +3433,14 @@ declare module DevExpress.ui { summary?: boolean; } export interface dxDataGridRow { - /** The data object represented by the row. */ data: Object; - /** The key of the data object represented by the row. */ key: any; - /** The visible index of the row. */ rowIndex: number; - /** The type of the row. */ rowType: string; + groupIndex: number; + isExpanded: boolean; + isSelected: boolean; + values: Array; } export interface dxDataGridColumn { /** Specifies the content alignment within column cells. */ @@ -3276,7 +3455,7 @@ declare module DevExpress.ui { allowFixing?: boolean; /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ allowSearch?: boolean; - /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + /** Specifies whether the user can group data by values of this column. Applies only when grouping is enabled. */ allowGrouping?: boolean; /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ allowHiding?: boolean; @@ -3307,7 +3486,7 @@ declare module DevExpress.ui { /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ calculateSortValue?: any; /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ - customizeText?: (cellInfo: { value: any; valueText: string }) => string; + customizeText?: (cellInfo: { value: any; valueText: string; target: string; groupInterval: any }) => string; /** Specifies the field of a data source that provides data for a column. */ dataField?: string; /** Specifies the required type of column values. */ @@ -3330,10 +3509,12 @@ declare module DevExpress.ui { filterType?: string; /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ fixed?: boolean; + /** Specifies the order according to which grid columns must be concealed when the widget adapts to the screen or container size. */ + hidingPriority?: number; /** Specifies the grid edge to which the column is anchored. */ fixedPosition?: string; /** Specifies a format for the values displayed in a column. */ - format?: string; + format?: any; /** Specifies a custom template for the group cell of a grid column. */ groupCellTemplate?: any; /** Specifies the index of a column when grid records are grouped by the values of this column. */ @@ -3358,9 +3539,12 @@ declare module DevExpress.ui { /** Specifies how header filter values should be combined into groups. */ groupInterval?: any; }; - /** Specifies a precision for formatted values displayed in a column. */ + /** + * Specifies a precision for formatted values displayed in a column. + * @deprecated Use the format | precision option instead. + */ precision?: number; - /** Specifies a filter operation applied to a column. */ + /** Specifies the default filter operation of a column. */ selectedFilterOperation?: string; /** Specifies whether or not the column displays its values by using editors. */ showEditorAlways?: boolean; @@ -3386,6 +3570,12 @@ declare module DevExpress.ui { name?: string; /** The form item configuration object. Used only when the editing mode is "form". */ formItem?: DevExpress.ui.dxFormItem; + /** An array of grid columns. */ + columns?: Array; + /** Specifies the band column that owns the current column. Accepts the index of the band column in the columns array. */ + ownerBand?: number; + /** Specifies whether the column bands other columns or not. */ + isBand?: boolean; } export interface dxDataGridOptions extends WidgetOptions { /** Specifies whether the outer borders of the grid are visible or not. */ @@ -3412,6 +3602,8 @@ declare module DevExpress.ui { onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ cellHintEnabled?: boolean; + /** Specifies whether or not the widget should hide columns in order to adapt to the screen or container size. */ + columnHidingEnabled?: boolean; /** Specifies whether or not grid columns can be reordered by a user. */ allowColumnReordering?: boolean; /** Specifies whether or not grid columns can be resized by a user. */ @@ -3422,6 +3614,8 @@ declare module DevExpress.ui { onCellHoverChanged?: (e: Object) => void; /** A handler for the cellPrepared event. */ onCellPrepared?: (e: Object) => void; + /** A handler for the adaptiveDetailRowPreparing event. */ + onAdaptiveDetailRowPreparing?: (e: Object) => void; /** Specifies whether or not the width of grid columns depends on column content. */ columnAutoWidth?: boolean; /** Specifies the options of a column chooser. */ @@ -3430,6 +3624,8 @@ declare module DevExpress.ui { emptyPanelText?: string; /** Specifies whether a user can invoke the column chooser or not. */ enabled?: boolean; + /** Specifies how the end-user chooses columns. */ + mode?: string; /** Specifies the height of the column chooser panel. */ height?: number; /** Specifies text displayed in the title of the column chooser panel. */ @@ -3476,6 +3672,8 @@ declare module DevExpress.ui { onContentReady?: Function; /** Specifies a function that customizes grid columns after they are created. */ customizeColumns?: (columns: Array) => void; + /** Customizes grid columns and data before exporting. */ + customizeExportData?: (columns: Array, rows: Array) => void; /** Specifies a data source for the grid. */ dataSource?: any; /** Specifies whether or not to enable data caching. */ @@ -3509,17 +3707,20 @@ declare module DevExpress.ui { form?: DevExpress.ui.dxFormOptions; /** Contains options that specify texts for editing-related grid controls. */ texts?: { - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the mode option is set to batch. */ saveAllChanges?: string; /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ cancelRowChanges?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the mode option is set to batch. */ cancelAllChanges?: string; /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ confirmDeleteMessage?: string; /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ confirmDeleteTitle?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the mode option is set to cell and the validation capabilities are enabled. +#####See Also##### +- Validation Engine +- Validation Engine - MVVM Approach */ validationCancelChanges?: string; /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ deleteRow?: string; @@ -3565,30 +3766,45 @@ declare module DevExpress.ui { /** Specifies whether the filter row is visible or not. */ visible?: boolean; }; - /** Specifies the behavior of grouped grid records. */ + /** Specifies grouping settings and the behavior of grouped grid records. */ grouping?: { /** Specifies whether the user can collapse grouped records in a grid or not. */ allowCollapsing?: boolean; /** Specifies whether groups appear expanded or not. */ autoExpandAll?: boolean; - /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ - groupContinuedMessage?: string; - /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + /** Enables the user to group data using the context menu. */ + contextMenuEnabled?: boolean; + /** Specifies the event on which a group will be expanded/collapsed. */ + expandMode?: string; + groupContinuedMessage?: string; groupContinuesMessage?: string; + /** Defines the texts of grouping-related visual elements. */ + texts?: { + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + /** Specifies the text of the context menu item that groups data by a specific column. */ + groupByThisColumn?: string; + /** Specifies the text of the context menu item that clears grouping settings of a specific column. */ + ungroup?: string; + /** Specifies the text of the context menu item that clears grouping settings of all columns. */ + ungroupAll?: string; + } }; - /** Specifies options that configure the group panel. */ + /** Configures the group panel. */ groupPanel?: { /** Specifies whether columns can be dragged onto or from the group panel. */ allowColumnDragging?: boolean; /** Specifies text displayed by the group panel when it does not contain any columns. */ emptyPanelText?: string; /** Specifies whether the group panel is visible or not. */ - visible?: boolean; + visible?: any; }; /** Specifies options configuring the load panel. */ loadPanel?: { /** Specifies whether to show the load panel or not. */ - enabled?: boolean; + enabled?: any; /** Specifies the height of the load panel in pixels. */ height?: number; /** Specifies a URL pointing to an image to be used as a loading indicator. */ @@ -3621,7 +3837,7 @@ declare module DevExpress.ui { }; /** Specifies paging options. */ paging?: { - /** Specifies whether dxDataGrid loads data page by page or all at once. */ + /** Specifies whether DataGrid loads data page by page or all at once. */ enabled?: boolean; /** Specifies the grid page that should be displayed by default. */ pageIndex?: number; @@ -3661,6 +3877,8 @@ declare module DevExpress.ui { placeholder?: string; /** Specifies whether the search panel is visible or not. */ visible?: boolean; + /** Specifies whether to search all columns or only visible ones. */ + searchVisibleColumnsOnly?: boolean; /** Specifies the width of the search panel in pixels. */ width?: number; /** Sets a search string for the search panel. */ @@ -3686,9 +3904,9 @@ declare module DevExpress.ui { /** Specifies the template for detail sections. */ template?: any; }; - /** Specifies options for exporting grid data. */ + /** Configures client-side export. */ export?: { - /** Indicates if the export feature is enabled in the grid. */ + /** Enables the client-side export feature. */ enabled?: boolean; /** Specifies a default name for the file to which grid data is exported. */ fileName?: string; @@ -3696,20 +3914,21 @@ declare module DevExpress.ui { excelFilterEnabled?: boolean; /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ excelWrapTextEnabled?: boolean; - /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE9 and Safari browsers. */ proxyUrl?: string; - /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + /** Allows an end user to export selected rows only. */ allowExportSelectedData?: boolean; /** Contains options that specify texts for the export-related commands and hints. */ texts?: { - /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + /** Specifies the hint of the Export button when the allowExportSelectedData option is true. */ exportTo?: string; - /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ exportToExcel?: string; - /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ excelFormat?: string; - /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ selectedRows?: string; + /** Specifies the text of the command that exports all data. */ + exportAll?: string; + /** Specifies the text of the drop-down menu command that exports selected rows. */ + exportSelectedRows?: string; } }; /** Specifies the keys of the records that must appear selected initially. */ @@ -3824,7 +4043,10 @@ declare module DevExpress.ui { }) => string; /** Specifies a pattern for the summary item text. */ displayFormat?: string; - /** Specifies a precision for the summary item value of a numeric format. */ + /** + * Specifies a precision for the summary item value of a numeric format. + * @deprecated Use the valueFormat | precision option instead. + */ precision?: number; /** Specifies whether or not a summary item must be displayed in the group footer. */ showInGroupFooter?: boolean; @@ -3835,7 +4057,7 @@ declare module DevExpress.ui { /** Specifies how to aggregate data for a summary item. */ summaryType?: string; /** Specifies a format for the summary item value. */ - valueFormat?: string; + valueFormat?: any; /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ skipEmptyValues?: boolean; }>; @@ -3856,14 +4078,17 @@ declare module DevExpress.ui { }) => string; /** Specifies a pattern for the summary item text. */ displayFormat?: string; - /** Specifies a precision for the summary item value of a numeric format. */ + /** + * Specifies a precision for the summary item value of a numeric format. + * @deprecated Use the valueFormat | precision option instead. + */ precision?: number; /** Specifies the column that must hold the summary item. */ showInColumn?: string; /** Specifies how to aggregate data for a summary item. */ summaryType?: string; /** Specifies a format for the summary item value. */ - valueFormat?: string; + valueFormat?: any; /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ skipEmptyValues?: boolean; }>; @@ -3953,6 +4178,12 @@ declare module DevExpress.ui { expandRow(key: any): void; /** Allows you to collapse a specific group or master row by its key. */ collapseRow(key: any): void; + /** Checks whether a specific adaptive detail row is expanded or collapsed. */ + isAdaptiveDetailRowExpanded(key: any): void; + /** Expands an adaptive detail row by the key of its parent data row. */ + expandAdaptiveDetailRow(key: any): void; + /** Collapses the currently expanded adaptive detail row (if there is one). */ + collapseAdaptiveDetailRow(): void; /** Applies a filter to the grid's data source. */ filter(filterExpr?: any): void; /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ @@ -3983,7 +4214,7 @@ declare module DevExpress.ui { /** Gets the current page size. */ pageSize(): number; /** Refreshes grid data. */ - refresh(): void; + refresh(): JQueryPromise; /** Removes a specific row from a grid. */ deleteRow(rowIndex: number): void; /** @@ -3992,7 +4223,7 @@ declare module DevExpress.ui { */ removeRow(rowIndex: number): void; /** Saves changes made in a grid. */ - saveEditData(): void; + saveEditData(): JQueryPromise; /** Searches grid records by a search string. */ searchByText(text: string): void; /** Selects all grid records. */ @@ -4010,6 +4241,8 @@ declare module DevExpress.ui { /** Invokes the column chooser panel. */ showColumnChooser(): void; startSelectionWithCheckboxes(): boolean; + /** Returns how many pages the grid contains. */ + pageCount(): number; /** Returns the number of records currently held by a grid. */ totalCount(): number; /** Recovers a row deleted in the batch edit mode. */ @@ -4043,8 +4276,38 @@ declare module DevExpress.ui { allowSortingBySummary?: boolean; /** Allows an end-user to change filtering options. */ allowFiltering?: boolean; + /** Specifies the area to which data field headers must belong. */ + dataFieldArea?: string; + /** Configures the field panel. */ + fieldPanel?: { + /** Makes fields on the field panel draggable. */ + allowFieldDragging?: boolean; + /** Shows/hides filter fields on the field panel. */ + showFilterFields?: boolean; + /** Shows/hides data fields on the field panel. */ + showDataFields?: boolean; + /** Shows/hides column fields on the field panel. */ + showColumnFields?: boolean; + /** Shows/hides row fields on the field panel. */ + showRowFields?: boolean; + /** Shows/hides the field panel. */ + visible?: boolean; + /** Specifies the placeholders of the field areas. */ + texts?: { + /** Specifies the placeholder of the column field area. */ + columnFieldArea?: string; + /** Specifies the placeholder of the row field area. */ + rowFieldArea?: string; + /** Specifies the placeholder of the filter field area. */ + filterFieldArea?: string; + /** Specifies the placeholder of the data field area. */ + dataFieldArea?: string; + } + } /** Allows an end-user to expand/collapse all header items within a header level. */ allowExpandAll?: boolean; + /** Specifies whether long text in header items should be wrapped. */ + wordWrapEnabled?: boolean; /** Specifies whether to display the Total rows. */ showRowTotals?: boolean; /** Specifies whether to display the Grand Total row. */ @@ -4057,6 +4320,8 @@ declare module DevExpress.ui { hideEmptySummaryCells?: boolean; /** Specifies where to show the total rows or columns. */ showTotalsPrior?: string; + /** Specifies the layout of items in the row header. */ + rowHeaderLayout?: string; /** Specifies whether the outer borders of the grid are visible or not. */ showBorders?: boolean; /** The Field Chooser configuration options. */ @@ -4085,7 +4350,7 @@ declare module DevExpress.ui { allFields?: string; }; } - /** Strings that can be changed or localized in the dxPivotGrid widget. */ + /** Strings that can be changed or localized in the PivotGrid widget. */ texts?: { /** The string to display as a header of the Grand Total row and column. */ grandTotal?: string; @@ -4131,13 +4396,13 @@ declare module DevExpress.ui { onCellPrepared?: (e: any) => void; /** A handler for the contextMenuPreparing event. */ onContextMenuPreparing?: (e: Object) => void; - /** Specifies options for exporting pivot grid data. */ + /** Configures client-side export. */ export?: { - /** Indicates whether the export feature is enabled for the pivot grid. */ + /** Enables client-side export. */ enabled?: boolean; /** Specifies a default name for the file to which grid data is exported. */ fileName?: string; - /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE9 and Safari browsers. */ proxyUrl?: string; }; /** A handler for the exporting event. */ @@ -4176,22 +4441,34 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxPivotGridOptions); /** Gets the PivotGridDataSource instance. */ getDataSource(): DevExpress.data.PivotGridDataSource; - /** Gets the dxPopup instance of the field chooser window. */ + /** Gets the Popup instance of the field chooser window. */ getFieldChooserPopup(): DevExpress.ui.dxPopup; /** Updates the widget to the size of its content. */ updateDimensions(): void; /** Exports pivot grid data to the Excel file. */ exportToExcel(): void; + /** Binds a Chart to the PivotGrid. */ + bindChart(chart: any, integrationOptions?: { + inverted?: boolean; + dataFieldsDisplayMode?: string; + putDataFieldsInto?: string; + alternateDataFields?: boolean; + processCell?: Function; + customizeChart?: Function; + customizeSeries?: Function; + }): any; } export interface dxPivotGridFieldChooserOptions extends WidgetOptions { /** Specifies the height of the widget. */ height?: any; /** Specifies the field chooser layout. */ layout?: number; - /** The data source of a dxPivotGrid widget. */ + /** The data source of a PivotGrid widget. */ dataSource?: DevExpress.data.PivotGridDataSource; onContentReady?: Function; - /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Strings that can be changed or localized in the PivotGridFieldChooser widget. */ texts?: { /** The string to display instead of Row Fields. */ rowFields?: string; @@ -4205,12 +4482,14 @@ declare module DevExpress.ui { allFields?: string; }; } - /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + /** A complementary widget for PivotGrid that allows you to manage data displayed in the PivotGrid. */ export class dxPivotGridFieldChooser extends Widget { constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); constructor(element: Element, options?: dxPivotGridFieldChooserOptions); /** Updates the widget to the size of its content. */ updateDimensions(): void; + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; } } interface JQuery { @@ -4289,7 +4568,7 @@ declare module DevExpress.framework { id?: string; /** Specifies the title of the widget associated with this command. */ title?: string; - /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + /** Specifies the type of the button, if the command is rendered as a Button widget. */ type?: string; /** A Boolean value specifying whether or not the widget associated with this command is visible. */ visible?: boolean; @@ -4543,36 +4822,6 @@ declare module DevExpress.framework { } } declare module DevExpress.viz.core { - /** - * Applies a theme for the entire page with several DevExtreme visualization widgets. - * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. - */ - export function currentTheme(theme: string): void; - /** - * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. - * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. - */ - export function currentTheme(platform: string, colorScheme: string): void; - /** - * Registers a new theme based on the existing one. - * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. - */ - export function registerTheme(customTheme: Object, baseTheme: string): void; - /** - * Applies a predefined or registered custom palette to all visualization widgets at once. - * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. - */ - export function currentPalette(paletteName: string): void; - /** - * Obtains the color sets of a predefined or registered palette. - * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. - */ - export function getPalette(paletteName: string): Object; - /** - * Registers a new palette. - * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. - */ - export function registerPalette(paletteName: string, palette: Object): void; export interface Border { /** Sets a border color for a selected series. */ color?: string; @@ -4586,19 +4835,19 @@ declare module DevExpress.viz.core { dashStyle?: string; } export interface DashedBorderWithOpacity extends DashedBorder { - /** Specifies the opacity of the tooltip's border. */ + /** Specifies how transparent the vertical crosshair line should be. */ opacity?: number; } export interface Font { - /** Specifies the font color for a strip label. */ + /** Colors the text displayed by the group labels. */ color?: string; - /** Specifies the font family for a strip label. */ + /** Specifies the font family of the text displayed by the group labels. */ family?: string; - /** Specifies the font opacity for a strip label. */ + /** Specifies how transparent the text displayed by the group labels should be. */ opacity?: number; - /** Specifies the font size for a strip label. */ + /** Specifies the size of the text displayed by the group labels. */ size?: any; - /** Specifies the font weight for the text displayed in strips. */ + /** Specifies the font weight of the text displayed by the group labels. */ weight?: number; } export interface Hatching { @@ -4611,35 +4860,61 @@ declare module DevExpress.viz.core { width?: number; } export interface Margins { - /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + /** Specifies the legend's bottom margin in pixels. */ bottom?: number; - /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + /** Specifies the legend's left margin in pixels. */ left?: number; - /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + /** Specifies the legend's right margin in pixels. */ right?: number; - /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + /** Specifies the legend's bottom margin in pixels. */ top?: number; } + export interface MarginOptions { + /** Generates space around the widget. */ + margin?: Margins; + } + export interface RedrawOnResizeOptions { + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + } + export interface TitleOptions { + /** Specifies the widget title. */ + title?: Title; + } + export interface ExportOptions { + /** Configures the exporting and printing features. */ + export?: Export; + } + export interface LoadingIndicatorOptions { + /** Configures the loading indicator. */ + loadingIndicator?: LoadingIndicator; + } + export interface LoadingIndicatorMethods { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + } export interface Size { - /** Specifies the width of the widget. */ + /** Specifies the width of the widget in pixels. */ width?: number; - /** Specifies the height of the widget. */ + /** Specifies the height of the widget in pixels. */ height?: number; } export interface Title { /** Specifies font options for the title. */ font?: viz.core.Font; - /** Specifies the widget title's horizontal position. */ + /** Specifies the title's alignment in a horizontal direction. */ horizontalAlignment?: string; - /** Specifies the widget title's position in the vertical direction. */ + /** Specifies the title's alignment in a vertical direction. */ verticalAlignment?: string; - /** Specifies the distance between the title and surrounding widget elements in pixels. */ - margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ + /** Generates space around the title. */ + margin?: Margins; + /** Specifies the minimum height that the title occupies. */ placeholderSize?: number; - /** Specifies text for the title. */ + /** Specifies the title text. */ text?: string; - /** Specifies a subtitle for the widget. */ + /** Specifies the widget subtitle. */ subtitle?: { /** Specifies font options for the subtitle. */ font?: viz.core.Font; @@ -4647,42 +4922,58 @@ declare module DevExpress.viz.core { text?: string; } } + export interface Export { + /** Enables the client-side exporting in the widget. */ + enabled?: boolean; + /** Enables the printing feature in the widget. Applies only if the export | enabled option is true. */ + printingEnabled?: boolean; + /** Specifies a set of formats available for exporting into. */ + formats?: Array; + /** Specifies a default name for the file to which the widget will be exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable exporting in IE9 and Safari browsers. */ + proxyUrl?: string; + /** Specifies the color that will fill transparent regions in the resulting file or document. */ + backgroundColor?: string; + } export interface Tooltip { /** Specifies the length of the tooltip's arrow in pixels. */ arrowLength?: number; /** Specifies the appearance of the tooltip's border. */ - border?: viz.core.DashedBorderWithOpacity; - /** Specifies a color for the tooltip. */ + border?: DashedBorderWithOpacity; + /** Specifies the color of tooltips. */ color?: string; - /** Specifies the z-index for tooltips. */ + /** Specifies the z-index of tooltips. */ zIndex?: number; /** Specifies the container to draw tooltips inside of it. */ container?: any; - /** Specifies text and appearance of a set of tooltips. */ + /** Allows you to change tooltip appearance. */ customizeTooltip?: (arg: Object) => { color?: string; text?: string }; - /** Specifies whether or not the tooltip is enabled. */ enabled?: boolean; - /** Specifies font options for the text displayed by the tooltip. */ + /** Specifies the font of the text displayed by a tooltip. */ font?: Font; - /** Specifies a format for the text displayed by the tooltip. */ - format?: string; - /** Specifies the opacity of a tooltip. */ + /** Specifies the format of the value displayed by a tooltip. */ + format?: any; + /** Specifies the opacity of tooltips. */ opacity?: number; - /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + /** Generates space on the left and the right of the text displayed by a tooltip. */ paddingLeftRight?: number; - /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + /** Generates space above and below the text displayed by a tooltip. */ paddingTopBottom?: number; - /** Specifies a precision for formatted values displayed by the tooltip. */ + /** + * Specifies the precision of formatted values in a tooltip. + * @deprecated Use the tooltip | format | precision option instead. + */ precision?: number; - /** Specifies options of the tooltip's shadow. */ + /** Specifies the appearance of the tooltip's shadow. */ shadow?: { /** Specifies the blur distance of the tooltip's shadow. */ blur?: number; /** Specifies the color of the tooltip's shadow. */ color?: string; - /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip itself measured in pixels. */ offsetX?: number; - /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip itself measured in pixels. */ offsetY?: number; /** Specifies the opacity of the tooltip's shadow. */ opacity?: number; @@ -4697,13 +4988,13 @@ declare module DevExpress.viz.core { enabled?: boolean; } export interface LoadingIndicator { - /** Specifies a color for the loading indicator background. */ + /** Colors the background of the loading indicator. */ backgroundColor?: string; - /** Specifies font options for the loading indicator text. */ + /** Specifies font options for the loading indicator. */ font?: viz.core.Font; /** Specifies whether to show the loading indicator or not. */ show?: boolean; - /** Specifies a text to be displayed by the loading indicator. */ + /** Specifies the text to be displayed by the loading indicator. */ text?: string; } export interface LegendBorder extends viz.core.DashedBorderWithOpacity { @@ -4747,6 +5038,8 @@ declare module DevExpress.viz.core { visible?: boolean; } export interface BaseWidgetOptions extends DOMComponentOptions { + /** Specifies the size of the widget in pixels. */ + size?: Size; /** A handler for the drawn event. */ onDrawn?: (e: { component: BaseWidget; @@ -4765,6 +5058,20 @@ declare module DevExpress.viz.core { version: string; } ) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ pathModified?: boolean; /** Specifies whether or not the widget supports right-to-left representation. */ @@ -4776,8 +5083,46 @@ declare module DevExpress.viz.core { export class BaseWidget extends DOMComponent { /** Returns the widget's SVG markup. */ svg(): string; + /** Exports the widget into a document with a specified name and format. */ + exportTo(): void; + /** Opens the browser's print window. */ + print(): void; + /** Redraws the widget. */ + render(): void; } } +declare module DevExpress.viz { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; +} declare module DevExpress.viz.charts { /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ export interface BaseSeries { @@ -4842,7 +5187,7 @@ declare module DevExpress.viz.charts { select(): void; /** Shows the tooltip of the point. */ showTooltip(): void; - /** Allows you to obtain the label of a series point. */ + /** Allows you to obtain the label(s) of the series point. */ getLabel(): any; /** Returns the series object to which the point belongs. */ series: BaseSeries; @@ -4931,8 +5276,11 @@ declare module DevExpress.viz.charts { } export interface BaseSeriesConfigLabel { /** Specifies a format for arguments displayed by point labels. */ - argumentFormat?: string; - /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentFormat?: any; + /** + * Specifies a precision for formatted point arguments displayed in point labels. + * @deprecated Use the series | label | argumentFormat | precision instead. + */ argumentPrecision?: number; /** Specifies a background color for point labels. */ backgroundColor?: string; @@ -4952,9 +5300,12 @@ declare module DevExpress.viz.charts { /** Specifies font options for the text displayed in point labels. */ font?: viz.core.Font; /** Specifies a format for the text displayed by point labels. */ - format?: string; + format?: any; position?: string; - /** Specifies a precision for formatted point values displayed in point labels. */ + /** + * Specifies a precision for formatted point values displayed in point labels. + * @deprecated Use the series | label | format | precision option instead. + */ precision?: number; /** Specifies the angle used to rotate point labels from their initial position. */ rotationAngle?: number; @@ -4962,26 +5313,27 @@ declare module DevExpress.viz.charts { visible?: boolean; } export interface SeriesConfigLabel extends BaseSeriesConfigLabel { - /** Specifies whether or not to show a label when the point has a zero value. */ + /** Specifies whether or not to show labels for points with zero value. Applies only to bar-like series. */ showForZeroValues?: boolean; } export interface ChartSeriesConfigLabel extends SeriesConfigLabel { - /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + /** Aligns point labels in relation to their points. */ alignment?: string; - /** Specifies how to shift point labels horizontally from their initial positions. */ + /** Along with verticalOffset, shifts point labels from their initial positions. */ horizontalOffset?: number; - /** Specifies how to shift point labels vertically from their initial positions. */ + /** Along with horizontalOffset, shifts point labels from their initial positions. */ verticalOffset?: number; - /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + /** + * Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. + * @deprecated Use the series | label | format | percentPrecision instead. + */ percentPrecision?: number; } export interface BaseCommonSeriesConfig { /** Specifies the data source field that provides arguments for series points. */ argumentField?: string; axis?: string; - /** An object defining the label configuration options for a series in the dxChart widget. */ label?: ChartSeriesConfigLabel; - /** Specifies border options for point labels. */ border?: viz.core.DashedBorder; /** Specifies a series color. */ color?: string; @@ -4989,7 +5341,6 @@ declare module DevExpress.viz.charts { dashStyle?: string; hoverMode?: string; hoverStyle?: { - /** An object defining the border options for a hovered series. */ border?: viz.core.DashedBorder; /**

Sets a color for a series when it is hovered over.

*/ color?: string; @@ -5007,10 +5358,9 @@ declare module DevExpress.viz.charts { minBarSize?: number; /** Specifies opacity for a series. */ opacity?: number; - /** Specifies the series elements to highlight when the series is selected. */ + /** Specifies series elements to be highlighted when a user selects a point. */ selectionMode?: string; selectionStyle?: { - /** An object defining the border options for a selected series. */ border?: viz.core.DashedBorder; /** Sets a color for a series when it is selected. */ color?: string; @@ -5088,11 +5438,11 @@ declare module DevExpress.viz.charts { visible?: boolean; } export interface ChartCommonPointOptions extends CommonPointOptions { - /** An object specifying the parameters of an image that is used as a point marker. */ + /** Substitutes the standard point symbols with an image. */ image?: { - /** Specifies the height of an image that is used as a point marker. */ + /** Specifies the height of the image used instead of a point marker. */ height?: any; - /** Specifies a URL leading to the image to be used as a point marker. */ + /** Specifies the URL of the image to be used as a point marker. */ url?: any; /** Specifies the width of an image that is used as a point marker. */ width?: any; @@ -5111,84 +5461,83 @@ declare module DevExpress.viz.charts { } /** An object that defines configuration options for chart series. */ export interface CommonSeriesConfig extends BaseCommonSeriesConfig { - /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + /** Specifies which data source field provides close values for points of a financial series. */ closeValueField?: string; - /** Specifies a radius for bar corners. */ + /** Makes bars look rounded. Applies only to bar-like series. */ cornerRadius?: number; - /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + /** Specifies which data source field provides high values for points of a financial series. */ highValueField?: string; - /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + /** Specifies a filling color for the body of a series point that visualizes a non-reduced value. Applies only to candlestick series. */ innerColor?: string; - /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + /** Specifies which data source field provides low values for points of a financial series. */ lowValueField?: string; - /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + /** Specifies which data source field provides open values for points of a financial series. */ openValueField?: string; - /** Specifies the pane that will be used to display a series. */ + /** Specifies which pane the series should belong to. Accepts the name of the pane. */ pane?: string; - /** An object defining configuration options for points in line-, scatter- and area-like series. */ point?: ChartCommonPointOptions; - /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + /** Coupled with the rangeValue2Field option, specifies which data source field provides values for a range-like series. */ rangeValue1Field?: string; - /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + /** Coupled with the rangeValue1Field option, specifies which data source field provides values for a range-like series. */ rangeValue2Field?: string; - /** Specifies reduction options for the stock or candleStick series. */ + /** Specifies reduction options for financial series. */ reduction?: { - /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + /** Specifies a color for the points whose price has decreased in comparison to the price of the previous point. */ color?: string; - /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + /** Specifies whether high, low, open or close prices of points should be compared. */ level?: string; }; - /** Specifies the data source field that defines the size of bubbles. */ + /** Specifies which data source field provides size values for bubbles. Required by and applies only to bubble series. */ sizeField?: string; } export interface CommonSeriesSettings extends CommonSeriesConfig { - /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + /** Defines common settings for all area series. */ area?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + /** Defines common settings for all bar series. */ bar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the bubble type in the chart. */ + /** Defines common settings for all bubble series. */ bubble?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + /** Defines common settings for all candlestick series. */ candlestick?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + /** Defines common settings for all full-stacked area series. */ fullstackedarea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + /** Defines common settings for all full-stacked spline area series. */ fullstackedsplinearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + /** Defines common settings for all full-stacked bar series. */ fullstackedbar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + /** Defines common settings for all full-stacked line series. */ fullstackedline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + /** Defines common settings for all full-stacked spline series. */ fullstackedspline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + /** Defines common settings for all line series. */ line?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + /** Defines common settings for all range area series. */ rangearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + /** Defines common settings for all range bar series. */ rangebar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + /** Defines common settings for all scatter series. */ scatter?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + /** Defines common settings for all spline series. */ spline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + /** Defines common settings for all spline area series. */ splinearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + /** Defines common settings for all stacked area series. */ stackedarea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + /** Defines common settings for all stacked spline area series. */ stackedsplinearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + /** Defines common settings for all stacked bar series. */ stackedbar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + /** Defines common settings for all stacked line series. */ stackedline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + /** Defines common settings for all stacked spline series. */ stackedspline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + /** Defines common settings for all step area series. */ steparea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + /** Defines common settings for all step line series. */ stepline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + /** Defines common settings for all stock series. */ stock?: CommonSeriesConfig; - /** Sets a series type. */ + /** Specifies the type of the series. */ type?: string; } export interface SeriesConfig extends CommonSeriesConfig { @@ -5231,7 +5580,10 @@ declare module DevExpress.viz.charts { export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ radialOffset?: number; - /** Specifies a precision for the percentage values displayed in labels. */ + /** + * Specifies a precision for the percentage values displayed in labels. + * @deprecated Use the series | label | format | percentPrecision instead. + */ percentPrecision?: number; } /** An object that defines configuration options for chart series. */ @@ -5267,7 +5619,7 @@ declare module DevExpress.viz.charts { /** Specifies a minimal size of a displayed pie segment. */ minSegmentSize?: number; /** - * Specifies the direction in which the dxPieChart series points are located. + * Specifies the direction in which the PieChart series points are located. * @deprecated Use the segmentsDirection option instead. */ segmentsDirection?: string; @@ -5334,11 +5686,11 @@ declare module DevExpress.viz.charts { nameField?: string; } export interface ChartCommonConstantLineLabel { - /** Specifies font options for a constant line label. */ + /** Specifies font options for constant line labels. */ font?: viz.core.Font; - /** Specifies the position of the constant line label relative to the chart plot. */ + /** Specifies the position of constant line labels on the chart plot. */ position?: string; - /** Indicates whether or not to display labels for the axis constant lines. */ + /** Makes constant line labels visible. */ visible?: boolean; } export interface PolarCommonConstantLineLabel { @@ -5356,11 +5708,11 @@ declare module DevExpress.viz.charts { width?: number; } export interface ChartCommonConstantLineStyle extends ConstantLineStyle { - /** An object defining constant line label options. */ + /** Configures constant line labels. */ label?: ChartCommonConstantLineLabel; - /** Specifies the space between the constant line label and the left/right side of the constant line. */ + /** Generates a pixel-measured empty space between the left/right side of a constant line and the constant line label. */ paddingLeftRight?: number; - /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + /** Generates a pixel-measured empty space between the top/bottom side of a constant line and the constant line label. */ paddingTopBottom?: number; } export interface PolarCommonConstantLineStyle extends ConstantLineStyle { @@ -5376,15 +5728,15 @@ declare module DevExpress.viz.charts { visible?: boolean; } export interface ChartCommonAxisLabel extends CommonAxisLabel { - /** Specifies the label's position relative to the tick (grid line). */ + /** Aligns axis labels in relation to ticks. */ alignment?: string; - /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ overlappingBehavior?: { - /** Specifies how to arrange axis labels. */ + /** Decides how to arrange axis labels when there is not enough space to keep all of them. */ mode?: string; - /** Specifies the angle used to rotate axis labels. */ + /** Specifies the rotation angle of axis labels. Applies only if the mode option is "rotate". */ rotationAngle?: number; - /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + /** Adds a pixel-measured empty space between two staggered rows of axis labels. Applies only if the mode option is "stagger". */ staggeringSpacing?: number; }; } @@ -5393,9 +5745,9 @@ declare module DevExpress.viz.charts { overlappingBehavior?: string; } export interface CommonAxisTitle { - /** Specifies font options for an axis title. */ + /** Specifies font options for the axis title. */ font?: viz.core.Font; - /** Specifies a margin for an axis title in pixels. */ + /** Adds a pixel-measured empty space between the axis title and axis labels. */ margin?: number; } export interface BaseCommonAxisSettings { @@ -5403,7 +5755,7 @@ declare module DevExpress.viz.charts { color?: string; /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ discreteAxisDivisionMode?: string; - /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + /** An object defining the configuration options for the grid lines of an axis in the PolarChart widget. */ grid?: { /** Specifies a color for grid lines. */ color?: string; @@ -5463,41 +5815,41 @@ declare module DevExpress.viz.charts { width?: number; } export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { - /** Specifies the appearance of all the widget's constant lines. */ + /** Configures the appearance of all constant lines in the widget. */ constantLineStyle?: ChartCommonConstantLineStyle; - /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + /** Configures axis labels. */ label?: ChartCommonAxisLabel; - /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + /** Controls the empty space between the maximum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ maxValueMargin?: number; - /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + /** Controls the empty space between the minimum series points and the axis. Applies only to the axes of the "continuous" and "logarithmic" type. */ minValueMargin?: number; - /** Specifies, in pixels, the space reserved for an axis. */ + /** Reserves a pixel-measured space for the axis. */ placeholderSize?: number; - /** An object defining configuration options for strip style. */ + /** Configures the appearance of strips. */ stripStyle?: { - /** An object defining the configuration options for a strip label style. */ + /** Configures the appearance of strip labels. */ label?: { - /** Specifies font options for a strip label. */ + /** Specifies font options for strip labels. */ font?: viz.core.Font; - /** Specifies the label's position on a strip. */ + /** Aligns strip labels in the horizontal direction. */ horizontalAlignment?: string; - /** Specifies a label's position on a strip. */ + /** Aligns strip labels in the vertical direction. */ verticalAlignment?: string; }; - /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + /** Generates a pixel-measured empty space between the left/right border of a strip and the strip label. */ paddingLeftRight?: number; - /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + /** Generates a pixel-measured empty space between the top/bottom border of a strip and the strip label. */ paddingTopBottom?: number; }; - /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + /** Configures axis titles. */ title?: CommonAxisTitle; - /** Indicates whether or not to display series with indents from axis boundaries. */ + /** Adds an empty space between the axis and the minimum and maximum series points. */ valueMarginsEnabled?: boolean; } export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { /** Specifies the appearance of all the widget's constant lines. */ constantLineStyle?: PolarCommonConstantLineStyle; - /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + /** An object defining the label configuration options that are common for all axes in the PolarChart widget. */ label?: PolarCommonAxisLabel; /** An object defining configuration options for strip style. */ stripStyle?: { @@ -5509,11 +5861,11 @@ declare module DevExpress.viz.charts { }; } export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { - /** Specifies the horizontal alignment of a constant line label. */ + /** Aligns constant line labels in the horizontal direction. */ horizontalAlignment?: string; - /** Specifies the vertical alignment of a constant line label. */ + /** Aligns constant line labels in the vertical direction. */ verticalAlignment?: string; - /** Specifies the text to be displayed in a constant line label. */ + /** Specifies the text of a constant line label. By default, equals to the value of the constant line. */ text?: string; } export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { @@ -5526,24 +5878,27 @@ declare module DevExpress.viz.charts { /** Specifies a callback function that returns the text to be displayed in value axis labels. */ customizeText?: (argument: { value: any; valueText: string }) => string; /** Specifies a format for the text displayed by axis labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the axis labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the axis labels. + * @deprecated Use the valueAxis | label | format | precision option instead. + */ precision?: number; } export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } export interface AxisTitle extends CommonAxisTitle { - /** Specifies the text for the value axis title. */ + /** Specifies the text of the axis title. */ text?: string; } export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { - /** An object defining constant line label options. */ + /** Specifies the appearance of the labels of those constant lines that belong to the value axis. */ label?: ChartConstantLineLabel; } export interface ChartConstantLine extends ChartConstantLineStyle { - /** An object defining constant line label options. */ + /** Configures the constant line label. */ label?: ChartConstantLineLabel; - /** Specifies a value to be displayed by a constant line. */ + /** Specifies the value indicated by a constant line. Setting this option is necessary. */ value?: any; } export interface PolarConstantLine extends PolarCommonConstantLineStyle { @@ -5567,25 +5922,25 @@ declare module DevExpress.viz.charts { minorTickCount?: number; /** Specifies the required type of the value axis. */ type?: string; - /** Specifies the pane on which the current value axis will be displayed. */ + /** Binds the value axis to a pane. */ pane?: string; /** Specifies options for value axis strips. */ strips?: Array; } export interface ChartAxis extends ChartCommonAxisSettings, Axis { - /** Defines an array of the value axis constant lines. */ + /** Declares a collection of constant lines belonging to the value axis. */ constantLines?: Array; - /** Specifies the appearance options for the constant lines of the value axis. */ + /** Specifies the appearance of those constant lines that belong to the value axis. */ constantLineStyle?: ChartCommonConstantLineStyle; - /** Specifies options for value axis labels. */ + /** Configures the labels of the value axis. */ label?: ChartAxisLabel; - /** Specifies the maximum value on the value axis. */ + /** Coupled with the min option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ max?: any; - /** Specifies the minimum value on the value axis. */ + /** Coupled with the max option, focuses the widget on a specific chart segment. Applies only to the axes of the "continuous" and "logarithmic" type. */ min?: any; - /** Specifies the position of the value axis on a chart. */ + /** Relocates the value axis. */ position?: string; - /** Specifies the title for a value axis. */ + /** Configures the axis title. */ title?: any; } export interface PolarAxis extends PolarCommonAxisSettings, Axis { @@ -5620,9 +5975,9 @@ declare module DevExpress.viz.charts { valueType?: string; } export interface ChartValueAxis extends ChartAxis, ValueAxis { - /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + /** Adds a pixel-measured empty space between two side-by-side value axes. Applies if several value axes are located on one side of the chart. */ multipleAxesSpacing?: number; - /** Specifies the value by which the chart's value axes are synchronized. */ + /** Synchronizes two or more value axes with each other at a specific value. */ synchronizedValue?: number; } export interface PolarValueAxis extends PolarAxis, ValueAxis { @@ -5637,61 +5992,63 @@ declare module DevExpress.viz.charts { } } export interface CommonPane { - /** Specifies a background color in a pane. */ + /** Specifies the color of the pane's background. */ backgroundColor?: string; - /** Specifies the border options of a chart's pane. */ + /** Configures the pane border. */ border?: PaneBorder; } export interface Pane extends CommonPane { - /** Specifies the name of a pane. */ + /** Specifies the name of the pane. */ name?: string; } export interface PaneBorder extends viz.core.DashedBorderWithOpacity { - /** Specifies the bottom border's visibility state in a pane. */ + /** Shows/hides the bottom border of the pane. Applies only when the border | visible option is true. */ bottom?: boolean; - /** Specifies the left border's visibility state in a pane. */ + /** Shows/hides the left border of the pane. Applies only when the border | visible option is true. */ left?: boolean; - /** Specifies the right border's visibility state in a pane. */ + /** Shows/hides the right border of the pane. Applies only when the border | visible option is true. */ right?: boolean; - /** Specifies the top border's visibility state in a pane. */ + /** Shows/hides the top border of the pane. Applies only when the border | visible option is true. */ top?: boolean; } export interface ChartAnimation extends viz.core.Animation { - /** Specifies the maximum series point count in the chart that the animation supports. */ + /** Specifies how many series points the widget should have before the animation will be disabled. */ maxPointCountSupported?: number; } export interface BaseChartTooltip extends viz.core.Tooltip { /** Specifies a format for arguments of the chart's series points. */ - argumentFormat?: string; - /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentFormat?: any; + /** + * Specifies a precision for formatted arguments displayed in tooltips. + * @deprecated Use the tooltip | argumentFormat | precision option instead. + */ argumentPrecision?: number; - /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + /** + * Specifies a precision for a percent value displayed in tooltips for stacked series and PieChart series. + * @deprecated Use the tooltip | format | percentPrecision option instead. + */ percentPrecision?: number; } - export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + export interface BaseChartOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { /** Specifies adaptive layout options. */ adaptiveLayout?: { - /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + /** Specifies the widget's width small enough for the layout to begin adapting. */ width?: number; - /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + /** Specifies the widget's height small enough for the layout to begin adapting. */ height?: number; - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + /** Specifies whether or not point labels should be kept when the layout is adapting. */ keepLabels?: boolean; }; /** Specifies animation options. */ animation?: ChartAnimation; - /** Specifies a callback function that returns an object with options for a specific point label. */ - customizeLabel?: (labelInfo: Object) => Object; - /** Specifies a callback function that returns an object with options for a specific point. */ + /** Customizes the appearance of an individual point label. */ + customizeLabel?: (pointInfo: Object) => Object; + /** Customizes the appearance of an individual series point. */ customizePoint?: (pointInfo: Object) => Object; - /** Specifies a data source for the chart. */ + /** Specifies the origin of data for the widget. */ dataSource?: any; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies options of a dxChart's (dxPieChart's) legend. */ + /** Specifies options of a Chart's or PieChart's legend. */ legend?: core.BaseLegend; - /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ - margin?: viz.core.Margins; /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ palette?: any; /** A handler for the done event. */ @@ -5715,15 +6072,9 @@ declare module DevExpress.viz.charts { }) => void; /** Specifies whether a single point or multiple points can be selected in the chart. */ pointSelectionMode?: string; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies options for the dxChart and dxPieChart widget series. */ + /** Specifies options for the Chart and PieChart widget series. */ series?: any; - /** Specifies the size of the widget in pixels. */ - size?: viz.core.Size; - /** Specifies a title for the chart. */ - title?: viz.core.Title; - /** Specifies tooltip options. */ + /** Configures tooltips. */ tooltip?: BaseChartTooltip; /** A handler for the tooltipShown event. */ onTooltipShown?: (e: { @@ -5739,7 +6090,7 @@ declare module DevExpress.viz.charts { }) => void; } /** A base class for all chart widgets included in the ChartJS library. */ - export class BaseChart extends viz.core.BaseWidget { + export class BaseChart extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { /** Deselects the chart's selected series. The series is displayed in an initial style. */ clearSelection(): void; /** Gets the current size of the widget. */ @@ -5750,12 +6101,10 @@ declare module DevExpress.viz.charts { getSeriesByName(seriesName: string): BaseSeries; /** Gets a series within the chart's series collection by its position number. */ getSeriesByPos(seriesIndex: number): BaseSeries; - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; /** Hides all widget tooltips. */ hideTooltip(): void; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; /** Redraws a widget. */ render(renderOptions?: { force?: boolean; @@ -5817,80 +6166,91 @@ declare module DevExpress.viz.charts { position?: string; } export interface ChartTooltip extends BaseChartTooltip { - /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + /** Specifies whether the tooltip must be located in the center of a series point or on its edge. Applies to bar-like and bubble series only. */ location?: string; /** Specifies the kind of information to display in a tooltip. */ shared?: boolean; } export interface dxChartOptions extends AdvancedOptions { - adaptiveLayout?: { - keepLabels?: boolean; - }; /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ synchronizeMultiAxes?: boolean; /** Specifies whether or not to filter the series points depending on their quantity. */ useAggregation?: boolean; - /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + /** Specifies whether or not to adjust the value axis when zooming the widget. */ adjustOnZoom?: boolean; - /** Specifies argument axis options for the dxChart widget. */ + /** Configures the argument axis. */ argumentAxis?: ChartArgumentAxis; - /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + /** Defines common settings for both the argument and value axis in a chart. */ commonAxisSettings?: ChartCommonAxisSettings; - /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + /** Defines common settings for all panes in a chart. */ commonPaneSettings?: CommonPane; - /** An object defining the configuration options that are common for all series of the dxChart widget. */ + /** Specifies settings common for all series in the chart. */ commonSeriesSettings?: CommonSeriesSettings; - /** An object that specifies the appearance options of the chart crosshair. */ + /** Configures the crosshair feature. */ crosshair?: { - /** Specifies a color for the crosshair lines. */ + /** Specifies the color of the crosshair lines. */ color?: string; - /** Specifies a dash style for the crosshair lines. */ + /** Specifies the dash style of the crosshair lines. */ dashStyle?: string; - /** Specifies whether to enable the crosshair or not. */ + /** Enables the crosshair. */ enabled?: boolean; - /** Specifies the opacity of the crosshair lines. */ + /** Specifies how transparent the crosshair lines should be. */ opacity?: number; /** Specifies the width of the crosshair lines. */ width?: number; - /** Specifies the appearance of the horizontal crosshair line. */ + /** Configures the horizontal crosshair line individually. */ horizontalLine?: CrosshaierWithLabel; - /** Specifies the appearance of the vertical crosshair line. */ + /** Configures the vertical crosshair line individually. */ verticalLine?: CrosshaierWithLabel; - /** Specifies the options of the crosshair labels. */ + /** Configures the crosshair labels. */ label?: { - /** Specifies a color for the background of the crosshair labels. */ + /** Paints the background of the crosshair labels. */ backgroundColor?: string; - /** Specifies whether the crosshair labels are visible or not. */ + /** Makes the crosshair labels visible. Applies only if the crosshair feature is enabled. */ visible?: boolean; - /** Specifies font options for the text of the crosshair labels. */ + /** Specifies font options for the crosshair labels. */ font?: viz.core.Font; - /** Specifies the format of the values displayed by crosshair labels. */ - format?: string; - /** Specifies a precision for formatted values. */ + /** Formats the point value/argument before it will be displayed in the crosshair label. */ + format?: any; + /** + * Specifies a precision for formatted values. + * @deprecated Use the crosshair | label | format | precision option instead. + */ precision?: number; /** Customizes the text displayed by the crosshair labels. */ customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; } }; - /** Specifies a default pane for the chart series. */ + /** Specifies which pane should be used by default. */ defaultPane?: string; /** Specifies a coefficient determining the diameter of the largest bubble. */ maxBubbleSize?: number; /** Specifies the diameter of the smallest bubble measured in pixels. */ minBubbleSize?: number; - /** Defines the dxChart widget's pane(s). */ + /** Declares a collection of panes. */ panes?: Array; - /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + /** Swaps the axes around making the value axis horizontal and the argument axis vertical. */ rotated?: boolean; /** Specifies the options of a chart's legend. */ legend?: Legend; - /** Specifies options for dxChart widget series. */ + /** A handler for the zoomStart event. */ + onZoomStart?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the zoomEnd event. */ + onZoomEnd?: (e: { + component: BaseChart; + element: Element; + rangeStart: any; + rangeEnd: any; + }) => void; + /** Specifies options for Chart widget series. */ series?: Array; /** Defines options for the series template. */ seriesTemplate?: SeriesTemplate; - /** Specifies tooltip options. */ tooltip?: ChartTooltip; - /** Specifies value axis options for the dxChart widget. */ + /** Configures the value axis. */ valueAxis?: Array; /** Enables scrolling in your chart. */ scrollingMode?: string; @@ -5912,27 +6272,23 @@ declare module DevExpress.viz.charts { position?: string; }; } - /** A widget used to embed charts into HTML JS applications. */ - export class dxChart extends BaseChart { - constructor(element: JQuery, options?: dxChartOptions); - constructor(element: Element, options?: dxChartOptions); - /** Sets the specified start and end values for the chart's argument axis. */ - zoomArgument(startValue: any, endValue: any): void; - } interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { /** Configures the label that belongs to the horizontal crosshair line. */ label?: { - /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + /** Paints the background of the label that belongs to the horizontal crosshair line. */ backgroundColor?: string; - /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + /** Makes the label of the horizontal crosshair line visible. Applies only if the crosshair feature is enabled and the horizontal line is visible. */ visible?: boolean; - /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + /** Specifies font options for the label of the horizontal crosshair line. */ font?: viz.core.Font; - /** Specifies the format of the values displayed by crosshair labels. */ - format?: string; - /** Specifies a precision for formatted values. */ + /** Formats the point value before it will be displayed in the crosshair label. */ + format?: any; + /** + * Specifies a precision for formatted values. + * @deprecated Use the crosshair | horizontalLine | label | format | precision option instead. + */ precision?: number; - /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + /** Customizes the text displayed by the label that belongs to the horizontal crosshair line. */ customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; } } @@ -5945,33 +6301,25 @@ declare module DevExpress.viz.charts { adaptiveLayout?: { width?: number; height?: number; - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ - keepLabels?: boolean; }; /** Indicates whether or not to display a "spider web". */ useSpiderWeb?: boolean; - /** Specifies argument axis options for the dxPolarChart widget. */ + /** Specifies argument axis options for the PolarChart widget. */ argumentAxis?: PolarArgumentAxis; - /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + /** An object defining the configuration options that are common for all axes of the PolarChart widget. */ commonAxisSettings?: PolarCommonAxisSettings; - /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + /** An object defining the configuration options that are common for all series of the PolarChart widget. */ commonSeriesSettings?: CommonPolarSeriesSettings; /** Specifies the options of a chart's legend. */ legend?: AdvancedLegend; - /** Specifies options for dxPolarChart widget series. */ + /** Specifies options for PolarChart widget series. */ series?: Array; /** Defines options for the series template. */ seriesTemplate?: PolarSeriesTemplate; - /** Specifies tooltip options. */ tooltip?: PolarChartTooltip; - /** Specifies value axis options for the dxPolarChart widget. */ + /** Specifies value axis options for the PolarChart widget. */ valueAxis?: PolarValueAxis; } - /** A chart widget displaying data in a polar coordinate system. */ - export class dxPolarChart extends BaseChart { - constructor(element: JQuery, options?: dxPolarChartOptions); - constructor(element: Element, options?: dxPolarChartOptions); - } export interface PieLegend extends core.BaseLegend { /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ hoverMode?: string; @@ -5983,12 +6331,11 @@ declare module DevExpress.viz.charts { export interface dxPieChartOptions extends BaseChartOptions { /** Specifies adaptive layout options. */ adaptiveLayout?: { - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ keepLabels?: boolean; }; - /** Specifies dxPieChart legend options. */ + /** Specifies PieChart legend options. */ legend?: PieLegend; - /** Specifies options for the series of the dxPieChart widget. */ + /** Specifies options for the series of the PieChart widget. */ series?: Array; /** Specifies the diameter of the pie. */ diameter?: number; @@ -6002,32 +6349,46 @@ declare module DevExpress.viz.charts { onLegendClick?: any; /** Specifies how a chart must behave when series point labels overlap. */ resolveLabelOverlapping?: string; - /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + /** An object defining the configuration options that are common for all series of the PieChart widget. */ commonSeriesSettings?: CommonPieSeriesSettings; /** Specifies the type of the pie chart series. */ type?: string; } - /** A circular chart widget for HTML JS applications. */ - export class dxPieChart extends BaseChart { - constructor(element: JQuery, options?: dxPieChartOptions); - constructor(element: Element, options?: dxPieChartOptions); +} +declare module DevExpress.viz { + /** A widget providing charts of various types for web applications. */ + export class dxChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + /** A circular chart widget for web applications. */ + export class dxPieChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxPieChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxPieChartOptions); /** - * Provides access to the dxPieChart series. + * Provides access to the PieChart series. * @deprecated Use the getAllSeries() method instead. */ - getSeries(): PieSeries; + getSeries(): DevExpress.viz.charts.PieSeries; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends DevExpress.viz.charts.BaseChart { + constructor(element: JQuery, options?: DevExpress.viz.charts.dxPolarChartOptions); + constructor(element: Element, options?: DevExpress.viz.charts.dxPolarChartOptions); } } interface JQuery { dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; dxChart(methodName: string, ...params: any[]): any; - dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxChart(methodName: "instance"): DevExpress.viz.dxChart; dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; dxPieChart(methodName: string, ...params: any[]): any; - dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPieChart(methodName: "instance"): DevExpress.viz.dxPieChart; dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; dxPolarChart(methodName: string, ...params: any[]): any; - dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; + dxPolarChart(methodName: "instance"): DevExpress.viz.dxPolarChart; } declare module DevExpress.viz.gauges { export interface BaseRangeContainer { @@ -6097,8 +6458,11 @@ declare module DevExpress.viz.gauges { /** Specifies font options for the text displayed in the scale labels of the gauge. */ font?: viz.core.Font; /** Specifies a format for the text displayed in scale labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the scale labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the scale labels. + * @deprecated Use the scale | label | format | precision option instead. + */ precision?: number; /** Specifies whether or not scale labels are visible on the gauge. */ visible?: boolean; @@ -6175,10 +6539,13 @@ declare module DevExpress.viz.gauges { customizeText?: (indicatedValue: { value: number; valueText: string }) => string; font?: viz.core.Font; /** Specifies a format for the text displayed in an indicator. */ - format?: string; + format?: any; /** Specifies the range bar's label indent in pixels. */ indent?: number; - /** Specifies a precision for the formatted value displayed by an indicator. */ + /** + * Specifies a precision for the formatted value displayed by an indicator. + * @deprecated Use the text | format | precision option instead. + */ precision?: number; }; offset?: number; @@ -6187,7 +6554,7 @@ declare module DevExpress.viz.gauges { /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ arrowLength?: number; /** Sets the array of colors to be used for coloring subvalue indicators. */ - palette?: Array; + palette?: any; /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ indentFromCenter?: number; /** Specifies the second color for the indicator of the twoColorNeedle type. */ @@ -6198,20 +6565,14 @@ declare module DevExpress.viz.gauges { spindleSize?: number; /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ spindleGapSize?: number; - /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + /** Specifies the orientation of the rangeBar indicator on a vertically oriented LinearGauge widget. */ horizontalOrientation?: string; - /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented LinearGauge widget. */ verticalOrientation?: string; } - export interface SharedGaugeOptions { + export interface SharedGaugeOptions extends viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { /** Specifies animation options. */ animation?: viz.core.Animation; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies the size of the widget in pixels. */ - size?: viz.core.Size; /** * Specifies a subtitle for the widget. * @deprecated Use the title | subtitle option instead. @@ -6228,34 +6589,7 @@ declare module DevExpress.viz.gauges { */ text?: string; }; - /** Specifies a title for a gauge. */ - title?: { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** - * Specifies a title's position on the gauge. - * @deprecated Use the horizontalAlignment and verticalAlignment options instead. - */ - position?: string; - /** Specifies the distance between the title and surrounding gauge elements in pixels. */ - margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ - placeholderSize?: number; - /** Specifies the gauge title's position in the vertical direction. */ - verticalAlignment?: string; - /** Specifies the gauge title's horizontal position. */ - horizontalAlignment?: string; - /** Specifies text for the title. */ - text?: string; - /** Specifies a subtitle for the widget. */ - subtitle?: { - /** Specifies font options for the subtitle. */ - font?: viz.core.Font; - /** Specifies text for the subtitle. */ - text?: string; - } - }; - /** Specifies options for gauge tooltips. */ + /** Configures tooltips. */ tooltip?: viz.core.Tooltip; /** A handler for the tooltipShown event. */ onTooltipShown?: (e: { @@ -6273,8 +6607,6 @@ declare module DevExpress.viz.gauges { export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { /** Specifies the color of the parent page element. */ containerBackgroundColor?: string; - /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ - margin?: viz.core.Margins; /** Specifies options of the gauge's range container. */ rangeContainer?: BaseRangeContainer; /** Specifies a gauge's scale options. */ @@ -6289,13 +6621,9 @@ declare module DevExpress.viz.gauges { valueIndicator?: BaseValueIndicator; } /** A gauge widget. */ - export class dxBaseGauge extends viz.core.BaseWidget { - /** Displays the loading indicator. */ + export class dxBaseGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { showLoadingIndicator(): void; - /** Conceals the loading indicator. */ hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(): void; /** Returns the main gauge value. */ value(): number; /** Updates a gauge value. */ @@ -6306,11 +6634,11 @@ declare module DevExpress.viz.gauges { subvalues(subvalues: Array): void; } export interface LinearRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + /** Specifies the orientation of the range container on a vertically oriented LinearGauge widget. */ horizontalOrientation?: string; - /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + /** Specifies the orientation of a range container on a horizontally oriented LinearGauge widget. */ verticalOrientation?: string; - /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + /** Specifies the width of the range container's start and end boundaries in the LinearGauge widget. */ width?: any; /** Specifies an end width of a range container. */ end?: number; @@ -6322,29 +6650,24 @@ declare module DevExpress.viz.gauges { indentFromTick?: number; } export interface LinearScale extends BaseScale { - /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + /** Specifies the orientation of scale ticks on a vertically oriented LinearGauge widget. */ horizontalOrientation?: string; label?: LinearScaleLabel; - /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + /** Specifies the orientation of scale ticks on a horizontally oriented LinearGauge widget. */ verticalOrientation?: string; } export interface dxLinearGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + /** Specifies the options required to set the geometry of the LinearGauge widget. */ geometry?: { - /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + /** Indicates whether to display the LinearGauge widget vertically or horizontally. */ orientation?: string; }; /** Specifies gauge range container options. */ rangeContainer?: LinearRangeContainer; scale?: LinearScale; } - /** A widget that represents a gauge with a linear scale. */ - export class dxLinearGauge extends dxBaseGauge { - constructor(element: JQuery, options?: dxLinearGaugeOptions); - constructor(element: Element, options?: dxLinearGaugeOptions); - } export interface CircularRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + /** Specifies the orientation of the range container in the CircularGauge widget. */ orientation?: string; /** Specifies the range container's width in pixels. */ width?: number; @@ -6359,7 +6682,7 @@ declare module DevExpress.viz.gauges { orientation?: string; } export interface dxCircularGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + /** Specifies the options required to set the geometry of the CircularGauge widget. */ geometry?: { /** Specifies the end angle of the circular gauge's arc. */ endAngle?: number; @@ -6370,11 +6693,6 @@ declare module DevExpress.viz.gauges { rangeContainer?: CircularRangeContainer; scale?: CircularScale; } - /** A widget that represents a gauge with a circular scale. */ - export class dxCircularGauge extends dxBaseGauge { - constructor(element: JQuery, options?: dxCircularGaugeOptions); - constructor(element: Element, options?: dxCircularGaugeOptions); - } export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { /** Specifies a color for the remaining segment of the bar's track. */ backgroundColor?: string; @@ -6402,10 +6720,13 @@ declare module DevExpress.viz.gauges { /** Specifies font options for bar labels. */ font?: viz.core.Font; /** Specifies a format for bar labels. */ - format?: string; + format?: any; /** Specifies the distance between the upper bar and bar labels in pixels. */ indent?: number; - /** Specifies a precision for the formatted value displayed by labels. */ + /** + * Specifies a precision for the formatted value displayed by labels. + * @deprecated Use the label | format | precision option instead. + */ precision?: number; /** Specifies whether bar labels appear on a gauge or not. */ visible?: boolean; @@ -6419,16 +6740,24 @@ declare module DevExpress.viz.gauges { /** Specifies the array of values to be indicated on a bar gauge. */ values?: Array; } +} +declare module DevExpress.viz { + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends DevExpress.viz.gauges.dxBaseGauge { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxLinearGaugeOptions); + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends DevExpress.viz.gauges.dxBaseGauge { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxCircularGaugeOptions); + } /** A circular bar widget. */ - export class dxBarGauge extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxBarGaugeOptions); - constructor(element: Element, options?: dxBarGaugeOptions); - /** Displays the loading indicator. */ + export class dxBarGauge extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.gauges.dxBarGaugeOptions); + constructor(element: Element, options?: DevExpress.viz.gauges.dxBarGaugeOptions); showLoadingIndicator(): void; - /** Conceals the loading indicator. */ hideLoadingIndicator(): void; - /** Redraws the widget. */ - render(): void; /** Returns an array of gauge values. */ values(): Array; /** Updates the values displayed by a gauge. */ @@ -6438,19 +6767,19 @@ declare module DevExpress.viz.gauges { interface JQuery { dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; dxLinearGauge(methodName: string, ...params: any[]): any; - dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxLinearGauge(methodName: "instance"): DevExpress.viz.dxLinearGauge; dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; dxCircularGauge(methodName: string, ...params: any[]): any; - dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxCircularGauge(methodName: "instance"): DevExpress.viz.dxCircularGauge; dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; dxBarGauge(methodName: string, ...params: any[]): any; - dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; + dxBarGauge(methodName: "instance"): DevExpress.viz.dxBarGauge; } declare module DevExpress.viz.rangeSelector { - export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { /** Specifies the options for the range selector's background. */ background?: { - /** Specifies the background color for the dxRangeSelector. */ + /** Specifies the background color for the RangeSelector. */ color?: string; /** Specifies image options. */ image?: { @@ -6462,9 +6791,7 @@ declare module DevExpress.viz.rangeSelector { /** Indicates whether or not the background (background color and/or image) is visible. */ visible?: boolean; }; - /** Specifies a title for the range selector. */ - title?: viz.core.Title; - /** Specifies the dxRangeSelector's behavior options. */ + /** Specifies the RangeSelector's behavior options. */ behavior?: { /** Indicates whether or not you can swap sliders. */ allowSlidersSwap?: boolean; @@ -6510,7 +6837,7 @@ declare module DevExpress.viz.rangeSelector { topIndent?: number; /** Specifies whether or not to filter the series points depending on their quantity. */ useAggregation?: boolean; - /** Specifies options for the chart's value axis. */ + /** Configures the chart value axis. */ valueAxis?: { /** Indicates whether or not the chart's value axis must be inverted. */ inverted?: boolean; @@ -6532,12 +6859,6 @@ declare module DevExpress.viz.rangeSelector { dataSource?: any; /** Specifies the data source field that provides data for the scale. */ dataSourceField?: string; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ - margin?: viz.core.Margins; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; /** Specifies options of the range selector's scale. */ scale?: { /** Specifies the scale's end value. */ @@ -6549,8 +6870,11 @@ declare module DevExpress.viz.rangeSelector { /** Specifies font options for the text displayed in the range selector's scale labels. */ font?: viz.core.Font; /** Specifies a format for the text displayed in scale labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the scale labels. */ + format?: any; + /** + * Specifies a precision for the formatted value displayed in the scale labels. + * @deprecated Use the scale | label | format | precision option instead. + */ precision?: number; /** Specifies a spacing between scale labels and the background bottom edge. */ topIndent?: number; @@ -6573,7 +6897,7 @@ declare module DevExpress.viz.rangeSelector { /** Specifies a callback function that returns the text to be displayed in scale markers. */ customizeText?: (markerValue: { value: any; valueText: string }) => string; /** Specifies a format for the text displayed in scale markers. */ - format?: string; + format?: any; }; /** Specifies the height of the marker's separator. */ separatorHeight?: number; @@ -6636,11 +6960,11 @@ declare module DevExpress.viz.rangeSelector { /** Specifies the order of arguments on a discrete scale. */ categories?: Array; }; - /** Specifies the range to be selected when displaying the dxRangeSelector. */ + /** Specifies the range to be selected when displaying the RangeSelector. */ selectedRange?: { - /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + /** Specifies the start value of the range to be selected when displaying the RangeSelector widget on a page. */ startValue?: any; - /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + /** Specifies the end value of the range to be selected when displaying the RangeSelector widget on a page. */ endValue?: any; }; /** Specifies the color of the selected range. */ @@ -6666,8 +6990,6 @@ declare module DevExpress.viz.rangeSelector { /** Specifies the opacity of the color of shutters. */ opacity?: number; }; - /** Specifies in pixels the size of the dxRangeSelector widget. */ - size?: viz.core.Size; /** Specifies the appearance of the range selector's slider handles. */ sliderHandle?: { /** Specifies the color of the slider handles. */ @@ -6686,7 +7008,7 @@ declare module DevExpress.viz.rangeSelector { /** Specifies font options for the text displayed by the range selector slider markers. */ font?: viz.core.Font; /** Specifies a format for the text displayed in slider markers. */ - format?: string; + format?: any; /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ invalidRangeColor?: string; /** @@ -6715,19 +7037,22 @@ declare module DevExpress.viz.rangeSelector { right?: number; }; }; - /** Specifies a precision for the formatted value displayed in slider markers. */ + /** + * Specifies a precision for the formatted value displayed in slider markers. + * @deprecated Use the sliderMarker | format | precision option instead. + */ precision?: number; /** Indicates whether or not the slider markers are visible. */ visible?: boolean; }; } +} +declare module DevExpress.viz { /** A widget that allows end users to select a range of values on a scale. */ - export class dxRangeSelector extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxRangeSelectorOptions); - constructor(element: Element, options?: dxRangeSelectorOptions); - /** Displays the loading indicator. */ + export class dxRangeSelector extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); + constructor(element: Element, options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions); showLoadingIndicator(): void; - /** Conceals the loading indicator. */ hideLoadingIndicator(): void; /** Redraws a widget. */ render(skipChartAnimation?: boolean): void; @@ -6740,7 +7065,7 @@ declare module DevExpress.viz.rangeSelector { interface JQuery { dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; dxRangeSelector(methodName: string, ...params: any[]): any; - dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; + dxRangeSelector(methodName: "instance"): DevExpress.viz.dxRangeSelector; } declare module DevExpress.viz.map { /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ @@ -6919,7 +7244,7 @@ declare module DevExpress.viz.map { customize?: (eleemnts: Array) => void; /** Specifies marker label options. */ label?: { - /** The name of the dataSource attribute containing marker texts. */ + /** The name of the data source attribute containing marker texts. */ dataField?: string; /** Enables marker labels. */ enabled?: boolean; @@ -7158,7 +7483,7 @@ declare module DevExpress.viz.map { */ sizeGroupingField?: string; } - export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { /** * An object specifying options for the map areas. * @deprecated Use the "area" type element of the layers array. @@ -7171,7 +7496,7 @@ declare module DevExpress.viz.map { /** Specifies a color for the background. */ color?: string; }; - /** Specifies options for dxVectorMap widget layers. */ + /** Specifies options for VectorMap widget layers. */ layers?: Array; /** Specifies the map projection. */ projection?: Object; @@ -7194,8 +7519,6 @@ declare module DevExpress.viz.map { /** Specifies the opacity of the control bar. */ opacity?: number; }; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; /** * Specifies a data source for the map area. * @deprecated Use the layers | dataSource option instead. @@ -7211,11 +7534,7 @@ declare module DevExpress.viz.map { * @deprecated Use the "marker" type element of the layers array. */ markerSettings?: MarkerSettings; - /** Specifies the size of the dxVectorMap widget. */ - size?: viz.core.Size; - /** Specifies a title for the vector map. */ - title?: viz.core.Title; - /** Specifies tooltip options. */ + /** Configures tooltips. */ tooltip?: viz.core.Tooltip; /** Configures map legends. */ legends?: Array; @@ -7297,6 +7616,8 @@ declare module DevExpress.viz.map { export interface Legend extends viz.core.BaseLegend { /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ markerColor?: string; + /** Specifies the shape of item markers. */ + markerShape?: string; /** Specifies text for legend items. */ customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ @@ -7309,16 +7630,27 @@ declare module DevExpress.viz.map { grouping?: string; } } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +declare module DevExpress.viz{ /** A vector map widget. */ - export class dxVectorMap extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxVectorMapOptions); - constructor(element: Element, options?: dxVectorMapOptions); - /** Displays the loading indicator. */ + export class dxVectorMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.map.dxVectorMapOptions); + constructor(element: Element, options?: DevExpress.viz.map.dxVectorMapOptions); showLoadingIndicator(): void; - /** Conceals the loading indicator. */ hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(): void; /** Gets the current coordinates of the map center. */ center(): Array; /** Sets the coordinates of the map center. */ @@ -7338,21 +7670,21 @@ declare module DevExpress.viz.map { /** Converts client area coordinates into map coordinates. */ convertCoordinates(x: number, y: number): Array; /** Gets all map layers. */ - getLayers(): Array; + getLayers(): Array; /** Gets the layer by its index. */ - getLayerByIndex(index: number): MapLayer; + getLayerByIndex(index: number): DevExpress.viz.map.MapLayer; /** Gets the layer by its name. */ - getLayerByName(name: string): MapLayer; + getLayerByName(name: string): DevExpress.viz.map.MapLayer; /** * Returns an array with all the map areas. * @deprecated Use the layer's getElements() method instead. */ - getAreas(): Array; + getAreas(): Array; /** * Returns an array with all the map markers. * @deprecated Use the layer's getElements() method instead. */ - getMarkers(): Array; + getMarkers(): Array; /** Gets the current coordinates of the map viewport. */ viewport(): Array; /** Sets the coordinates of the map viewport. */ @@ -7362,24 +7694,11 @@ declare module DevExpress.viz.map { /** Sets the value of the map zoom factor. */ zoomFactor(zoomFactor: number): void; } - export var projection: ProjectionCreator; - export interface ProjectionCreator { - /** Creates a new projection. */ - (data: { - to?: (coordinates: Array) => Array; - from?: (coordinates: Array) => Array; - aspectRatio?: number; - }): Object; - /** Gets the default or custom projection from the projection storage. */ - get(name: string): Object; - /** Adds a new projection to the internal projections storage. */ - add(name: string, projection: Object): void; - } } interface JQuery { dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; dxVectorMap(methodName: string, ...params: any[]): any; - dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; + dxVectorMap(methodName: "instance"): DevExpress.viz.dxVectorMap; } declare module DevExpress.viz.sparklines { export interface SparklineTooltip extends viz.core.Tooltip { @@ -7394,12 +7713,8 @@ declare module DevExpress.viz.sparklines { */ verticalAlignment?: string; } - export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { - /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ - margin?: viz.core.Margins; - /** Specifies the size of the widget. */ - size?: viz.core.Size; - /** Specifies tooltip options. */ + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions, viz.core.MarginOptions { + /** Configures the tooltip. */ tooltip?: SparklineTooltip; /** A handler for the tooltipShown event. */ onTooltipShown?: (e: { @@ -7414,10 +7729,8 @@ declare module DevExpress.viz.sparklines { } /** Overridden by descriptions for particular widgets. */ export class BaseSparkline extends viz.core.BaseWidget { - /** Redraws a widget. */ - render(): void; } - export interface dxBulletOptions extends BaseSparkline { + export interface dxBulletOptions extends BaseSparklineOptions { /** Specifies a color for the bullet bar. */ color?: string; /** Specifies an end value for the invisible scale. */ @@ -7437,11 +7750,6 @@ declare module DevExpress.viz.sparklines { /** Specifies the primary value indicated by the bullet bar. */ value?: number; } - /** A bullet graph widget. */ - export class dxBullet extends BaseSparkline { - constructor(element: JQuery, options?: dxBulletOptions); - constructor(element: Element, options?: dxBulletOptions); - } export interface dxSparklineOptions extends BaseSparklineOptions { /** Specifies the data source field that provides arguments for a sparkline. */ argumentField?: string; @@ -7488,17 +7796,257 @@ declare module DevExpress.viz.sparklines { /** Specifies the maximum value of the sparkline's value axis. */ maxValue?: number; } +} +declare module DevExpress.viz { + /** A bullet graph widget. */ + export class dxBullet extends DevExpress.viz.sparklines.BaseSparkline { + constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxBulletOptions); + constructor(element: Element, options?: DevExpress.viz.sparklines.dxBulletOptions); + } /** A sparkline widget. */ - export class dxSparkline extends BaseSparkline { - constructor(element: JQuery, options?: dxSparklineOptions); - constructor(element: Element, options?: dxSparklineOptions); + export class dxSparkline extends DevExpress.viz.sparklines.BaseSparkline { + constructor(element: JQuery, options?: DevExpress.viz.sparklines.dxSparklineOptions); + constructor(element: Element, options?: DevExpress.viz.sparklines.dxSparklineOptions); } } interface JQuery { dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; dxBullet(methodName: string, ...params: any[]): any; - dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxBullet(methodName: "instance"): DevExpress.viz.dxBullet; dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; dxSparkline(methodName: string, ...params: any[]): any; - dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; + dxSparkline(methodName: "instance"): DevExpress.viz.dxSparkline; +} +declare module DevExpress.viz.treeMap { + export interface dxTreeMapOptions extends viz.core.BaseWidgetOptions, viz.core.RedrawOnResizeOptions, viz.core.TitleOptions, viz.core.LoadingIndicatorOptions, viz.core.ExportOptions { + /** Specifies the origin of data for the widget. */ + dataSource?: any; + /** Specifies the name of the data source field that provides nested items for a group. Applies to hierarchical data sources only. */ + childrenField?: string; + /** Specifies the name of the data source field that provides values for tiles. */ + valueField?: string; + /** Specifies the name of the data source field that provides colors for tiles. */ + colorField?: string; + /** Specifies the name of the data source field that provides texts for tile and group labels. */ + labelField?: string; + /** Specifies the name of the data source field that provides IDs for items. Applies to flat data sources only. */ + idField?: string; + /** Specifies the name of the data source field that provides parent IDs for items. Applies to flat data sources only. */ + parentField?: string; + /** Specifies the layout algorithm. */ + layoutAlgorithm?: any; + /** Specifies the direction in which the items will be laid out. */ + layoutDirection?: string; + /** Configures tiles. */ + tile?: { + /** Configures the tile borders. */ + border?: { + /** Specifies the width of the tile borders in pixels. */ + width?: number; + /** Colors the tile borders. */ + color?: string; + }; + /** Specifies a single color for all tiles. */ + color?: string; + /** Specifies the appearance of tiles in the hover state. */ + hoverStyle?: { + /** Configures the appearance of the tile borders in the hover state. */ + border?: { + /** Specifies the width of the tile borders in pixels. Applies to a tile in the hover state. */ + width?: number; + /** Colors the tile borders in the hover state. */ + color?: string; + }; + /** Colors tiles in the hover state. */ + color?: string; + }; + /** Specifies the appearance of tiles in the selected state. */ + selectionStyle?: { + /** Configures the appearance of the tile borders in the selected state. */ + border?: { + /** Specifies the width of the tile borders in pixels. Applies to a tile in the selected state. */ + width?: number; + /** Colors the tile borders in the selected state. */ + color?: string; + }; + /** Colors tiles in the selected state. */ + color?: string; + }; + /** Configures the tile labels. */ + label?: { + /** Changes the visibility of the tile labels. */ + visible?: boolean; + /** Specifies the font settings of the tile labels. */ + font?: viz.core.Font; + }; + }; + /** Configures groups. */ + group?: { + /** Specifies the height of the group headers in pixels. */ + headerHeight?: number; + /** Configures the group borders. */ + border?: { + /** Specifies the width of the group borders in pixels. */ + width?: number; + /** Colors the group borders. */ + color?: string; + }; + /** Colors the group headers. */ + color?: string; + /** Specifies the appearance of groups in the hover state. */ + hoverStyle?: { + /** Configures the appearance of the group borders in the hover state. */ + border?: { + /** Specifies the width of the group borders in pixels. Applies to a group in the hover state. */ + width?: number; + /** Colors the group borders in the hover state. */ + color?: string; + }; + /** Colors the group headers in the hover state. */ + color?: string; + }; + /** Specifies the appearance of groups in the selected state. */ + selectionStyle?: { + /** Configures the appearance of the group borders in the selected state. */ + border?: { + /** Specifies the width of the group borders in pixels. Applies to a group in the selected state. */ + width?: number; + /** Colors the group borders in the selected state. */ + color?: string; + }; + /** Colors the group headers in the selected state. */ + color?: string; + }; + /** Configures the group labels. */ + label?: { + /** Changes the visibility of the group labels. */ + visible?: boolean; + /** Specifies the font settings of the group labels. */ + font?: viz.core.Font; + }; + }; + /** Manages the color settings. */ + colorizer?: { + /** Specifies the colorizing algorithm. */ + type?: string; + /** Sets the palette to be used for colorizing tiles. */ + palette?: any; + /** Specifies whether or not all tiles in a group must be colored uniformly. Applies only if the type option is "discrete". */ + colorizeGroups?: boolean; + /** Allows you to paint tiles with similar values uniformly. Applies only if the type option is "gradient" or "range". */ + range?: Array; + /** Specifies the name of the data source field whose values define the color of a tile. Applies only if the type option is "gradient" or "range". */ + colorCodeField?: string; + }; + /** Specifies whether tiles and groups change their style in the hover state. */ + hoverEnabled?: boolean; + /** Specifies whether a single or multiple nodes can be in the selected state simultaneously. */ + selectionMode?: string; + /** Specifies how many hierarchical levels must be visualized. */ + maxDepth?: number; + /** Specifies whether the user will interact with a single tile or its group. */ + interactWithGroup?: boolean; + tooltip?: viz.core.Tooltip; + /** A handler for the nodesInitialized event. */ + onNodesInitialized?: (e: { + component: dxTreeMap; + element: Element; + root: TreeMapNode + }) => void; + /** A handler for the nodesRendering event. */ + onNodesRendering?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the hoverChanged event. */ + onHoverChanged?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode; + }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode; + }) => void; + /** A handler for the drill event. */ + onDrill?: (e: { + component: dxTreeMap; + element: Element; + node: TreeMapNode + }) => void; + } + /** This section describes fields and methods that can be used in code to manipulate a Node object. */ + export interface TreeMapNode { + /** The level that the current node occupies in the hierarchy of nodes. */ + level: number; + /** The index of the current node in the array of all nodes on the same level. */ + index: number; + /** The object from the data source visualized by the node. */ + data: Object; + /** Returns the parent node of the current node. */ + getParent(): TreeMapNode; + /** Indicates how many direct descendants the current node has. */ + getChildrenCount(): number; + /** Returns all nodes nested in the current node. */ + getAllChildren(): Array; + /** Returns all descendant nodes. */ + getAllNodes(): Array; + /** Gets a specific node from a collection of direct descendants. */ + getChild(index: number): TreeMapNode; + /** Gets the raw value of the node. */ + value(): number; + /** Returns the label of the node. */ + label(): string; + /** Sets the label to the node. */ + label(label: string): void; + /** Customizes the node. */ + customize(options: any): void; + /** Reverts the appearance of the node to the initial state. */ + resetCustomization(): void; + /** Indicates whether the node is in the hover state or not. */ + isHovered(): boolean; + /** Sets the selection state of a node. */ + select(state: boolean): void; + /** Indicates whether the node is selected or not. */ + isSelected(): boolean; + /** Indicates whether the node is visualized by a tile or a group of tiles. */ + isLeaf(): boolean; + /** Indicates whether the current node is active. */ + isActive(): boolean; + /** Shows the tooltip. */ + showTooltip(): void; + /** Drills down into the node. */ + drillDown(): void; + } +} +declare module DevExpress.viz { + /** A widget for displaying hierarchical data by using nested rectangles. */ + export class dxTreeMap extends viz.core.BaseWidget implements viz.core.LoadingIndicatorMethods { + constructor(element: JQuery, options?: DevExpress.viz.treeMap.dxTreeMapOptions); + constructor(element: Element, options?: DevExpress.viz.treeMap.dxTreeMapOptions); + /** Returns the root node. */ + getRootNode(): DevExpress.viz.treeMap.TreeMapNode; + /** Returns the current node. */ + getCurrentNode(): DevExpress.viz.treeMap.TreeMapNode; + /** Deselects all nodes in the widget. */ + clearSelection(): void; + /** Hides the tooltip. */ + hideTooltip(): void; + /** Drills one level up. */ + drillUp(): void; + /** Resets the drill down level. */ + resetDrillDown(): void; + showLoadingIndicator(): void; + hideLoadingIndicator(): void; + } +} +interface JQuery { + dxTreeMap(options?: DevExpress.viz.treeMap.dxTreeMapOptions): JQuery; + dxTreeMap(methodName: string, ...params: any[]): any; + dxTreeMap(methodName: "instance"): DevExpress.viz.dxTreeMap; } diff --git a/dexie/dexie-tests.ts b/dexie/dexie-tests.ts deleted file mode 100644 index 7eb6a75dbb..0000000000 --- a/dexie/dexie-tests.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Dexie from "dexie"; - -interface IFriend { - id?: number, - name?: string, - age?: number -} - -class MyDB extends Dexie { - friends: Dexie.Table; - constructor() { - super("MyDB"); - this.version(1).stores({ - friends: "++id,name,age" - }); - } -} - -var db = new MyDB(); - -db.friends.add({name: "Kalle", age: 23}).then(()=>{ - db.friends.where('age').below(30).count(count => { - console.log("Num yound friends: " + count); - }); -}); diff --git a/dexie/index.d.ts b/dexie/index.d.ts deleted file mode 100644 index 720d38fb29..0000000000 --- a/dexie/index.d.ts +++ /dev/null @@ -1,323 +0,0 @@ -// Type definitions for Dexie v1.3.1 -// Project: https://github.com/dfahlander/Dexie.js -// Definitions by: David Fahlander -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Thenable { - then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; - then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; -} - -declare type IndexableType = string | number | Date | Array; - -declare class Dexie { - constructor(databaseName: string); - - constructor(databaseName: string, options: { addons: Array<(db: Dexie) => void> }); - - name: string; - tables: Dexie.Table[]; - verno: number; - - static addons: Array<(db: Dexie) => void>; - static version: number; - - static getDatabaseNames(): Dexie.Promise>; - - static getDatabaseNames(onFulfilled: (value: Array) => Thenable): Dexie.Promise; - - static getDatabaseNames(onFulfilled: (value: Array) => U): Dexie.Promise; - - static getByKeyPath(obj: Object, keyPath: string): any; - - static setByKeyPath(obj: Object, keyPath: string, value: any): void; - - static delByKeyPath(obj: Object, keyPath: string): void; - - static shallowClone(obj: Object): Object; - - static deepClone(obj: Object): Object; - - static delete(databaseName : string): Dexie.Promise; - - static exists(databaseName : string): Dexie.Promise; - - version(versionNumber: Number): Dexie.Version - - on: { - (eventName: string, subscriber: () => any): void; - (eventName: string, subscriber: () => any, bSticky: boolean): void; - ready: Dexie.DexieOnReadyEvent; - error: Dexie.DexieErrorEvent; - populate: Dexie.DexieEvent; - blocked: Dexie.DexieEvent; - versionchange: Dexie.DexieVersionChangeEvent; - } - - open(): Dexie.Promise; - - table(tableName: string): Dexie.Table; - - table(tableName: string): Dexie.Table; - - table(tableName: string): Dexie.Table; - - transaction(mode: string, table: Dexie.Table, scope: () => Thenable): Dexie.Promise; - - transaction(mode: string, table: Dexie.Table, table2: Dexie.Table, scope: () => Thenable): Dexie.Promise; - - transaction(mode: string, table: Dexie.Table, table2: Dexie.Table, table3: Dexie.Table, scope: () => Thenable): Dexie.Promise; - - transaction(mode: string, tables: Dexie.Table[], scope: () => Thenable): Dexie.Promise; - - transaction(mode: string, table: Dexie.Table, scope: () => U): Dexie.Promise; - - transaction(mode: string, table: Dexie.Table, table2: Dexie.Table, scope: () => U): Dexie.Promise; - - transaction(mode: string, table: Dexie.Table, table2: Dexie.Table, table3: Dexie.Table, scope: () => U): Dexie.Promise; - - transaction(mode: string, tables: Dexie.Table[], scope: () => U): Dexie.Promise; - - close(): void; - - delete(): Dexie.Promise; - - exists(name : string) : Dexie.Promise; - - isOpen(): boolean; - - hasFailed(): boolean; - - backendDB(): IDBDatabase; - - vip(scopeFunction: () => U): U; -} - -declare namespace Dexie { - - class Promise implements Thenable { - constructor(callback: (resolve: (value?: Thenable) => void, reject: (error?: any) => void) => void); - - constructor(callback: (resolve: (value?: R) => void, reject: (error?: any) => void) => void); - - then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Promise; - - then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Promise; - - then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Promise; - - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Promise; - - catch(onRejected: (error: any) => Thenable): Promise; - - catch(onRejected: (error: any) => U): Promise; - - catch(ExceptionType: Function, onRejected: (error: any) => Promise): Promise; - - catch(ExceptionType: Function, onRejected: (error: any) => U): Promise; - - catch(errorName: string, onRejected: (error: any) => Promise): Promise; - - catch(errorName: string, onRejected: (error: any) => U): Promise; - - finally(onFinally: () => any): Promise; - - onuncatched: () => any; - } - - namespace Promise { - function resolve(value?: Thenable): Promise; - - function resolve(value?: R): Promise; - - function reject(error: any): Promise; - - function all(promises: Thenable[]): Promise; - - function all(...promises: Thenable[]): Promise; - - function race(promises: Thenable[]): Promise; - - function newPSD(scope: () => R): R; - - var PSD: any; - - var on: { - (eventName: string, subscriber: (...args: any[]) => any): void; - error: DexieErrorEvent; - } - } - - - interface Version { - stores(schema: { [key: string]: string }): Version; - upgrade(fn: (trans: Transaction) => void): Version; - } - - interface Transaction { - active: boolean; - db: Dexie; - mode: string; - idbtrans: IDBTransaction; - tables: { [type: string]: Table }; - storeNames: Array; - on: { - (eventName: string, subscriber: () => any): void; - complete: DexieEvent; - abort: DexieEvent; - error: DexieEvent; - } - abort(): void; - table(tableName: string): Table; - table(tableName: string): Table; - table(tableName: string): Table; - } - - interface DexieEvent { - subscribe(fn: () => any): void; - unsubscribe(fn: () => any): void; - fire(): any; - } - - interface DexieErrorEvent { - subscribe(fn: (error: any) => any): void; - unsubscribe(fn: (error: any) => any): void; - fire(error: any): any; - } - - interface DexieVersionChangeEvent { - subscribe(fn: (event: IDBVersionChangeEvent) => any): void; - unsubscribe(fn: (event: IDBVersionChangeEvent) => any): void; - fire(event: IDBVersionChangeEvent): any; - } - - interface DexieOnReadyEvent { - subscribe(fn: () => any, bSticky: boolean): void; - unsubscribe(fn: () => any): void; - fire(): any; - } - - interface Table { - name: string; - schema: TableSchema; - hook: { - (eventName: string, subscriber: () => any): void; - creating: DexieEvent; - reading: DexieEvent; - updating: DexieEvent; - deleting: DexieEvent; - } - - get(key: Key): Promise; - where(index: string): WhereClause; - - filter(fn: (obj: T) => boolean): Collection; - - count(): Promise; - count(onFulfilled: (value: number) => Thenable): Promise; - count(onFulfilled: (value: number) => U): Promise; - - offset(n: number): Collection; - - limit(n: number): Collection; - - each(callback: (obj: T, cursor: IDBCursor) => any): Promise; - - toArray(): Promise>; - toArray(onFulfilled: (value: Array) => Thenable): Promise; - toArray(onFulfilled: (value: Array) => U): Promise; - - toCollection(): Collection; - orderBy(index: string): Collection; - reverse(): Collection; - mapToClass(constructor: Function): Function; - add(item: T, key?: Key): Promise; - update(key: Key, changes: { [keyPath: string]: any }): Promise; - put(item: T, key?: Key): Promise; - delete(key: Key): Promise; - clear(): Promise; - } - - interface WhereClause { - above(key: IndexableType): Collection; - aboveOrEqual(key: IndexableType): Collection; - anyOf(keys: IndexableType[]): Collection; - anyOf(...keys: IndexableType[]): Collection; - anyOfIgnoreCase(keys: string[]): Collection; - anyOfIgnoreCase(...keys: string[]): Collection; - below(key: IndexableType): Collection; - belowOrEqual(key: IndexableType): Collection; - between(lower: IndexableType, upper: IndexableType, includeLower?: boolean, includeUpper?: boolean): Collection; - equals(key: IndexableType): Collection; - equalsIgnoreCase(key: string): Collection; - inAnyRange(ranges: Array): Collection; - startsWith(key: string): Collection; - startsWithAnyOf(prefixes: string[]): Collection; - startsWithAnyOf(...prefixes: string[]): Collection; - startsWithIgnoreCase(key: string): Collection; - startsWithAnyOfIgnoreCase(prefixes: string[]): Collection; - startsWithAnyOfIgnoreCase(...prefixes: string[]): Collection; - noneOf(keys: Array): Collection; - notEqual(key: IndexableType): Collection; - } - - interface Collection { - and(filter: (x: T) => boolean): Collection; - count(): Promise; - count(onFulfilled: (value: number) => Thenable): Promise; - count(onFulfilled: (value: number) => U): Promise; - distinct(): Collection; - each(callback: (obj: T, cursor: IDBCursor) => any): Promise; - eachKey(callback: (key: Key, cursor: IDBCursor) => any): Promise; - eachUniqueKey(callback: (key: Key, cursor: IDBCursor) => any): Promise; - first(): Promise; - first(onFulfilled: (value: T) => Thenable): Promise; - first(onFulfilled: (value: T) => U): Promise; - keys(): Promise; - keys(onFulfilled: (value: Key[]) => Thenable): Promise; - keys(onFulfilled: (value: Key[]) => U): Promise; - last(): Promise; - last(onFulfilled: (value: T) => Thenable): Promise; - last(onFulfilled: (value: T) => U): Promise; - limit(n: number): Collection; - offset(n: number): Collection; - or(indexOrPrimayKey: string): WhereClause; - reverse(): Collection; - sortBy(keyPath: string): Promise; - sortBy(keyPath: string, onFulfilled: (value: T[]) => Thenable): Promise; - sortBy(keyPath: string, onFulfilled: (value: T[]) => U): Promise; - toArray(): Promise>; - toArray(onFulfilled: (value: Array) => Thenable): Promise; - toArray(onFulfilled: (value: Array) => U): Promise; - uniqueKeys(): Promise; - uniqueKeys(onFulfilled: (value: Key[]) => Thenable): Promise; - uniqueKeys(onFulfilled: (value: Key[]) => U): Promise; - until(filter: (value: T) => boolean, includeStopEntry?: boolean): Collection; - // WriteableCollection: - delete(): Promise; - modify(changes: { [keyPath: string]: any }): Promise; - modify(changeCallback: (obj: T) => void): Promise; - } - - interface TableSchema { - name: string; - primKey: IndexSpec; - indexes: IndexSpec[]; - mappedClass: Function; - } - - interface IndexSpec { - name: string; - keyPath: any; // string | Array - unique: boolean; - multi: boolean; - auto: boolean; - compound: boolean; - src: string; - } -} - -export default Dexie; - diff --git a/dhtmlxgantt/dhtmlxgantt-tests.ts b/dhtmlxgantt/dhtmlxgantt-tests.ts index f20a92506d..6ea32b509d 100644 --- a/dhtmlxgantt/dhtmlxgantt-tests.ts +++ b/dhtmlxgantt/dhtmlxgantt-tests.ts @@ -3,6 +3,7 @@ //date operations var start: Date = gantt.date.week_start(new Date()); var next: Date = gantt.date.add(new Date(), 1, "week"); +var datePos: Date = gantt.dateFromPos(0); //hotkeys gantt.keys.edit_cancel = 13; @@ -33,4 +34,4 @@ gantt.attachEvent("onBeforeLightbox", function (id?: string) { }); //gantt enterprise var gantt2 = Gantt.getGanttInstance(); -gantt2.config.api_date = "format"; \ No newline at end of file +gantt2.config.api_date = "format"; diff --git a/dhtmlxgantt/index.d.ts b/dhtmlxgantt/index.d.ts index a9542cc00f..f94ba88a33 100644 --- a/dhtmlxgantt/index.d.ts +++ b/dhtmlxgantt/index.d.ts @@ -1,13 +1,13 @@ // Type definitions for dhtmlxGantt 4.0.0 // Project: http://dhtmlx.com/docs/products/dhtmlxGantt -// Definitions by: Maksim Kozhukh +// Definitions by: Maksim Kozhukh , Christophe Camicas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface GanttCallback { (...args: any[]) : any } -type GanttEventName ='onAfterAutoSchedule'|'onAfterBatchUpdate'|'onAfterLightbox'|'onAfterLinkAdd'|'onAfterLinkDelete'|'onAfterLinkUpdate'|'onAfterRedo'|'onAfterTaskAdd'|'onAfterTaskAutoSchedule'|'onAfterTaskDelete'|'onAfterTaskDrag'|'onAfterTaskMove'|'onAfterTaskUpdate'|'onAfterUndo'|'onAjaxError'|'onBeforeAutoSchedule'|'onBeforeBatchUpdate'|'onBeforeCollapse'|'onBeforeDataRender'|'onBeforeExpand'|'onBeforeGanttReady'|'onBeforeGanttRender'|'onBeforeLightbox'|'onBeforeLinkAdd'|'onBeforeLinkDelete'|'onBeforeLinkDisplay'|'onBeforeLinkUpdate'|'onBeforeParse'|'onBeforeRedo'|'onBeforeRowDragEnd'|'onBeforeTaskAdd'|'onBeforeTaskAutoSchedule'|'onBeforeTaskChanged'|'onBeforeTaskDelete'|'onBeforeTaskDisplay'|'onBeforeTaskDrag'|'onBeforeTaskMove'|'onBeforeTaskSelected'|'onBeforeTaskUpdate'|'onBeforeUndo'|'onCircularLinkError'|'onClear'|'onCollapse'|'onColumnResize'|'onColumnResizeEnd'|'onColumnResizeStart'|'onContextMenu'|'onDataRender'|'onEmptyClick'|'onError'|'onExpand'|'onGanttReady'|'onGanttRender'|'onGanttScroll'|'onGridHeaderClick'|'onGridResize'|'onGridResizeEnd'|'onGridResizeStart'|'onLightbox'|'onLightboxButton'|'onLightboxCancel'|'onLightboxChange'|'onLightboxDelete'|'onLightboxSave'|'onLinkClick'|'onLinkDblClick'|'onLinkIdChange'|'onLinkValidation'|'onLoadEnd'|'onLoadStart'|'onMouseMove'|'onOptionsLoad'|'onParse'|'onRowDragEnd'|'onRowDragStart'|'onScaleAdjusted'|'onScaleClick'|'onTaskClick'|'onTaskClosed'|'onTaskCreated'|'onTaskDblClick'|'onTaskDrag'|'onTaskIdChange'|'onTaskLoading'|'onTaskOpened'|'onTaskRowClick'|'onTaskSelected'|'onTaskUnselected'|'onTemplatesReady'; +type GanttCallback = (...args: any[]) => any; +type GanttEventName = 'onAfterAutoSchedule'|'onAfterBatchUpdate'|'onAfterLightbox'|'onAfterLinkAdd'|'onAfterLinkDelete'|'onAfterLinkUpdate'|'onAfterRedo'|'onAfterTaskAdd'|'onAfterTaskAutoSchedule'|'onAfterTaskDelete'|'onAfterTaskDrag'|'onAfterTaskMove'|'onAfterTaskUpdate'|'onAfterUndo'|'onAjaxError'|'onBeforeAutoSchedule'|'onBeforeBatchUpdate'|'onBeforeCollapse'|'onBeforeDataRender'|'onBeforeExpand'|'onBeforeGanttReady'|'onBeforeGanttRender'|'onBeforeLightbox'|'onBeforeLinkAdd'|'onBeforeLinkDelete'|'onBeforeLinkDisplay'|'onBeforeLinkUpdate'|'onBeforeParse'|'onBeforeRedo'|'onBeforeRowDragEnd'|'onBeforeTaskAdd'|'onBeforeTaskAutoSchedule'|'onBeforeTaskChanged'|'onBeforeTaskDelete'|'onBeforeTaskDisplay'|'onBeforeTaskDrag'|'onBeforeTaskMove'|'onBeforeTaskSelected'|'onBeforeTaskUpdate'|'onBeforeUndo'|'onCircularLinkError'|'onClear'|'onCollapse'|'onColumnResize'|'onColumnResizeEnd'|'onColumnResizeStart'|'onContextMenu'|'onDataRender'|'onEmptyClick'|'onError'|'onExpand'|'onGanttReady'|'onGanttRender'|'onGanttScroll'|'onGridHeaderClick'|'onGridResize'|'onGridResizeEnd'|'onGridResizeStart'|'onLightbox'|'onLightboxButton'|'onLightboxCancel'|'onLightboxChange'|'onLightboxDelete'|'onLightboxSave'|'onLinkClick'|'onLinkDblClick'|'onLinkIdChange'|'onLinkValidation'|'onLoadEnd'|'onLoadStart'|'onMouseMove'|'onOptionsLoad'|'onParse'|'onRowDragEnd'|'onRowDragStart'|'onScaleAdjusted'|'onScaleClick'|'onTaskClick'|'onTaskClosed'|'onTaskCreated'|'onTaskDblClick'|'onTaskDrag'|'onTaskIdChange'|'onTaskLoading'|'onTaskOpened'|'onTaskRowClick'|'onTaskSelected'|'onTaskUnselected'|'onTemplatesReady'; -interface GanttTemplates{ +interface GanttTemplates { /** * specifies the format of dates that are set by means of API methods. Used to parse incoming dates * @param date the date which needs formatting @@ -269,7 +269,7 @@ interface GanttTemplates{ } -interface GanttConfigOptions{ +interface GanttConfigOptions { /** * sets the date format for addTask() method to */ @@ -802,7 +802,7 @@ interface GanttConfigOptions{ } -interface GanttDateHelpers{ +interface GanttDateHelpers { add(origin: Date, count: number, unit: string): Date; copy(origin: Date): Date; @@ -823,21 +823,21 @@ interface GanttDateHelpers{ to_fixed(value: number): string; } -interface GanttHotkeys{ +interface GanttHotkeys { edit_save: number; edit_cancel: number; } -//Gantt.locale +//Gantt.locale -interface GanttLocaleDate{ +interface GanttLocaleDate { month_full: string[]; month_short: string[]; day_full: string[]; day_short: string[]; } -interface GanttLocaleLabels{ +interface GanttLocaleLabels { new_task: string; icon_save: string; icon_cancel: string; @@ -861,25 +861,25 @@ interface GanttLocaleLabels{ years: string; } -interface GanttLocale{ +interface GanttLocale { date: GanttLocaleDate; labels: GanttLocaleLabels; } -interface GanttEnterprise{ +interface GanttEnterprise { /** * Creates a new instance of Gantt */ getGanttInstance(): GanttStatic; } -interface GanttStatic{ +interface GanttStatic { templates: GanttTemplates; config: GanttConfigOptions; date: GanttDateHelpers; keys: GanttHotkeys; - skin: String; - version: String; + skin: string; + version: string; locale: GanttLocale; $click: any; @@ -1056,10 +1056,10 @@ interface GanttStatic{ dataProcessor(url: string): void; /** - * gets the date of the specified horizontal position in the chart area + * returns the date of the specified horizontal position in the chart area * @param pos the relative horizontal position you want to know the date of */ - dateFromPos(pos: number): void; + dateFromPos(pos: number): Date; /** * returns false if the provided argument is undefined, otherwise true @@ -1730,4 +1730,4 @@ interface GanttStatic{ declare var gantt: GanttStatic; -declare var Gantt: GanttEnterprise; \ No newline at end of file +declare var Gantt: GanttEnterprise; diff --git a/doccookies/index.d.ts b/doccookies/index.d.ts index c8f87bffb0..e2590a2def 100644 --- a/doccookies/index.d.ts +++ b/doccookies/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for docCookies +// Type definitions for docCookies // Project: https://developer.mozilla.org/en-US/docs/Web/API/document.cookie // Definitions by: Jon Egerton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/docopt/index.d.ts b/docopt/index.d.ts index 05d0da4524..a40904bf76 100644 --- a/docopt/index.d.ts +++ b/docopt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Docopt v0.6.2 +// Type definitions for Docopt v0.6.2 // Project: http://docopt.org/ // Definitions by: Giovanni Bassi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/documentdb-server/index.d.ts b/documentdb-server/index.d.ts index 4afc0da96e..907fbd3d8c 100644 --- a/documentdb-server/index.d.ts +++ b/documentdb-server/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DocumentDB server side JavaScript SDK +// Type definitions for DocumentDB server side JavaScript SDK // Project: http://dl.windowsazure.com/documentDB/jsserverdocs // Definitions by: François Nguyen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/domurl/index.d.ts b/domurl/index.d.ts index 8c418c75cc..d0b7896d61 100644 --- a/domurl/index.d.ts +++ b/domurl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for domurl +// Type definitions for domurl // Project: https://github.com/Mikhus/domurl // Definitions by: Mikhus // Definitions: https://github.com/Mikhus/DefinitelyTyped diff --git a/dot/index.d.ts b/dot/index.d.ts index 8e4f9afdb0..6bc646b771 100644 --- a/dot/index.d.ts +++ b/dot/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for doT v1.0.1 +// Type definitions for doT v1.0.1 // Project: https://github.com/olado/doT // Definitions by: ZombieHunter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/doubleclick-gpt/doubleclick-gpt-tests.ts b/doubleclick-gpt/doubleclick-gpt-tests.ts new file mode 100644 index 0000000000..4bf01bf6e8 --- /dev/null +++ b/doubleclick-gpt/doubleclick-gpt-tests.ts @@ -0,0 +1,425 @@ +if (googletag && googletag.apiReady) { + // GPT API can be called safely. +} + +googletag.cmd.push(() => { + googletag + .defineSlot("/1234567/sports", [160, 600]) + .addService(googletag.pubads()); +}); + +googletag.defineOutOfPageSlot("/1234567/sports", "div-1"); + +googletag.defineSlot("/1234567/sports", [728, 90], "div-1"); + +// The calls to construct an ad and display contents. +let slot1 = + googletag.pubads().display("/1234567/sports", [728, 90], "div-1"); +let slot2 = + googletag.pubads().display("/1234567/news", [160, 600], "div-2"); +let slot3 = + googletag.pubads().display("/1234567/weather", [160, 600], "div-3"); + +// This call to destroy only slot1. +googletag.destroySlots([slot1]); + +// This call to destroy both slot1 and slot2. +googletag.destroySlots([slot1, slot2]); + +// This call to destroy all slots. +googletag.destroySlots(); + +googletag.cmd.push(() => { + googletag.display("div-1"); +}); + +// Calling with div id +googletag.openConsole("div-1"); + +// Calling without div id +googletag.openConsole(); + +googletag.setAdIframeTitle("title"); + +googletag.cmd.push(function() { + googletag.defineSlot("/1234567/sports", [160, 600]). + addService(googletag.pubads()); +}); + +googletag.companionAds().setRefreshUnfilledSlots(true); + +let slot = googletag.defineSlot("/1234567/sports", [728, 90], "div-1"). + addService(googletag.content()); +googletag.enableServices(); + +let content = ""; +googletag.content().setContent(slot, content); + +googletag.pubads().definePassback("/1234567/sports", [468, 60]).display(); + +googletag.pubads().definePassback("/1234567/sports", [468, 60]) + .setClickUrl("%%CLICK_URL_UNESC%%") + .display(); + +googletag.pubads().definePassback("/1234567/sports", [468, 60]) + .setForceSafeFrame(true) + .display(); + +googletag.pubads().definePassback("/1234567/sports", [468, 60]) + .setTagForChildDirectedTreatment(1) + .display(); + +googletag.pubads().definePassback("/1234567/sports", [468, 60]). + setTargeting("color", "red"). + setTargeting("sport", ["rugby", "rowing"]). + display(); + +googletag.pubads().definePassback("/1234567/sports", [160, 600]). + updateTargetingFromMap({"color": "red", + "interests": ["sports", "music", "movies"]}). + display(); + +// The calls to construct an ad and display contents. +slot1 = googletag.pubads().display("/1234567/sports", [728, 90], "div-1"); +slot2 = googletag.pubads().display("/1234567/news", [160, 600], "div-2"); +slot3 = googletag.pubads().display("/1234567/weather", [160, 600], "div-3"); + +// This call to clear only slot1. +googletag.pubads().clear([slot1]); + +// This call to clear both slot1 and slot2. +googletag.pubads().clear([slot1, slot2]); + +// This call to clear all slots. +googletag.pubads().clear(); + +// Set category exclusion to exclude ads with "AirlineAd" labels. +googletag.pubads().setCategoryExclusion("AirlineAd"); + +// Make ad requests. No ad with "AirlineAd" label will be returned. + +// Clear category exclusions so all ads can be returned. +googletag.pubads().clearCategoryExclusions(); + +// Mark ad requests as child-directed. +googletag.pubads().setTagForChildDirectedTreatment(1); + +// Clear child-directed setting and return to initial not-set value. +googletag.pubads().clearTagForChildDirectedTreatment(); + +googletag.pubads().setTargeting("interests", "sports"); +googletag.pubads().setTargeting("colors", "blue"); +googletag.pubads().setTargeting("fruits", "apple"); + +googletag.pubads().clearTargeting("interests"); +// Targeting "colors" and "fruits" are still present, while "interests" was +// cleared. + +googletag.pubads().clearTargeting(); +// All targeting has been cleared. + +googletag.pubads().defineOutOfPagePassback("/1234567/sports").display(); + +googletag.pubads().definePassback("/1234567/sports", [468, 60]).display(); + +googletag.pubads().display("/1234567/sports", [728, 90], "div-1"); + +googletag.pubads().set("adsense_background_color", "#FFFFFF"); +let color = googletag.pubads().get("adsense_background_color"); +// color == "#FFFFFF". + +googletag.pubads().set("adsense_background_color", "#FFFFFF"); +googletag.pubads().set("adsense_border_color", "#AABBCC"); +let keys = googletag.pubads().getAttributeKeys(); +// Keys are ["adsense_background_color", "adsense_border_color"]. + +googletag.pubads().setTargeting("interests", "sports"); + +let param = googletag.pubads().getTargeting("interests"); +// param is ["sports"] + +param = googletag.pubads().getTargeting("age"); +// param is [] (empty array) + +googletag.pubads().setTargeting("interests", "sports"); +googletag.pubads().setTargeting("colors", "blue"); + +keys = googletag.pubads().getTargetingKeys(); +// keys are ["interests", "colors"]. + +// The calls to construct slots and display contents. +slot1 = googletag.defineSlot("/1234567/sports", [728, 90], "div-1"); +slot2 = googletag.defineSlot("/1234567/news", "fluid", "div-2"); +slot3 = googletag.defineSlot("/1234567/weather", [160, 600], "div-3"); + +// This call to refresh fetches a new ad for slot1 only. +googletag.pubads().refresh([slot1]); + +// This call to refresh fetches a new ad for both slot1 and slot2. +googletag.pubads().refresh([slot1, slot2]); + +// This call to refresh fetches a new ad for each slot. +googletag.pubads().refresh(); + +// This call to refresh fetches a new ad for slot1, without changing the +// correlator. +googletag.pubads().refresh([slot1], {changeCorrelator: false}); + +// This call to refresh fetches a new ad for each slot, without changing +// the correlator. +googletag.pubads().refresh(undefined, {changeCorrelator: false}); + +// Label = AirlineAd. +googletag.pubads().setCategoryExclusion("AirlineAd"); + +// Make DFP ads centered. +googletag.pubads().setCentering(true); + +googletag.pubads().setCookieOptions(1); + +googletag.pubads().setForceSafeFrame(true); + +// The following slot will be opted-out of the page-level force +// safeframe instruction. +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setForceSafeFrame(false). + addService(googletag.pubads()); + +// The following slot will have safeframe forced. +googletag.defineSlot("/1234567/news", [160, 600], "div-2"). + addService(googletag.pubads()); + +// Latitude, longitude: +googletag.pubads().setLocation(34, -45.12); + +// Latitude, longitude, and precision in millimeters: +googletag.pubads().setLocation(34, -45.12, 10000); + +// Postal code: +googletag.pubads().setLocation("10001,US"); + +googletag.pubads().setPublisherProvidedId("AB123456789"); + +googletag.pubads().setForceSafeFrame(true); + +let pageConfig = { + allowOverlayExpansion: true, + allowPushExpansion: true, + sandbox: true +}; + +let slotConfig = {allowOverlayExpansion: false}; + +googletag.pubads().setSafeFrameConfig(pageConfig); + +// The following slot will not allow for expansion by overlay. +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setSafeFrameConfig(slotConfig). + addService(googletag.pubads()); + +// The following slot will inherit the page level settings, and hence +// would allow for expansion by overlay. +googletag.defineSlot("/1234567/news", [160, 600], "div-2"). + addService(googletag.pubads()); + +googletag.display(); + +googletag.pubads().setTagForChildDirectedTreatment(1); + +// Example with a single value for a key. +googletag.pubads().setTargeting("interests", "sports"); + +// Example with multiple values for a key inside in an array. +googletag.pubads().setTargeting("interests", ["sports", "music", "movies"]); + +// Assume that the correlator is currently 12345. All ad requests made by +// this page will currently use that value. + +// Replace the current correlator with a new correlator. +googletag.pubads().updateCorrelator(); + +// 1. Slot render ended listener. +// The listener will be called only when the pubads service renders a slot. +// To listen to companion ads, add a similar listener to +// googletag.companionAds(). +googletag.pubads().addEventListener("slotRenderEnded", function(event: googletag.events.SlotRenderEndedEvent) { + console.log("Slot has been rendered:"); + console.log(event); +}); + +// 2. Slot render ended listener, slot specific logic. +// Listeners operate at service level, which means that you cannot add a +// listener for a slotRenderEnded event for a specific slot only. You can, +// however, programmatically filter a listener to respond only to a certain +// ad slot, using this pattern: +let targetSlot = slot1; +googletag.pubads().addEventListener("slotRenderEnded", function(event: googletag.events.SlotRenderEndedEvent) { + if (event.slot === targetSlot) { + // Slot specific logic. + } +}); + +// 3. Impression viewable listener, slot specific logic. +// The listener will be called when the impression is considered viewable. +// This event also operates at service level, but, as above, you can filter +// to respond only to a certain ad slot by using this pattern: +googletag.pubads().addEventListener("impressionViewable", function(event: googletag.events.ImpressionViewableEvent) { + if (event.slot === targetSlot) { + // Slot specific logic. + } +}); + +let mapping1 = googletag.sizeMapping(). + addSize([1024, 768], [970, 250]). + addSize([980, 690], [728, 90]). + addSize([640, 480], "fluid"). + addSize([0, 0], [88, 31]). // Fits browsers of any size smaller than 640x480. + build(); +let mapping2 = googletag.sizeMapping(). + addSize([1024, 768], [970, 250]). + addSize([980, 690], []). + addSize([640, 480], [120, 60]). + addSize([0, 0], []). + build(); + +googletag.defineSlot("/1234567/sports", [160, 600]). + addService(googletag.pubads()); + +// Set category exclusion to exclude ads with "AirlineAd" labels. +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setCategoryExclusion("AirlineAd"). + addService(googletag.pubads()); + +// Make an ad request. No ad with "AirlineAd" label will be returned for the slot. + +// Clear category exclusions so all ads can be returned. +slot.clearCategoryExclusions(); + +// Make an ad request. Any ad can be returned for the slot. + + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setTargeting("allow_expandable", "true"). + setTargeting("interests", ["sports", "music", "movies"]). + setTargeting("color", "red"). + addService(googletag.pubads()); + +slot.clearTargeting("color"); +// Targeting "allow_expandable" and "interests" are still present, while +// "color" was cleared. + +slot.clearTargeting(); +// All targeting has been cleared. + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + addService(googletag.pubads()); +let mapping = googletag.sizeMapping(). + addSize([100, 100], [88, 31]). + addSize([320, 400], [[320, 50], [300, 50]]). + build(); +slot.defineSizeMapping(mapping); + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + set("adsense_background_color", "#FFFFFF"). + addService(googletag.pubads()); + +color = googletag.pubads().get("adsense_background_color"); +// color == "#FFFFFF". + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + addService(googletag.pubads()); + +let path = slot.getAdUnitPath(); +// path is "/1234567/sports" + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + set("adsense_background_color", "#FFFFFF"). + set("adsense_border_color", "#AABBCC"). + addService(googletag.pubads()); + +keys = googletag.pubads().getAttributeKeys(); +// Keys are ["adsense_background_color", "adsense_border_color"]. + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setCategoryExclusion("AirlineAd"). + setCategoryExclusion("TrainAd"). + addService(googletag.pubads()); + +let exclusions = slot.getCategoryExclusions(); +// exclusions are ["AirlineAd", "TrainAd"] + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + addService(googletag.pubads()); + +let slotElementId = slot.getSlotElementId(); +// slotElementId is "div-1" + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setTargeting("allow_expandable", "true"). + addService(googletag.pubads()); + +param = slot.getTargeting("allow_expandable"); +// param is ["true"] + +param = slot.getTargeting("age"); +// param is [] (empty array) + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setTargeting("allow_expandable", "true"). + setTargeting("interests", ["sports", "music", "movies"]). + addService(googletag.pubads()); + +keys = slot.getTargetingKeys(); +// keys are ["interests", "allow_expandable"]. + +// Setting an attribute on a single ad slot. +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + set("adsense_background_color", "#FFFFFF"). + addService(googletag.pubads()); + +// Label = AirlineAd +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setCategoryExclusion("AirlineAd"). + addService(googletag.pubads()); + +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setClickUrl("http://www.example.com"). + addService(googletag.pubads()); + +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setCollapseEmptyDiv(true, true). + addService(googletag.pubads()); +// The above will cause the div for this slot to be collapsed +// when the page is loaded, before ads are requested. + +googletag.defineSlot("/1234567/sports", [160, 600], "div-2"). + setCollapseEmptyDiv(true). + addService(googletag.pubads()); +// The above will cause the div for this slot to be collapsed + // only after GPT detects that no ads are available for the slot. + +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setForceSafeFrame(true). + addService(googletag.pubads()); + +googletag.pubads().setForceSafeFrame(true); + +// The following slot will have a sandboxed safeframe that only disallows +// top-level navigation. +googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + setSafeFrameConfig({sandbox: true}). + addService(googletag.pubads()); + +googletag.defineSlot("/1234567/news", [160, 600], "div-2"). + addService(googletag.pubads()); + +googletag.display(); + +slot = googletag.defineSlot("/1234567/sports", [160, 600], "div-1"). + addService(googletag.pubads()); + +// Example with a single value for a key. +slot.setTargeting("allow_expandable", "true"); + +// Example with multiple values for a key inside in an array. +slot.setTargeting("interests", ["sports", "music", "movies"]); diff --git a/doubleclick-gpt/index.d.ts b/doubleclick-gpt/index.d.ts new file mode 100644 index 0000000000..8f6a47ae12 --- /dev/null +++ b/doubleclick-gpt/index.d.ts @@ -0,0 +1,173 @@ +// Type definitions for Google Publisher Tag v104 +// Project: https://developers.google.com/doubleclick-gpt/reference +// Definitions by: John Wright +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace googletag { + export type SingleSizeArray = number[]; + + export type NamedSize = string; + + export type SingleSize = SingleSizeArray | NamedSize; + + export type MultiSize = SingleSize[]; + + export type GeneralSize = SingleSize | MultiSize; + + export type SizeMapping = GeneralSize[]; + + export type SizeMappingArray = SizeMapping[]; + + export interface CommandArray { + push(f: Function): number; + } + + export interface Service { + addEventListener( + eventType: string, + listener: (event: events.ImpressionViewableEvent | events.SlotOnloadEvent | events.SlotRenderEndedEvent | events.slotVisibilityChangedEvent) => void + ): void; + } + + export interface CompanionAdsService extends Service { + enableSyncLoading(): void; + setRefreshUnfilledSlots(value: boolean): void; + } + + export interface ContentService extends Service { + setContent(slot: Slot, content: String): void; + } + + export interface ResponseInformation { + advertiserId: string; + campaignId: string; + creativeId?: number; + labelIds: number[]; + lineItemId?: number; + } + + export interface SafeFrameConfig { + allowOverlayExpansion?: boolean; + allowPushExpansion?: boolean; + sandbox?: boolean; + } + + interface Googletag { + apiReady: boolean; + cmd: CommandArray; + companionAds(): CompanionAdsService; + content(): ContentService; + defineOutOfPageSlot(adUnitPath: string, opt_div?: string): Slot; + defineSlot(adUnitPath: string, size: GeneralSize, opt_div?: string): Slot; + destroySlots(opt_slots?: Slot[]): boolean; + disablePublisherConsole(): void; + display(div?: string): void; + enableServices(): void; + getVersion(): string; + openConsole(opt_div?: string): void; + pubads(): PubAdsService; + pubadsReady: boolean; + setAdIframeTitle(title: string): void; + sizeMapping(): SizeMappingBuilder; + } + + export interface Slot { + addService(service: Service): Slot; + clearCategoryExclusions(): Slot; + clearTargeting(opt_key?: string): Slot; + defineSizeMapping(sizeMapping: SizeMappingArray): Slot; + get(key: string): string | null; + getAdUnitPath(): string; + getAttributeKeys(): string[]; + getCategoryExclusions(): string[]; + getResponseInformation(): ResponseInformation; + getSlotElementId(): string; + getTargeting(key: string): string[]; + getTargetingKeys(): string[]; + set(key: string, value: string): Slot; + setCategoryExclusion(categoryExclusion: string): Slot; + setClickUrl(value: string): Slot; + setCollapseEmptyDiv(collapse: boolean, opt_collapseBeforeAdFetch?: boolean): Slot; + setForceSafeFrame(forceSafeFrame: boolean): Slot; + setSafeFrameConfig(config: SafeFrameConfig): Slot; + setTargeting(key: string, value: string | string[]): Slot; + } + + export interface PassbackSlot { + display(): void; + get(key: string): string; + set(key: string, value: string): PassbackSlot; + setClickUrl(url: string): PassbackSlot; + setForceSafeFrame(forceSafeFrame: boolean): PassbackSlot; + setTagForChildDirectedTreatment(value: number): PassbackSlot; + setTargeting(key: string, value: string | string[]): PassbackSlot; + updateTargetingFromMap(map: Object): PassbackSlot; + } + + export interface PubAdsService extends Service { + clear(opt_slots?: Slot[]): boolean; + clearCategoryExclusions(): PubAdsService; + clearTagForChildDirectedTreatment(): PubAdsService; + clearTargeting(opt_key?: string): PubAdsService; + collapseEmptyDivs(opt_collapseBeforeAdFetch?: boolean): boolean; + defineOutOfPagePassback(adUnitPath: string): PassbackSlot; + definePassback(adUnitPath: string, size: GeneralSize): PassbackSlot; + disableInitialLoad(): void; + display(adUnitPath: string, size: GeneralSize, opt_div?: string, opt_clickUrl?: string): Slot; + enableAsyncRendering(): boolean; + enableSingleRequest(): boolean; + enableSyncRendering(): boolean; + enableVideoAds(): void; + get(key: string): string | null; + getAttributeKeys(): string[]; + getTargeting(key: string): string[]; + getTargetingKeys(): string[]; + refresh(opt_slots?: Slot[], opt_options?: {changeCorrelator: boolean}): void; + set(key: string, value: string): PubAdsService; + setCategoryExclusion(categoryExclusion: string): PubAdsService; + setCentering(centerAds: boolean): void; + setCookieOptions(cookieOptions: number): PubAdsService; + setForceSafeFrame(forceSafeFrame: boolean): PubAdsService; + setLocation(latitudeOrAddress: string | number, opt_longitude?: number, opt_radius?: number): PubAdsService; + setPublisherProvidedId(ppid: string): PubAdsService; + setSafeFrameConfig(config: SafeFrameConfig): PubAdsService; + setTagForChildDirectedTreatment(value: number): PubAdsService; + setTargeting(key: string, value: string | string[]): PubAdsService; + setVideoContent(videoContentId: string, videoCmsId: string): void; + updateCorrelator(): PubAdsService; + } + + export interface SizeMappingBuilder { + addSize(viewportSize: SingleSizeArray, slotSize: GeneralSize): SizeMappingBuilder; + build(): SizeMappingArray; + } + + export namespace events { + export interface ImpressionViewableEvent { + serviceName: string; + slot: Slot; + } + + export interface SlotOnloadEvent { + serviceName: string; + slot: Slot; + } + + export interface SlotRenderEndedEvent { + creativeId?: number; + isEmpty: boolean; + lineItemId?: number; + serviceName: string; + size: number[] | string; + slot: Slot; + } + + export interface slotVisibilityChangedEvent { + inViewPercentage: number; + serviceName: string; + slot: Slot; + } + } +} + +declare let googletag: googletag.Googletag; diff --git a/doubleclick-gpt/tsconfig.json b/doubleclick-gpt/tsconfig.json new file mode 100644 index 0000000000..20513bc9de --- /dev/null +++ b/doubleclick-gpt/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "doubleclick-gpt-tests.ts" + ] +} diff --git a/dsv/index.d.ts b/dsv/index.d.ts index 2fac461110..975246f51d 100644 --- a/dsv/index.d.ts +++ b/dsv/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dsv +// Type definitions for dsv // Project: https://www.npmjs.com/package/dsv // Definitions by: Jason Swearingen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/durandal/index.d.ts b/durandal/index.d.ts index c9ade9ee23..b95bcb1271 100644 --- a/durandal/index.d.ts +++ b/durandal/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Durandal 2.1.0 +// Type definitions for Durandal 2.1.0 // Project: http://durandaljs.com // Definitions by: Blue Spire // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 71d773d5b7..1fb6a01302 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,21 +1,19 @@ -// Type definitions for ej.web.all v14.3.0.52 +// Type definitions for ej.web.all v14.4.0.15 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - /*! * filename: ej.web.all.d.ts -* version : 14.3.0.52 +* version : 14.4.0.15 * Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under -* applicable laws. +* applicable laws. */ declare module ej { - + var dataUtil: dataUtil; function isMobile(): boolean; function isIOS(): boolean; @@ -103,7 +101,7 @@ declare module ej { function select(jsonArray: any, fields: string): any; function setTransition(): boolean; function sum(json: string, fieldName: string): string; - function swap(array: any, x: string, y: string): any; + function swap(array: any, x: string, y: string): any; var cssUA: string; var serverTimezoneOffset: number; var transform: string; @@ -114,9 +112,10 @@ declare module ej { var transitionDuration: string; var transitionProperty: string; var transitionTimingFunction: string; + var template: any; var util: { valueFunction(val: string): any; - } + } export module device { function isAndroid(): boolean; function isIOS(): boolean; @@ -132,8 +131,8 @@ declare module ej { function destroyAll(elements: Element): void; function init(element: Element): void; function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; - } - + } + interface browserInfoOptions { name: string; version: string; @@ -149,7 +148,7 @@ declare module ej { _on(element: JQuery, eventType?: string, handler?: (eventObject: JQueryEventObject) => any): any; _on(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; _off(element: JQuery, eventName: string, handler ?: (eventObject: JQueryEventObject) => any): any; - _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; + _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; persistState(): void; restoreState(silent: boolean): void; } @@ -159,17 +158,17 @@ declare module ej { static fn: Widget; static extend(widget: Widget): any; register(pluginName: string, className: string, prototype: any): void; - destroyAll(elements: Element): void; - model: any; + destroyAll(elements: Element): void; + model: any; } interface BaseEvent { cancel: boolean; - type: string; + type: string; } class DataManager { - constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); setDefaultQuery(query: ej.Query): void; executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; executeLocal(query?: ej.Query): ej.DataManager; @@ -177,7 +176,7 @@ declare module ej { insert(data: Object, tableName?: string): JQueryPromise; remove(keyField: string, value: any, tableName?: string): Object; update(keyField: string, value: any, tableName?: string): Object; - } + } class Query { constructor(); @@ -294,18 +293,28 @@ declare module ej { changeSetContent?: string; batchChangeSetContentType?: string; } + + class WebApiAdaptor extends ej.ODataAdaptor { + constructor(); + insert(dm: ej.DataManager, data: Object, tableName?: string): { url: string; type: string; data: Object; } + remove(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: Object; } + update(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: Object; accept: string; } + processResponse(data: Object, ds: Object, query: ej.Query, xhr: any, request: any, changes: Changes): { + result: Object; count: number + }; + } class ODataV4Adaptor extends ej.ODataAdaptor { constructor(); options: ODataAdaptorOptions; onCount(e: Object): string; onEachSearch(e: Object): void; - onSearch(e: Object): string; + onSearch(e: Object): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { result: Object; count: number }; - + } interface ODataAdaptorOptions { requestType?: string; @@ -410,7 +419,7 @@ declare module ej { predicates: any; }; } - interface dataUtil { + interface dataUtil { swap(array: Array, x: number, y: number): void; mergeSort(jsonArray: Array, fieldName?: string, comparer?:any): Array; max(jsonArray: Array, fieldName?: string, comparer?: string): Array; @@ -480,7 +489,7 @@ declare module ej { row, tHead } - + enum filterType{ StartsWith, Contains, @@ -496,7 +505,7 @@ declare module ej { Fade, None, Slide - } + } enum Type{ Overlay, Slide @@ -865,10 +874,10 @@ export interface HelperEventArgs { function parseDate(value: string, format: string, culture ?: string): Date; function getLocalizedConstants(controlName: string, culture ?: string): any; -interface globalize { +interface globalize { addCulture(name: string, culture?: any): void; preferredCulture(culture?: string): culture; - format(value: any, format: string, culture?: string): string; + format(value: any, format: string, culture?: string): string; parseInt(value: string, radix?: any, culture?: string): number; parseFloat(value: string, radix?: any, culture?: string): number; parseDate(value: string, format: string, culture?: string): Date; @@ -933,7 +942,7 @@ interface globalize { M: string; Y: string; S: string; - } + } class Scroller extends ej.Widget { static fn: Scroller; constructor(element: JQuery, options?: Scroller.Model); @@ -2470,7 +2479,7 @@ export interface ClickEventArgs { */ status?: boolean; - /** return the event model for sever side processing. + /** return the event model for sever side processing. */ e?: any; } @@ -2537,16 +2546,16 @@ Normal, Mini, //Creates button with Built-in small size height, width specified Small, -//Creates button with Built-in medium size height, width specified +//Creates button with Built-in medium size height, width specified Medium, -//Creates button with Built-in large size height, width specified +//Creates button with Built-in large size height, width specified Large, } enum ButtonType { //Creates button with Built-in button type specified Button, -//Creates button with Built-in reset type specified +//Creates button with Built-in reset type specified Reset, //Creates button with Built-in submit type specified Submit, @@ -2932,7 +2941,7 @@ class ListBox extends ej.Widget { removeSelectedItems(): void; /** Removes a list item by using its text. - * @param {string} Text of the listbox item to be removed. + * @param {string} Text of the listbox item to be removed. * @returns {void} */ removeItemByText(text: string): void; @@ -2943,7 +2952,7 @@ class ListBox extends ej.Widget { */ removeItemByIndex(index: number): void; - /** + /** * @returns {void} */ selectAll(): void; @@ -2989,7 +2998,7 @@ class ListBox extends ej.Widget { */ uncheckItemsByIndices(indices: number[]|string): void; - /** + /** * @returns {void} */ unselectAll(): void; @@ -3071,7 +3080,7 @@ class ListBox extends ej.Widget { */ hideItemByIndex(index: number): void; - /** + /** * @returns {void} */ show(): void; @@ -4199,6 +4208,11 @@ export interface Model { */ htmlAttributes?: any; + /** Defines the localized text values in button and tooltip. + * @Default {en-US} + */ + locale?: string; + /** Specifies the model type to be rendered initially in the color picker control. See below to get available ModelType * @Default {ej.ColorPicker.ModelType.Default} */ @@ -4522,7 +4536,7 @@ enum Presets{ } enum ButtonMode { -//Displays the button in split mode +//Displays the button in split mode Split, //Displays the button in Dropdown mode Dropdown, @@ -4542,25 +4556,25 @@ class FileExplorer extends ej.Widget { adjustSize(): void; /** Disable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled * @returns {void} */ disableMenuItem(item: string|HTMLElement): void; /** Disable the particular toolbar item. - * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled * @returns {void} */ disableToolbarItem(item: string|HTMLElement): void; /** Enable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled * @returns {void} */ enableMenuItem(item: string|HTMLElement): void; /** Enable the particular toolbar item - * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled * @returns {void} */ enableToolbarItem(item: string|HTMLElement): void; @@ -4571,7 +4585,7 @@ class FileExplorer extends ej.Widget { refresh(): void; /** Remove the particular toolbar item. - * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed * @returns {void} */ removeToolbarItem(item: string|HTMLElement): void; @@ -5314,7 +5328,7 @@ enum layoutType{ ///Supports to display files in tile view Tile, - ///Supports to display files in grid view + ///Supports to display files in grid view Grid, ///Supports to display files as large icons @@ -5926,10 +5940,10 @@ enum Level{ enum HighlightSection{ - ///Highlight the week of the currently selected date in DatePicker popup calendar + ///Highlight the week of the currently selected date in DatePicker popup calendar Week, - ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar WorkDays, ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists @@ -6403,7 +6417,7 @@ enum popupPosition { //Opens the DateTimePicker popup below to the DateTimePicker input box Bottom, -//Opens the DateTimePicker popup above to the DateTimePicker input box +//Opens the DateTimePicker popup above to the DateTimePicker input box Top, } @@ -7049,6 +7063,11 @@ class DocumentEditor extends ej.Widget { */ getPageCount(): void; + /** Gets the text of current selection in the document. + * @returns {void} + */ + getSelectedText(): void; + /** Gets the current zoom factor value of the document container. * @returns {void} */ @@ -7607,11 +7626,11 @@ export interface ActionCompleteEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; - /** Returns the query for data retrieval from the Database + /** Returns the query for data retrieval from the Database */ request?: any; @@ -7642,7 +7661,7 @@ export interface ActionFailureEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; @@ -7665,11 +7684,11 @@ export interface ActionSuccessEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; - /** Returns the query for data retrieval from the Database + /** Returns the query for data retrieval from the Database */ request?: any; @@ -8118,14 +8137,14 @@ export interface Fields { } enum FilterType { -//filter the data wherever contains search key +//filter the data wherever contains search key Contains, //filter the data based on search key present at start position StartsWith, } enum MultiSelectMode { -// can select only single item in DropDownList +// can select only single item in DropDownList None, //can select multiple items and it's separated by delimiterChar Delimiter, @@ -9538,10 +9557,10 @@ export interface Model { keyup? (e: KeyupEventArgs): void; /** Fires when mouse out in mask edit textbox control. */ - mouseout? (e: MouseoutEventArgs): void; + mouseOut? (e: MouseOutEventArgs): void; /** Fires when mouse over in mask edit textbox control. */ - mouseover? (e: MouseoverEventArgs): void; + mouseOver? (e: MouseOverEventArgs): void; } export interface ChangeEventArgs { @@ -9712,7 +9731,7 @@ export interface KeyupEventArgs { unmaskedValue?: string; } -export interface MouseoutEventArgs { +export interface MouseOutEventArgs { /** if the event should be canceled; otherwise, false. */ @@ -9735,7 +9754,7 @@ export interface MouseoutEventArgs { unmaskedValue?: string; } -export interface MouseoverEventArgs { +export interface MouseOverEventArgs { /** if the event should be canceled; otherwise, false. */ @@ -11190,11 +11209,11 @@ class Ribbon extends ej.Widget { /** To customize whole content from Tab Group. * @param {number} ribbon tab index. - * @param {string} ribbon group index. + * @param {string} ribbon group text. * @param {number} sub group index in the ribbon group, * @returns {void} */ - removeTabGroupContent(tabIndex: number, groupIndex: string, subGroupIndex?: number): void; + removeTabGroupContent(tabIndex: number, groupText: string, subGroupIndex?: number): void; /** Remove option from Backstage. * @param {number} index to the backstage item @@ -11216,11 +11235,6 @@ export interface Model { */ isResponsive?: boolean; - /** When isMobileOnly is true,its shows in mobile toolbar. - * @Default {false} - */ - isMobileOnly?: boolean; - /** Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties are not defined in buttonSettings and content defaults. * @Default {object} */ @@ -11236,6 +11250,16 @@ export interface Model { */ collapsePinSettings?: CollapsePinSettings; + /** Set enableOnDemand as true to load ribbon tab and backstage contents while corresponding item clicked. + * @Default {false} + */ + enableOnDemand?: boolean; + + /** Set collapsible property as true to render ribbon in initially collapsed state. + * @Default {false} + */ + collapsible?: boolean; + /** Align content in the ribbon control from right to left by setting the property as true. * @Default {false} */ @@ -11912,6 +11936,11 @@ export interface TabsGroupsContentGroupsGalleryItem { export interface TabsGroupsContentGroup { + /** When isMobileOnly is true,its shows in mobile toolbar.isResponsive should be true for using this property. + * @Default {false} + */ + isMobileOnly?: boolean; + /** Specifies the Syncfusion button members, events by using this buttonSettings. * @Default {object} */ @@ -12142,7 +12171,7 @@ enum CustomItemType{ enum QuickAccessMode{ - ///Controls are hidden in Quick Access toolbar + ///Controls are hidden in Quick Access toolbar None, ///Add controls in toolBar @@ -12210,7 +12239,7 @@ class Kanban extends ej.Widget { toggleColumn(headerText: any): void; /** Expand or collapse the card based on the state of target "div" - * @param {string|number} Pass the id of card to be toggle + * @param {string|number} Pass the id of card to be toggle * @returns {void} */ toggleCard(key: string|number): void; @@ -12584,6 +12613,42 @@ export interface Model { /** Triggered when card is double clicked. */ cardDoubleClick? (e: CardDoubleClickEventArgs): void; + + /** Triggered before the card is selected. */ + cardSelecting? (e: CardSelectingEventArgs): void; + + /** Triggered when the Kanban is rendered completely */ + create? (e: CreateEventArgs): void; + + /** Triggers after the cell is clicked. */ + cellClick? (e: CellClickEventArgs): void; + + /** Triggered the Kanban is bound with data during initial rendering. */ + dataBound? (e: DataBoundEventArgs): void; + + /** Triggered when Kanban going to destroy. */ + destroy? (e: DestroyEventArgs): void; + + /** Triggered after the card is deleted. */ + endDelete? (e: EndDeleteEventArgs): void; + + /** Triggered after the card is edited. */ + endEdit? (e: EndEditEventArgs): void; + + /** Triggers after the header is clicked. */ + headerClick? (e: HeaderClickEventArgs): void; + + /** Triggered initial load. */ + load? (e: LoadEventArgs): void; + + /** Triggered when toolbar item is clicked in Kanban. */ + toolbarClick? (e: ToolbarClickEventArgs): void; + + /** Triggered every time a single card rendered request is made to access particular card information. */ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /** Triggered before the context menu is opened. */ + contextOpen? (e: ContextOpenEventArgs): void; } export interface ActionBeginEventArgs { @@ -13008,11 +13073,328 @@ export interface CardDoubleClickEventArgs { */ data?: any; + /** Returns the Kanban model. + */ + model?: any; + /** Returns the name of the event. */ type?: string; } +export interface CardSelectingEventArgs { + + /** Returns the selecting cell index value. + */ + cellIndex?: number; + + /** Returns the selecting card index value. + */ + cardIndex?: number; + + /** Returns the selecting cell element + */ + currentCell?: any; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the previously selecting the card element + */ + previousCard?: any; + + /** Returns the previously rowcell is selecting card indexes + */ + previousRowcellindex?: Array; + + /** Returns the current item. + */ + currentTarget?: any; + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns added data. + */ + data?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface CellClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the select cell index value. + */ + cellIndex?: number; + + /** Returns the edited row index. + */ + rowIndex?: number; +} + +export interface DataBoundEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /** Returns the kanban model. + */ + model?: any; + + /** Returns deleted data. + */ + data?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface EndDeleteEventArgs { + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns request type. + */ + requestType?: string; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns deleted data. + */ + data?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Current action name + */ + action?: string; +} + +export interface EndEditEventArgs { + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns request type. + */ + requestType?: string; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns modified data. + */ + data?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Current Action name + */ + action?: string; +} + +export interface HeaderClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the select cell index value. + */ + cellIndex?: number; + + /** Returns the column object. + */ + columnData?: any; +} + +export interface LoadEventArgs { + + /** Returns the kanban model. + */ + model?: any; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface ToolbarClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the current item. + */ + currentTarget?: any; + + /** Returns the item id of that current element. + */ + itemId?: string; + + /** Returns the item index of that current element. + */ + itemIndex?: number; + + /** Returns the item name of that current element. + */ + itemName?: string; + + /** Returns the item text of that current element. + */ + itemText?: string; + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the toolbar object of the Kanban. + */ + toolbarData?: any; +} + +export interface QueryCellInfoEventArgs { + + /** Returns Kanban card. + */ + card?: any; + + /** Returns Kanban card. + */ + cell?: any; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns current row record object (JSON). + */ + data?: any; + + /** Returns the column object. + */ + column?: any; + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface ContextOpenEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the Kanban model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the current item. + */ + currentTarget?: any; + + /** Returns the status of contextmenu item which denotes its enabled state. + */ + status?: boolean; + + /** Returns the target item. + */ + target?: any; +} + +export interface SwimlaneSettingsUnassignedGroup { + + /** To enable or disable unassigned category change with swim lane key values. + * @Default {true} + */ + enable?: boolean; + + /** To set the user defined values which are need to categorized as unassigned category swim lane groups. + * @Default {[null,undefined,]} + */ + keys?: boolean; +} + export interface SwimlaneSettings { /** To enable or disable items count in swim lane. @@ -13024,6 +13406,11 @@ export interface SwimlaneSettings { * @Default {false} */ allowDragAndDrop?: boolean; + + /** Customize the settings for unassigned category of swim lane. + * @Default {Object} + */ + unassignedGroup?: SwimlaneSettingsUnassignedGroup; } export interface ContextMenuSettingsCustomMenuItem { @@ -13415,7 +13802,7 @@ enum EditingType{ ///Allows to set edit type as string edit type String, - ///Allows to set edit type as numeric edit type + ///Allows to set edit type as numeric edit type Numeric, ///Allows to set edit type as drop down edit type @@ -13652,6 +14039,11 @@ export interface Model { */ template?: string; + /** The templateId enables to bind multiple customized template items in Rotator. + * @Default {null} + */ + templateId?: Array; + /** Specifies the source for thumbnail elements. * @Default {null} */ @@ -14845,7 +15237,7 @@ export interface ChangeEventArgs { */ value?: number; - /** returns true if event triggered by interaction else returns false. + /** returns true if event triggered by interaction else returns false. */ isInteraction?: boolean; } @@ -16096,7 +16488,7 @@ enum Position{ ///Tab headers display to top position Top, - ///Tab headers display to bottom position + ///Tab headers display to bottom position Bottom, ///Tab headers display to left position. @@ -17081,11 +17473,21 @@ export interface Model { */ dataSource?: any; + /** Disables an Item or set of Items that are enabled in the Toolbar + * @Default {[]} + */ + disabledItemIndices?: Array; + /** Specifies the Toolbar control state. * @Default {true} */ enabled?: boolean; + /** Enables an Item or set of Items that are disabled in the Toolbar + * @Default {[]} + */ + enabledItemIndices?: Array; + /** Specifies enableRTL property to align the Toolbar control from right to left direction. * @Default {false} */ @@ -17744,6 +18146,11 @@ export interface Model { */ fields?: Fields; + /** Gets or sets a value that indicates whether to enable full row selection support for TreeView. + * @Default {false} + */ + fullRowSelect?: boolean; + /** Defines the height of the TreeView. * @Default {Null} */ @@ -17946,7 +18353,7 @@ export interface BeforeCollapseEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -18074,7 +18481,7 @@ export interface BeforeExpandEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -18246,6 +18653,14 @@ export interface KeyPressEventArgs { /** it returns when the current node is in expanded state; otherwise, false. */ isExpanded?: boolean; + + /** returns the id of current TreeView node + */ + id?: string; + + /** returns the parentId of current TreeView node + */ + parentId?: string; } export interface LoadErrorEventArgs { @@ -18437,7 +18852,7 @@ export interface NodeCollapseEventArgs { */ isChildLoaded?: boolean; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -18741,7 +19156,7 @@ export interface NodeExpandEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -19614,7 +20029,7 @@ class Grid extends ej.Widget { defaults:Grid.Model; /** Adds a grid model property which is to be ignored upon exporting. - * @param {Array} Pass the array of parameters which need to be ignored on exporting + * @param {Array} Pass the array of parameters which need to be ignored on exporting * @returns {void} */ addIgnoreOnExport(propertyNames: Array): void; @@ -20040,7 +20455,7 @@ class Grid extends ej.Widget { saveCell(): Boolean; /** We can prevent the client side cellSave event triggering by passing the preventSaveEvent argument as true. - * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering + * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering * @returns {void} */ saveCell(preventSaveEvent: boolean): void; @@ -20591,7 +21006,7 @@ export interface Model { templateRefresh? (e: TemplateRefreshEventArgs): void; /** Triggered when toolbar item is clicked in grid. */ - toolBarClick? (e: ToolBarClickEventArgs): void; + toolbarClick? (e: ToolbarClickEventArgs): void; } export interface ActionBeginEventArgs { @@ -22205,7 +22620,7 @@ export interface TemplateRefreshEventArgs { type?: string; } -export interface ToolBarClickEventArgs { +export interface ToolbarClickEventArgs { /** Returns the cancel option value. */ @@ -22374,7 +22789,7 @@ export interface Column { headerText?: String; /** This defines the text alignment of a particular column header cell value. See headerTextAlign - * @Default {ej.TextAlign.Left} + * @Default {null} */ headerTextAlign?: ej.TextAlign|string; @@ -23380,7 +23795,7 @@ export interface LoadedEventArgs { export interface TooltipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -23504,7 +23919,7 @@ export interface PointRegionMouseClickEventArgs { export interface SparklineMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -23519,7 +23934,7 @@ export interface SparklineMouseMoveEventArgs { export interface SparklineMouseLeaveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -23892,6 +24307,11 @@ export interface Model { */ cssClass?: string; + /** Connects the PivotSchemaDesigner with the specified ID to the PivotGrid Control. + * @Default {“”} + */ + pivotTableFieldListID?: string; + /** Initializes the data source for the PivotGrid widget, when it functions completely on client-side. * @Default {{}} */ @@ -28520,7 +28940,7 @@ export interface ResizeStopEventArgs { export interface OverflowButtonClickEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. + /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. */ object?: any; @@ -28543,7 +28963,7 @@ export interface OverflowButtonClickEventArgs { export interface OverflowButtonHoverEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. + /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. */ object?: any; @@ -29384,6 +29804,11 @@ export interface Model { */ allowMultiSorting?: boolean; + /** Enables or disables the option for multiple exporting + * @Default {false} + */ + allowMultipleExporting?: boolean; + /** Enables or disables the interactive selection of a row. * @Default {true} */ @@ -29915,6 +30340,9 @@ export interface Model { /** Triggered while editing the Gantt chart (dragging, resizing the taskbar ) */ taskbarEditing? (e: TaskbarEditingEventArgs): void; + /** Triggered when taskbar item is clicked in Gantt. */ + taskbarClick? (e: TaskbarClickEventArgs): void; + /** Triggered when toolbar item is clicked in Gantt. */ toolbarClick? (e: ToolbarClickEventArgs): void; } @@ -30552,6 +30980,33 @@ export interface TaskbarEditingEventArgs { type?: string; } +export interface TaskbarClickEventArgs { + + /** Returns currently clicked row data + */ + data?: any; + + /** Returns the current item index. + */ + index?: number; + + /** Returns the Gantt model. + */ + model?: any; + + /** Returns the clicked row element + */ + taskbarElement?: any; + + /** Returns the target element. + */ + target?: any; + + /** Returns the name of the event. + */ + type?: string; +} + export interface ToolbarClickEventArgs { /** Returns the cancel option value. @@ -31550,7 +32005,7 @@ class TreeGrid extends ej.Widget { /** To rename a column with the specified name * @param {number} Index of the column to be renamed - * @param {string} Header text of the column + * @param {string} Header text of the column * @returns {void} */ renameColumn(columnIndex: number, name: string): void; @@ -31627,6 +32082,13 @@ class TreeGrid extends ej.Widget { * @returns {void} */ sortColumn(columnName: string, columnSortDirection: string): void; + + /** To reorder the column with field name and target index values + * @param {string} you can pass a name of column to reorder. + * @param {string} you can pass a target column index to be inserted. + * @returns {void} + */ + reorderColumn(fieldName: string, targetIndex: string): void; } export module TreeGrid{ @@ -31637,6 +32099,11 @@ export interface Model { */ allowColumnResize?: boolean; + /** Enables or disables the option for column reordering + * @Default {false} + */ + allowColumnReordering?: boolean; + /** Enables or disables the ability to drag and drop the row interactively to reorder the rows. * @Default {false} */ @@ -31735,6 +32202,10 @@ export interface Model { */ enableVirtualization?: boolean; + /** Specifies the settings for column resize + */ + columnResizeSettings?: ColumnResizeSettings; + /** Options for filtering and customizing filter actions. */ filterSettings?: FilterSettings; @@ -31875,6 +32346,15 @@ export interface Model { /** Triggered while collapsing the TreeGrid record */ collapsing? (e: CollapsingEventArgs): void; + /** Triggered when you start to drag a column */ + columnDragStart? (e: ColumnDragStartEventArgs): void; + + /** Triggered while dragging a column */ + columnDrag? (e: ColumnDragEventArgs): void; + + /** Triggered when a column is dropped */ + columnDrop? (e: ColumnDropEventArgs): void; + /** Triggered after a column resized */ columnResized? (e: ColumnResizedEventArgs): void; @@ -32080,6 +32560,95 @@ export interface CollapsingEventArgs { expanded?: boolean; } +export interface ColumnDragStartEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the control model values. + */ + model?: any; + + /** Returns the event Type. + */ + type?: string; + + /** Returns the column data which is dragged + */ + draggedColumn?: any; + + /** Returns the index of the column being dragged + */ + draggedColumnIndex?: number; +} + +export interface ColumnDragEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the control model values. + */ + model?: any; + + /** Returns the event Type. + */ + type?: string; + + /** Returns the column data which is dragged + */ + draggedColumn?: any; + + /** Returns the index of the column being dragged + */ + draggedColumnIndex?: number; + + /** Returns the target column data + */ + targetColumn?: any; + + /** Returns the index of the target column + */ + targetColumnIndex?: number; + + /** Returns that we can drop over the column or not. + */ + canDrop?: boolean; +} + +export interface ColumnDropEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the control model values. + */ + model?: any; + + /** Returns the event Type. + */ + type?: string; + + /** Returns the column data which is dragged + */ + draggedColumn?: any; + + /** Returns the index of the column being dragged + */ + draggedColumnIndex?: number; + + /** Returns the target column data + */ + targetColumn?: any; + + /** Returns the index of the target column + */ + targetColumnIndex?: number; +} + export interface ColumnResizedEventArgs { /** Returns the cancel option value. @@ -32763,6 +33332,14 @@ export interface EditSettings { rowPosition?: ej.TreeGrid.RowPosition|string; } +export interface ColumnResizeSettings { + + /** Specifies the mode for column resizing + * @Default {normal} + */ + columnResizeMode?: string; +} + export interface FilterSettings { /** Specifies the mode on which column filtering should start @@ -32770,6 +33347,11 @@ export interface FilterSettings { */ filterBarMode?: string; + /** Specifies the type of column filtering. + * @Default {filterbar} + */ + filterType?: string; + /** Specifies the column collection for filtering the TreeGrid content on initial load * @Default {[]} */ @@ -33290,11 +33872,11 @@ export interface SelectEventArgs { status?: boolean; } } -enum GroupButtonMode +enum GroupButtonMode { -//Sets the GroupButton to work as checkbox mode +//Sets the GroupButton to work as checkbox mode CheckBox, -//Sets the RadioButton to work as radio button mode +//Sets the RadioButton to work as radio button mode RadioButton, } @@ -33372,6 +33954,11 @@ export interface Model { */ width?: number; + /** Navigation pane opened initially when isPaneOpen property is true. + * @Default {false} + */ + isPaneOpen?: boolean; + /** Event triggers before the control gets closed. */ beforeClose? (e: BeforeCloseEventArgs): void; @@ -33457,59 +34044,71 @@ class RadialMenu extends ej.Widget { showMenu(): void; /** To enable menu item using index + * @param {number} Index of the Radialmenu to be enabled. * @returns {void} */ - enableItemByIndex(): void; + enableItemByIndex(itemIndex: number): void; /** To enable menu items using indices + * @param {Array} Index of the Radialmenu to be enabled. * @returns {void} */ - enableItemsByIndices(): void; + enableItemsByIndices(itemIndices: Array): void; /** To disable menu item using index + * @param {number} Index of the Radialmenu to be disabled. * @returns {void} */ - disableItemByIndex(): void; + disableItemByIndex(itemIndex: number): void; /** To disable menu items using indices + * @param {Array} items of the Radialmenu to disable. * @returns {void} */ - disableItemsByIndices(): void; + disableItemsByIndices(itemIndices: Array): void; /** To enable menu item using item text + * @param {String} item of the Radialmenu item to enable. * @returns {void} */ - enableItem(): void; + enableItem(item: String): void; /** To disable menu item using item text + * @param {String} item of the Radialmenu item to disable. * @returns {void} */ - disableItem(): void; + disableItem(item: String): void; /** To enable menu items using item texts + * @param {Array} items of the Radialmenu item to enable. * @returns {void} */ - enableItems(): void; + enableItems(items: Array): void; /** To disable menu items using item texts + * @param {Array} items of the Radialmenu item to disable. * @returns {void} */ - disableItems(): void; + disableItems(items: Array): void; /** To update menu item badge value + * @param {number} The index value to add the given items at the specified index. If index is not specified, the given value will not be updated. + * @param {number} The Value to be updated in the badge. It will be updated based on the given index * @returns {void} */ - updateBadgeValue(): void; + updateBadgeValue(index: number, value: number): void; /** To show menu item badge + * @param {number} Index of the Radialmenu item to be shown badge. * @returns {void} */ - showBadge(): void; + showBadge(index: number): void; /** To hide menu item badge + * @param {number} Index of the Radialmenu item to hide the badge. * @returns {void} */ - hideBadge(): void; + hideBadge(index: number): void; } export module RadialMenu{ @@ -33791,7 +34390,7 @@ export interface MouseDownEventArgs { */ text?: string; - /** returns the index of current tile item + /** returns the index of current tile item */ index?: number; } @@ -33814,7 +34413,7 @@ export interface MouseUpEventArgs { */ text?: boolean; - /** returns the index of current tile item + /** returns the index of current tile item */ index?: number; } @@ -34353,30 +34952,30 @@ export interface Model { export interface ChangeEventArgs { - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the initial value of Radial slider + /** returns the initial value of Radial slider */ oldValue?: Number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value of the Radial slider + /** returns the current value of the Radial slider */ value?: Number; } export interface CreateEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; @@ -34384,91 +34983,91 @@ export interface CreateEventArgs { */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; } export interface MouseoverEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the value selected + /** returns the value selected */ selectedValue?: Number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: Number; } export interface SlideEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the value selected in Radial slider + /** returns the value selected in Radial slider */ selectedValue?: Number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the currently selected value + /** returns the currently selected value */ value?: Number; } export interface StartEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: Number; } export interface StopEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: Number; } @@ -34495,13 +35094,13 @@ class Spreadsheet extends ej.Widget { addNewSheet(): void; /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. - * @param {string} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @param {string} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. * @returns {void} */ clearAll(range?: string): void; /** This property is used to clear all the formats applied in the specified range in Spreadsheet. - * @param {string} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @param {string} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. * @returns {void} */ clearAllFormat(range?: string): void; @@ -34513,7 +35112,7 @@ class Spreadsheet extends ej.Widget { clearBorder(range?: string): void; /** This property is used to clear the contents in the specified range in Spreadsheet. - * @param {string} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @param {string} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. * @returns {void} */ clearContents(range?: string): void; @@ -34525,10 +35124,10 @@ class Spreadsheet extends ej.Widget { clearRange(rangeName: string): void; /** It is used to remove data in the specified range of cells based on the defined property. - * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. - * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties - * @param {any} Optional. - * @param {boolean} Optional. If pass true, if you want to skip the hidden rows + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {any} Optional. + * @param {boolean} Optional. If pass true, if you want to skip the hidden rows * @param {any} Optional. Pass the status to perform undo and redo operation. * @param {any} Optional. It specifies whether to skip element processing or not. * @returns {void} @@ -34654,7 +35253,7 @@ class Spreadsheet extends ej.Widget { getRange(startRIndex: number, startCIndex: number, endRIndex: number, endCIndex: number, sheetIdx: number): HTMLElement; /** This method is used to get the data in specified range in Spreadsheet. - * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. + * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. * @returns {Array} */ getRangeData(options?: any): Array; @@ -34938,7 +35537,7 @@ class Spreadsheet extends ej.Widget { /** This method is used to update the data for the specified range of cells in the Spreadsheet. * @param {any} Pass the cells data that you want to update. - * @param {Array} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @param {Array} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. * @returns {void} */ updateData(data: any, range?: Array): void; @@ -35097,7 +35696,7 @@ export interface XLClipboard { export interface XLComment { /** This method is used to delete the comment in the specified range in Spreadsheet. - * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. * @returns {void} @@ -35105,7 +35704,7 @@ export interface XLComment { deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; /** This method is used to edit the comment in the target Cell in Spreadsheet. - * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. * @returns {void} */ editComment(targetCell: any): void; @@ -35127,9 +35726,9 @@ export interface XLComment { getComment(cell: HTMLElement): any; /** This method is used to set new comment in Spreadsheet. - * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. * @param {string} Optional. Pass the comment data. - * @param {boolean} Optional. Pass true to show comment in edit mode + * @param {boolean} Optional. Pass true to show comment in edit mode * @returns {void} */ setComment(range: string|Array,data: string,showEditPanel: boolean): void; @@ -35229,7 +35828,7 @@ export interface XLEdit { /** This method is used to update a particular cell value and its format in the Spreadsheet. * @param {any} Pass row index and column index of the cell. * @param {string|number} Pass the cell value. - * @param {string} Pass the class name to update format. + * @param {string} Pass the class name to update format. * @param {number} Pass sheet index. * @returns {void} */ @@ -35239,7 +35838,7 @@ export interface XLEdit { export interface XLExport { /** This method is used to save the sheet data as Excel or CSV document (.xls, .xlsx and .csv) in Spreadsheet. - * @param {string} Pass the export type that you want. + * @param {string} Pass the export type that you want. * @returns {void} */ export(type: string): void; @@ -35268,7 +35867,7 @@ export interface XLFormat { /** This method is used to create a table for the selected range of cells in the Spreadsheet. * @param {any} Pass the table object. - * @param {string} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @param {string} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. * @returns {void} */ createTable(tableObject: any,range: string): void; @@ -35302,7 +35901,7 @@ export interface XLFormat { /** This method is used to update the format for the selected range of cells in the Spreadsheet. * @param {any} Pass the format object that you want to update. - * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. * @returns {void} */ updateFormat(formatObj: any,range: Array): void; @@ -35349,7 +35948,7 @@ export interface XLFreeze { export interface XLPivot { /** This property is used to clear the pivot table list in Spreadsheet. - * @param {string} Pass the name of the pivot table. + * @param {string} Pass the name of the pivot table. * @returns {void} */ clearPivotFieldList(pivotName: string): void; @@ -35545,7 +36144,7 @@ export interface XLSort { export interface XLValidate { /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. - * @param {string} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {string} If range is specified, it will apply rules for the specified range else it will use the current selected range. * @param {Array} Pass the validation condition, value1 and value2. * @param {string} Pass the data type. * @param {boolean} Pass 'true' if you ignore blank values. @@ -35555,7 +36154,7 @@ export interface XLValidate { applyDVRules(range: string,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. - * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. * @returns {void} */ clearDV(range: string): void; @@ -37107,7 +37706,7 @@ export interface SelectionSettings { export interface SheetsBorder { - /** + /** */ type?: ej.Spreadsheet.BorderType|string; @@ -37523,6 +38122,26 @@ class PdfViewer extends ej.Widget { */ print(): void; + /** Abort the printing function and restores the PDF Viewer. + * @returns {void} + */ + abortPrint(): void; + + /** Shows/hides the print icon in the tool bar. + * @returns {void} + */ + showPrintTools(): void; + + /** Downloads the PDF document being loaded in the ejPdfViewer control. + * @returns {void} + */ + download(): void; + + /** Shows/hides the download tool in the tool bar. + * @returns {void} + */ + showDownloadTool(): void; + /** Shows/hides the page navigation tools in the toolbar * @returns {void} */ @@ -37649,6 +38268,9 @@ export interface Model { /** Triggers after the printing is completed. */ afterPrint? (e: AfterPrintEventArgs): void; + /** Triggers when the mouse click is performed over the page of the PDF document. */ + pageClick? (e: PageClickEventArgs): void; + /** Triggers when PDF viewer control is destroyed successfully. */ destroy? (e: DestroyEventArgs): void; } @@ -37759,6 +38381,29 @@ export interface AfterPrintEventArgs { type?: string; } +export interface PageClickEventArgs { + + /** True, if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** Returns the PDF viewer model + */ + model?: any; + + /** Returns the name of the event + */ + type?: string; + + /** Returns the current X position + */ + offsetX?: number; + + /** Returns the current Y position + */ + offsetY?: number; +} + export interface DestroyEventArgs { /** True, if the event should be canceled; otherwise, false. @@ -37812,7 +38457,7 @@ enum PdfService{ enum LinkTarget{ - ///Opens the hyperlink in the same tab of the browser. + ///Opens the hyperlink in the same tab of the browser. Default, ///Opens the hyperlink in a new tab of the browser. @@ -38310,7 +38955,7 @@ export interface IgnoreSettings { } declare module ej.datavisualization { - + class SymbolPalette extends ej.Widget { static fn: SymbolPalette; constructor(element: JQuery, options?: SymbolPalette.Model); @@ -43028,6 +43673,10 @@ export interface Model { */ primaryXAxis?: PrimaryXAxis; + /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + axes?: Array; + /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. */ primaryYAxis?: PrimaryYAxis; @@ -43388,11 +44037,11 @@ export interface DisplayTextRenderingEventArgs { */ locationY?: number; - /** Index of the series in series Collection whose data label is being rendered + /** Index of the series in series Collection whose data label is being rendered */ seriesIndex?: number; - /** Index of the point in series whose data label is being rendered + /** Index of the point in series whose data label is being rendered */ pointIndex?: number; @@ -43693,7 +44342,7 @@ export interface SeriesRenderingEventArgs { export interface SymbolRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43716,7 +44365,7 @@ export interface SymbolRenderingEventArgs { export interface TitleRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43743,7 +44392,7 @@ export interface TitleRenderingEventArgs { export interface ToolTipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43770,7 +44419,7 @@ export interface ToolTipInitializeEventArgs { export interface TrackAxisToolTipEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43801,7 +44450,7 @@ export interface TrackAxisToolTipEventArgs { export interface TrackToolTipEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43836,7 +44485,7 @@ export interface TrackToolTipEventArgs { export interface AxisLabelClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43848,7 +44497,7 @@ export interface AxisLabelClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the labels in chart area. + /** X and Y co-ordinate of the labels in chart area. */ location?: any; @@ -43867,7 +44516,7 @@ export interface AxisLabelClickEventArgs { export interface AxisLabelMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43879,7 +44528,7 @@ export interface AxisLabelMouseMoveEventArgs { */ type?: string; - /** X and Y co-ordinate of the labels in chart area. + /** X and Y co-ordinate of the labels in chart area. */ location?: any; @@ -43898,7 +44547,7 @@ export interface AxisLabelMouseMoveEventArgs { export interface ChartClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43910,30 +44559,30 @@ export interface ChartClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface ChartMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43945,30 +44594,30 @@ export interface ChartMouseMoveEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface ChartDoubleClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -43980,30 +44629,30 @@ export interface ChartDoubleClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface AnnotationClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -44015,26 +44664,26 @@ export interface AnnotationClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the annotation in chart area. + /** X and Y co-ordinate of the annotation in chart area. */ location?: any; - /** Information about the annotation, like Coordinate unit, Region, content + /** Information about the annotation, like Coordinate unit, Region, content */ contentData?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface AfterResizeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -44046,34 +44695,34 @@ export interface AfterResizeEventArgs { */ type?: string; - /** Chart width, after resize + /** Chart width, after resize */ width?: number; - /** Chart height, after resize + /** Chart height, after resize */ height?: number; - /** Chart width, before resize + /** Chart width, before resize */ prevWidth?: number; - /** Chart height, before resize + /** Chart height, before resize */ prevHeight?: number; - /** Chart width, when the chart was first rendered + /** Chart width, when the chart was first rendered */ originalWidth?: number; - /** Chart height, when the chart was first rendered + /** Chart height, when the chart was first rendered */ originalHeight?: number; } export interface BeforeResizeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -44085,26 +44734,26 @@ export interface BeforeResizeEventArgs { */ type?: string; - /** Chart width, before resize + /** Chart width, before resize */ currentWidth?: number; - /** Chart height, before resize + /** Chart height, before resize */ currentHeight?: number; - /** Chart width, after resize + /** Chart width, after resize */ newWidth?: number; - /** Chart height, after resize + /** Chart height, after resize */ newHeight?: number; } export interface ErrorBarRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -44116,7 +44765,7 @@ export interface ErrorBarRenderingEventArgs { */ type?: string; - /** Error bar Object + /** Error bar Object */ errorbar?: any; } @@ -46603,6 +47252,677 @@ export interface PrimaryXAxis { zoomPosition?: number; } +export interface AxesAlternateGridBandEven { + + /** Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /** Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface AxesAlternateGridBandOdd { + + /** Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /** Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface AxesAlternateGridBand { + + /** Options for customizing even grid band. + */ + even?: AxesAlternateGridBandEven; + + /** Options for customizing odd grid band. + */ + odd?: AxesAlternateGridBandOdd; +} + +export interface AxesAxisLine { + + /** Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /** Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /** Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /** Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface AxesCrosshairLabel { + + /** Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface AxesFont { + + /** Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /** Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /** Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /** Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface AxesMajorGridLines { + + /** Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /** Color of the major grid line. + * @Default {null} + */ + color?: string; + + /** Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /** Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /** Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface AxesMajorTickLines { + + /** Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /** Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /** Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface AxesMinorGridLines { + + /** Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /** Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /** Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface AxesMinorTickLines { + + /** Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /** Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /** Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface AxesRange { + + /** Minimum value of the axis range. + * @Default {null} + */ + min?: number; + + /** Maximum value of the axis range. + * @Default {null} + */ + max?: number; + + /** Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface AxesMultiLevelLabelsFont { + + /** Font color of the multi level labels text. + * @Default {null} + */ + color?: string; + + /** Font family of the multi level labels text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of the multi level labels text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /** Font weight of the multi level label text. + * @Default {regular} + */ + fontWeight?: string; + + /** Opacity of the multi level label text. + * @Default {1} + */ + opacity?: number; + + /** Font size of the multi level label text. + * @Default {12px} + */ + size?: string; +} + +export interface AxesMultiLevelLabelsBorder { + + /** Border color of the multi level labels. + * @Default {null} + */ + color?: string; + + /** Border width of the multi level labels. + * @Default {1} + */ + width?: number; + + /** Border type of the multi level labels. + * @Default {rectangle. See Type} + */ + type?: ej.datavisualization.Chart.MultiLevelLabelsBorderType|string; +} + +export interface AxesMultiLevelLabel { + + /** Visibility of the multi level labels. + * @Default {false} + */ + visible?: boolean; + + /** Text of the multi level labels. + */ + text?: string; + + /** Starting value of the multi level labels. + * @Default {null} + */ + start?: number; + + /** Ending value of the multi level labels. + * @Default {null} + */ + end?: number; + + /** Specifies the level of multi level labels. + * @Default {0} + */ + level?: number; + + /** Specifies the maximum width of the text in multi level labels. + * @Default {null} + */ + maximumTextWidth?: number; + + /** Specifies the alignment of the text in multi level labels. + * @Default {center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /** Specifies the handling of text over flow in multi level labels. + * @Default {center. See TextOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /** Options for customizing the font of the text. + */ + font?: AxesMultiLevelLabelsFont; + + /** Options for customizing the border of the series. + */ + border?: AxesMultiLevelLabelsBorder; +} + +export interface AxesStripLineFont { + + /** Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /** Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /** Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /** Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /** Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface AxesStripLine { + + /** Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /** Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /** End value of the strip line. + * @Default {null} + */ + end?: number; + + /** Options for customizing the font of the text. + */ + font?: AxesStripLineFont; + + /** Start value of the strip line. + * @Default {null} + */ + start?: number; + + /** Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /** Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /** Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /** Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /** Width of the strip line. + * @Default {0} + */ + width?: number; + + /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface AxesLabelBorder { + + /** Specifies the color of the label border. + * @Default {null} + */ + color?: string; + + /** Specifies the width of the label border. + * @Default {1} + */ + width?: number; +} + +export interface AxesTitleFont { + + /** Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /** Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /** Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /** Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface AxesTitle { + + /** Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /** Options for customizing the title font. + */ + font?: AxesTitleFont; + + /** Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /** Title for the axis. + */ + text?: string; + + /** Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; + + /** offset value for axis title. + * @Default {0} + */ + offset?: number; + + /** Specifies the position of the axis title. + * @Default {outside. See Position} + */ + position?: ej.datavisualization.Chart.LabelPosition|string; + + /** Specifies the position of the axis title. + * @Default {center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.TextAlignment|string; +} + +export interface Axis { + + /** Options for customizing axis alternate grid band. + */ + alternateGridBand?: AxesAlternateGridBand; + + /** Specifies where axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. + * @Default {null} + */ + crossesAt?: number; + + /** Category axis can also plot points based on index value of data points. Index based plotting can be enabled by setting ‘isIndexed’ property to true. + * @Default {false} + */ + isIndexed?: boolean; + + /** Options for customizing the axis line. + */ + axisLine?: AxesAxisLine; + + /** Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /** Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /** Options to customize the crosshair label. + */ + crosshairLabel?: AxesCrosshairLabel; + + /** With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /** Specifies the placement of labels. + * @Default {ej.datavisualization.Chart.LabelPlacement.BetweenTicks. See LabelPlacement} + */ + labelPlacement?: ej.datavisualization.Chart.LabelPlacement|string; + + /** Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /** Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /** Options for customizing the font of the axis Labels. + */ + font?: AxesFont; + + /** Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /** Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /** Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /** Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /** Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /** Specifies the position of the axis labels. + * @Default {center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.LabelAlignment|string; + + /** Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /** Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /** Options for customizing major gird lines. + */ + majorGridLines?: AxesMajorGridLines; + + /** Options for customizing the major tick lines. + */ + majorTickLines?: AxesMajorTickLines; + + /** Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /** Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /** Options for customizing the minor grid lines. + */ + minorGridLines?: AxesMinorGridLines; + + /** Options for customizing the minor tick lines. + */ + minorTickLines?: AxesMinorTickLines; + + /** Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /** Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /** Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /** Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /** Options to customize the range of the axis. + */ + range?: AxesRange; + + /** Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /** Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /** Options for customizing the multi level labels. + * @Default {[ ]} + */ + multiLevelLabels?: Array; + + /** Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /** Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /** Options for customizing the border of the labels. + */ + labelBorder?: AxesLabelBorder; + + /** Options for customizing the axis title. + */ + title?: AxesTitle; + + /** Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /** Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /** The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /** Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + export interface PrimaryYAxisAlternateGridBandEven { /** Fill color for the even grid bands. @@ -53441,11 +54761,11 @@ export interface Model { /** Defines the background color of diagram elements * @Default {transparent} */ - backgroundColor?: String; + backgroundColor?: string; /** Defines the path of the background image of diagram elements */ - backgroundImage?: String; + backgroundImage?: string; /** Sets the direction of line bridges. * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} @@ -53502,7 +54822,7 @@ export interface Model { /** Specifies the height of the diagram * @Default {null} */ - height?: String; + height?: string; /** Customizes the undo redo functionality */ @@ -53515,7 +54835,7 @@ export interface Model { /** Defines the current culture of diagram * @Default {en-US} */ - locale?: String; + locale?: string; /** Array of JSON objects where each object represents a node * @Default {[]} @@ -53561,12 +54881,12 @@ export interface Model { /** Specifies the width of the diagram * @Default {null} */ - width?: String; + width?: string; /** Sets the factor by which we can zoom in or zoom out * @Default {0.2} */ - zoomFactor?: Number; + zoomFactor?: number; /** Triggers When auto scroll is changed */ autoScrollChange? (e: AutoScrollChangeEventArgs): void; @@ -54404,12 +55724,12 @@ export interface ConnectorsLabel { /** Sets the border color of the label * @Default {transparent} */ - borderColor?: String; + borderColor?: string; /** Sets the border width of the label * @Default {0} */ - borderWidth?: Number; + borderWidth?: number; /** Defines whether the label should be aligned within the connector boundaries * @Default {true} @@ -54419,22 +55739,22 @@ export interface ConnectorsLabel { /** Sets the fill color of the text area * @Default {transparent} */ - fillColor?: String; + fillColor?: string; /** Sets the font color of the text * @Default {black} */ - fontColor?: String; + fontColor?: string; /** Sets the font family of the text * @Default {Arial} */ - fontFamily?: String; + fontFamily?: string; /** Defines the font size of the text * @Default {12} */ - fontSize?: Number; + fontSize?: number; /** Sets the horizontal alignment of the label. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} @@ -54453,7 +55773,7 @@ export interface ConnectorsLabel { /** Sets the unique identifier of the label */ - name?: String; + name?: string; /** Sets the fraction/ratio(relative to connector) that defines the position of the label * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} @@ -54468,7 +55788,7 @@ export interface ConnectorsLabel { /** Defines the transparency of labels * @Default {1} */ - opacity?: Number; + opacity?: number; /** Defines whether the label is editable or not * @Default {false} @@ -54483,16 +55803,16 @@ export interface ConnectorsLabel { /** Defines the angle to which the label needs to be rotated * @Default {0} */ - rotateAngle?: Number; + rotateAngle?: number; /** Sets the position of the label with respect to the total segment length * @Default {0.5} */ - segmentOffset?: String; + segmentOffset?: string; /** Defines the label text */ - text?: String; + text?: string; /** Defines how to align the text inside the label. * @Default {ej.datavisualization.Diagram.TextAlign.Center} @@ -54517,7 +55837,7 @@ export interface ConnectorsLabel { /** Sets the width of the label(the maximum value of label width and the connector width will be considered as label width) * @Default {50} */ - width?: Number; + width?: number; /** Defines how the label text needs to be wrapped. * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} @@ -54529,12 +55849,12 @@ export interface ConnectorsSegment { /** Sets the direction of orthogonal segment */ - direction?: String; + direction?: string; /** Describes the length of orthogonal segment * @Default {undefined} */ - length?: Number; + length?: number; /** Describes the end point of bezier/straight segment * @Default {Diagram.Point()} @@ -54577,12 +55897,12 @@ export interface ConnectorsShapeMultiplicitySource { /** Defines the source label to connector. Applicable, if the connector is of type "UML" * @Default {null} */ - lowerBounds?: Number; + lowerBounds?: number; /** Defines the source label to connector. Applicable, if the connector is of type "UML" * @Default {null} */ - upperBounds?: Number; + upperBounds?: number; } export interface ConnectorsShapeMultiplicity { @@ -54645,26 +55965,26 @@ export interface ConnectorsSourceDecorator { /** Sets the border color of the source decorator * @Default {black} */ - borderColor?: String; + borderColor?: string; /** Sets the border width of the decorator * @Default {1} */ - borderWidth?: Number; + borderWidth?: number; /** Sets the fill color of the source decorator * @Default {black} */ - fillColor?: String; + fillColor?: string; /** Sets the height of the source decorator * @Default {8} */ - height?: Number; + height?: number; /** Defines the custom shape of the source decorator */ - pathData?: String; + pathData?: string; /** Defines the shape of the source decorator. * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} @@ -54674,7 +55994,7 @@ export interface ConnectorsSourceDecorator { /** Defines the width of the source decorator * @Default {8} */ - width?: Number; + width?: number; } export interface ConnectorsSourcePoint { @@ -54682,12 +56002,12 @@ export interface ConnectorsSourcePoint { /** Defines the x-coordinate of a position * @Default {0} */ - x?: Number; + x?: number; /** Defines the y-coordinate of a position * @Default {0} */ - y?: Number; + y?: number; } export interface ConnectorsTargetDecorator { @@ -54695,21 +56015,21 @@ export interface ConnectorsTargetDecorator { /** Sets the border color of the decorator * @Default {black} */ - borderColor?: String; + borderColor?: string; /** Sets the color with which the decorator will be filled * @Default {black} */ - fillColor?: String; + fillColor?: string; /** Defines the height of the target decorator * @Default {8} */ - height?: Number; + height?: number; /** Defines the custom shape of the target decorator */ - pathData?: String; + pathData?: string; /** Defines the shape of the target decorator. * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} @@ -54719,7 +56039,7 @@ export interface ConnectorsTargetDecorator { /** Defines the width of the target decorator * @Default {8} */ - width?: Number; + width?: number; } export interface Connector { @@ -54732,7 +56052,7 @@ export interface Connector { /** Defines the width of the line bridges * @Default {10} */ - bridgeSpace?: Number; + bridgeSpace?: number; /** Enables or disables the behaviors of connectors. * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} @@ -54742,11 +56062,11 @@ export interface Connector { /** Defines the radius of the rounded corner * @Default {0} */ - cornerRadius?: Number; + cornerRadius?: number; /** Configures the styles of shapes */ - cssClass?: String; + cssClass?: string; /** Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} @@ -54761,50 +56081,50 @@ export interface Connector { /** Sets the stroke color of the connector * @Default {black} */ - lineColor?: String; + lineColor?: string; /** Sets the pattern of dashes and gaps used to stroke the path of the connector */ - lineDashArray?: String; + lineDashArray?: string; /** Defines the padding value to ease the interaction with connectors * @Default {10} */ - lineHitPadding?: Number; + lineHitPadding?: number; /** Sets the width of the line * @Default {1} */ - lineWidth?: Number; + lineWidth?: number; /** Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. * @Default {0} */ - marginBottom?: Number; + marginBottom?: number; /** Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. * @Default {0} */ - marginLeft?: Number; + marginLeft?: number; /** Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. * @Default {0} */ - marginRight?: Number; + marginRight?: number; /** Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. * @Default {0} */ - marginTop?: Number; + marginTop?: number; /** Sets a unique name for the connector */ - name?: String; + name?: string; /** Defines the transparency of the connector * @Default {1} */ - opacity?: Number; + opacity?: number; /** Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item * @Default {null} @@ -54813,7 +56133,7 @@ export interface Connector { /** Sets the parent name of the connector. */ - parent?: String; + parent?: string; /** An array of JSON objects where each object represents a segment * @Default {[ { type:straight } ]} @@ -54832,12 +56152,12 @@ export interface Connector { /** Sets the source node of the connector */ - sourceNode?: String; + sourceNode?: string; /** Defines the space to be left between the source node and the source point of a connector * @Default {0} */ - sourcePadding?: Number; + sourcePadding?: number; /** Describes the start point of the connector * @Default {ej.datavisualization.Diagram.Point()} @@ -54846,7 +56166,7 @@ export interface Connector { /** Sets the source port of the connector */ - sourcePort?: String; + sourcePort?: string; /** Defines the target decorator of the connector * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} @@ -54855,12 +56175,12 @@ export interface Connector { /** Sets the target node of the connector */ - targetNode?: String; + targetNode?: string; /** Defines the space to be left between the target node and the target point of the connector * @Default {0} */ - targetPadding?: Number; + targetPadding?: number; /** Describes the end point of the connector * @Default {ej.datavisualization.Diagram.Point()} @@ -54869,7 +56189,7 @@ export interface Connector { /** Sets the targetPort of the connector */ - targetPort?: String; + targetPort?: string; /** Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip * @Default {null} @@ -54889,7 +56209,7 @@ export interface Connector { /** Sets the z-index of the connector * @Default {0} */ - zOrder?: Number; + zOrder?: number; } export interface ContextMenu { @@ -54914,26 +56234,26 @@ export interface DataSourceSettings { /** Sets the unique id of the data source items */ - id?: String; + id?: string; /** Defines the parent id of the data source item * @Default {''} */ - parent?: String; + parent?: string; /** Describes query to retrieve a set of data from the specified datasource * @Default {null} */ - query?: String; + query?: string; /** Sets the unique id of the root data source item */ - root?: String; + root?: string; /** Describes the name of the table on which the specified query has to be executed * @Default {null} */ - tableName?: String; + tableName?: string; } export interface DefaultSettings { @@ -54985,7 +56305,7 @@ export interface HistoryManager { /** The stackLimit property used to restrict the undo and redo actions to a certain limit. * @Default {null} */ - stackLimit?: Number; + stackLimit?: number; /** A method that starts to group the changes to revert/restore them in a single undo or redo */ @@ -55010,7 +56330,7 @@ export interface Layout { /** Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned */ - fixedNode?: String; + fixedNode?: string; /** Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types * @Default {null} @@ -55020,7 +56340,7 @@ export interface Layout { /** Sets the space to be horizontally left between nodes * @Default {30} */ - horizontalSpacing?: Number; + horizontalSpacing?: number; /** Defines the space to be left between layout bounds and layout. * @Default {ej.datavisualization.Diagram.Margin()} @@ -55050,7 +56370,7 @@ export interface Layout { /** Sets the space to be vertically left between nodes * @Default {30} */ - verticalSpacing?: Number; + verticalSpacing?: number; } export interface NodesAnnotation { @@ -55058,7 +56378,7 @@ export interface NodesAnnotation { /** Sets the angle between the BPMN shape and the annotation * @Default {0} */ - angle?: Number; + angle?: number; /** Sets the direction of the text annotation * @Default {ej.datavisualization.Diagram.BPMNAnnotationDirections.Left} @@ -55068,37 +56388,37 @@ export interface NodesAnnotation { /** Sets the height of the text annotation * @Default {20} */ - height?: Number; + height?: number; /** Sets the distance between the BPMN shape and the annotation * @Default {0} */ - length?: Number; + length?: number; /** Defines the additional information about the flow object in a BPMN Process */ - text?: String; + text?: string; /** Sets the width of the text annotation * @Default {20} */ - width?: Number; + width?: number; } export interface NodesClassAttribute { /** Sets the name of the attribute */ - name?: String; + name?: string; /** Sets the data type of attribute */ - type?: String; + type?: string; /** Defines the visibility of the attribute * @Default {ej.datavisualization.Diagram.ScopeValueDefaults.Public} */ - scope?: String; + scope?: string; } export interface NodesClassMethod { @@ -55106,14 +56426,14 @@ export interface NodesClassMethod { /** Sets the visibility of the method. * @Default {ej.datavisualization.Diagram.ScopeValueDefaults.Public} */ - scope?: String; + scope?: string; } export interface NodesClass { /** Sets the name of class. */ - name?: String; + name?: string; /** Defines the collection of attributes * @Default {[]} @@ -55131,22 +56451,22 @@ export interface NodesCollapseIcon { /** Sets the border color for collapse icon of node * @Default {black} */ - borderColor?: String; + borderColor?: string; /** Sets the border width for collapse icon of node * @Default {1} */ - borderWidth?: Number; + borderWidth?: number; /** Sets the fill color for collapse icon of node * @Default {white} */ - fillColor?: String; + fillColor?: string; /** Defines the height for collapse icon of node * @Default {15} */ - height?: Number; + height?: number; /** Sets the horizontal alignment of the icon. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} @@ -55179,7 +56499,7 @@ export interface NodesContainer { /** Defines the orientation of the container. Applicable, if the group is a container. * @Default {vertical} */ - orientation?: String; + orientation?: string; /** Sets the type of the container. Applicable if the group is a container. * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} @@ -55204,14 +56524,14 @@ export interface NodesEnumerationMember { /** Sets the name of the enumeration member */ - name?: String; + name?: string; } export interface NodesEnumeration { /** Sets the name of the Enumeration */ - name?: String; + name?: string; /** Defines the collection of enumeration members * @Default {[]} @@ -55224,22 +56544,22 @@ export interface NodesExpandIcon { /** Sets the border color for expand icon of node * @Default {black} */ - borderColor?: String; + borderColor?: string; /** Sets the border width for expand icon of node * @Default {1} */ - borderWidth?: Number; + borderWidth?: number; /** Sets the fill color for expand icon of node * @Default {white} */ - fillColor?: String; + fillColor?: string; /** Defines the height for expand icon of node * @Default {15} */ - height?: Number; + height?: number; /** Sets the horizontal alignment of the icon. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} @@ -55277,22 +56597,22 @@ export interface NodesGradientLinearGradient { /** Defines the left most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ - x1?: Number; + x1?: number; /** Defines the right most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ - x2?: Number; + x2?: number; /** Defines the top most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ - y1?: Number; + y1?: number; /** Defines the bottom most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ - y2?: Number; + y2?: number; } export interface NodesGradientRadialGradient { @@ -55300,22 +56620,22 @@ export interface NodesGradientRadialGradient { /** Defines the position of the outermost circle * @Default {0} */ - cx?: Number; + cx?: number; /** Defines the outer most circle of the radial gradient * @Default {0} */ - cy?: Number; + cy?: number; /** Defines the innermost circle of the radial gradient * @Default {0} */ - fx?: Number; + fx?: number; /** Defines the innermost circle of the radial gradient * @Default {0} */ - fy?: Number; + fy?: number; /** Defines the different colors and the region of color transitions. * @Default {[]} @@ -55327,17 +56647,17 @@ export interface NodesGradientStop { /** Sets the color to be filled over the specified region */ - color?: String; + color?: string; /** Sets the position where the previous color transition ends and a new color transition starts * @Default {0} */ - offset?: Number; + offset?: number; /** Describes the transparency level of the region * @Default {1} */ - opacity?: Number; + opacity?: number; } export interface NodesGradient { @@ -55359,29 +56679,29 @@ export interface NodesInterfaceAttribute { /** Sets the name of the attribute */ - name?: String; + name?: string; /** Sets the type of the attribute */ - type?: String; + type?: string; /** Sets the visibility of the attribute */ - scope?: String; + scope?: string; } export interface NodesInterfaceMethod { /** Sets the visibility of the method */ - scope?: String; + scope?: string; } export interface NodesInterface { /** Sets the name of the interface */ - name?: String; + name?: string; /** Defines a collection of attributes of the interface * @Default {[]} @@ -55404,32 +56724,32 @@ export interface NodesLabel { /** Sets the border color of the label * @Default {transparent} */ - borderColor?: String; + borderColor?: string; /** Sets the border width of the label * @Default {0} */ - borderWidth?: Number; + borderWidth?: number; /** Sets the fill color of the text area * @Default {transparent} */ - fillColor?: String; + fillColor?: string; /** Sets the font color of the text * @Default {black} */ - fontColor?: String; + fontColor?: string; /** Sets the font family of the text * @Default {Arial} */ - fontFamily?: String; + fontFamily?: string; /** Defines the font size of the text * @Default {12} */ - fontSize?: Number; + fontSize?: number; /** Sets the horizontal alignment of the label. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} @@ -55453,7 +56773,7 @@ export interface NodesLabel { /** Sets the unique identifier of the label */ - name?: String; + name?: string; /** Sets the fraction/ratio(relative to node) that defines the position of the label * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} @@ -55463,7 +56783,7 @@ export interface NodesLabel { /** Defines the transparency of the labels * @Default {1} */ - opacity?: Number; + opacity?: number; /** Defines whether the label is editable or not * @Default {false} @@ -55473,11 +56793,11 @@ export interface NodesLabel { /** Defines the angle to which the label needs to be rotated * @Default {0} */ - rotateAngle?: Number; + rotateAngle?: number; /** Defines the label text */ - text?: String; + text?: string; /** Defines how to align the text inside the label. * @Default {ej.datavisualization.Diagram.TextAlign.Center} @@ -55502,7 +56822,7 @@ export interface NodesLabel { /** Sets the width of the label(the maximum value of label width and the node width will be considered as label width) * @Default {50} */ - width?: Number; + width?: number; /** Defines how the label text needs to be wrapped. * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} @@ -55540,7 +56860,7 @@ export interface NodesLane { /** Defines the fill color of the lane * @Default {white} */ - fillColor?: String; + fillColor?: string; /** Defines the header of the lane * @Default {{ text: Function, fontSize: 11 }} @@ -55554,12 +56874,12 @@ export interface NodesLane { /** Sets the unique identifier of the lane */ - name?: String; + name?: string; /** Sets the orientation of the lane. * @Default {vertical} */ - orientation?: String; + orientation?: string; } export interface NodesPaletteItem { @@ -55572,7 +56892,7 @@ export interface NodesPaletteItem { /** Defines the height of the symbol * @Default {0} */ - height?: Number; + height?: number; /** Defines the margin of the symbol item * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} @@ -55582,17 +56902,17 @@ export interface NodesPaletteItem { /** Defines the preview height of the symbol * @Default {undefined} */ - previewHeight?: Number; + previewHeight?: number; /** Defines the preview width of the symbol * @Default {undefined} */ - previewWidth?: Number; + previewWidth?: number; /** Defines the width of the symbol * @Default {0} */ - width?: Number; + width?: number; } export interface NodesPhase { @@ -55605,36 +56925,36 @@ export interface NodesPhase { /** Defines the line color of the splitter that splits adjacent phases. * @Default {#606060} */ - lineColor?: String; + lineColor?: string; /** Sets the dash array that used to stroke the phase splitter * @Default {3,3} */ - lineDashArray?: String; + lineDashArray?: string; /** Sets the lineWidth of the phase * @Default {1} */ - lineWidth?: Number; + lineWidth?: number; /** Sets the unique identifier of the phase */ - name?: String; + name?: string; /** Sets the length of the smaller region(phase) of a swimlane * @Default {100} */ - offset?: Number; + offset?: number; /** Sets the orientation of the phase * @Default {horizontal} */ - orientation?: String; + orientation?: string; /** Sets the type of the object as phase * @Default {phase} */ - type?: String; + type?: string; } export interface NodesPort { @@ -55642,17 +56962,17 @@ export interface NodesPort { /** Sets the border color of the port * @Default {#1a1a1a} */ - borderColor?: String; + borderColor?: string; /** Sets the stroke width of the port * @Default {1} */ - borderWidth?: Number; + borderWidth?: number; /** Defines the space to be left between the port bounds and its incoming and outgoing connections. * @Default {0} */ - connectorPadding?: Number; + connectorPadding?: number; /** Defines whether connections can be created with the port * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} @@ -55662,11 +56982,11 @@ export interface NodesPort { /** Sets the fill color of the port * @Default {white} */ - fillColor?: String; + fillColor?: string; /** Sets the unique identifier of the port */ - name?: String; + name?: string; /** Defines the position of the port as fraction/ ratio relative to node * @Default {ej.datavisualization.Diagram.Point(0, 0)} @@ -55675,7 +56995,7 @@ export interface NodesPort { /** Defines the path data to draw the port. Applicable, if the port shape is path. */ - pathData?: String; + pathData?: string; /** Defines the shape of the port. * @Default {ej.datavisualization.Diagram.PortShapes.Square} @@ -55685,7 +57005,7 @@ export interface NodesPort { /** Defines the size of the port * @Default {8} */ - size?: Number; + size?: number; /** Defines when the port should be visible. * @Default {ej.datavisualization.Diagram.PortVisibility.Default} @@ -55698,17 +57018,17 @@ export interface NodesShadow { /** Defines the angle of the shadow relative to node * @Default {45} */ - angle?: Number; + angle?: number; /** Sets the distance to move the shadow relative to node * @Default {5} */ - distance?: Number; + distance?: number; /** Defines the opaque of the shadow * @Default {0.7} */ - opacity?: Number; + opacity?: number; } export interface NodesSubProcess { @@ -55806,16 +57126,16 @@ export interface Node { /** Sets the border color of node * @Default {black} */ - borderColor?: String; + borderColor?: string; /** Sets the pattern of dashes and gaps to stroke the border */ - borderDashArray?: String; + borderDashArray?: string; /** Sets the border width of the node * @Default {1} */ - borderWidth?: Number; + borderWidth?: number; /** Defines whether the group can be ungrouped or not * @Default {true} @@ -55844,7 +57164,7 @@ export interface Node { /** Defines the distance to be left between a node and its connections(In coming and out going connections). * @Default {0} */ - connectorPadding?: Number; + connectorPadding?: number; /** Enables or disables the default behaviors of the node. * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} @@ -55859,11 +57179,11 @@ export interface Node { /** Defines the corner radius of rectangular shapes. * @Default {0} */ - cornerRadius?: Number; + cornerRadius?: number; /** Configures the styles of shapes */ - cssClass?: String; + cssClass?: string; /** Defines the BPMN data object */ @@ -55891,7 +57211,7 @@ export interface Node { /** Defines the fill color of the node * @Default {white} */ - fillColor?: String; + fillColor?: string; /** Sets the type of the BPMN Gateway. Applicable, if the node is a BPMN gateway. * @Default {ej.datavisualization.Diagram.BPMNGateways.None} @@ -55915,7 +57235,7 @@ export interface Node { /** Defines the height of the node * @Default {0} */ - height?: Number; + height?: number; /** Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} @@ -55955,66 +57275,66 @@ export interface Node { /** Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. * @Default {0} */ - marginBottom?: Number; + marginBottom?: number; /** Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. * @Default {0} */ - marginLeft?: Number; + marginLeft?: number; /** Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. * @Default {0} */ - marginRight?: Number; + marginRight?: number; /** Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. * @Default {0} */ - marginTop?: Number; + marginTop?: number; /** Defines the maximum height limit of the node * @Default {0} */ - maxHeight?: Number; + maxHeight?: number; /** Defines the maximum width limit of the node * @Default {0} */ - maxWidth?: Number; + maxWidth?: number; /** Defines the minimum height limit of the node * @Default {0} */ - minHeight?: Number; + minHeight?: number; /** Defines the minimum width limit of the node * @Default {0} */ - minWidth?: Number; + minWidth?: number; /** Sets the unique identifier of the node */ - name?: String; + name?: string; /** Defines the position of the node on X-Axis * @Default {0} */ - offsetX?: Number; + offsetX?: number; /** Defines the position of the node on Y-Axis * @Default {0} */ - offsetY?: Number; + offsetY?: number; /** Defines the opaque of the node * @Default {1} */ - opacity?: Number; + opacity?: number; /** Defines the orientation of nodes. Applicable, if the node is a swimlane. * @Default {vertical} */ - orientation?: String; + orientation?: string; /** A read only collection of outgoing connectors/edges of the node * @Default {[]} @@ -56024,22 +57344,22 @@ export interface Node { /** Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. * @Default {0} */ - paddingBottom?: Number; + paddingBottom?: number; /** Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. * @Default {0} */ - paddingLeft?: Number; + paddingLeft?: number; /** Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. * @Default {0} */ - paddingRight?: Number; + paddingRight?: number; /** Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. * @Default {0} */ - paddingTop?: Number; + paddingTop?: number; /** Defines the size and preview size of the node to add that to symbol palette * @Default {null} @@ -56048,11 +57368,11 @@ export interface Node { /** Sets the name of the parent group */ - parent?: String; + parent?: string; /** Sets the path geometry that defines the shape of a path node */ - pathData?: String; + pathData?: string; /** An array of objects, where each object represents a smaller region(phase) of a swimlane. * @Default {[]} @@ -56062,7 +57382,7 @@ export interface Node { /** Sets the height of the phase headers * @Default {0} */ - phaseSize?: Number; + phaseSize?: number; /** Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} @@ -56082,7 +57402,7 @@ export interface Node { /** Sets the angle to which the node should be rotated * @Default {0} */ - rotateAngle?: Number; + rotateAngle?: number; /** Defines the opacity and the position of shadow * @Default {ej.datavisualization.Diagram.Shadow()} @@ -56096,7 +57416,7 @@ export interface Node { /** Sets the source path of the image. Applicable, if the type of the node is image. */ - source?: String; + source?: string; /** Defines the sub process of a BPMN Activity. Applicable, if the type of the BPMN activity is sub process. * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} @@ -56110,7 +57430,7 @@ export interface Node { /** Sets the id of svg/html templates. Applicable, if the node is HTML or native. */ - templateId?: String; + templateId?: string; /** Defines the textBlock of a text node * @Default {null} @@ -56145,12 +57465,12 @@ export interface Node { /** Defines the width of the node * @Default {0} */ - width?: Number; + width?: number; /** Defines the z-index of the node * @Default {0} */ - zOrder?: Number; + zOrder?: number; } export interface PageSettings { @@ -56168,27 +57488,27 @@ export interface PageSettings { /** Defines the background color of diagram pages * @Default {#ffffff} */ - pageBackgroundColor?: String; + pageBackgroundColor?: string; /** Defines the page border color * @Default {#565656} */ - pageBorderColor?: String; + pageBorderColor?: string; /** Sets the border width of diagram pages * @Default {0} */ - pageBorderWidth?: Number; + pageBorderWidth?: number; /** Defines the height of a page * @Default {null} */ - pageHeight?: Number; + pageHeight?: number; /** Defines the page margin * @Default {24} */ - pageMargin?: Number; + pageMargin?: number; /** Sets the orientation of the page. * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} @@ -56198,7 +57518,7 @@ export interface PageSettings { /** Defines the height of a diagram page * @Default {null} */ - pageWidth?: Number; + pageWidth?: number; /** Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". * @Default {null} @@ -56226,12 +57546,12 @@ export interface ScrollSettings { /** Allows to read the zoom value of diagram * @Default {0} */ - currentZoom?: Number; + currentZoom?: number; /** Sets the horizontal scroll offset * @Default {0} */ - horizontalOffset?: Number; + horizontalOffset?: number; /** Allows to extend the scrollable region that is based on the scroll limit * @Default {{left: 0, right: 0, top:0, bottom: 0}} @@ -56241,17 +57561,17 @@ export interface ScrollSettings { /** Sets the vertical scroll offset * @Default {0} */ - verticalOffset?: Number; + verticalOffset?: number; /** Allows to read the view port height of the diagram * @Default {0} */ - viewPortHeight?: Number; + viewPortHeight?: number; /** Allows to read the view port width of the diagram * @Default {0} */ - viewPortWidth?: Number; + viewPortWidth?: number; } export interface SelectedItemsUserHandle { @@ -56259,12 +57579,12 @@ export interface SelectedItemsUserHandle { /** Defines the background color of the user handle * @Default {#2382c3} */ - backgroundColor?: String; + backgroundColor?: string; /** Sets the border color of the user handle * @Default {transparent} */ - borderColor?: String; + borderColor?: string; /** Defines whether the user handle should be added, when more than one element is selected * @Default {false} @@ -56274,11 +57594,11 @@ export interface SelectedItemsUserHandle { /** Sets the stroke color of the user handle * @Default {transparent} */ - pathColor?: String; + pathColor?: string; /** Defines the custom shape of the user handle */ - pathData?: String; + pathData?: string; /** Defines the position of the user handle * @Default {ej.datavisualization.Diagram.UserHandlePositions.BottomCenter} @@ -56288,7 +57608,7 @@ export interface SelectedItemsUserHandle { /** Defines the size of the user handle * @Default {8} */ - size?: Number; + size?: number; /** Defines the interactive behaviors of the user handle */ @@ -56320,22 +57640,22 @@ export interface SelectedItems { /** Sets the height of the selected items * @Default {0} */ - height?: Number; + height?: number; /** Sets the x position of the selector * @Default {0} */ - offsetX?: Number; + offsetX?: number; /** Sets the y position of the selector * @Default {0} */ - offsetY?: Number; + offsetY?: number; /** Sets the angle to rotate the selected items * @Default {0} */ - rotateAngle?: Number; + rotateAngle?: number; /** Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip * @Default {ej.datavisualization.Diagram.Tooltip()} @@ -56350,7 +57670,7 @@ export interface SelectedItems { /** Sets the width of the selected items * @Default {0} */ - width?: Number; + width?: number; } export interface SnapSettingsHorizontalGridLines { @@ -56358,11 +57678,11 @@ export interface SnapSettingsHorizontalGridLines { /** Defines the line color of horizontal grid lines * @Default {lightgray} */ - lineColor?: String; + lineColor?: string; /** Specifies the pattern of dashes and gaps used to stroke horizontal grid lines */ - lineDashArray?: String; + lineDashArray?: string; /** A pattern of lines and gaps that defines a set of horizontal gridlines * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} @@ -56380,11 +57700,11 @@ export interface SnapSettingsVerticalGridLines { /** Defines the line color of horizontal grid lines * @Default {lightgray} */ - lineColor?: String; + lineColor?: string; /** Specifies the pattern of dashes and gaps used to stroke horizontal grid lines */ - lineDashArray?: String; + lineDashArray?: string; /** A pattern of lines and gaps that defines a set of horizontal gridlines * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} @@ -56411,7 +57731,7 @@ export interface SnapSettings { /** Defines the angle by which the object needs to be snapped * @Default {5} */ - snapAngle?: Number; + snapAngle?: number; /** Defines and sets the snapConstraints */ @@ -56420,7 +57740,7 @@ export interface SnapSettings { /** Defines the minimum distance between the selected object and the nearest object * @Default {5} */ - snapObjectDistance?: Number; + snapObjectDistance?: number; /** Defines the appearance of horizontal gridlines */ @@ -56458,16 +57778,16 @@ export interface Tooltip { /** Sets the svg/html template to be bound with tooltip */ - templateId?: String; + templateId?: string; } } module Diagram { -enum ImageAlignment +enum ImageAlignment { //Scales the graphic content non-uniformly to the width and height of the diagram area None, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area XMinYMin, //Used to align the image at the left center of diagram area XMinYMid, @@ -56705,7 +58025,7 @@ enum BPMNFlows { //Used to specify the Sequence flow in a BPMN Process Sequence, -//Used to specify the Association flow in a BPMN Process +//Used to specify the Association flow in a BPMN Process Association, //Used to specify the Message flow in a BPMN Process Message, @@ -57313,7 +58633,7 @@ All, } module Diagram { -enum UserHandlePositions +enum UserHandlePositions { //Set the position of the userhandle as topleft TopLeft, @@ -57715,17 +59035,17 @@ module HeatMap { enum CellVisibility { -//Display the content of the cell +//Display the content of the cell Visible, -//Hide the content of the cell +//Hide the content of the cell Hidden, } } module HeatMap { -enum TextDecoration +enum TextDecoration { -//Defines a line below the text +//Defines a line below the text Underline, //Defines a line above the text Overline, @@ -57843,9 +59163,9 @@ module HeatMap { enum LegendOrientation { -//Scales the graphic content non-uniformly to the width and height of the diagram area +//Scales the graphic content non-uniformly to the width and height of the diagram area Horizontal, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area Vertical, } } @@ -57853,9 +59173,9 @@ module HeatMap { enum LegendMode { -//Scales the graphic content non-uniformly to the width and height of the diagram area +//Scales the graphic content non-uniformly to the width and height of the diagram area Gradient, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area List, } } @@ -58052,7 +59372,7 @@ export interface LoadedEventArgs { export interface TooltipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -58176,7 +59496,7 @@ export interface PointRegionMouseClickEventArgs { export interface SparklineMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -58191,7 +59511,7 @@ export interface SparklineMouseMoveEventArgs { export interface SparklineMouseLeaveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -58472,17 +59792,17 @@ export interface Model { /** The sourceId property of overview should be set with the corresponding Diagram ID for you need the overall view. * @Default {null} */ - sourceID?: String; + sourceID?: string; /** Defines the height of the overview * @Default {400} */ - height?: Number; + height?: number; /** Defines the width of the overview * @Default {250} */ - width?: Number; + width?: number; } } @@ -58894,4 +60214,3 @@ ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; ejWaitingPopup(memberName: any, value?: any, param?: any): any; data(key: "ejWaitingPopup"): ej.WaitingPopup; } - diff --git a/ejs/index.d.ts b/ejs/index.d.ts index 6bd3b397c9..a5bfb23ee9 100644 --- a/ejs/index.d.ts +++ b/ejs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ejs.js v2.3.3 +// Type definitions for ejs.js v2.3.3 // Project: http://ejs.co/ // Definitions by: Ben Liddicott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/elastic.js/index.d.ts b/elastic.js/index.d.ts index 9bf5f6a9dc..99a45f58fa 100644 --- a/elastic.js/index.d.ts +++ b/elastic.js/index.d.ts @@ -2350,7 +2350,7 @@ declare module elasticjs { Sets the distance unit. Valid values are: in, yd, ft, km, NM, mm, cm, mi, and m. */ - unit(unit: Number): GeoDistanceAggregation; + unit(unit: string): GeoDistanceAggregation; } @@ -2485,7 +2485,7 @@ declare module elasticjs { Sets the distance unit. Valid values are "mi" for miles or "km" for kilometers. Defaults to "km". */ - unit(unit: Number): GeoDistanceFacet; + unit(unit: string): GeoDistanceFacet; /* Allows you to specify a different value field to aggrerate over. @@ -2582,7 +2582,7 @@ declare module elasticjs { Sets the distance unit. Valid values are "mi" for miles or "km" for kilometers. Defaults to "km". */ - unit(unit: Number): GeoDistanceFilter; + unit(unit: string): GeoDistanceFilter; } @@ -2706,7 +2706,7 @@ declare module elasticjs { Sets the distance unit. Valid values are "mi" for miles or "km" for kilometers. Defaults to "km". */ - unit(unit: Number): GeoDistanceRangeFilter; + unit(unit: string): GeoDistanceRangeFilter; } @@ -7413,7 +7413,7 @@ declare module elasticjs { Valid during sort types: geo distance */ - unit(unit: Number): Sort; + unit(unit: string): Sort; } diff --git a/elasticsearch/elasticsearch-tests.ts b/elasticsearch/elasticsearch-tests.ts index 62e45dfd58..c9be3c01ef 100644 --- a/elasticsearch/elasticsearch-tests.ts +++ b/elasticsearch/elasticsearch-tests.ts @@ -46,12 +46,12 @@ client.create({ }); client.cluster.getSettings({ - masterTimeout: 100 + masterTimeout: '100s' }, (err, response) => { }); client.cluster.health({ - masterTimeout: 100 + masterTimeout: '100s' }, (err, response) => { }); @@ -208,6 +208,33 @@ client.suggest({ }, function (error, response) { }); + +// first we do a search, and specify a scroll timeout +var allTitles: string[] = []; +client.search({ + index: 'myindex', + // Set to 30 seconds because we are calling right back + scroll: '30s', + searchType: 'query_then_fetch', + docvalueFields: ['title'], + q: 'title:test' +}, function getMoreUntilDone(error, response) { + // collect the title from each response + response.hits.hits.forEach(function (hit) { + allTitles.push(hit.fields.title); + }); + + if (response.hits.total !== allTitles.length) { + // now we can call scroll over and over + client.scroll({ + scrollId: response._scroll_id, + scroll: '30s' + }, getMoreUntilDone); + } else { + console.log('every "test" title', allTitles); + } +}); + client.indices.updateAliases({ body: { actions: [ diff --git a/elasticsearch/index.d.ts b/elasticsearch/index.d.ts index d7df27565f..f3ac0992c6 100644 --- a/elasticsearch/index.d.ts +++ b/elasticsearch/index.d.ts @@ -131,8 +131,14 @@ declare module Elasticsearch { failed: number; } + /** + * A string of a number and a time unit. A time unit is one of + * [d, h, m, s, ms, micros, nanos]. eg: "30s" for 30 seconds. + * These are incorrectly identified as `Date | number` in the docs as of 2016-11-15. + */ + export type TimeSpan = string; + export type NameList = string | string[] | boolean; - export type DateLike = Date | number; export type Refresh = boolean | "true" | "false" | "wait_for" | ""; export type VersionType = "internal" | "external" | "external_gte" | "force"; export type ExpandWildcards = "open" | "closed" | "none" | "all"; @@ -142,7 +148,7 @@ declare module Elasticsearch { waitForActiveShards?: string; refresh?: Refresh; routing?: string; - timeout?: DateLike; + timeout?: TimeSpan; type?: string; fields?: NameList; _source?: NameList; @@ -183,9 +189,9 @@ declare module Elasticsearch { waitForActiveShards?: string; parent?: string; refresh?: Refresh; - timeout?: DateLike; - timestamp?: DateLike; - ttl?: DateLike; + timeout?: TimeSpan; + timestamp?: Date | number; + ttl?: TimeSpan; version?: number; versionType?: VersionType; pipeline?: string; @@ -209,7 +215,7 @@ declare module Elasticsearch { parent?: string; refresh?: Refresh; routing?: string; - timeout?: DateLike; + timeout?: TimeSpan; version?: number; versionType?: VersionType; index: string; @@ -232,7 +238,7 @@ declare module Elasticsearch { parent?: string; refresh?: Refresh; routing?: string; - timeout?: DateLike; + timeout?: TimeSpan; version?: number; versionType?: VersionType; index: string; @@ -399,9 +405,9 @@ declare module Elasticsearch { parent?: string; refresh?: string; routing?: string; - timeout?: DateLike; - timestamp?: DateLike; - ttl?: DateLike; + timeout?: TimeSpan; + timestamp?: Date | number; + ttl?: TimeSpan; version?: number; versionType?: VersionType; pipeline?: string; @@ -481,7 +487,7 @@ declare module Elasticsearch { export interface ReindexParams extends GenericParams { refresh?: boolean; - timeout?: DateLike; + timeout?: TimeSpan; waitForActiveShards?: string; waitForCompletion?: boolean; requestsPerSecond?: number; @@ -537,7 +543,7 @@ declare module Elasticsearch { } export interface ScrollParams extends GenericParams { - scroll: DateLike; + scroll: TimeSpan; scrollId: string; } @@ -559,7 +565,7 @@ declare module Elasticsearch { preference?: string; q?: string; routing?: NameList; - scroll?: DateLike; + scroll?: TimeSpan; searchType?: "query_then_fetch" | "dfs_query_then_fetch"; size?: number; sort?: NameList; @@ -572,7 +578,7 @@ declare module Elasticsearch { suggestMode?: "missing" | "popular" | "always"; suggestSize?: number; suggestText?: string; - timeout?: DateLike; + timeout?: TimeSpan; trackScores?: boolean; version?: boolean; requestCache?: boolean; @@ -638,7 +644,7 @@ declare module Elasticsearch { expandWildcards?: ExpandWildcards; preference?: string; routing?: NameList; - scroll?: DateLike; + scroll?: TimeSpan; searchType?: "query_then_fetch" | "query_and_fetch" | "dfs_query_then_fetch" | "dfs_query_and_fetch"; index: NameList; type: NameList; @@ -682,9 +688,9 @@ declare module Elasticsearch { refresh?: Refresh; retryOnConflict?: number; routing?: string; - timeout?: DateLike; - timestamp?: DateLike; - ttl?: DateLike; + timeout?: TimeSpan; + timestamp?: Date | number; + ttl?: TimeSpan; version?: number; versionType?: "internal" | "force"; id: string; @@ -712,9 +718,9 @@ declare module Elasticsearch { preference?: string; q?: string; routing?: NameList; - scroll?: DateLike; + scroll?: TimeSpan; searchType?: "query_then_fetch" | "dfs_query_then_fetch"; - searchTimeout?: DateLike; + searchTimeout?: TimeSpan; size?: number; sort?: NameList; _source?: NameList; @@ -726,7 +732,7 @@ declare module Elasticsearch { suggestMode?: "missing" | "popular" | "always"; suggestSize?: number; suggestText?: string; - timeout?: DateLike; + timeout?: TimeSpan; trackScores?: boolean; version?: boolean; versionType?: boolean; @@ -786,7 +792,7 @@ declare module Elasticsearch { export interface CatCommonParams extends GenericParams { format: string; local?: boolean; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; h?: NameList; help?: boolean; v?: boolean; @@ -828,7 +834,7 @@ declare module Elasticsearch { export interface CatRecoveryParams extends GenericParams { format: string; bytes?: CatBytes; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; h?: NameList; help?: boolean; v?: boolean; @@ -849,7 +855,7 @@ declare module Elasticsearch { export interface CatSnapshotsParams extends GenericParams { format: string; ignoreUnavailable?: boolean; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; h?: NameList; help?: boolean; v?: boolean; @@ -899,15 +905,15 @@ declare module Elasticsearch { export interface ClusterGetSettingsParams extends GenericParams { flatSettings?: boolean; - masterTimeout?: DateLike; - timeout?: DateLike; + masterTimeout?: TimeSpan; + timeout?: TimeSpan; includeDefaults?: boolean; } export interface ClusterHealthParams extends GenericParams { level?: "cluster" | "indices" | "shards"; local?: boolean; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; waitForActiveShards?: string; waitForNodes?: string; waitForEvents?: "immediate" | "urgent" | "high" | "normal" | "low" | "languid"; @@ -918,13 +924,13 @@ declare module Elasticsearch { export interface ClusterPendingTasksParams extends GenericParams { local?: boolean; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; } export interface ClusterPutSettingsParams extends GenericParams { flatSettings?: boolean; - masterTimeout?: DateLike; - timeout?: DateLike; + masterTimeout?: TimeSpan; + timeout?: TimeSpan; } export interface ClusterRerouteParams extends GenericParams { @@ -932,13 +938,13 @@ declare module Elasticsearch { explain?: boolean; retryFailed?: boolean; metric?: NameList; - masterTimeout?: DateLike; - timeout?: DateLike; + masterTimeout?: TimeSpan; + timeout?: TimeSpan; } export interface ClusterStateParams extends GenericParams { local?: boolean; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; flatSettings?: boolean; ignoreUnavailable?: boolean; allowNoIndices?: boolean; @@ -950,7 +956,7 @@ declare module Elasticsearch { export interface ClusterStatsParams extends GenericParams { flatSettings?: boolean; human?: boolean; - timeout?: DateLike; + timeout?: TimeSpan; nodeId?: NameList; } @@ -1057,8 +1063,8 @@ declare module Elasticsearch { } export interface IndicesCloseParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; ignoreUnavailable?: boolean; allowNoIndices?: boolean; expandWildcards?: ExpandWildcards; @@ -1067,28 +1073,28 @@ declare module Elasticsearch { export interface IndicesCreateParams extends GenericParams { waitForActiveShards?: string; - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; updateAllTypes?: boolean; index: string; } export interface IndicesDeleteParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; index: NameList; } export interface IndicesDeleteAliasParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; index: NameList; name: NameList; } export interface IndicesDeleteTemplateParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; name: string; } @@ -1105,8 +1111,8 @@ declare module Elasticsearch { } export interface IndicesExistsTemplateParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; name: NameList; } @@ -1197,7 +1203,7 @@ declare module Elasticsearch { export interface IndicesGetTemplateParams extends GenericParams { flatSettings?: boolean; - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; local?: boolean; name?: NameList; } @@ -1211,8 +1217,8 @@ declare module Elasticsearch { } export interface IndicesOpenParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; ignoreUnavailable?: boolean; allowNoIndices?: boolean; expandWildcards?: ExpandWildcards; @@ -1220,15 +1226,15 @@ declare module Elasticsearch { } export interface IndicesPutAliasParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; index?: NameList; name: NameList; } export interface IndicesPutMappingParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; ignoreUnavailable?: boolean; allowNoIndices?: boolean; expandWildcards?: ExpandWildcards; @@ -1239,7 +1245,7 @@ declare module Elasticsearch { } export interface IndicesPutSettingsParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; preserveExisting?: boolean; ignoreUnavailable?: boolean; allowNoIndices?: boolean; @@ -1252,8 +1258,8 @@ declare module Elasticsearch { export interface IndicesPutTemplateParams extends GenericParams { order?: number; create?: boolean; - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; flatSettings?: boolean; name: string; body: any; @@ -1276,8 +1282,8 @@ declare module Elasticsearch { } export interface IndicesRolloverParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; waitForActiveShards?: number | string; alias?: string; newIndex?: string; @@ -1313,8 +1319,8 @@ declare module Elasticsearch { } export interface IndicesShrinkParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; waitForActiveShards?: string | number; index: string; target: string; @@ -1333,8 +1339,8 @@ declare module Elasticsearch { } export interface IndicesUpdateAliasesParams extends GenericParams { - timeout?: DateLike; - masterTimeout?: DateLike; + timeout?: TimeSpan; + masterTimeout?: TimeSpan; body: { actions: IndicesUpdateAliasesParamsAction[]; } @@ -1426,19 +1432,19 @@ declare module Elasticsearch { } export interface NodesHotThreadsParams extends GenericParams { - interval?: DateLike; + interval?: TimeSpan; snapshots?: number; threads?: number; ignoreIdleThreads?: boolean; type?: "cpu" | "wait" | "blocked"; - timeout?: DateLike; + timeout?: TimeSpan; nodeId: NameList; } export interface NodesInfoParams extends GenericParams { flatSettings?: boolean; human?: boolean; - timeout?: DateLike; + timeout?: TimeSpan; nodeId: NameList; metric?: NameList; } @@ -1451,7 +1457,7 @@ declare module Elasticsearch { human?: boolean; level?: "indices" | "node" | "shards"; types?: NameList; - timeout?: DateLike; + timeout?: TimeSpan; metric?: NameList; indexMetric?: NameList; nodeId?: NameList; @@ -1479,61 +1485,61 @@ declare module Elasticsearch { } export interface SnapshotCreateParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; waitForCompletion?: boolean; repository: string; snapshot: string; } export interface SnapshotCreateRepositoryParams extends GenericParams { - masterTimeout?: DateLike; - timeout?: DateLike; + masterTimeout?: TimeSpan; + timeout?: TimeSpan; verify?: boolean; repository: string; } export interface SnapshotDeleteParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; repository: string; snapshot: string; } export interface SnapshotDeleteRepositoryParams extends GenericParams { - masterTimeout?: DateLike; - timeout?: DateLike; + masterTimeout?: TimeSpan; + timeout?: TimeSpan; repository: string; } export interface SnapshotGetParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; ignoreUnavailable?: boolean; repository: string; snapshot: NameList; } export interface SnapshotGetRepositoryParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; local?: boolean; repository: NameList; } export interface SnapshotRestoreParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; waitForCompletion?: boolean; repository: string; snapshot: string; } export interface SnapshotStatusParams extends GenericParams { - masterTimeout?: DateLike; + masterTimeout?: TimeSpan; ignoreUnavailable?: boolean; repository: string; snapshot: NameList; } export interface SnapshotVerifyRepositoryParams extends GenericParams { - masterTimeout?: DateLike; - timeout?: DateLike; + masterTimeout?: TimeSpan; + timeout?: TimeSpan; repository: string; } diff --git a/electron-debug/electron-debug-tests.ts b/electron-debug/electron-debug-tests.ts new file mode 100644 index 0000000000..15910e76d7 --- /dev/null +++ b/electron-debug/electron-debug-tests.ts @@ -0,0 +1,8 @@ +import debug = require('electron-debug') + +debug({enabled: false}); + +debug({showDevTools: true}); +debug({showDevTools: 'right'}); +debug({showDevTools: 'bottom'}); +debug({showDevTools: 'undocked'}); diff --git a/electron-debug/index.d.ts b/electron-debug/index.d.ts new file mode 100644 index 0000000000..4806b7ccf5 --- /dev/null +++ b/electron-debug/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for electron-debug v1.1.0 +// Project: https://github.com/sindresorhus/electron-debug +// Definitions by: Daniel Perez Alvarez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Install keyboard shortcuts and optionally activate DevTools on each + * created BrowserWindow. + */ +declare function electronDebug(options: { + /** Enable debug options. */ + enabled?: boolean; + /** Show DevTools on each created BrowserWindow. */ + showDevTools?: boolean | 'right' | 'bottom' | 'undocked'; +}): void; + +export = electronDebug; diff --git a/electron-debug/tsconfig.json b/electron-debug/tsconfig.json new file mode 100644 index 0000000000..c43a839ee3 --- /dev/null +++ b/electron-debug/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "electron-debug-tests.ts" + ] +} diff --git a/electron/electron-tests.ts b/electron/electron-tests.ts new file mode 100644 index 0000000000..00b34d60b1 --- /dev/null +++ b/electron/electron-tests.ts @@ -0,0 +1,7 @@ +/// +/// + +import electron = require('electron'); +import child_process = require('child_process'); + +child_process.spawn(electron); diff --git a/electron/github-electron-main-tests.ts b/electron/github-electron-main-tests.ts index f333e86ec7..ce5bbf8e2e 100644 --- a/electron/github-electron-main-tests.ts +++ b/electron/github-electron-main-tests.ts @@ -63,6 +63,7 @@ app.on('ready', () => { mainWindow.loadURL(`file://${__dirname}/index.html`); mainWindow.loadURL('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer'}); mainWindow.webContents.loadURL('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer'}); + mainWindow.webContents.loadURL('file://foo/bar', {userAgent: 'cool-agent', httpReferrer: 'greateRefferer', postData: [{type: 'blob', blobUUID: 'hogefuga'}]}); mainWindow.webContents.openDevTools(); mainWindow.webContents.toggleDevTools(); @@ -80,6 +81,9 @@ app.on('ready', () => { mainWindow = null; }); + mainWindow.webContents.setVisualZoomLevelLimits(50, 200); + mainWindow.webContents.setLayoutZoomLevelLimits(50, 200); + mainWindow.webContents.print({silent: true, printBackground: false}); mainWindow.webContents.print(); @@ -93,7 +97,7 @@ app.on('ready', () => { mainWindow.webContents.printToPDF({}, (err, data) => {}); - mainWindow.webContents.executeJavaScript('return true;'); + mainWindow.webContents.executeJavaScript('return true;').then((v: boolean) => console.log(v)); mainWindow.webContents.executeJavaScript('return true;', true); mainWindow.webContents.executeJavaScript('return true;', true, (result: boolean) => console.log(result)); mainWindow.webContents.insertText('blah, blah, blah'); @@ -313,6 +317,10 @@ var window = new BrowserWindow(); window.setProgressBar(0.5); window.setRepresentedFilename('/etc/passwd'); window.setDocumentEdited(true); +window.previewFile('/path/to/file'); +window.previewFile('/path/to/file', 'Displayed Name'); +window.setVibrancy('light'); +window.setVibrancy('titlebar'); // Online/Offline Event Detection // https://github.com/atom/electron/blob/master/docs/tutorial/online-offline-events.md @@ -320,7 +328,7 @@ window.setDocumentEdited(true); var onlineStatusWindow: Electron.BrowserWindow; app.on('ready', () => { - onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false }); + onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false, vibrancy: 'sidebar' }); onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`); }); app.on('accessibility-support-changed', (_, enabled) => console.log('accessibility: ' + enabled)); @@ -869,20 +877,25 @@ app.on('ready', () => { // clipboard // https://github.com/atom/electron/blob/master/docs/api/clipboard.md -clipboard.writeText('Example String'); -clipboard.writeText('Example String', 'selection'); -clipboard.writeBookmark('foo', 'http://example.com'); -clipboard.writeBookmark('foo', 'http://example.com', 'selection'); -console.log(clipboard.readText('selection')); -console.log(clipboard.availableFormats()); -console.log(clipboard.readBookmark().title); -clipboard.clear(); +{ + let str: string; + clipboard.writeText('Example String'); + clipboard.writeText('Example String', 'selection'); + clipboard.writeBookmark('foo', 'http://example.com'); + clipboard.writeBookmark('foo', 'http://example.com', 'selection'); + clipboard.writeFindText('foo'); + str = clipboard.readText('selection'); + str = clipboard.readFindText(); + console.log(clipboard.availableFormats()); + console.log(clipboard.readBookmark().title); + clipboard.clear(); -clipboard.write({ - html: '', - text: 'Hello World!', - image: clipboard.readImage() -}); + clipboard.write({ + html: '', + text: 'Hello World!', + image: clipboard.readImage() + }); +} // crash-reporter // https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md @@ -1051,6 +1064,7 @@ session.defaultSession.enableNetworkEmulation({ session.defaultSession.setCertificateVerifyProc((hostname, cert, callback) => { callback((hostname === 'github.com') ? true : false); + console.log(cert.issuer.commonName); }); session.defaultSession.setPermissionRequestHandler(function(webContents, permission, callback) { diff --git a/electron/github-electron-renderer-tests.ts b/electron/github-electron-renderer-tests.ts index 87d9a4abf7..20dca2d07e 100644 --- a/electron/github-electron-renderer-tests.ts +++ b/electron/github-electron-renderer-tests.ts @@ -57,7 +57,8 @@ console.log(webFrame.getZoomFactor()); webFrame.setZoomLevel(200); console.log(webFrame.getZoomLevel()); -webFrame.setZoomLevelLimits(50, 200); +webFrame.setVisualZoomLevelLimits(50, 200); +webFrame.setLayoutZoomLevelLimits(50, 200); webFrame.setSpellCheckProvider('en-US', true, { spellCheck: text => { @@ -68,12 +69,16 @@ webFrame.setSpellCheckProvider('en-US', true, { webFrame.registerURLSchemeAsSecure('app'); webFrame.registerURLSchemeAsBypassingCSP('app'); webFrame.registerURLSchemeAsPrivileged('app'); +webFrame.registerURLSchemeAsPrivileged('app', { + secure: true, + supportFetchAPI: true, +}); webFrame.insertText('text'); webFrame.executeJavaScript('JSON.stringify({})', false, (result) => { console.log(result); -}); +}).then((result: string) => console.log('OK:' + result)); console.log(webFrame.getResourceUsage()); webFrame.clearCache(); diff --git a/electron/github-electron.d.ts b/electron/github-electron.d.ts new file mode 100644 index 0000000000..f87b50b362 --- /dev/null +++ b/electron/github-electron.d.ts @@ -0,0 +1,5765 @@ +// Type definitions for Electron v1.4.4 +// Project: http://electron.atom.io/ +// Definitions by: jedmao , rhysd , Milan Burda +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Electron { + + interface Event { + preventDefault: Function; + sender: NodeJS.EventEmitter; + } + + type Point = { + x: number; + y: number; + } + + type Size = { + width: number; + height: number; + } + + type Rectangle = { + x: number; + y: number; + width: number; + height: number; + } + + interface Destroyable { + /** + * Destroys the object. + */ + destroy(): void; + /** + * @returns Whether the object is destroyed. + */ + isDestroyed(): boolean; + } + + // https://github.com/electron/electron/blob/master/docs/api/app.md + + /** + * The app module is responsible for controlling the application's lifecycle. + */ + interface App extends NodeJS.EventEmitter { + /** + * Emitted when the application has finished basic startup. + * On Windows and Linux, the will-finish-launching event + * is the same as the ready event; on macOS, this event represents + * the applicationWillFinishLaunching notification of NSApplication. + * You would usually set up listeners for the open-file and open-url events here, + * and start the crash reporter and auto updater. + * + * In most cases, you should just do everything in the ready event handler. + */ + on(event: 'will-finish-launching', listener: Function): this; + /** + * Emitted when Electron has finished initialization. + */ + on(event: 'ready', listener: (event: Event, launchInfo: Object) => void): this; + /** + * Emitted when all windows have been closed. + * + * If you do not subscribe to this event and all windows are closed, + * the default behavior is to quit the app; however, if you subscribe, + * you control whether the app quits or not. + * If the user pressed Cmd + Q, or the developer called app.quit(), + * Electron will first try to close all the windows and then emit the will-quit event, + * and in this case the window-all-closed event would not be emitted. + */ + on(event: 'window-all-closed', listener: Function): this; + /** + * Emitted before the application starts closing its windows. + * Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. + */ + on(event: 'before-quit', listener: (event: Event) => void): this; + /** + * Emitted when all windows have been closed and the application will quit. + * Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. + */ + on(event: 'will-quit', listener: (event: Event) => void): this; + /** + * Emitted when the application is quitting. + */ + on(event: 'quit', listener: (event: Event, exitCode: number) => void): this; + /** + * Emitted when the user wants to open a file with the application. + * The open-file event is usually emitted when the application is already open + * and the OS wants to reuse the application to open the file. + * open-file is also emitted when a file is dropped onto the dock and the application + * is not yet running. Make sure to listen for the open-file event very early + * in your application startup to handle this case (even before the ready event is emitted). + * + * You should call event.preventDefault() if you want to handle this event. + * + * Note: This is only implemented on macOS. + */ + on(event: 'open-file', listener: (event: Event, url: string) => void): this; + /** + * Emitted when the user wants to open a URL with the application. + * The URL scheme must be registered to be opened by your application. + * + * You should call event.preventDefault() if you want to handle this event. + * + * Note: This is only implemented on macOS. + */ + on(event: 'open-url', listener: (event: Event, url: string) => void): this; + /** + * Emitted when the application is activated, which usually happens when clicks on the applications’s dock icon. + * Note: This is only implemented on macOS. + */ + on(event: 'activate', listener: Function): this; + /** + * Emitted during Handoff when an activity from a different device wants to be resumed. + * You should call event.preventDefault() if you want to handle this event. + */ + on(event: 'continue-activity', listener: (event: Event, type: string, userInfo: Object) => void): this; + /** + * Emitted when a browserWindow gets blurred. + */ + on(event: 'browser-window-blur', listener: (event: Event, browserWindow: BrowserWindow) => void): this; + /** + * Emitted when a browserWindow gets focused. + */ + on(event: 'browser-window-focus', listener: (event: Event, browserWindow: BrowserWindow) => void): this; + /** + * Emitted when a new browserWindow is created. + */ + on(event: 'browser-window-created', listener: (event: Event, browserWindow: BrowserWindow) => void): this; + /** + * Emitted when a new webContents is created. + */ + on(event: 'web-contents-created', listener: (event: Event, webContents: WebContents) => void): this; + /** + * Emitted when failed to verify the certificate for url, to trust the certificate + * you should prevent the default behavior with event.preventDefault() and call callback(true). + */ + on(event: 'certificate-error', listener: (event: Event, + webContents: WebContents, + url: string, + error: string, + certificate: Certificate, + callback: (trust: boolean) => void + ) => void): this; + /** + * Emitted when a client certificate is requested. + * + * The url corresponds to the navigation entry requesting the client certificate + * and callback needs to be called with an entry filtered from the list. + * Using event.preventDefault() prevents the application from using the first certificate from the store. + */ + on(event: 'select-client-certificate', listener: (event: Event, + webContents: WebContents, + url: string, + certificateList: Certificate[], + callback: (certificate: Certificate) => void + ) => void): this; + /** + * Emitted when webContents wants to do basic auth. + * + * The default behavior is to cancel all authentications, to override this + * you should prevent the default behavior with event.preventDefault() + * and call callback(username, password) with the credentials. + */ + on(event: 'login', listener: (event: Event, + webContents: WebContents, + request: LoginRequest, + authInfo: LoginAuthInfo, + callback: (username: string, password: string) => void + ) => void): this; + /** + * Emitted when the gpu process crashes. + */ + on(event: 'gpu-process-crashed', listener: (event: Event, killed: boolean) => void): this; + /** + * Emitted when Chrome's accessibility support changes. + * + * Note: This API is only available on macOS and Windows. + */ + on(event: 'accessibility-support-changed', listener: (event: Event, accessibilitySupportEnabled: boolean) => void): this; + on(event: string, listener: Function): this; + /** + * Try to close all windows. The before-quit event will first be emitted. + * If all windows are successfully closed, the will-quit event will be emitted + * and by default the application would be terminated. + * + * This method guarantees all beforeunload and unload handlers are correctly + * executed. It is possible that a window cancels the quitting by returning + * false in beforeunload handler. + */ + quit(): void; + /** + * Exits immediately with exitCode. + * All windows will be closed immediately without asking user + * and the before-quit and will-quit events will not be emitted. + */ + exit(exitCode?: number): void; + /** + * Relaunches the app when current instance exits. + * + * By default the new instance will use the same working directory + * and command line arguments with current instance. + * When args is specified, the args will be passed as command line arguments instead. + * When execPath is specified, the execPath will be executed for relaunch instead of current app. + * + * Note that this method does not quit the app when executed, you have to call app.quit + * or app.exit after calling app.relaunch to make the app restart. + * + * When app.relaunch is called for multiple times, multiple instances + * will be started after current instance exited. + */ + relaunch(options?: { + args?: string[], + execPath?: string + }): void; + /** + * @returns Whether Electron has finished initializing. + */ + isReady(): boolean; + /** + * On Linux, focuses on the first visible window. + * On macOS, makes the application the active app. + * On Windows, focuses on the application’s first window. + */ + focus(): void; + /** + * Hides all application windows without minimizing them. + * Note: This is only implemented on macOS. + */ + hide(): void; + /** + * Shows application windows after they were hidden. Does not automatically focus them. + * Note: This is only implemented on macOS. + */ + show(): void; + /** + * Returns the current application directory. + */ + getAppPath(): string; + /** + * @returns The path to a special directory or file associated with name. + * On failure an Error would throw. + */ + getPath(name: AppPathName): string; + /** + * Overrides the path to a special directory or file associated with name. + * If the path specifies a directory that does not exist, the directory will + * be created by this method. On failure an Error would throw. + * + * You can only override paths of names defined in app.getPath. + * + * By default web pages' cookies and caches will be stored under userData + * directory, if you want to change this location, you have to override the + * userData path before the ready event of app module gets emitted. + */ + setPath(name: AppPathName, path: string): void; + /** + * @returns The version of loaded application, if no version is found in + * application's package.json, the version of current bundle or executable. + */ + getVersion(): string; + /** + * @returns The current application's name, the name in package.json would be used. + * Usually the name field of package.json is a short lowercased name, according to + * the spec of npm modules. So usually you should also specify a productName field, + * which is your application's full capitalized name, and it will be preferred over + * name by Electron. + */ + getName(): string; + /** + * Overrides the current application's name. + */ + setName(name: string): void; + /** + * @returns The current application locale. + */ + getLocale(): string; + /** + * Adds path to recent documents list. + * + * This list is managed by the system, on Windows you can visit the list from + * task bar, and on macOS you can visit it from dock menu. + * + * Note: This is only implemented on macOS and Windows. + */ + addRecentDocument(path: string): void; + /** + * Clears the recent documents list. + * + * Note: This is only implemented on macOS and Windows. + */ + clearRecentDocuments(): void; + /** + * Sets the current executable as the default handler for a protocol (aka URI scheme). + * Once registered, all links with your-protocol:// will be opened with the current executable. + * The whole link, including protocol, will be passed to your application as a parameter. + * + * On Windows you can provide optional parameters path, the path to your executable, + * and args, an array of arguments to be passed to your executable when it launches. + * + * @param protocol The name of your protocol, without ://. + * @param path Defaults to process.execPath. + * @param args Defaults to an empty array. + * + * Note: This is only implemented on macOS and Windows. + * On macOS, you can only register protocols that have been added to your app's info.plist. + */ + setAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; + /** + * Removes the current executable as the default handler for a protocol (aka URI scheme). + * + * @param protocol The name of your protocol, without ://. + * @param path Defaults to process.execPath. + * @param args Defaults to an empty array. + * + * Note: This is only implemented on macOS and Windows. + */ + removeAsDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; + /** + * @param protocol The name of your protocol, without ://. + * @param path Defaults to process.execPath. + * @param args Defaults to an empty array. + * + * @returns Whether the current executable is the default handler for a protocol (aka URI scheme). + * + * Note: This is only implemented on macOS and Windows. + */ + isDefaultProtocolClient(protocol: string, path?: string, args?: string[]): boolean; + /** + * Adds tasks to the Tasks category of JumpList on Windows. + * + * Note: This API is only available on Windows. + */ + setUserTasks(tasks: Task[]): boolean; + /** + * Note: This API is only available on Windows. + */ + getJumpListSettings(): JumpListSettings; + /** + * Sets or removes a custom Jump List for the application. + * + * If categories is null the previously set custom Jump List (if any) will be replaced + * by the standard Jump List for the app (managed by Windows). + * + * Note: This API is only available on Windows. + */ + setJumpList(categories: JumpListCategory[]): SetJumpListResult; + /** + * This method makes your application a Single Instance Application instead of allowing + * multiple instances of your app to run, this will ensure that only a single instance + * of your app is running, and other instances signal this instance and exit. + */ + makeSingleInstance(callback: (args: string[], workingDirectory: string) => void): boolean; + /** + * Releases all locks that were created by makeSingleInstance. This will allow + * multiple instances of the application to once again run side by side. + */ + releaseSingleInstance(): void; + /** + * Creates an NSUserActivity and sets it as the current activity. + * The activity is eligible for Handoff to another device afterward. + * + * @param type Uniquely identifies the activity. Maps to NSUserActivity.activityType. + * @param userInfo App-specific state to store for use by another device. + * @param webpageURL The webpage to load in a browser if no suitable app is + * installed on the resuming device. The scheme must be http or https. + * + * Note: This API is only available on macOS. + */ + setUserActivity(type: string, userInfo: Object, webpageURL?: string): void; + /** + * @returns The type of the currently running activity. + * + * Note: This API is only available on macOS. + */ + getCurrentActivityType(): string; + /** + * Changes the Application User Model ID to id. + * + * Note: This is only implemented on Windows. + */ + setAppUserModelId(id: string): void; + /** + * Imports the certificate in pkcs12 format into the platform certificate store. + * @param callback Called with the result of import operation, a value of 0 indicates success + * while any other value indicates failure according to chromium net_error_list. + * + * Note: This API is only available on Linux. + */ + importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void; + /** + * Disables hardware acceleration for current app. + * This method can only be called before app is ready. + */ + disableHardwareAcceleration(): void; + /** + * @returns whether current desktop environment is Unity launcher. (Linux) + * + * Note: This API is only available on Linux. + */ + isUnityRunning(): boolean; + /** + * Returns a Boolean, true if Chrome's accessibility support is enabled, false otherwise. + * This API will return true if the use of assistive technologies, such as screen readers, + * has been detected. + * See https://www.chromium.org/developers/design-documents/accessibility for more details. + * + * Note: This API is only available on macOS and Windows. + */ + isAccessibilitySupportEnabled(): boolean; + /** + * @returns an Object with the login item settings of the app. + * + * Note: This API is only available on macOS and Windows. + */ + getLoginItemSettings(): LoginItemSettings; + /** + * Set the app's login item settings. + * + * Note: This API is only available on macOS and Windows. + */ + setLoginItemSettings(settings: LoginItemSettings): void; + /** + * Set the about panel options. This will override the values defined in the app's .plist file. + * See the Apple docs for more details. + * + * Note: This API is only available on macOS. + */ + setAboutPanelOptions(options: AboutPanelOptions): void; + commandLine: CommandLine; + /** + * Note: This API is only available on macOS. + */ + dock: Dock; + } + + type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'|'pepperFlashSystemPlugin'; + + interface ImportCertificateOptions { + /** + * Path for the pkcs12 file. + */ + certificate: string; + /** + * Passphrase for the certificate. + */ + password: string; + } + + interface CommandLine { + /** + * Append a switch [with optional value] to Chromium's command line. + * + * Note: This will not affect process.argv, and is mainly used by developers + * to control some low-level Chromium behaviors. + */ + appendSwitch(_switch: string, value?: string): void; + /** + * Append an argument to Chromium's command line. The argument will quoted properly. + * + * Note: This will not affect process.argv. + */ + appendArgument(value: string): void; + } + + interface Dock { + /** + * When critical is passed, the dock icon will bounce until either the + * application becomes active or the request is canceled. + * + * When informational is passed, the dock icon will bounce for one second. + * However, the request remains active until either the application becomes + * active or the request is canceled. + * + * @param type The default is informational. + * @returns An ID representing the request. + */ + bounce(type?: 'critical' | 'informational'): number; + /** + * Cancel the bounce of id. + * + * Note: This API is only available on macOS. + */ + cancelBounce(id: number): void; + /** + * Bounces the Downloads stack if the filePath is inside the Downloads folder. + * + * Note: This API is only available on macOS. + */ + downloadFinished(filePath: string): void; + /** + * Sets the string to be displayed in the dock’s badging area. + * + * Note: This API is only available on macOS. + */ + setBadge(text: string): void; + /** + * Returns the badge string of the dock. + * + * Note: This API is only available on macOS. + */ + getBadge(): string; + /** + * Sets the counter badge for current app. Setting the count to 0 will hide the badge. + * + * @returns True when the call succeeded, otherwise returns false. + * + * Note: This API is only available on macOS and Linux. + */ + setBadgeCount(count: number): boolean; + /** + * @returns The current value displayed in the counter badge. + * + * Note: This API is only available on macOS and Linux. + */ + getBadgeCount(): number; + /** + * Hides the dock icon. + * + * Note: This API is only available on macOS. + */ + hide(): void; + /** + * Shows the dock icon. + * + * Note: This API is only available on macOS. + */ + show(): void; + /** + * @returns Whether the dock icon is visible. + * The app.dock.show() call is asynchronous so this method might not return true immediately after that call. + * + * Note: This API is only available on macOS. + */ + isVisible(): boolean; + /** + * Sets the application dock menu. + * + * Note: This API is only available on macOS. + */ + setMenu(menu: Menu): void; + /** + * Sets the image associated with this dock icon. + * + * Note: This API is only available on macOS. + */ + setIcon(icon: NativeImage | string): void; + } + + interface Task { + /** + * Path of the program to execute, usually you should specify process.execPath + * which opens current program. + */ + program: string; + /** + * The arguments of command line when program is executed. + */ + arguments: string; + /** + * The string to be displayed in a JumpList. + */ + title: string; + /** + * Description of this task. + */ + description?: string; + /** + * The absolute path to an icon to be displayed in a JumpList, it can be + * arbitrary resource file that contains an icon, usually you can specify + * process.execPath to show the icon of the program. + */ + iconPath: string; + /** + * The icon index in the icon file. If an icon file consists of two or more + * icons, set this value to identify the icon. If an icon file consists of + * one icon, this value is 0. + */ + iconIndex?: number; + } + + /** + * ok - Nothing went wrong. + * error - One or more errors occured, enable runtime logging to figure out the likely cause. + * invalidSeparatorError - An attempt was made to add a separator to a custom category in the Jump List. + * Separators are only allowed in the standard Tasks category. + * fileTypeRegistrationError - An attempt was made to add a file link to the Jump List + * for a file type the app isn't registered to handle. + * customCategoryAccessDeniedError - Custom categories can't be added to the Jump List + * due to user privacy or group policy settings. + */ + type SetJumpListResult = 'ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError'; + + interface JumpListSettings { + /** + * The minimum number of items that will be shown in the Jump List. + */ + minItems: number; + /** + * Items that the user has explicitly removed from custom categories in the Jump List. + */ + removedItems: JumpListItem[]; + } + + interface JumpListCategory { + /** + * tasks - Items in this category will be placed into the standard Tasks category. + * frequent - Displays a list of files frequently opened by the app, the name of the category and its items are set by Windows. + * recent - Displays a list of files recently opened by the app, the name of the category and its items are set by Windows. + * custom - Displays tasks or file links, name must be set by the app. + */ + type?: 'tasks' | 'frequent' | 'recent' | 'custom'; + /** + * Must be set if type is custom, otherwise it should be omitted. + */ + name?: string; + /** + * Array of JumpListItem objects if type is tasks or custom, otherwise it should be omitted. + */ + items?: JumpListItem[]; + } + + interface JumpListItem { + /** + * task - A task will launch an app with specific arguments. + * separator - Can be used to separate items in the standard Tasks category. + * file - A file link will open a file using the app that created the Jump List. + */ + type: 'task' | 'separator' | 'file'; + /** + * Path of the file to open, should only be set if type is file. + */ + path?: string; + /** + * Path of the program to execute, usually you should specify process.execPath which opens the current program. + * Should only be set if type is task. + */ + program?: string; + /** + * The command line arguments when program is executed. Should only be set if type is task. + */ + args?: string; + /** + * The text to be displayed for the item in the Jump List. Should only be set if type is task. + */ + title?: string; + /** + * Description of the task (displayed in a tooltip). Should only be set if type is task. + */ + description?: string; + /** + * The absolute path to an icon to be displayed in a Jump List, which can be an arbitrary + * resource file that contains an icon (e.g. .ico, .exe, .dll). + * You can usually specify process.execPath to show the program icon. + */ + iconPath?: string; + /** + * The index of the icon in the resource file. If a resource file contains multiple icons + * this value can be used to specify the zero-based index of the icon that should be displayed + * for this task. If a resource file contains only one icon, this property should be set to zero. + */ + iconIndex?: number; + } + + interface LoginItemSettings { + /** + * True if the app is set to open at login. + */ + openAtLogin: boolean; + /** + * True if the app is set to open as hidden at login. This setting is only supported on macOS. + */ + openAsHidden: boolean; + /** + * True if the app was opened at login automatically. This setting is only supported on macOS. + */ + wasOpenedAtLogin?: boolean; + /** + * True if the app was opened as a hidden login item. This indicates that the app should not + * open any windows at startup. This setting is only supported on macOS. + */ + wasOpenedAsHidden?: boolean; + /** + * True if the app was opened as a login item that should restore the state from the previous session. + * This indicates that the app should restore the windows that were open the last time the app was closed. + * This setting is only supported on macOS. + */ + restoreState?: boolean; + } + + interface AboutPanelOptions { + /** + * The app's name. + */ + applicationName?: string; + /** + * The app's version. + */ + applicationVersion?: string; + /** + * Copyright information. + */ + copyright?: string; + /** + * Credit information. + */ + credits?: string; + /** + * The app's build version number. + */ + version?: string; + } + + // https://github.com/electron/electron/blob/master/docs/api/auto-updater.md + + /** + * This module provides an interface for the Squirrel auto-updater framework. + */ + interface AutoUpdater extends NodeJS.EventEmitter { + /** + * Emitted when there is an error while updating. + */ + on(event: 'error', listener: (error: Error) => void): this; + /** + * Emitted when checking if an update has started. + */ + on(event: 'checking-for-update', listener: Function): this; + /** + * Emitted when there is an available update. The update is downloaded automatically. + */ + on(event: 'update-available', listener: Function): this; + /** + * Emitted when there is no available update. + */ + on(event: 'update-not-available', listener: Function): this; + /** + * Emitted when an update has been downloaded. + * Note: On Windows only releaseName is available. + */ + on(event: 'update-downloaded', listener: (event: Event, releaseNotes: string, releaseName: string, releaseDate: Date, updateURL: string) => void): this; + on(event: string, listener: Function): this; + /** + * Set the url and initialize the auto updater. + */ + setFeedURL(url: string, requestHeaders?: Headers): void; + /** + * @returns The current update feed URL. + */ + getFeedURL(): string; + /** + * Ask the server whether there is an update, you have to call setFeedURL + * before using this API + */ + checkForUpdates(): void; + /** + * Restarts the app and installs the update after it has been downloaded. + * It should only be called after update-downloaded has been emitted. + */ + quitAndInstall(): void; + } + + // https://github.com/electron/electron/blob/master/docs/api/browser-window.md + + /** + * The BrowserWindow class gives you ability to create a browser window. + * You can also create a window without chrome by using Frameless Window API. + */ + class BrowserWindow extends NodeJS.EventEmitter implements Destroyable { + /** + * Emitted when the document changed its title, + * calling event.preventDefault() would prevent the native window’s title to change. + */ + on(event: 'page-title-updated', listener: (event: Event, title: string) => void): this; + /** + * Emitted when the window is going to be closed. It’s emitted before the beforeunload + * and unload event of the DOM. Calling event.preventDefault() will cancel the close. + */ + on(event: 'close', listener: (event: Event) => void): this; + /** + * Emitted when the window is closed. After you have received this event + * you should remove the reference to the window and avoid using it anymore. + */ + on(event: 'closed', listener: Function): this; + /** + * Emitted when the web page becomes unresponsive. + */ + on(event: 'unresponsive', listener: Function): this; + /** + * Emitted when the unresponsive web page becomes responsive again. + */ + on(event: 'responsive', listener: Function): this; + /** + * Emitted when the window loses focus. + */ + on(event: 'blur', listener: Function): this; + /** + * Emitted when the window gains focus. + */ + on(event: 'focus', listener: Function): this; + /** + * Emitted when the window is shown. + */ + on(event: 'show', listener: Function): this; + /** + * Emitted when the window is hidden. + */ + on(event: 'hide', listener: Function): this; + /** + * Emitted when the web page has been rendered and window can be displayed without visual flash. + */ + on(event: 'ready-to-show', listener: Function): this; + /** + * Emitted when window is maximized. + */ + on(event: 'maximize', listener: Function): this; + /** + * Emitted when the window exits from maximized state. + */ + on(event: 'unmaximize', listener: Function): this; + /** + * Emitted when the window is minimized. + */ + on(event: 'minimize', listener: Function): this; + /** + * Emitted when the window is restored from minimized state. + */ + on(event: 'restore', listener: Function): this; + /** + * Emitted when the window is getting resized. + */ + on(event: 'resize', listener: Function): this; + /** + * Emitted when the window is getting moved to a new position. + */ + on(event: 'move', listener: Function): this; + /** + * Emitted when the window enters full screen state. + */ + on(event: 'enter-full-screen', listener: Function): this; + /** + * Emitted when the window leaves full screen state. + */ + on(event: 'leave-full-screen', listener: Function): this; + /** + * Emitted when the window enters full screen state triggered by HTML API. + */ + on(event: 'enter-html-full-screen', listener: Function): this; + /** + * Emitted when the window leaves full screen state triggered by HTML API. + */ + on(event: 'leave-html-full-screen', listener: Function): this; + /** + * Emitted when an App Command is invoked. These are typically related + * to keyboard media keys or browser commands, as well as the "Back" / + * "Forward" buttons built into some mice on Windows. + * Note: This is only implemented on Windows. + */ + on(event: 'app-command', listener: (event: Event, command: string) => void): this; + /** + * Emitted when scroll wheel event phase has begun. + * Note: This is only implemented on macOS. + */ + on(event: 'scroll-touch-begin', listener: Function): this; + /** + * Emitted when scroll wheel event phase has ended. + * Note: This is only implemented on macOS. + */ + on(event: 'scroll-touch-end', listener: Function): this; + /** + * Emitted when scroll wheel event phase filed upon reaching the edge of element. + * Note: This is only implemented on macOS. + */ + on(event: 'scroll-touch-edge', listener: Function): this; + /** + * Emitted on 3-finger swipe. + * Note: This is only implemented on macOS. + */ + on(event: 'swipe', listener: (event: Event, direction: SwipeDirection) => void): this; + on(event: string, listener: Function): this; + /** + * Creates a new BrowserWindow with native properties as set by the options. + */ + constructor(options?: BrowserWindowOptions); + /** + * @returns All opened browser windows. + */ + static getAllWindows(): BrowserWindow[]; + /** + * @returns The window that is focused in this application. + */ + static getFocusedWindow(): BrowserWindow; + /** + * Find a window according to the webContents it owns. + */ + static fromWebContents(webContents: WebContents): BrowserWindow; + /** + * Find a window according to its ID. + */ + static fromId(id: number): BrowserWindow; + /** + * Adds devtools extension located at path. The extension will be remembered + * so you only need to call this API once, this API is not for programming use. + * @returns The extension's name. + * + * Note: This API cannot be called before the ready event of the app module is emitted. + */ + static addDevToolsExtension(path: string): string; + /** + * Remove a devtools extension. + * @param name The name of the devtools extension to remove. + * + * Note: This API cannot be called before the ready event of the app module is emitted. + */ + static removeDevToolsExtension(name: string): void; + /** + * @returns devtools extensions. + * + * Note: This API cannot be called before the ready event of the app module is emitted. + */ + static getDevToolsExtensions(): DevToolsExtensions; + /** + * The WebContents object this window owns, all web page related events and + * operations would be done via it. + * Note: Users should never store this object because it may become null when + * the renderer process (web page) has crashed. + */ + webContents: WebContents; + /** + * Get the unique ID of this window. + */ + id: number; + /** + * Force closing the window, the unload and beforeunload event won't be emitted + * for the web page, and close event would also not be emitted for this window, + * but it would guarantee the closed event to be emitted. + * You should only use this method when the renderer process (web page) has crashed. + */ + destroy(): void; + /** + * Try to close the window, this has the same effect with user manually clicking + * the close button of the window. The web page may cancel the close though, + * see the close event. + */ + close(): void; + /** + * Focus on the window. + */ + focus(): void; + /** + * Remove focus on the window. + */ + blur(): void; + /** + * @returns Whether the window is focused. + */ + isFocused(): boolean; + /** + * @returns Whether the window is destroyed. + */ + isDestroyed(): boolean; + /** + * Shows and gives focus to the window. + */ + show(): void; + /** + * Shows the window but doesn't focus on it. + */ + showInactive(): void; + /** + * Hides the window. + */ + hide(): void; + /** + * @returns Whether the window is visible to the user. + */ + isVisible(): boolean; + /** + * @returns Whether the window is a modal window. + */ + isModal(): boolean; + /** + * Maximizes the window. + */ + maximize(): void; + /** + * Unmaximizes the window. + */ + unmaximize(): void; + /** + * @returns Whether the window is maximized. + */ + isMaximized(): boolean; + /** + * Minimizes the window. On some platforms the minimized window will be + * shown in the Dock. + */ + minimize(): void; + /** + * Restores the window from minimized state to its previous state. + */ + restore(): void; + /** + * @returns Whether the window is minimized. + */ + isMinimized(): boolean; + /** + * Sets whether the window should be in fullscreen mode. + */ + setFullScreen(flag: boolean): void; + /** + * @returns Whether the window is in fullscreen mode. + */ + isFullScreen(): boolean; + /** + * This will have a window maintain an aspect ratio. + * The extra size allows a developer to have space, specified in pixels, + * not included within the aspect ratio calculations. + * This API already takes into account the difference between a window’s size and its content size. + * + * Note: This API is available only on macOS. + */ + setAspectRatio(aspectRatio: number, extraSize?: Size): void; + /** + * Resizes and moves the window to width, height, x, y. + */ + setBounds(options: Rectangle, animate?: boolean): void; + /** + * @returns The window's width, height, x and y values. + */ + getBounds(): Rectangle; + /** + * Resizes and moves the window's client area (e.g. the web page) to width, height, x, y. + */ + setContentBounds(options: Rectangle, animate?: boolean): void; + /** + * @returns The window's client area (e.g. the web page) width, height, x and y values. + */ + getContentBounds(): Rectangle; + /** + * Resizes the window to width and height. + */ + setSize(width: number, height: number, animate?: boolean): void; + /** + * @returns The window's width and height. + */ + getSize(): number[]; + /** + * Resizes the window's client area (e.g. the web page) to width and height. + */ + setContentSize(width: number, height: number, animate?: boolean): void; + /** + * @returns The window's client area's width and height. + */ + getContentSize(): number[]; + /** + * Sets the minimum size of window to width and height. + */ + setMinimumSize(width: number, height: number): void; + /** + * @returns The window's minimum width and height. + */ + getMinimumSize(): number[]; + /** + * Sets the maximum size of window to width and height. + */ + setMaximumSize(width: number, height: number): void; + /** + * @returns The window's maximum width and height. + */ + getMaximumSize(): number[]; + /** + * Sets whether the window can be manually resized by user. + */ + setResizable(resizable: boolean): void; + /** + * @returns Whether the window can be manually resized by user. + */ + isResizable(): boolean; + /** + * Sets whether the window can be moved by user. On Linux does nothing. + * Note: This API is available only on macOS and Windows. + */ + setMovable(movable: boolean): void; + /** + * Note: This API is available only on macOS and Windows. + * @returns Whether the window can be moved by user. On Linux always returns true. + */ + isMovable(): boolean; + /** + * Sets whether the window can be manually minimized by user. On Linux does nothing. + * Note: This API is available only on macOS and Windows. + */ + setMinimizable(minimizable: boolean): void; + /** + * Note: This API is available only on macOS and Windows. + * @returns Whether the window can be manually minimized by user. On Linux always returns true. + */ + isMinimizable(): boolean; + /** + * Sets whether the window can be manually maximized by user. On Linux does nothing. + * Note: This API is available only on macOS and Windows. + */ + setMaximizable(maximizable: boolean): void; + /** + * Note: This API is available only on macOS and Windows. + * @returns Whether the window can be manually maximized by user. On Linux always returns true. + */ + isMaximizable(): boolean; + /** + * Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window. + */ + setFullScreenable(fullscreenable: boolean): void; + /** + * @returns Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window. + */ + isFullScreenable(): boolean; + /** + * Sets whether the window can be manually closed by user. On Linux does nothing. + * Note: This API is available only on macOS and Windows. + */ + setClosable(closable: boolean): void; + /** + * Note: This API is available only on macOS and Windows. + * @returns Whether the window can be manually closed by user. On Linux always returns true. + */ + isClosable(): boolean; + /** + * Sets whether the window should show always on top of other windows. After + * setting this, the window is still a normal window, not a toolbox window + * which can not be focused on. + */ + setAlwaysOnTop(flag: boolean, level?: WindowLevel): void; + /** + * @returns Whether the window is always on top of other windows. + */ + isAlwaysOnTop(): boolean; + /** + * Moves window to the center of the screen. + */ + center(): void; + /** + * Moves window to x and y. + */ + setPosition(x: number, y: number, animate?: boolean): void; + /** + * @returns The window's current position. + */ + getPosition(): number[]; + /** + * Changes the title of native window to title. + */ + setTitle(title: string): void; + /** + * Note: The title of web page can be different from the title of the native window. + * @returns The title of the native window. + */ + getTitle(): string; + /** + * Changes the attachment point for sheets on macOS. + * Note: This API is available only on macOS. + */ + setSheetOffset(offsetY: number, offsetX?: number): void; + /** + * Starts or stops flashing the window to attract user's attention. + */ + flashFrame(flag: boolean): void; + /** + * Makes the window do not show in Taskbar. + */ + setSkipTaskbar(skip: boolean): void; + /** + * Enters or leaves the kiosk mode. + */ + setKiosk(flag: boolean): void; + /** + * @returns Whether the window is in kiosk mode. + */ + isKiosk(): boolean; + /** + * The native type of the handle is HWND on Windows, NSView* on macOS, + * and Window (unsigned long) on Linux. + * @returns The platform-specific handle of the window as Buffer. + */ + getNativeWindowHandle(): Buffer; + /** + * Hooks a windows message. The callback is called when the message is received in the WndProc. + * Note: This API is available only on Windows. + */ + hookWindowMessage(message: number, callback: Function): void; + /** + * @returns Whether the message is hooked. + */ + isWindowMessageHooked(message: number): boolean; + /** + * Unhook the window message. + */ + unhookWindowMessage(message: number): void; + /** + * Unhooks all of the window messages. + */ + unhookAllWindowMessages(): void; + /** + * Sets the pathname of the file the window represents, and the icon of the + * file will show in window's title bar. + * Note: This API is available only on macOS. + */ + setRepresentedFilename(filename: string): void; + /** + * Note: This API is available only on macOS. + * @returns The pathname of the file the window represents. + */ + getRepresentedFilename(): string; + /** + * Specifies whether the window’s document has been edited, and the icon in + * title bar will become grey when set to true. + * Note: This API is available only on macOS. + */ + setDocumentEdited(edited: boolean): void; + /** + * Note: This API is available only on macOS. + * @returns Whether the window's document has been edited. + */ + isDocumentEdited(): boolean; + focusOnWebView(): void; + blurWebView(): void; + /** + * Captures the snapshot of page within rect, upon completion the callback + * will be called. Omitting the rect would capture the whole visible page. + * Note: Be sure to read documents on remote buffer in remote if you are going + * to use this API in renderer process. + * @param callback Supplies the image that stores data of the snapshot. + */ + capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; + /** + * Captures the snapshot of page within rect, upon completion the callback + * will be called. Omitting the rect would capture the whole visible page. + * Note: Be sure to read documents on remote buffer in remote if you are going + * to use this API in renderer process. + * @param callback Supplies the image that stores data of the snapshot. + */ + capturePage(callback: (image: NativeImage) => void): void; + /** + * Same as webContents.loadURL(url). + */ + loadURL(url: string, options?: LoadURLOptions): void; + /** + * Same as webContents.reload. + */ + reload(): void; + /** + * Sets the menu as the window top menu. + * Note: This API is not available on macOS. + */ + setMenu(menu: Menu): void; + /** + * Sets the progress value in the progress bar. + * On Linux platform, only supports Unity desktop environment, you need to + * specify the *.desktop file name to desktopName field in package.json. + * By default, it will assume app.getName().desktop. + * @param progress Valid range is [0, 1.0]. If < 0, the progress bar is removed. + * If greater than 0, it becomes indeterminate. + */ + setProgressBar(progress: number, options?: { + /** + * Mode for the progress bar. + * Note: This is only implemented on Windows. + */ + mode: 'none' | 'normal' | 'indeterminate' | 'error' | 'paused' + }): void; + /** + * Sets a 16px overlay onto the current Taskbar icon, usually used to convey + * some sort of application status or to passively notify the user. + * Note: This API is only available on Windows 7 or above. + * @param overlay The icon to display on the bottom right corner of the Taskbar + * icon. If this parameter is null, the overlay is cleared + * @param description Provided to Accessibility screen readers. + */ + setOverlayIcon(overlay: NativeImage, description: string): void; + /** + * Sets whether the window should have a shadow. On Windows and Linux does nothing. + * Note: This API is available only on macOS. + */ + setHasShadow(hasShadow: boolean): void; + /** + * Note: This API is available only on macOS. + * @returns whether the window has a shadow. On Windows and Linux always returns true. + */ + hasShadow(): boolean; + /** + * Add a thumbnail toolbar with a specified set of buttons to the thumbnail image + * of a window in a taskbar button layout. + * @returns Whether the thumbnail has been added successfully. + * + * Note: This API is available only on Windows. + */ + setThumbarButtons(buttons: ThumbarButton[]): boolean; + /** + * Sets the region of the window to show as the thumbnail image displayed when hovering + * over the window in the taskbar. You can reset the thumbnail to be the entire window + * by specifying an empty region: {x: 0, y: 0, width: 0, height: 0}. + * + * Note: This API is available only on Windows. + */ + setThumbnailClip(region: Rectangle): boolean; + /** + * Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. + * Note: This API is available only on Windows. + */ + setThumbnailToolTip(toolTip: string): boolean; + /** + * Same as webContents.showDefinitionForSelection(). + * Note: This API is available only on macOS. + */ + showDefinitionForSelection(): void; + /** + * Changes window icon. + * Note: This API is not available on macOS. + */ + setIcon(icon: NativeImage): void; + /** + * Sets whether the window menu bar should hide itself automatically. Once set + * the menu bar will only show when users press the single Alt key. + * If the menu bar is already visible, calling setAutoHideMenuBar(true) won't + * hide it immediately. + */ + setAutoHideMenuBar(hide: boolean): void; + /** + * @returns Whether menu bar automatically hides itself. + */ + isMenuBarAutoHide(): boolean; + /** + * Sets whether the menu bar should be visible. If the menu bar is auto-hide, + * users can still bring up the menu bar by pressing the single Alt key. + */ + setMenuBarVisibility(visibile: boolean): void; + /** + * @returns Whether the menu bar is visible. + */ + isMenuBarVisible(): boolean; + /** + * Sets whether the window should be visible on all workspaces. + * Note: This API does nothing on Windows. + */ + setVisibleOnAllWorkspaces(visible: boolean): void; + /** + * Note: This API always returns false on Windows. + * @returns Whether the window is visible on all workspaces. + */ + isVisibleOnAllWorkspaces(): boolean; + /** + * Makes the window ignore all mouse events. + * + * All mouse events happened in this window will be passed to the window below this window, + * but if this window has focus, it will still receive keyboard events. + */ + setIgnoreMouseEvents(ignore: boolean): void; + /** + * Prevents the window contents from being captured by other apps. + * + * On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. + * On Windows it calls SetWindowDisplayAffinity with WDA_MONITOR. + */ + setContentProtection(enable: boolean): void; + /** + * Changes whether the window can be focused. + * Note: This API is available only on Windows. + */ + setFocusable(focusable: boolean): void; + /** + * Sets parent as current window's parent window, + * passing null will turn current window into a top-level window. + * Note: This API is not available on Windows. + */ + setParentWindow(parent: BrowserWindow): void; + /** + * @returns The parent window. + */ + getParentWindow(): BrowserWindow; + /** + * @returns All child windows. + */ + getChildWindows(): BrowserWindow[]; + } + + type WindowLevel = 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock'; + type SwipeDirection = 'up' | 'right' | 'down' | 'left'; + type ThumbarButtonFlags = 'enabled' | 'disabled' | 'dismissonclick' | 'nobackground' | 'hidden' | 'noninteractive'; + + interface ThumbarButton { + icon: NativeImage | string; + click: Function; + tooltip?: string; + flags?: ThumbarButtonFlags[]; + } + + interface DevToolsExtensions { + [name: string]: { + name: string; + value: string; + } + } + + interface WebPreferences { + /** + * Whether to enable DevTools. + * If it is set to false, can not use BrowserWindow.webContents.openDevTools() to open DevTools. + * Default: true. + */ + devTools?: boolean; + /** + * Whether node integration is enabled. + * Default: true. + */ + nodeIntegration?: boolean; + /** + * Specifies a script that will be loaded before other scripts run in the page. + * This script will always have access to node APIs no matter whether node integration is turned on or off. + * The value should be the absolute file path to the script. + * When node integration is turned off, the preload script can reintroduce + * Node global symbols back to the global scope. + */ + preload?: string; + /** + * Sets the session used by the page. Instead of passing the Session object directly, + * you can also choose to use the partition option instead, which accepts a partition string. + * When both session and partition are provided, session would be preferred. + * Default: the default session. + */ + session?: Session; + /** + * Sets the session used by the page according to the session’s partition string. + * If partition starts with persist:, the page will use a persistent session available + * to all pages in the app with the same partition. if there is no persist: prefix, + * the page will use an in-memory session. By assigning the same partition, + * multiple pages can share the same session. + * Default: the default session. + */ + partition?: string; + /** + * The default zoom factor of the page, 3.0 represents 300%. + * Default: 1.0. + */ + zoomFactor?: number; + /** + * Enables JavaScript support. + * Default: true. + */ + javascript?: boolean; + /** + * When setting false, it will disable the same-origin policy (Usually using testing + * websites by people), and set allowDisplayingInsecureContent and allowRunningInsecureContent + * to true if these two options are not set by user. + * Default: true. + */ + webSecurity?: boolean; + /** + * Allow an https page to display content like images from http URLs. + * Default: false. + */ + allowDisplayingInsecureContent?: boolean; + /** + * Allow a https page to run JavaScript, CSS or plugins from http URLs. + * Default: false. + */ + allowRunningInsecureContent?: boolean; + /** + * Enables image support. + * Default: true. + */ + images?: boolean; + /** + * Make TextArea elements resizable. + * Default: true. + */ + textAreasAreResizable?: boolean; + /** + * Enables WebGL support. + * Default: true. + */ + webgl?: boolean; + /** + * Enables WebAudio support. + * Default: true. + */ + webaudio?: boolean; + /** + * Whether plugins should be enabled. + * Default: false. + */ + plugins?: boolean; + /** + * Enables Chromium’s experimental features. + * Default: false. + */ + experimentalFeatures?: boolean; + /** + * Enables Chromium’s experimental canvas features. + * Default: false. + */ + experimentalCanvasFeatures?: boolean; + /** + * Enables DirectWrite font rendering system on Windows. + * Default: true. + */ + directWrite?: boolean; + /** + * Enables scroll bounce (rubber banding) effect on macOS. + * Default: false. + */ + scrollBounce?: boolean; + /** + * A list of feature strings separated by ",", like CSSVariables,KeyboardEventKey to enable. + */ + blinkFeatures?: string; + /** + * A list of feature strings separated by ",", like CSSVariables,KeyboardEventKey to disable. + */ + disableBlinkFeatures?: string; + /** + * Sets the default font for the font-family. + */ + defaultFontFamily?: { + /** + * Default: Times New Roman. + */ + standard?: string; + /** + * Default: Times New Roman. + */ + serif?: string; + /** + * Default: Arial. + */ + sansSerif?: string; + /** + * Default: Courier New. + */ + monospace?: string; + }; + /** + * Default: 16. + */ + defaultFontSize?: number; + /** + * Default: 13. + */ + defaultMonospaceFontSize?: number; + /** + * Default: 0. + */ + minimumFontSize?: number; + /** + * Default: ISO-8859-1. + */ + defaultEncoding?: string; + /** + * Whether to throttle animations and timers when the page becomes background. + * Default: true. + */ + backgroundThrottling?: boolean; + /** + * Whether to enable offscreen rendering for the browser window. + * Default: false. + */ + offscreen?: boolean; + /** + * Whether to enable Chromium OS-level sandbox. + * Default: false. + */ + sandbox?: boolean; + } + + interface BrowserWindowOptions { + /** + * Window’s width in pixels. + * Default: 800. + */ + width?: number; + /** + * Window’s height in pixels. + * Default: 600. + */ + height?: number; + /** + * Window’s left offset from screen. + * Default: center the window. + */ + x?: number; + /** + * Window’s top offset from screen. + * Default: center the window. + */ + y?: number; + /** + * The width and height would be used as web page’s size, which means + * the actual window’s size will include window frame’s size and be slightly larger. + * Default: false. + */ + useContentSize?: boolean; + /** + * Show window in the center of the screen. + * Default: true + */ + center?: boolean; + /** + * Window’s minimum width. + * Default: 0. + */ + minWidth?: number; + /** + * Window’s minimum height. + * Default: 0. + */ + minHeight?: number; + /** + * Window’s maximum width. + * Default: no limit. + */ + maxWidth?: number; + /** + * Window’s maximum height. + * Default: no limit. + */ + maxHeight?: number; + /** + * Whether window is resizable. + * Default: true. + */ + resizable?: boolean; + /** + * Whether window is movable. + * Note: This is not implemented on Linux. + * Default: true. + */ + movable?: boolean; + /** + * Whether window is minimizable. + * Note: This is not implemented on Linux. + * Default: true. + */ + minimizable?: boolean; + /** + * Whether window is maximizable. + * Note: This is not implemented on Linux. + * Default: true. + */ + maximizable?: boolean; + /** + * Whether window is closable. + * Note: This is not implemented on Linux. + * Default: true. + */ + closable?: boolean; + /** + * Whether the window can be focused. + * On Windows setting focusable: false also implies setting skipTaskbar: true. + * On Linux setting focusable: false makes the window stop interacting with wm, + * so the window will always stay on top in all workspaces. + * Default: true. + */ + focusable?: boolean; + /** + * Whether the window should always stay on top of other windows. + * Default: false. + */ + alwaysOnTop?: boolean; + /** + * Whether the window should show in fullscreen. + * When explicitly set to false the fullscreen button will be hidden or disabled on macOS. + * Default: false. + */ + fullscreen?: boolean; + /** + * Whether the window can be put into fullscreen mode. + * On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. + * Default: true. + */ + fullscreenable?: boolean; + /** + * Whether to show the window in taskbar. + * Default: false. + */ + skipTaskbar?: boolean; + /** + * The kiosk mode. + * Default: false. + */ + kiosk?: boolean; + /** + * Default window title. + * Default: "Electron". + */ + title?: string; + /** + * The window icon, when omitted on Windows the executable’s icon would be used as window icon. + */ + icon?: NativeImage|string; + /** + * Whether window should be shown when created. + * Default: true. + */ + show?: boolean; + /** + * Specify false to create a Frameless Window. + * Default: true. + */ + frame?: boolean; + /** + * Specify parent window. + * Default: null. + */ + parent?: BrowserWindow; + /** + * Whether this is a modal window. This only works when the window is a child window. + * Default: false. + */ + modal?: boolean; + /** + * Whether the web view accepts a single mouse-down event that simultaneously activates the window. + * Default: false. + */ + acceptFirstMouse?: boolean; + /** + * Whether to hide cursor when typing. + * Default: false. + */ + disableAutoHideCursor?: boolean; + /** + * Auto hide the menu bar unless the Alt key is pressed. + * Default: true. + */ + autoHideMenuBar?: boolean; + /** + * Enable the window to be resized larger than screen. + * Default: false. + */ + enableLargerThanScreen?: boolean; + /** + * Window’s background color as Hexadecimal value, like #66CD00 or #FFF or #80FFFFFF (alpha is supported). + * Default: #FFF (white). + */ + backgroundColor?: string; + /** + * Whether window should have a shadow. + * Note: This is only implemented on macOS. + * Default: true. + */ + hasShadow?: boolean; + /** + * Forces using dark theme for the window. + * Note: Only works on some GTK+3 desktop environments. + * Default: false. + */ + darkTheme?: boolean; + /** + * Makes the window transparent. + * Default: false. + */ + transparent?: boolean; + /** + * The type of window, default is normal window. + */ + type?: BrowserWindowType; + /** + * The style of window title bar. + */ + titleBarStyle?: 'default' | 'hidden' | 'hidden-inset'; + /** + * Use WS_THICKFRAME style for frameless windows on Windows + */ + thickFrame?: boolean; + /** + * Settings of web page’s features. + */ + webPreferences?: WebPreferences; + } + + type BrowserWindowType = BrowserWindowTypeLinux | BrowserWindowTypeMac | BrowserWindowTypeWindows; + type BrowserWindowTypeLinux = 'desktop' | 'dock' | 'toolbar' | 'splash' | 'notification'; + type BrowserWindowTypeMac = 'desktop' | 'textured'; + type BrowserWindowTypeWindows = 'toolbar'; + + // https://github.com/electron/electron/blob/master/docs/api/clipboard.md + + /** + * The clipboard module provides methods to perform copy and paste operations. + */ + interface Clipboard { + /** + * @returns The contents of the clipboard as plain text. + */ + readText(type?: ClipboardType): string; + /** + * Writes the text into the clipboard as plain text. + */ + writeText(text: string, type?: ClipboardType): void; + /** + * @returns The contents of the clipboard as markup. + */ + readHTML(type?: ClipboardType): string; + /** + * Writes markup to the clipboard. + */ + writeHTML(markup: string, type?: ClipboardType): void; + /** + * @returns The contents of the clipboard as a NativeImage. + */ + readImage(type?: ClipboardType): NativeImage; + /** + * Writes the image into the clipboard. + */ + writeImage(image: NativeImage, type?: ClipboardType): void; + /** + * @returns The contents of the clipboard as RTF. + */ + readRTF(type?: ClipboardType): string; + /** + * Writes the text into the clipboard in RTF. + */ + writeRTF(text: string, type?: ClipboardType): void; + /** + * Clears everything in clipboard. + */ + clear(type?: ClipboardType): void; + /** + * @returns Array available formats for the clipboard type. + */ + availableFormats(type?: ClipboardType): string[]; + /** + * Returns whether the clipboard supports the format of specified data. + * Note: This API is experimental and could be removed in future. + * @returns Whether the clipboard has data in the specified format. + */ + has(format: string, type?: ClipboardType): boolean; + /** + * Reads the data in the clipboard of the specified format. + * Note: This API is experimental and could be removed in future. + */ + read(format: string, type?: ClipboardType): string | NativeImage; + /** + * Writes data to the clipboard. + */ + write(data: { + text?: string; + rtf?: string; + html?: string; + image?: NativeImage; + }, type?: ClipboardType): void; + /** + * @returns An Object containing title and url keys representing the bookmark in the clipboard. + * + * Note: This API is available on macOS and Windows. + */ + readBookmark(): Bookmark; + /** + * Writes the title and url into the clipboard as a bookmark. + * + * Note: This API is available on macOS and Windows. + */ + writeBookmark(title: string, url: string, type?: ClipboardType): void; + } + + type ClipboardType = '' | 'selection'; + + interface Bookmark { + title: string; + url: string; + } + + // https://github.com/electron/electron/blob/master/docs/api/content-tracing.md + + /** + * The content-tracing module is used to collect tracing data generated by the underlying Chromium content module. + * This module does not include a web interface so you need to open chrome://tracing/ + * in a Chrome browser and load the generated file to view the result. + */ + interface ContentTracing { + /** + * Get a set of category groups. The category groups can change as new code paths are reached. + * + * @param callback Called once all child processes have acknowledged the getCategories request. + */ + getCategories(callback: (categoryGroups: string[]) => void): void; + /** + * Start recording on all processes. Recording begins immediately locally and asynchronously + * on child processes as soon as they receive the EnableRecording request. + * + * @param callback Called once all child processes have acknowledged the startRecording request. + */ + startRecording(options: ContentTracingOptions, callback: Function): void; + /** + * Stop recording on all processes. Child processes typically are caching trace data and + * only rarely flush and send trace data back to the main process. That is because it may + * be an expensive operation to send the trace data over IPC, and we would like to avoid + * much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all + * child processes to flush any pending trace data. + * + * @param resultFilePath Trace data will be written into this file if it is not empty, + * or into a temporary file. + * @param callback Called once all child processes have acknowledged the stopRecording request. + */ + stopRecording(resultFilePath: string, callback: (filePath: string) => void): void; + /** + * Start monitoring on all processes. Monitoring begins immediately locally and asynchronously + * on child processes as soon as they receive the startMonitoring request. + * + * @param callback Called once all child processes have acked to the startMonitoring request. + */ + startMonitoring(options: ContentTracingOptions, callback: Function): void; + /** + * Stop monitoring on all processes. + * + * @param callback Called once all child processes have acknowledged the stopMonitoring request. + */ + stopMonitoring(callback: Function): void; + /** + * Get the current monitoring traced data. Child processes typically are caching trace data + * and only rarely flush and send trace data back to the main process. That is because it may + * be an expensive operation to send the trace data over IPC, and we would like to avoid much + * runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child + * processes to flush any pending trace data. + * + * @param callback Called once all child processes have acknowledged the captureMonitoringSnapshot request. + */ + captureMonitoringSnapshot(resultFilePath: string, callback: (filePath: string) => void): void; + /** + * Get the maximum usage across processes of trace buffer as a percentage of the full state. + * + * @param callback Called when the TraceBufferUsage value is determined. + */ + getTraceBufferUsage(callback: Function): void; + /** + * @param callback Called every time the given event occurs on any process. + */ + setWatchEvent(categoryName: string, eventName: string, callback: Function): void; + /** + * Cancel the watch event. This may lead to a race condition with the watch event callback if tracing is enabled. + */ + cancelWatchEvent(): void; + } + + interface ContentTracingOptions { + /** + * Filter to control what category groups should be traced. + * A filter can have an optional - prefix to exclude category groups + * that contain a matching category. Having both included and excluded + * category patterns in the same list is not supported. + * + * Examples: + * test_MyTest* + * test_MyTest*,test_OtherStuff + * -excluded_category1,-excluded_category2 + */ + categoryFilter: string; + /** + * Controls what kind of tracing is enabled, it is a comma-delimited list. + * + * Possible options are: + * record-until-full + * record-continuously + * trace-to-console + * enable-sampling + * enable-systrace + * + * The first 3 options are trace recoding modes and hence mutually exclusive. + * If more than one trace recording modes appear in the traceOptions string, + * the last one takes precedence. If none of the trace recording modes are specified, + * recording mode is record-until-full. + * + * The trace option will first be reset to the default option (record_mode set + * to record-until-full, enable_sampling and enable_systrace set to false) + * before options parsed from traceOptions are applied on it. + */ + traceOptions: string; + } + + // https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md + + /** + * The crash-reporter module enables sending your app's crash reports. + */ + interface CrashReporter { + /** + * You are required to call this method before using other crashReporter APIs. + * + * Note: On macOS, Electron uses a new crashpad client, which is different from breakpad + * on Windows and Linux. To enable the crash collection feature, you are required to call + * the crashReporter.start API to initialize crashpad in the main process and in each + * renderer process from which you wish to collect crash reports. + */ + start(options: CrashReporterStartOptions): void; + /** + * @returns The crash report. When there was no crash report + * sent or the crash reporter is not started, null will be returned. + */ + getLastCrashReport(): CrashReport; + /** + * @returns All uploaded crash reports. + */ + getUploadedReports(): CrashReport[]; + } + + interface CrashReporterStartOptions { + /** + * Default: app.getName() + */ + productName?: string; + companyName: string; + /** + * URL that crash reports would be sent to as POST. + */ + submitURL: string; + /** + * Send the crash report without user interaction. + * Default: true. + */ + autoSubmit?: boolean; + /** + * Default: false. + */ + ignoreSystemCrashHandler?: boolean; + /** + * An object you can define that will be sent along with the report. + * Only string properties are sent correctly, nested objects are not supported. + */ + extra?: {[prop: string]: string}; + } + + interface CrashReport { + id: string; + date: Date; + } + + // https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md + + /** + * The desktopCapturer module can be used to get available sources + * that can be used to be captured with getUserMedia. + */ + interface DesktopCapturer { + /** + * Starts a request to get all desktop sources. + * + * Note: There is no guarantee that the size of source.thumbnail is always + * the same as the thumnbailSize in options. It also depends on the scale of the screen or window. + */ + getSources(options: DesktopCapturerOptions, callback: (error: Error, sources: DesktopCapturerSource[]) => any): void; + } + + interface DesktopCapturerOptions { + /** + * The types of desktop sources to be captured. + */ + types?: ('screen' | 'window')[]; + /** + * The suggested size that thumbnail should be scaled. + * Default: {width: 150, height: 150} + */ + thumbnailSize?: Size; + } + + interface DesktopCapturerSource { + /** + * The id of the captured window or screen used in navigator.webkitGetUserMedia. + * The format looks like window:XX or screen:XX where XX is a random generated number. + */ + id: string; + /** + * The described name of the capturing screen or window. + * If the source is a screen, the name will be Entire Screen or Screen ; + * if it is a window, the name will be the window’s title. + */ + name: string; + /** + * A thumbnail image. + */ + thumbnail: NativeImage; + } + + // https://github.com/electron/electron/blob/master/docs/api/dialog.md + + /** + * The dialog module provides APIs to show native system dialogs, such as opening files or alerting, + * so web applications can deliver the same user experience as native applications. + */ + interface Dialog { + /** + * Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, + * so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown. + * + * @param callback If supplied, the API call will be asynchronous. + * @returns On success, returns an array of file paths chosen by the user, + * otherwise returns undefined. + */ + showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; + /** + * Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, + * so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown. + * + * @param callback If supplied, the API call will be asynchronous. + * @returns On success, returns an array of file paths chosen by the user, + * otherwise returns undefined. + */ + showOpenDialog(options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; + /** + * @param callback If supplied, the API call will be asynchronous. + * @returns On success, returns the path of file chosen by the user, otherwise + * returns undefined. + */ + showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions, callback?: (fileName: string) => void): string; + /** + * @param callback If supplied, the API call will be asynchronous. + * @returns On success, returns the path of file chosen by the user, otherwise + * returns undefined. + */ + showSaveDialog(options: SaveDialogOptions, callback?: (fileName: string) => void): string; + /** + * Shows a message box. It will block until the message box is closed. + * @param callback If supplied, the API call will be asynchronous. + * @returns The index of the clicked button. + */ + showMessageBox(browserWindow: BrowserWindow, options: ShowMessageBoxOptions, callback?: (response: number) => void): number; + /** + * Shows a message box. It will block until the message box is closed. + * @param callback If supplied, the API call will be asynchronous. + * @returns The index of the clicked button. + */ + showMessageBox(options: ShowMessageBoxOptions, callback?: (response: number) => void): number; + /** + * Displays a modal dialog that shows an error message. + * + * This API can be called safely before the ready event the app module emits, + * it is usually used to report errors in early stage of startup. + * If called before the app readyevent on Linux, the message will be emitted to stderr, + * and no GUI dialog will appear. + */ + showErrorBox(title: string, content: string): void; + } + + interface OpenDialogOptions { + title?: string; + defaultPath?: string; + /** + * Custom label for the confirmation button, when left empty the default label will be used. + */ + buttonLabel?: string; + /** + * File types that can be displayed or selected. + */ + filters?: { + name: string; + /** + * Extensions without wildcards or dots (e.g. 'png' is good but '.png' and '*.png' are bad). + * To show all files, use the '*' wildcard (no other wildcard is supported). + */ + extensions: string[]; + }[]; + /** + * Contains which features the dialog should use. + */ + properties?: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory' | 'showHiddenFiles')[]; + } + + interface SaveDialogOptions { + title?: string; + defaultPath?: string; + /** + * Custom label for the confirmation button, when left empty the default label will be used. + */ + buttonLabel?: string; + /** + * File types that can be displayed, see dialog.showOpenDialog for an example. + */ + filters?: { + name: string; + extensions: string[]; + }[]; + } + + interface ShowMessageBoxOptions { + /** + * On Windows, "question" displays the same icon as "info", unless you set an icon using the "icon" option. + */ + type?: 'none' | 'info' | 'error' | 'question' | 'warning'; + /** + * Texts for buttons. On Windows, an empty array will result in one button labeled "OK". + */ + buttons?: string[]; + /** + * Index of the button in the buttons array which will be selected by default when the message box opens. + */ + defaultId?: number; + /** + * Title of the message box (some platforms will not show it). + */ + title?: string; + /** + * Contents of the message box. + */ + message?: string; + /** + * Extra information of the message. + */ + detail?: string; + icon?: NativeImage; + /** + * The value will be returned when user cancels the dialog instead of clicking the buttons of the dialog. + * By default it is the index of the buttons that have "cancel" or "no" as label, + * or 0 if there is no such buttons. On macOS and Windows the index of "Cancel" button + * will always be used as cancelId, not matter whether it is already specified. + */ + cancelId?: number; + /** + * On Windows Electron will try to figure out which one of the buttons are common buttons + * (like "Cancel" or "Yes"), and show the others as command links in the dialog. + * This can make the dialog appear in the style of modern Windows apps. + * If you don’t like this behavior, you can set noLink to true. + */ + noLink?: boolean; + } + + // https://github.com/electron/electron/blob/master/docs/api/download-item.md + + /** + * DownloadItem represents a download item in Electron. + */ + interface DownloadItem extends NodeJS.EventEmitter { + /** + * Emitted when the download has been updated and is not done. + */ + on(event: 'updated', listener: (event: Event, state: 'progressing' | 'interrupted') => void): this; + /** + * Emits when the download is in a terminal state. This includes a completed download, + * a cancelled download (via downloadItem.cancel()), and interrupted download that can’t be resumed. + */ + on(event: 'done', listener: (event: Event, state: 'completed' | 'cancelled' | 'interrupted') => void): this; + on(event: string, listener: Function): this; + /** + * Set the save file path of the download item. + * Note: The API is only available in session’s will-download callback function. + * If user doesn’t set the save path via the API, Electron will use the original + * routine to determine the save path (Usually prompts a save dialog). + */ + setSavePath(path: string): void; + /** + * @returns The save path of the download item. + * This will be either the path set via downloadItem.setSavePath(path) or the path selected from the shown save dialog. + */ + getSavePath(): string; + /** + * Pauses the download. + */ + pause(): void; + /** + * @returns Whether the download is paused. + */ + isPaused(): boolean; + /** + * Resumes the download that has been paused. + */ + resume(): void; + /** + * @returns Whether the download can resume. + */ + canResume(): boolean; + /** + * Cancels the download operation. + */ + cancel(): void; + /** + * @returns The origin url where the item is downloaded from. + */ + getURL(): string; + /** + * @returns The mime type. + */ + getMimeType(): string; + /** + * @returns Whether the download has user gesture. + */ + hasUserGesture(): boolean; + /** + * @returns The file name of the download item. + * Note: The file name is not always the same as the actual one saved in local disk. + * If user changes the file name in a prompted download saving dialog, + * the actual name of saved file will be different. + */ + getFilename(): string; + /** + * @returns The total size in bytes of the download item. If the size is unknown, it returns 0. + */ + getTotalBytes(): number; + /** + * @returns The received bytes of the download item. + */ + getReceivedBytes(): number; + /** + * @returns The Content-Disposition field from the response header. + */ + getContentDisposition(): string; + /** + * @returns The current state. + */ + getState(): 'progressing' | 'completed' | 'cancelled' | 'interrupted'; + } + + // https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md + + /** + * The globalShortcut module can register/unregister a global keyboard shortcut + * with the operating system so that you can customize the operations for various shortcuts. + * Note: The shortcut is global; it will work even if the app does not have the keyboard focus. + * You should not use this module until the ready event of the app module is emitted. + */ + interface GlobalShortcut { + /** + * Registers a global shortcut of accelerator. + * @param accelerator Represents a keyboard shortcut. It can contain modifiers + * and key codes, combined by the "+" character. + * @param callback Called when the registered shortcut is pressed by the user. + */ + register(accelerator: string, callback: Function): void; + /** + * @param accelerator Represents a keyboard shortcut. It can contain modifiers + * and key codes, combined by the "+" character. + * @returns Whether the accelerator is registered. + */ + isRegistered(accelerator: string): boolean; + /** + * Unregisters the global shortcut of keycode. + * @param accelerator Represents a keyboard shortcut. It can contain modifiers + * and key codes, combined by the "+" character. + */ + unregister(accelerator: string): void; + /** + * Unregisters all the global shortcuts. + */ + unregisterAll(): void; + } + + // https://github.com/electron/electron/blob/master/docs/api/ipc-main.md + + /** + * The ipcMain module handles asynchronous and synchronous messages + * sent from a renderer process (web page). + * Messages sent from a renderer will be emitted to this module. + */ + interface IpcMain extends NodeJS.EventEmitter { + addListener(channel: string, listener: IpcMainEventListener): this; + on(channel: string, listener: IpcMainEventListener): this; + once(channel: string, listener: IpcMainEventListener): this; + removeListener(channel: string, listener: IpcMainEventListener): this; + removeAllListeners(channel?: string): this; + } + + type IpcMainEventListener = (event: IpcMainEvent, ...args: any[]) => void; + + interface IpcMainEvent { + /** + * Set this to the value to be returned in a synchronous message. + */ + returnValue?: any; + /** + * Returns the webContents that sent the message, you can call sender.send + * to reply to the asynchronous message. + */ + sender: WebContents; + } + + // https://github.com/electron/electron/blob/master/docs/api/ipc-renderer.md + + /** + * The ipcRenderer module provides a few methods so you can send synchronous + * and asynchronous messages from the render process (web page) to the main process. + * You can also receive replies from the main process. + */ + interface IpcRenderer extends NodeJS.EventEmitter { + addListener(channel: string, listener: IpcRendererEventListener): this; + on(channel: string, listener: IpcRendererEventListener): this; + once(channel: string, listener: IpcRendererEventListener): this; + removeListener(channel: string, listener: IpcRendererEventListener): this; + removeAllListeners(channel?: string): this; + /** + * Send ...args to the renderer via channel in asynchronous message, the main + * process can handle it by listening to the channel event of ipc module. + */ + send(channel: string, ...args: any[]): void; + /** + * Send ...args to the renderer via channel in synchronous message, and returns + * the result sent from main process. The main process can handle it by listening + * to the channel event of ipc module, and returns by setting event.returnValue. + * Note: Usually developers should never use this API, since sending synchronous + * message would block the whole renderer process. + * @returns The result sent from the main process. + */ + sendSync(channel: string, ...args: any[]): any; + /** + * Like ipc.send but the message will be sent to the host page instead of the main process. + * This is mainly used by the page in to communicate with host page. + */ + sendToHost(channel: string, ...args: any[]): void; + } + + type IpcRendererEventListener = (event: IpcRendererEvent, ...args: any[]) => void; + + interface IpcRendererEvent { + /** + * You can call sender.send to reply to the asynchronous message. + */ + sender: IpcRenderer; + } + + // https://github.com/electron/electron/blob/master/docs/api/menu-item.md + // https://github.com/electron/electron/blob/master/docs/api/accelerator.md + + /** + * The MenuItem allows you to add items to an application or context menu. + */ + class MenuItem { + /** + * Create a new menu item. + */ + constructor(options: MenuItemOptions); + + click: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; + /** + * Read-only property. + */ + type: MenuItemType; + /** + * Read-only property. + */ + role: MenuItemRole | MenuItemRoleMac; + /** + * Read-only property. + */ + accelerator: string; + /** + * Read-only property. + */ + icon: NativeImage | string; + /** + * Read-only property. + */ + submenu: Menu | MenuItemOptions[]; + + label: string; + sublabel: string; + enabled: boolean; + visible: boolean; + checked: boolean; + } + + type MenuItemType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio'; + type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close' | 'quit' | 'togglefullscreen' | 'resetzoom' | 'zoomin' | 'zoomout'; + type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'startspeaking' | 'stopspeaking' | 'front' | 'zoom' | 'window' | 'help' | 'services'; + + interface MenuItemOptions { + /** + * Callback when the menu item is clicked. + */ + click?: (menuItem: MenuItem, browserWindow: BrowserWindow) => void; + /** + * Can be normal, separator, submenu, checkbox or radio. + */ + type?: MenuItemType; + label?: string; + sublabel?: string; + /** + * An accelerator is string that represents a keyboard shortcut, it can contain + * multiple modifiers and key codes, combined by the + character. + * + * Examples: + * CommandOrControl+A + * CommandOrControl+Shift+Z + * + * Platform notice: + * On Linux and Windows, the Command key would not have any effect, + * you can use CommandOrControl which represents Command on macOS and Control on + * Linux and Windows to define some accelerators. + * + * Use Alt instead of Option. The Option key only exists on macOS, whereas + * the Alt key is available on all platforms. + * + * The Super key is mapped to the Windows key on Windows and Linux and Cmd on macOS. + * + * Available modifiers: + * Command (or Cmd for short) + * Control (or Ctrl for short) + * CommandOrControl (or CmdOrCtrl for short) + * Alt + * Option + * AltGr + * Shift + * Super + * + * Available key codes: + * 0 to 9 + * A to Z + * F1 to F24 + * Punctuations like ~, !, @, #, $, etc. + * Plus + * Space + * Tab + * Backspace + * Delete + * Insert + * Return (or Enter as alias) + * Up, Down, Left and Right + * Home and End + * PageUp and PageDown + * Escape (or Esc for short) + * VolumeUp, VolumeDown and VolumeMute + * MediaNextTrack, MediaPreviousTrack, MediaStop and MediaPlayPause + * PrintScreen + */ + accelerator?: string; + /** + * In Electron for the APIs that take images, you can pass either file paths + * or NativeImage instances. When passing null, an empty image will be used. + */ + icon?: NativeImage|string; + /** + * If false, the menu item will be greyed out and unclickable. + */ + enabled?: boolean; + /** + * If false, the menu item will be entirely hidden. + */ + visible?: boolean; + /** + * Should only be specified for 'checkbox' or 'radio' type menu items. + */ + checked?: boolean; + /** + * Should be specified for submenu type menu item, when it's specified the + * type: 'submenu' can be omitted for the menu item + */ + submenu?: Menu|MenuItemOptions[]; + /** + * Unique within a single menu. If defined then it can be used as a reference + * to this item by the position attribute. + */ + id?: string; + /** + * This field allows fine-grained definition of the specific location within + * a given menu. + */ + position?: string; + /** + * Define the action of the menu item, when specified the click property will be ignored + */ + role?: MenuItemRole | MenuItemRoleMac; + } + + // https://github.com/electron/electron/blob/master/docs/api/menu.md + + /** + * The Menu class is used to create native menus that can be used as application + * menus and context menus. This module is a main process module which can be used + * in a render process via the remote module. + * + * Each menu consists of multiple menu items, and each menu item can have a submenu. + */ + class Menu extends NodeJS.EventEmitter { + /** + * Creates a new menu. + */ + constructor(); + /** + * Sets menu as the application menu on macOS. On Windows and Linux, the menu + * will be set as each window's top menu. + */ + static setApplicationMenu(menu: Menu): void; + /** + * @returns The application menu if set, or null if not set. + */ + static getApplicationMenu(): Menu; + /** + * Sends the action to the first responder of application. + * This is used for emulating default Cocoa menu behaviors, + * usually you would just use the role property of MenuItem. + * + * Note: This method is macOS only. + */ + static sendActionToFirstResponder(action: string): void; + /** + * @param template Generally, just an array of options for constructing MenuItem. + * You can also attach other fields to element of the template, and they will + * become properties of the constructed menu items. + */ + static buildFromTemplate(template: MenuItemOptions[]): Menu; + /** + * Pops up this menu as a context menu in the browserWindow. You can optionally + * provide a (x,y) coordinate to place the menu at, otherwise it will be placed + * at the current mouse cursor position. + * @param x Horizontal coordinate where the menu will be placed. + * @param y Vertical coordinate where the menu will be placed. + */ + popup(browserWindow?: BrowserWindow, x?: number, y?: number): void; + /** + * Appends the menuItem to the menu. + */ + append(menuItem: MenuItem): void; + /** + * Inserts the menuItem to the pos position of the menu. + */ + insert(position: number, menuItem: MenuItem): void; + /** + * @returns an array containing the menu’s items. + */ + items: MenuItem[]; + } + + // https://github.com/electron/electron/blob/master/docs/api/native-image.md + + /** + * This class is used to represent an image. + */ + class NativeImage { + /** + * Creates an empty NativeImage instance. + */ + static createEmpty(): NativeImage; + /** + * Creates a new NativeImage instance from file located at path. + * This method returns an empty image if the path does not exist, cannot be read, or is not a valid image. + */ + static createFromPath(path: string): NativeImage; + /** + * Creates a new NativeImage instance from buffer. + * @param scaleFactor 1.0 by default. + */ + static createFromBuffer(buffer: Buffer, scaleFactor?: number): NativeImage; + /** + * Creates a new NativeImage instance from dataURL + */ + static createFromDataURL(dataURL: string): NativeImage; + /** + * @returns Buffer that contains the image's PNG encoded data. + */ + toPNG(): Buffer; + /** + * @returns Buffer that contains the image's JPEG encoded data. + */ + toJPEG(quality: number): Buffer; + /** + * @returns Buffer that contains a copy of the image's raw bitmap pixel data. + */ + toBitmap(): Buffer; + /** + * @returns Buffer that contains the image's raw bitmap pixel data. + * + * The difference between getBitmap() and toBitmap() is, getBitmap() does not copy the bitmap data, + * so you have to use the returned Buffer immediately in current event loop tick, + * otherwise the data might be changed or destroyed. + */ + getBitmap(): Buffer; + /** + * @returns The data URL of the image. + */ + toDataURL(): string; + /** + * The native type of the handle is NSImage* on macOS. + * Note: This is only implemented on macOS. + * @returns The platform-specific handle of the image as Buffer. + */ + getNativeHandle(): Buffer; + /** + * @returns Whether the image is empty. + */ + isEmpty(): boolean; + /** + * @returns The size of the image. + */ + getSize(): Size; + /** + * Marks the image as template image. + */ + setTemplateImage(option: boolean): void; + /** + * Returns a boolean whether the image is a template image. + */ + isTemplateImage(): boolean; + /** + * @param rect The area of the image to crop + * @returns The cropped image. + */ + crop(rect: Rectangle): NativeImage; + /** + * @returns The resized image. + * If only the height or the width are specified then the current aspect ratio will be preserved in the resized image. + */ + resize(options: { + width?: number; + height?: number; + /** + * The desired quality of the resized image. + * Default: best. + */ + quality?: 'good' | 'better' | 'best'; + }): NativeImage; + /** + * @returns The image's aspect ratio. + */ + getAspectRatio(): number; + } + + // https://github.com/electron/electron/blob/master/docs/api/power-monitor.md + + /** + * The power-monitor module is used to monitor power state changes. + * You should not use this module until the ready event of the app module is emitted. + */ + interface PowerMonitor extends NodeJS.EventEmitter { + /** + * Emitted when the system is suspending. + */ + on(event: 'suspend', listener: Function): this; + /** + * Emitted when system is resuming. + */ + on(event: 'resume', listener: Function): this; + /** + * Emitted when the system changes to AC power. + */ + on(event: 'on-ac', listener: Function): this; + /** + * Emitted when system changes to battery power. + */ + on(event: 'on-battery', listener: Function): this; + on(event: string, listener: Function): this; + } + + // https://github.com/electron/electron/blob/master/docs/api/power-save-blocker.md + + /** + * The powerSaveBlocker module is used to block the system from entering + * low-power (sleep) mode and thus allowing the app to keep the system and screen active. + */ + interface PowerSaveBlocker { + /** + * Starts preventing the system from entering lower-power mode. + * @returns The blocker ID that is assigned to this power blocker. + * Note: prevent-display-sleep has higher has precedence over prevent-app-suspension. + */ + start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number; + /** + * @param id The power save blocker id returned by powerSaveBlocker.start. + * Stops the specified power save blocker. + */ + stop(id: number): void; + /** + * @param id The power save blocker id returned by powerSaveBlocker.start. + * @returns Whether the corresponding powerSaveBlocker has started. + */ + isStarted(id: number): boolean; + } + + // https://github.com/electron/electron/blob/master/docs/api/protocol.md + + /** + * The protocol module can register a custom protocol or intercept an existing protocol. + */ + interface Protocol { + /** + * Registers custom schemes as standard schemes. + */ + registerStandardSchemes(schemes: string[]): void; + /** + * Registers custom schemes to handle service workers. + */ + registerServiceWorkerSchemes(schemes: string[]): void; + /** + * Registers a protocol of scheme that will send the file as a response. + */ + registerFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; + /** + * Registers a protocol of scheme that will send a Buffer as a response. + */ + registerBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; + /** + * Registers a protocol of scheme that will send a String as a response. + */ + registerStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; + /** + * Registers a protocol of scheme that will send an HTTP request as a response. + */ + registerHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; + /** + * Unregisters the custom protocol of scheme. + */ + unregisterProtocol(scheme: string, completion?: (error: Error) => void): void; + /** + * The callback will be called with a boolean that indicates whether there is already a handler for scheme. + */ + isProtocolHandled(scheme: string, callback: (handled: boolean) => void): void; + /** + * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a file as a response. + */ + interceptFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; + /** + * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a Buffer as a response. + */ + interceptBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; + /** + * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a String as a response. + */ + interceptStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; + /** + * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a new HTTP request as a response. + */ + interceptHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; + /** + * Remove the interceptor installed for scheme and restore its original handler. + */ + uninterceptProtocol(scheme: string, completion?: (error: Error) => void): void; + } + + type FileProtocolHandler = (request: ProtocolRequest, callback: FileProtocolCallback) => void; + type BufferProtocolHandler = (request: ProtocolRequest, callback: BufferProtocolCallback) => void; + type StringProtocolHandler = (request: ProtocolRequest, callback: StringProtocolCallback) => void; + type HttpProtocolHandler = (request: ProtocolRequest, callback: HttpProtocolCallback) => void; + + interface ProtocolRequest { + url: string; + referrer: string; + method: string; + uploadData?: { + /** + * Content being sent. + */ + bytes: Buffer, + /** + * Path of file being uploaded. + */ + file: string, + /** + * UUID of blob data. Use session.getBlobData method to retrieve the data. + */ + blobUUID: string; + }[]; + } + + interface ProtocolCallback { + (error: number): void; + (obj: { + error: number + }): void; + (): void; + } + + interface FileProtocolCallback extends ProtocolCallback { + (filePath: string): void; + (obj: { + path: string + }): void; + } + + interface BufferProtocolCallback extends ProtocolCallback { + (buffer: Buffer): void; + (obj: { + data: Buffer, + mimeType: string, + charset?: string + }): void; + } + + interface StringProtocolCallback extends ProtocolCallback { + (str: string): void; + (obj: { + data: Buffer, + mimeType: string, + charset?: string + }): void; + } + + interface HttpProtocolCallback extends ProtocolCallback { + (redirectRequest: { + url: string; + method: string; + session?: Object; + uploadData?: { + contentType: string; + data: string; + }; + }): void; + } + + // https://github.com/electron/electron/blob/master/docs/api/remote.md + + /** + * The remote module provides a simple way to do inter-process communication (IPC) + * between the renderer process (web page) and the main process. + */ + interface Remote extends CommonElectron { + /** + * @returns The object returned by require(module) in the main process. + */ + require(module: string): any; + /** + * @returns The BrowserWindow object which this web page belongs to. + */ + getCurrentWindow(): BrowserWindow; + /** + * @returns The WebContents object of this web page. + */ + getCurrentWebContents(): WebContents; + /** + * @returns The global variable of name (e.g. global[name]) in the main process. + */ + getGlobal(name: string): any; + /** + * Returns the process object in the main process. This is the same as + * remote.getGlobal('process'), but gets cached. + */ + process: NodeJS.Process; + } + + // https://github.com/electron/electron/blob/master/docs/api/screen.md + + /** + * The Display object represents a physical display connected to the system. + * A fake Display may exist on a headless system, or a Display may correspond to a remote, virtual display. + */ + interface Display { + /** + * Unique identifier associated with the display. + */ + id: number; + bounds: Rectangle; + workArea: Rectangle; + size: Size; + workAreaSize: Size; + /** + * Output device’s pixel scale factor. + */ + scaleFactor: number; + /** + * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees. + */ + rotation: number; + touchSupport: 'available' | 'unavailable' | 'unknown'; + } + + type DisplayMetrics = 'bounds' | 'workArea' | 'scaleFactor' | 'rotation'; + + /** + * The screen module retrieves information about screen size, displays, cursor position, etc. + * You can not use this module until the ready event of the app module is emitted. + */ + interface Screen extends NodeJS.EventEmitter { + /** + * Emitted when newDisplay has been added. + */ + on(event: 'display-added', listener: (event: Event, newDisplay: Display) => void): this; + /** + * Emitted when oldDisplay has been removed. + */ + on(event: 'display-removed', listener: (event: Event, oldDisplay: Display) => void): this; + /** + * Emitted when one or more metrics change in a display. + */ + on(event: 'display-metrics-changed', listener: (event: Event, display: Display, changedMetrics: DisplayMetrics[]) => void): this; + on(event: string, listener: Function): this; + /** + * @returns The current absolute position of the mouse pointer. + */ + getCursorScreenPoint(): Point; + /** + * @returns The primary display. + */ + getPrimaryDisplay(): Display; + /** + * @returns An array of displays that are currently available. + */ + getAllDisplays(): Display[]; + /** + * @returns The display nearest the specified point. + */ + getDisplayNearestPoint(point: Point): Display; + /** + * @returns The display that most closely intersects the provided bounds. + */ + getDisplayMatching(rect: Rectangle): Display; + } + + // https://github.com/electron/electron/blob/master/docs/api/session.md + + /** + * The session module can be used to create new Session objects. + * You can also access the session of existing pages by using + * the session property of webContents which is a property of BrowserWindow. + */ + class Session extends NodeJS.EventEmitter { + /** + * @returns a new Session instance from partition string. + */ + static fromPartition(partition: string, options?: FromPartitionOptions): Session; + /** + * @returns the default session object of the app. + */ + static defaultSession: Session; + /** + * Emitted when Electron is about to download item in webContents. + * Calling event.preventDefault() will cancel the download + * and item will not be available from next tick of the process. + */ + on(event: 'will-download', listener: (event: Event, item: DownloadItem, webContents: WebContents) => void): this; + on(event: string, listener: Function): this; + /** + * The cookies gives you ability to query and modify cookies. + */ + cookies: SessionCookies; + /** + * @returns the session’s current cache size. + */ + getCacheSize(callback: (size: number) => void): void; + /** + * Clears the session’s HTTP cache. + */ + clearCache(callback: Function): void; + /** + * Clears the data of web storages. + */ + clearStorageData(callback: Function): void; + /** + * Clears the data of web storages. + */ + clearStorageData(options: ClearStorageDataOptions, callback: Function): void; + /** + * Writes any unwritten DOMStorage data to disk. + */ + flushStorageData(): void; + /** + * Sets the proxy settings. + */ + setProxy(config: ProxyConfig, callback: Function): void; + /** + * Resolves the proxy information for url. + */ + resolveProxy(url: URL, callback: (proxy: string) => void): void; + /** + * Sets download saving directory. + * By default, the download directory will be the Downloads under the respective app folder. + */ + setDownloadPath(path: string): void; + /** + * Emulates network with the given configuration for the session. + */ + enableNetworkEmulation(options: NetworkEmulationOptions): void; + /** + * Disables any network emulation already active for the session. + * Resets to the original network configuration. + */ + disableNetworkEmulation(): void; + /** + * Sets the certificate verify proc for session, the proc will be called + * whenever a server certificate verification is requested. + * + * Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc. + */ + setCertificateVerifyProc(proc: (hostname: string, cert: Certificate, callback: (accepted: boolean) => void) => void): void; + /** + * Sets the handler which can be used to respond to permission requests for the session. + */ + setPermissionRequestHandler(handler: (webContents: WebContents, permission: Permission, callback: (allow: boolean) => void) => void): void; + /** + * Clears the host resolver cache. + */ + clearHostResolverCache(callback: Function): void; + /** + * Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication. + * @param domains Comma-seperated list of servers for which integrated authentication is enabled. + */ + allowNTLMCredentialsForDomains(domains: string): void; + /** + * Overrides the userAgent and acceptLanguages for this session. + * The acceptLanguages must a comma separated ordered list of language codes, for example "en-US,fr,de,ko,zh-CN,ja". + * This doesn't affect existing WebContents, and each WebContents can use webContents.setUserAgent to override the session-wide user agent. + */ + setUserAgent(userAgent: string, acceptLanguages?: string): void; + /** + * @returns The user agent for this session. + */ + getUserAgent(): string; + /** + * Returns the blob data associated with the identifier. + */ + getBlobData(identifier: string, callback: (result: Buffer) => void): void; + /** + * The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime. + */ + webRequest: WebRequest; + /** + * @returns An instance of protocol module for this session. + */ + protocol: Protocol; + } + + type Permission = 'media' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal'; + + interface FromPartitionOptions { + /** + * Whether to enable cache. + */ + cache?: boolean; + } + + interface ClearStorageDataOptions { + /** + * Should follow window.location.origin’s representation scheme://host:port. + */ + origin?: string; + /** + * The types of storages to clear. + */ + storages?: ('appcache' | 'cookies' | 'filesystem' | 'indexdb' | 'localstorage' | 'shadercache' | 'websql' | 'serviceworkers')[]; + /** + * The types of quotas to clear. + */ + quotas?: ('temporary' | 'persistent' | 'syncable')[]; + } + + interface ProxyConfig { + /** + * The URL associated with the PAC file. + */ + pacScript: string; + /** + * Rules indicating which proxies to use. + */ + proxyRules: string; + /** + * Rules indicating which URLs should bypass the proxy settings. + */ + proxyBypassRules: string; + } + + interface NetworkEmulationOptions { + /** + * Whether to emulate network outage. + * Default: false. + */ + offline?: boolean; + /** + * RTT in ms. + * Default: 0, which will disable latency throttling. + */ + latency?: number; + /** + * Download rate in Bps. + * Default: 0, which will disable download throttling. + */ + downloadThroughput?: number; + /** + * Upload rate in Bps. + * Default: 0, which will disable upload throttling. + */ + uploadThroughput?: number; + } + + interface CookieFilter { + /** + * Retrieves cookies which are associated with url. Empty implies retrieving cookies of all urls. + */ + url?: string; + /** + * Filters cookies by name. + */ + name?: string; + /** + * Retrieves cookies whose domains match or are subdomains of domains. + */ + domain?: string; + /** + * Retrieves cookies whose path matches path. + */ + path?: string; + /** + * Filters cookies by their Secure property. + */ + secure?: boolean; + /** + * Filters out session or persistent cookies. + */ + session?: boolean; + } + + interface Cookie { + /** + * Emitted when a cookie is changed because it was added, edited, removed, or expired. + */ + on(event: 'changed', listener: (event: Event, cookie: Cookie, cause: CookieChangedCause) => void): this; + on(event: string, listener: Function): this; + /** + * The name of the cookie. + */ + name: string; + /** + * The value of the cookie. + */ + value: string; + /** + * The domain of the cookie. + */ + domain: string; + /** + * Whether the cookie is a host-only cookie. + */ + hostOnly: string; + /** + * The path of the cookie. + */ + path: string; + /** + * Whether the cookie is marked as secure. + */ + secure: boolean; + /** + * Whether the cookie is marked as HTTP only. + */ + httpOnly: boolean; + /** + * Whether the cookie is a session cookie or a persistent cookie with an expiration date. + */ + session: boolean; + /** + * The expiration date of the cookie as the number of seconds since the UNIX epoch. + * Not provided for session cookies. + */ + expirationDate?: number; + } + + type CookieChangedCause = 'explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite'; + + interface CookieDetails { + /** + * The URL associated with the cookie. + */ + url: string; + /** + * The name of the cookie. + * Default: empty. + */ + name?: string; + /** + * The value of the cookie. + * Default: empty. + */ + value?: string; + /** + * The domain of the cookie. + * Default: empty. + */ + domain?: string; + /** + * The path of the cookie. + * Default: empty. + */ + path?: string; + /** + * Whether the cookie should be marked as secure. + * Default: false. + */ + secure?: boolean; + /** + * Whether the cookie should be marked as HTTP only. + * Default: false. + */ + httpOnly?: boolean; + /** + * The expiration date of the cookie as the number of seconds since the UNIX epoch. + * If omitted, the cookie becomes a session cookie. + */ + expirationDate?: number; + } + + interface SessionCookies { + /** + * Sends a request to get all cookies matching filter. + */ + get(filter: CookieFilter, callback: (error: Error, cookies: Cookie[]) => void): void; + /** + * Sets the cookie with details. + */ + set(details: CookieDetails, callback: (error: Error) => void): void; + /** + * Removes the cookies matching url and name. + */ + remove(url: string, name: string, callback: (error: Error) => void): void; + } + + /** + * Each API accepts an optional filter and a listener, the listener will be called when the API's event has happened. + * Passing null as listener will unsubscribe from the event. + * + * The filter will be used to filter out the requests that do not match the URL patterns. + * If the filter is omitted then all requests will be matched. + * + * For certain events the listener is passed with a callback, + * which should be called with an response object when listener has done its work. + */ + interface WebRequest { + /** + * The listener will be called when a request is about to occur. + */ + onBeforeRequest(listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; + /** + * The listener will be called when a request is about to occur. + */ + onBeforeRequest(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; + /** + * The listener will be called before sending an HTTP request, once the request headers are available. + * This may occur after a TCP connection is made to the server, but before any http data is sent. + */ + onBeforeSendHeaders(listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; + /** + * The listener will be called before sending an HTTP request, once the request headers are available. + * This may occur after a TCP connection is made to the server, but before any http data is sent. + */ + onBeforeSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; + /** + * The listener will be called just before a request is going to be sent to the server, + * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. + */ + onSendHeaders(listener: (details: WebRequest.SendHeadersDetails) => void): void; + /** + * The listener will be called just before a request is going to be sent to the server, + * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. + */ + onSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.SendHeadersDetails) => void): void; + /** + * The listener will be called when HTTP response headers of a request have been received. + */ + onHeadersReceived(listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; + /** + * The listener will be called when HTTP response headers of a request have been received. + */ + onHeadersReceived(filter: WebRequest.Filter, listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; + /** + * The listener will be called when first byte of the response body is received. + * For HTTP requests, this means that the status line and response headers are available. + */ + onResponseStarted(listener: (details: WebRequest.ResponseStartedDetails) => void): void; + /** + * The listener will be called when first byte of the response body is received. + * For HTTP requests, this means that the status line and response headers are available. + */ + onResponseStarted(filter: WebRequest.Filter, listener: (details: WebRequest.ResponseStartedDetails) => void): void; + /** + * The listener will be called when a server initiated redirect is about to occur. + */ + onBeforeRedirect(listener: (details: WebRequest.BeforeRedirectDetails) => void): void; + /** + * The listener will be called when a server initiated redirect is about to occur. + */ + onBeforeRedirect(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRedirectDetails) => void): void; + /** + * The listener will be called when a request is completed. + */ + onCompleted(listener: (details: WebRequest.CompletedDetails) => void): void; + /** + * The listener will be called when a request is completed. + */ + onCompleted(filter: WebRequest.Filter, listener: (details: WebRequest.CompletedDetails) => void): void; + /** + * The listener will be called when an error occurs. + */ + onErrorOccurred(listener: (details: WebRequest.ErrorOccurredDetails) => void): void; + /** + * The listener will be called when an error occurs. + */ + onErrorOccurred(filter: WebRequest.Filter, listener: (details: WebRequest.ErrorOccurredDetails) => void): void; + } + + namespace WebRequest { + interface Filter { + urls: string[]; + } + + interface Details { + id: number; + url: string; + method: string; + resourceType: string; + timestamp: number; + } + + interface UploadData { + /** + * Content being sent. + */ + bytes: Buffer; + /** + * Path of file being uploaded. + */ + file: string; + /** + * UUID of blob data. Use session.getBlobData method to retrieve the data. + */ + blobUUID: string; + } + + interface BeforeRequestDetails extends Details { + uploadData?: UploadData[]; + } + + type BeforeRequestCallback = (response: { + cancel?: boolean; + /** + * The original request is prevented from being sent or completed, and is instead redirected to the given URL. + */ + redirectURL?: string; + }) => void; + + interface BeforeSendHeadersDetails extends Details { + requestHeaders: Headers; + } + + type BeforeSendHeadersCallback = (response: { + cancel?: boolean; + /** + * When provided, request will be made with these headers. + */ + requestHeaders?: Headers; + }) => void; + + interface SendHeadersDetails extends Details { + requestHeaders: Headers; + } + + interface HeadersReceivedDetails extends Details { + statusLine: string; + statusCode: number; + responseHeaders: Headers; + } + + type HeadersReceivedCallback = (response: { + cancel?: boolean; + /** + * When provided, the server is assumed to have responded with these headers. + */ + responseHeaders?: Headers; + /** + * Should be provided when overriding responseHeaders to change header status + * otherwise original response header's status will be used. + */ + statusLine?: string; + }) => void; + + interface ResponseStartedDetails extends Details { + responseHeaders: Headers; + fromCache: boolean; + statusCode: number; + statusLine: string; + } + + interface BeforeRedirectDetails extends Details { + redirectURL: string; + statusCode: number; + ip?: string; + fromCache: boolean; + responseHeaders: Headers; + } + + interface CompletedDetails extends Details { + responseHeaders: Headers; + fromCache: boolean; + statusCode: number; + statusLine: string; + } + + interface ErrorOccurredDetails extends Details { + fromCache: boolean; + error: string; + } + } + + // https://github.com/electron/electron/blob/master/docs/api/shell.md + + /** + * The shell module provides functions related to desktop integration. + */ + interface Shell { + /** + * Show the given file in a file manager. If possible, select the file. + * @returns Whether the item was successfully shown. + */ + showItemInFolder(fullPath: string): boolean; + /** + * Open the given file in the desktop's default manner. + * @returns Whether the item was successfully shown. + */ + openItem(fullPath: string): boolean; + /** + * Open the given external protocol URL in the desktop's default manner + * (e.g., mailto: URLs in the default mail user agent). + * @returns Whether an application was available to open the URL. + */ + openExternal(url: string, options?: { + /** + * Bring the opened application to the foreground. + * Default: true. + */ + activate: boolean; + }): boolean; + /** + * Move the given file to trash. + * @returns Whether the item was successfully moved to the trash. + */ + moveItemToTrash(fullPath: string): boolean; + /** + * Play the beep sound. + */ + beep(): void; + /** + * Creates or updates a shortcut link at shortcutPath. + * + * Note: This API is available only on Windows. + */ + writeShortcutLink(shortcutPath: string, options: ShortcutLinkOptions): boolean; + /** + * Creates or updates a shortcut link at shortcutPath. + * + * Note: This API is available only on Windows. + */ + writeShortcutLink(shortcutPath: string, operation: 'create' | 'update' | 'replace', options: ShortcutLinkOptions): boolean; + /** + * Resolves the shortcut link at shortcutPath. + * An exception will be thrown when any error happens. + * + * Note: This API is available only on Windows. + */ + readShortcutLink(shortcutPath: string): ShortcutLinkOptions; + } + + interface ShortcutLinkOptions { + /** + * The target to launch from this shortcut. + */ + target: string; + /** + * The working directory. + * Default: empty. + */ + cwd?: string; + /** + * The arguments to be applied to target when launching from this shortcut. + * Default: empty. + */ + args?: string; + /** + * The description of the shortcut. + * Default: empty. + */ + description?: string; + /** + * The path to the icon, can be a DLL or EXE. icon and iconIndex have to be set together. + * Default: empty, which uses the target's icon. + */ + icon?: string; + /** + * The resource ID of icon when icon is a DLL or EXE. + * Default: 0. + */ + iconIndex?: number; + /** + * The Application User Model ID. + * Default: empty. + */ + appUserModelId?: string; + } + + // https://github.com/electron/electron/blob/master/docs/api/system-preferences.md + + type SystemColor = + '3d-dark-shadow' | // Dark shadow for three-dimensional display elements. + '3d-face' | // Face color for three-dimensional display elements and for dialog box backgrounds. + '3d-highlight' | // Highlight color for three-dimensional display elements. + '3d-light' | // Light color for three-dimensional display elements. + '3d-shadow' | // Shadow color for three-dimensional display elements. + 'active-border' | // Active window border. + 'active-caption' | // Active window title bar. Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled. + 'active-caption-gradient' | // Right side color in the color gradient of an active window's title bar. + 'app-workspace' | // Background color of multiple document interface (MDI) applications. + 'button-text' | // Text on push buttons. + 'caption-text' | // Text in caption, size box, and scroll bar arrow box. + 'desktop' | // Desktop background color. + 'disabled-text' | // Grayed (disabled) text. + 'highlight' | // Item(s) selected in a control. + 'highlight-text' | // Text of item(s) selected in a control. + 'hotlight' | // Color for a hyperlink or hot-tracked item. + 'inactive-border' | // Inactive window border. + 'inactive-caption' | // Inactive window caption. Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled. + 'inactive-caption-gradient' | // Right side color in the color gradient of an inactive window's title bar. + 'inactive-caption-text' | // Color of text in an inactive caption. + 'info-background' | // Background color for tooltip controls. + 'info-text' | // Text color for tooltip controls. + 'menu' | // Menu background. + 'menu-highlight' | // The color used to highlight menu items when the menu appears as a flat menu. + 'menubar' | // The background color for the menu bar when menus appear as flat menus. + 'menu-text' | // Text in menus. + 'scrollbar' | // Scroll bar gray area. + 'window' | // Window background. + 'window-frame' | // Window frame. + 'window-text'; // Text in windows. + + /** + * Get system preferences. + */ + interface SystemPreferences { + /** + * Note: This is only implemented on Windows. + */ + on(event: 'accent-color-changed', listener: (event: Event, newColor: string) => void): this; + /** + * Note: This is only implemented on Windows. + */ + on(event: 'color-changed', listener: (event: Event) => void): this; + /** + * Note: This is only implemented on Windows. + */ + on(event: 'inverted-color-scheme-changed', listener: ( + event: Event, + /** + * @param invertedColorScheme true if an inverted color scheme, such as a high contrast theme, is being used, false otherwise. + */ + invertedColorScheme: boolean + ) => void): this; + on(event: string, listener: Function): this; + /** + * @returns Whether the system is in Dark Mode. + * + * Note: This is only implemented on macOS. + */ + isDarkMode(): boolean; + /** + * @returns Whether the Swipe between pages setting is on. + * + * Note: This is only implemented on macOS. + */ + isSwipeTrackingFromScrollEventsEnabled(): boolean; + /** + * Posts event as native notifications of macOS. + * The userInfo contains the user information dictionary sent along with the notification. + * + * Note: This is only implemented on macOS. + */ + postNotification(event: string, userInfo: Object): void; + /** + * Posts event as native notifications of macOS. + * The userInfo contains the user information dictionary sent along with the notification. + * + * Note: This is only implemented on macOS. + */ + postLocalNotification(event: string, userInfo: Object): void; + /** + * Subscribes to native notifications of macOS, callback will be called when the corresponding event happens. + * The id of the subscriber is returned, which can be used to unsubscribe the event. + * + * Note: This is only implemented on macOS. + */ + subscribeNotification(event: string, callback: (event: Event, userInfo: Object) => void): number; + /** + * Removes the subscriber with id. + * + * Note: This is only implemented on macOS. + */ + unsubscribeNotification(id: number): void; + /** + * Same as subscribeNotification, but uses NSNotificationCenter for local defaults. + */ + subscribeLocalNotification(event: string, callback: (event: Event, userInfo: Object) => void): number; + /** + * Same as unsubscribeNotification, but removes the subscriber from NSNotificationCenter. + */ + unsubscribeLocalNotification(id: number): void; + /** + * Get the value of key in system preferences. + * + * Note: This is only implemented on macOS. + */ + getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url' | 'array' | 'dictionary'): any; + /** + * @returns Whether DWM composition (Aero Glass) is enabled. + * + * Note: This is only implemented on Windows. + */ + isAeroGlassEnabled(): boolean; + /** + * @returns The users current system wide color preference in the form of an RGBA hexadecimal string. + * + * Note: This is only implemented on Windows. + */ + getAccentColor(): string; + /** + * @returns true if an inverted color scheme, such as a high contrast theme, is active, false otherwise. + * + * Note: This is only implemented on Windows. + */ + isInvertedColorScheme(): boolean; + /** + * @returns The system color setting in RGB hexadecimal form (#ABCDEF). See the Windows docs for more details. + * + * Note: This is only implemented on Windows. + */ + getColor(color: SystemColor): string; + } + + // https://github.com/electron/electron/blob/master/docs/api/tray.md + + /** + * A Tray represents an icon in an operating system's notification area. + */ + class Tray extends NodeJS.EventEmitter implements Destroyable { + /** + * Emitted when the tray icon is clicked. + * Note: The bounds payload is only implemented on macOS and Windows. + */ + on(event: 'click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; + /** + * Emitted when the tray icon is right clicked. + * Note: This is only implemented on macOS and Windows. + */ + on(event: 'right-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; + /** + * Emitted when the tray icon is double clicked. + * Note: This is only implemented on macOS and Windows. + */ + on(event: 'double-click', listener: (modifiers: Modifiers, bounds: Rectangle) => void): this; + /** + * Emitted when the tray balloon shows. + * Note: This is only implemented on Windows. + */ + on(event: 'balloon-show', listener: Function): this; + /** + * Emitted when the tray balloon is clicked. + * Note: This is only implemented on Windows. + */ + on(event: 'balloon-click', listener: Function): this; + /** + * Emitted when the tray balloon is closed because of timeout or user manually closes it. + * Note: This is only implemented on Windows. + */ + on(event: 'balloon-closed', listener: Function): this; + /** + * Emitted when any dragged items are dropped on the tray icon. + * Note: This is only implemented on macOS. + */ + on(event: 'drop', listener: Function): this; + /** + * Emitted when dragged files are dropped in the tray icon. + * Note: This is only implemented on macOS + */ + on(event: 'drop-files', listener: (event: Event, files: string[]) => void): this; + /** + * Emitted when dragged text is dropped in the tray icon. + * Note: This is only implemented on macOS + */ + on(event: 'drop-text', listener: (event: Event, text: string) => void): this; + /** + * Emitted when a drag operation enters the tray icon. + * Note: This is only implemented on macOS + */ + on(event: 'drag-enter', listener: Function): this; + /** + * Emitted when a drag operation exits the tray icon. + * Note: This is only implemented on macOS + */ + on(event: 'drag-leave', listener: Function): this; + /** + * Emitted when a drag operation ends on the tray or ends at another location. + * Note: This is only implemented on macOS + */ + on(event: 'drag-end', listener: Function): this; + on(event: string, listener: Function): this; + /** + * Creates a new tray icon associated with the image. + */ + constructor(image: NativeImage|string); + /** + * Destroys the tray icon immediately. + */ + destroy(): void; + /** + * Sets the image associated with this tray icon. + */ + setImage(image: NativeImage|string): void; + /** + * Sets the image associated with this tray icon when pressed. + */ + setPressedImage(image: NativeImage): void; + /** + * Sets the hover text for this tray icon. + */ + setToolTip(toolTip: string): void; + /** + * Sets the title displayed aside of the tray icon in the status bar. + * Note: This is only implemented on macOS. + */ + setTitle(title: string): void; + /** + * Sets when the tray's icon background becomes highlighted. + * Note: This is only implemented on macOS. + */ + setHighlightMode(mode: 'selection' | 'always' | 'never'): void; + /** + * Displays a tray balloon. + * Note: This is only implemented on Windows. + */ + displayBalloon(options?: { + icon?: NativeImage; + title?: string; + content?: string; + }): void; + /** + * Pops up the context menu of tray icon. When menu is passed, + * the menu will showed instead of the tray's context menu. + * The position is only available on Windows, and it is (0, 0) by default. + * Note: This is only implemented on macOS and Windows. + */ + popUpContextMenu(menu?: Menu, position?: Point): void; + /** + * Sets the context menu for this icon. + */ + setContextMenu(menu: Menu): void; + /** + * @returns The bounds of this tray icon. + */ + getBounds(): Rectangle; + /** + * @returns Whether the tray icon is destroyed. + */ + isDestroyed(): boolean; + } + + interface Modifiers { + altKey: boolean; + shiftKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + } + + interface DragItem { + /** + * The absolute path of the file to be dragged + */ + file: string; + /** + * The image showing under the cursor when dragging. + */ + icon: NativeImage; + } + + // https://github.com/electron/electron/blob/master/docs/api/web-contents.md + + interface WebContentsStatic { + /** + * @returns An array of all WebContents instances. This will contain web contents for all windows, + * webviews, opened devtools, and devtools extension background pages. + */ + getAllWebContents(): WebContents[]; + /** + * @returns The web contents that is focused in this application, otherwise returns null. + */ + getFocusedWebContents(): WebContents; + /** + * Find a WebContents instance according to its ID. + */ + fromId(id: number): WebContents; + } + + /** + * A WebContents is responsible for rendering and controlling a web page. + */ + interface WebContents extends NodeJS.EventEmitter { + /** + * Emitted when the navigation is done, i.e. the spinner of the tab has stopped spinning, + * and the onload event was dispatched. + */ + on(event: 'did-finish-load', listener: Function): this; + /** + * This event is like did-finish-load but emitted when the load failed or was cancelled, + * e.g. window.stop() is invoked. + */ + on(event: 'did-fail-load', listener: (event: Event, errorCode: number, errorDescription: string, validatedURL: string, isMainFrame: boolean) => void): this; + /** + * Emitted when a frame has done navigation. + */ + on(event: 'did-frame-finish-load', listener: (event: Event, isMainFrame: boolean) => void): this; + /** + * Corresponds to the points in time when the spinner of the tab started spinning. + */ + on(event: 'did-start-loading', listener: Function): this; + /** + * Corresponds to the points in time when the spinner of the tab stopped spinning. + */ + on(event: 'did-stop-loading', listener: Function): this; + /** + * Emitted when details regarding a requested resource are available. + * status indicates the socket connection to download the resource. + */ + on(event: 'did-get-response-details', listener: (event: Event, + status: boolean, + newURL: string, + originalURL: string, + httpResponseCode: number, + requestMethod: string, + referrer: string, + headers: Headers, + resourceType: string + ) => void): this; + /** + * Emitted when a redirect is received while requesting a resource. + */ + on(event: 'did-get-redirect-request', listener: (event: Event, + oldURL: string, + newURL: string, + isMainFrame: boolean, + httpResponseCode: number, + requestMethod: string, + referrer: string, + headers: Headers + ) => void): this; + /** + * Emitted when the document in the given frame is loaded. + */ + on(event: 'dom-ready', listener: (event: Event) => void): this; + /** + * Emitted when page receives favicon URLs. + */ + on(event: 'page-favicon-updated', listener: (event: Event, favicons: string[]) => void): this; + /** + * Emitted when the page requests to open a new window for a url. + * It could be requested by window.open or an external link like . + * + * By default a new BrowserWindow will be created for the url. + * + * Calling event.preventDefault() will prevent creating new windows. + * In such case, the event.newGuest may be set with a reference + * to a BrowserWindow instance to make it used by the Electron's runtime. + */ + on(event: 'new-window', listener: (event: WebContents.NewWindowEvent, + url: string, + frameName: string, + disposition: NewWindowDisposition, + /** + * The options which will be used for creating the new BrowserWindow. + */ + options: BrowserWindowOptions, + /** + * The non-standard features (features not handled by Chromium or Electron) given to window.open(). + */ + additionalFeatures: string[] + ) => void): this; + /** + * Emitted when a user or the page wants to start navigation. + * It can happen when the window.location object is changed or a user clicks a link in the page. + * + * This event will not emit when the navigation is started programmatically with APIs like + * webContents.loadURL and webContents.back. + * + * It is also not emitted for in-page navigations, such as clicking anchor links + * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. + * + * Calling event.preventDefault() will prevent the navigation. + */ + on(event: 'will-navigate', listener: (event: Event, url: string) => void): this; + /** + * Emitted when a navigation is done. + * + * This event is not emitted for in-page navigations, such as clicking anchor links + * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. + */ + on(event: 'did-navigate', listener: (event: Event, url: string) => void): this; + /** + * Emitted when an in-page navigation happened. + * + * When in-page navigation happens, the page URL changes but does not cause + * navigation outside of the page. Examples of this occurring are when anchor links + * are clicked or when the DOM hashchange event is triggered. + */ + on(event: 'did-navigate-in-page', listener: (event: Event, url: string, isMainFrame: boolean) => void): this; + /** + * Emitted when the renderer process has crashed. + */ + on(event: 'crashed', listener: (event: Event, killed: boolean) => void): this; + /** + * Emitted when a plugin process has crashed. + */ + on(event: 'plugin-crashed', listener: (event: Event, name: string, version: string) => void): this; + /** + * Emitted when webContents is destroyed. + */ + on(event: 'destroyed', listener: Function): this; + /** + * Emitted when DevTools is opened. + */ + on(event: 'devtools-opened', listener: Function): this; + /** + * Emitted when DevTools is closed. + */ + on(event: 'devtools-closed', listener: Function): this; + /** + * Emitted when DevTools is focused / opened. + */ + on(event: 'devtools-focused', listener: Function): this; + /** + * Emitted when failed to verify the certificate for url. + * The usage is the same with the "certificate-error" event of app. + */ + on(event: 'certificate-error', listener: (event: Event, + url: string, + error: string, + certificate: Certificate, + callback: (trust: boolean) => void + ) => void): this; + /** + * Emitted when a client certificate is requested. + * The usage is the same with the "select-client-certificate" event of app. + */ + on(event: 'select-client-certificate', listener: (event: Event, + url: string, + certificateList: Certificate[], + callback: (certificate: Certificate) => void + ) => void): this; + /** + * Emitted when webContents wants to do basic auth. + * The usage is the same with the "login" event of app. + */ + on(event: 'login', listener: (event: Event, + request: LoginRequest, + authInfo: LoginAuthInfo, + callback: (username: string, password: string) => void + ) => void): this; + /** + * Emitted when a result is available for webContents.findInPage request. + */ + on(event: 'found-in-page', listener: (event: Event, result: FoundInPageResult) => void): this; + /** + * Emitted when media starts playing. + */ + on(event: 'media-started-playing', listener: Function): this; + /** + * Emitted when media is paused or done playing. + */ + on(event: 'media-paused', listener: Function): this; + /** + * Emitted when a page’s theme color changes. This is usually due to encountering a meta tag: + * + */ + on(event: 'did-change-theme-color', listener: Function): this; + /** + * Emitted when mouse moves over a link or the keyboard moves the focus to a link. + */ + on(event: 'update-target-url', listener: (event: Event, url: string) => void): this; + /** + * Emitted when the cursor’s type changes. + * If the type parameter is custom, the image parameter will hold the custom cursor image + * in a NativeImage, and scale, size and hotspot will hold additional information about the custom cursor. + */ + on(event: 'cursor-changed', listener: (event: Event, type: CursorType, image?: NativeImage, scale?: number, size?: Size, hotspot?: Point) => void): this; + /** + * Emitted when there is a new context menu that needs to be handled. + */ + on(event: 'context-menu', listener: (event: Event, params: ContextMenuParams) => void): this; + /** + * Emitted when bluetooth device needs to be selected on call to navigator.bluetooth.requestDevice. + * To use navigator.bluetooth api webBluetooth should be enabled. + * If event.preventDefault is not called, first available device will be selected. + * callback should be called with deviceId to be selected, + * passing empty string to callback will cancel the request. + */ + on(event: 'select-bluetooth-device', listener: (event: Event, deviceList: BluetoothDevice[], callback: (deviceId: string) => void) => void): this; + /** + * Emitted when a new frame is generated. Only the dirty area is passed in the buffer. + */ + on(event: 'paint', listener: (event: Event, dirtyRect: Rectangle, image: NativeImage) => void): this; + on(event: string, listener: Function): this; + /** + * Loads the url in the window. + * @param url Must contain the protocol prefix (e.g., the http:// or file://). + */ + loadURL(url: string, options?: LoadURLOptions): void; + /** + * Initiates a download of the resource at url without navigating. + * The will-download event of session will be triggered. + */ + downloadURL(url: string): void; + /** + * @returns The URL of current web page. + */ + getURL(): string; + /** + * @returns The title of web page. + */ + getTitle(): string; + /** + * @returns The favicon of the web page. + */ + getFavicon(): NativeImage; + /** + * @returns Whether web page is still loading resources. + */ + isLoading(): boolean; + /** + * @returns Whether the main frame (and not just iframes or frames within it) is still loading. + */ + isLoadingMainFrame(): boolean; + /** + * @returns Whether web page is waiting for a first-response for the main + * resource of the page. + */ + isWaitingForResponse(): boolean; + /** + * Stops any pending navigation. + */ + stop(): void; + /** + * Reloads current page. + */ + reload(): void; + /** + * Reloads current page and ignores cache. + */ + reloadIgnoringCache(): void; + /** + * @returns Whether the web page can go back. + */ + canGoBack(): boolean; + /** + * @returns Whether the web page can go forward. + */ + canGoForward(): boolean; + /** + * @returns Whether the web page can go to offset. + */ + canGoToOffset(offset: number): boolean; + /** + * Clears the navigation history. + */ + clearHistory(): void; + /** + * Makes the web page go back. + */ + goBack(): void; + /** + * Makes the web page go forward. + */ + goForward(): void; + /** + * Navigates to the specified absolute index. + */ + goToIndex(index: number): void; + /** + * Navigates to the specified offset from the "current entry". + */ + goToOffset(offset: number): void; + /** + * @returns Whether the renderer process has crashed. + */ + isCrashed(): boolean; + /** + * Overrides the user agent for this page. + */ + setUserAgent(userAgent: string): void; + /** + * @returns The user agent for this web page. + */ + getUserAgent(): string; + /** + * Injects CSS into this page. + */ + insertCSS(css: string): void; + /** + * Evaluates code in page. + * @param code Code to evaluate. + */ + executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + /** + * Mute the audio on the current web page. + */ + setAudioMuted(muted: boolean): void; + /** + * @returns Whether this page has been muted. + */ + isAudioMuted(): boolean; + /** + * Changes the zoom factor to the specified factor. + * Zoom factor is zoom percent divided by 100, so 300% = 3.0. + */ + setZoomFactor(factor: number): void; + /** + * Sends a request to get current zoom factor. + */ + getZoomFactor(callback: (zoomFactor: number) => void): void; + /** + * Changes the zoom level to the specified level. + * The original size is 0 and each increment above or below represents + * zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. + */ + setZoomLevel(level: number): void; + /** + * Sends a request to get current zoom level. + */ + getZoomLevel(callback: (zoomLevel: number) => void): void; + /** + * Sets the maximum and minimum zoom level. + */ + setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + /** + * Executes the editing command undo in web page. + */ + undo(): void; + /** + * Executes the editing command redo in web page. + */ + redo(): void; + /** + * Executes the editing command cut in web page. + */ + cut(): void; + /** + * Executes the editing command copy in web page. + */ + copy(): void; + /** + * Copy the image at the given position to the clipboard. + */ + copyImageAt(x: number, y: number): void; + /** + * Executes the editing command paste in web page. + */ + paste(): void; + /** + * Executes the editing command pasteAndMatchStyle in web page. + */ + pasteAndMatchStyle(): void; + /** + * Executes the editing command delete in web page. + */ + delete(): void; + /** + * Executes the editing command selectAll in web page. + */ + selectAll(): void; + /** + * Executes the editing command unselect in web page. + */ + unselect(): void; + /** + * Executes the editing command replace in web page. + */ + replace(text: string): void; + /** + * Executes the editing command replaceMisspelling in web page. + */ + replaceMisspelling(text: string): void; + /** + * Inserts text to the focused element. + */ + insertText(text: string): void; + /** + * Starts a request to find all matches for the text in the web page. + * The result of the request can be obtained by subscribing to found-in-page event. + * @returns The request id used for the request. + */ + findInPage(text: string, options?: FindInPageOptions): number; + /** + * Stops any findInPage request for the webContents with the provided action. + */ + stopFindInPage(action: StopFindInPageAtion): void; + /** + * Checks if any serviceworker is registered. + */ + hasServiceWorker(callback: (hasServiceWorker: boolean) => void): void; + /** + * Unregisters any serviceworker if present. + */ + unregisterServiceWorker(callback: (isFulfilled: boolean) => void): void; + /** + * Prints window's web page. When silent is set to false, Electron will pick up system's default printer and default settings for printing. + * Calling window.print() in web page is equivalent to call WebContents.print({silent: false, printBackground: false}). + * Note: On Windows, the print API relies on pdf.dll. If your application doesn't need print feature, you can safely remove pdf.dll in saving binary size. + */ + print(options?: PrintOptions): void; + /** + * Prints windows' web page as PDF with Chromium's preview printing custom settings. + */ + printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; + /** + * Adds the specified path to DevTools workspace. + */ + addWorkSpace(path: string): void; + /** + * Removes the specified path from DevTools workspace. + */ + removeWorkSpace(path: string): void; + /** + * Opens the developer tools. + */ + openDevTools(options?: { + /** + * Opens the devtools with specified dock state. Defaults to last used dock state. + */ + mode?: 'right' | 'bottom' | 'undocked' | 'detach' + }): void; + /** + * Closes the developer tools. + */ + closeDevTools(): void; + /** + * Returns whether the developer tools are opened. + */ + isDevToolsOpened(): boolean; + /** + * Returns whether the developer tools are focussed. + */ + isDevToolsFocused(): boolean; + /** + * Toggle the developer tools. + */ + toggleDevTools(): void; + /** + * Starts inspecting element at position (x, y). + */ + inspectElement(x: number, y: number): void; + /** + * Opens the developer tools for the service worker context. + */ + inspectServiceWorker(): void; + /** + * Send args.. to the web page via channel in asynchronous message, the web page + * can handle it by listening to the channel event of ipc module. + * Note: + * 1. The IPC message handler in web pages do not have a event parameter, + * which is different from the handlers on the main process. + * 2. There is no way to send synchronous messages from the main process + * to a renderer process, because it would be very easy to cause dead locks. + */ + send(channel: string, ...args: any[]): void; + /** + * Enable device emulation with the given parameters. + */ + enableDeviceEmulation(parameters: DeviceEmulationParameters): void; + /** + * Disable device emulation. + */ + disableDeviceEmulation(): void; + /** + * Sends an input event to the page. + */ + sendInputEvent(event: SendInputEvent): void; + /** + * Begin subscribing for presentation events and captured frames, + * The callback will be called when there is a presentation event. + */ + beginFrameSubscription(onlyDirty: boolean, callback: BeginFrameSubscriptionCallback): void; + /** + * Begin subscribing for presentation events and captured frames, + * The callback will be called when there is a presentation event. + */ + beginFrameSubscription(callback: BeginFrameSubscriptionCallback): void; + /** + * End subscribing for frame presentation events. + */ + endFrameSubscription(): void; + /** + * @returns If the process of saving page has been initiated successfully. + */ + savePage(fullPath: string, saveType: 'HTMLOnly' | 'HTMLComplete' | 'MHTML', callback?: (eror: Error) => void): boolean; + /** + * Shows pop-up dictionary that searches the selected word on the page. + * Note: This API is available only on macOS. + */ + showDefinitionForSelection(): void; + /** + * @returns Whether offscreen rendering is enabled. + */ + isOffscreen(): boolean; + /** + * If offscreen rendering is enabled and not painting, start painting. + */ + startPainting(): void; + /** + * If offscreen rendering is enabled and painting, stop painting. + */ + stopPainting(): void; + /** + * If offscreen rendering is enabled returns whether it is currently painting. + */ + isPainting(): boolean; + /** + * If offscreen rendering is enabled sets the frame rate to the specified number. + * Only values between 1 and 60 are accepted. + */ + setFrameRate(fps: number): void; + /** + * If offscreen rendering is enabled returns the current frame rate. + */ + getFrameRate(): number; + /** + * If offscreen rendering is enabled invalidates the frame and generates a new one through the 'paint' event. + */ + invalidate(): void; + /** + * Sets the item as dragging item for current drag-drop operation. + */ + startDrag(item: DragItem): void; + /** + * Captures a snapshot of the page within rect. + */ + capturePage(callback: (image: NativeImage) => void): void; + /** + * Captures a snapshot of the page within rect. + */ + capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; + /** + * @returns The unique ID of this WebContents. + */ + id: number; + /** + * @returns The session object used by this webContents. + */ + session: Session; + /** + * @returns The WebContents that might own this WebContents. + */ + hostWebContents: WebContents; + /** + * @returns The WebContents of DevTools for this WebContents. + * Note: Users should never store this object because it may become null + * when the DevTools has been closed. + */ + devToolsWebContents: WebContents; + /** + * @returns Debugger API + */ + debugger: Debugger; + } + + namespace WebContents { + interface NewWindowEvent extends Event { + newGuest?: BrowserWindow; + } + } + + interface BeginFrameSubscriptionCallback { + ( + /** + * The frameBuffer is a Buffer that contains raw pixel data. + * On most machines, the pixel data is effectively stored in 32bit BGRA format, + * but the actual representation depends on the endianness of the processor + * (most modern processors are little-endian, on machines with big-endian + * processors the data is in 32bit ARGB format). + */ + frameBuffer: Buffer, + /** + * The dirtyRect is an object with x, y, width, height properties that describes which part of the page was repainted. + * If onlyDirty is set to true, frameBuffer will only contain the repainted area. onlyDirty defaults to false. + */ + dirtyRect?: Rectangle + ): void + } + + interface ContextMenuParams { + /** + * x coordinate + */ + x: number; + /** + * y coordinate + */ + y: number; + /** + * URL of the link that encloses the node the context menu was invoked on. + */ + linkURL: string; + /** + * Text associated with the link. May be an empty string if the contents of the link are an image. + */ + linkText: string; + /** + * URL of the top level page that the context menu was invoked on. + */ + pageURL: string; + /** + * URL of the subframe that the context menu was invoked on. + */ + frameURL: string; + /** + * Source URL for the element that the context menu was invoked on. + * Elements with source URLs are images, audio and video. + */ + srcURL: string; + /** + * Type of the node the context menu was invoked on. + */ + mediaType: 'none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin'; + /** + * Parameters for the media element the context menu was invoked on. + */ + mediaFlags: { + /** + * Whether the media element has crashed. + */ + inError: boolean; + /** + * Whether the media element is paused. + */ + isPaused: boolean; + /** + * Whether the media element is muted. + */ + isMuted: boolean; + /** + * Whether the media element has audio. + */ + hasAudio: boolean; + /** + * Whether the media element is looping. + */ + isLooping: boolean; + /** + * Whether the media element's controls are visible. + */ + isControlsVisible: boolean; + /** + * Whether the media element's controls are toggleable. + */ + canToggleControls: boolean; + /** + * Whether the media element can be rotated. + */ + canRotate: boolean; + } + /** + * Whether the context menu was invoked on an image which has non-empty contents. + */ + hasImageContents: boolean; + /** + * Whether the context is editable. + */ + isEditable: boolean; + /** + * These flags indicate whether the renderer believes it is able to perform the corresponding action. + */ + editFlags: { + /** + * Whether the renderer believes it can undo. + */ + canUndo: boolean; + /** + * Whether the renderer believes it can redo. + */ + canRedo: boolean; + /** + * Whether the renderer believes it can cut. + */ + canCut: boolean; + /** + * Whether the renderer believes it can copy + */ + canCopy: boolean; + /** + * Whether the renderer believes it can paste. + */ + canPaste: boolean; + /** + * Whether the renderer believes it can delete. + */ + canDelete: boolean; + /** + * Whether the renderer believes it can select all. + */ + canSelectAll: boolean; + } + /** + * Text of the selection that the context menu was invoked on. + */ + selectionText: string; + /** + * Title or alt text of the selection that the context was invoked on. + */ + titleText: string; + /** + * The misspelled word under the cursor, if any. + */ + misspelledWord: string; + /** + * The character encoding of the frame on which the menu was invoked. + */ + frameCharset: string; + /** + * If the context menu was invoked on an input field, the type of that field. + */ + inputFieldType: 'none' | 'plainText' | 'password' | 'other'; + /** + * Input source that invoked the context menu. + */ + menuSourceType: 'none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu'; + } + + interface BluetoothDevice { + deviceName: string; + deviceId: string; + } + + interface Headers { + [key: string]: string; + } + + type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'; + + /** + * Specifies the action to take place when ending webContents.findInPage request. + * 'clearSelection' - Clear the selection. + * 'keepSelection' - Translate the selection into a normal selection. + * 'activateSelection' - Focus and click the selection node. + */ + type StopFindInPageAtion = 'clearSelection' | 'keepSelection' | 'activateSelection'; + + type CursorType = 'default' | 'crosshair' | 'pointer' | 'text' | 'wait' | 'help' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ns-resize' | 'ew-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'm-panning' | 'e-panning' | 'n-panning' | 'ne-panning' | 'nw-panning' | 's-panning' | 'se-panning' |'sw-panning' | 'w-panning' | 'move' | 'vertical-text' | 'cell' | 'context-menu' | 'alias' | 'progress' | 'nodrop' | 'copy' | 'none' | 'not-allowed' | 'zoom-in' | 'zoom-out' | 'grab' | 'grabbing' | 'custom'; + + interface LoadURLOptions { + /** + * HTTP Referrer URL. + */ + httpReferrer?: string; + /** + * User agent originating the request. + */ + userAgent?: string; + /** + * Extra headers separated by "\n" + */ + extraHeaders?: string; + } + + interface PrintOptions { + /** + * Don't ask user for print settings. + * Defaults: false. + */ + silent?: boolean; + /** + * Also prints the background color and image of the web page. + * Defaults: false. + */ + printBackground?: boolean; + } + + interface PrintToPDFOptions { + /** + * Specify the type of margins to use. + * 0 - default + * 1 - none + * 2 - minimum + * Default: 0 + */ + marginsType?: number; + /** + * Specify page size of the generated PDF. + * Default: A4. + */ + pageSize?: 'A3' | 'A4' | 'A5' | 'Legal' | 'Letter' | 'Tabloid' | Size; + /** + * Whether to print CSS backgrounds. + * Default: false. + */ + printBackground?: boolean; + /** + * Whether to print selection only. + * Default: false. + */ + printSelectionOnly?: boolean; + /** + * true for landscape, false for portrait. + * Default: false. + */ + landscape?: boolean; + } + + interface Certificate { + /** + * PEM encoded data. + */ + data: string; + /** + * Issuer's Common Name. + */ + issuerName: string; + /** + * Subject's Common Name. + */ + subjectName: string; + /** + * Hex value represented string. + */ + serialNumber: string; + /** + * Start date of the certificate being valid in seconds. + */ + validStart: number; + /** + * End date of the certificate being valid in seconds. + */ + validExpiry: number; + /** + * Fingerprint of the certificate. + */ + fingerprint: string; + } + + interface LoginRequest { + method: string; + url: string; + referrer: string; + } + + interface LoginAuthInfo { + isProxy: boolean; + scheme: string; + host: string; + port: number; + realm: string; + } + + interface FindInPageOptions { + /** + * Whether to search forward or backward, defaults to true + */ + forward?: boolean; + /** + * Whether the operation is first request or a follow up, defaults to false. + */ + findNext?: boolean; + /** + * Whether search should be case-sensitive, defaults to false. + */ + matchCase?: boolean; + /** + * Whether to look only at the start of words. defaults to false. + */ + wordStart?: boolean; + /** + * When combined with wordStart, accepts a match in the middle of a word + * if the match begins with an uppercase letter followed by a lowercase + * or non-letter. Accepts several other intra-word matches, defaults to false. + */ + medialCapitalAsWordStart?: boolean; + } + + interface FoundInPageResult { + requestId: number; + /** + * Indicates if more responses are to follow. + */ + finalUpdate: boolean; + /** + * Position of the active match. + */ + activeMatchOrdinal?: number; + /** + * Number of Matches. + */ + matches?: number; + /** + * Coordinates of first match region. + */ + selectionArea?: Rectangle; + } + + interface DeviceEmulationParameters { + /** + * Specify the screen type to emulated + * Default: desktop + */ + screenPosition?: 'desktop' | 'mobile'; + /** + * Set the emulated screen size (screenPosition == mobile) + */ + screenSize?: Size; + /** + * Position the view on the screen (screenPosition == mobile) + * Default: {x: 0, y: 0} + */ + viewPosition?: Point; + /** + * Set the device scale factor (if zero defaults to original device scale factor) + * Default: 0 + */ + deviceScaleFactor: number; + /** + * Set the emulated view size (empty means no override). + */ + viewSize?: Size; + /** + * Whether emulated view should be scaled down if necessary to fit into available space + * Default: false + */ + fitToView?: boolean; + /** + * Offset of the emulated view inside available space (not in fit to view mode) + * Default: {x: 0, y: 0} + */ + offset?: Point; + /** + * Scale of emulated view inside available space (not in fit to view mode) + * Default: 1 + */ + scale: number; + } + + interface SendInputEvent { + type: 'mouseDown' | 'mouseUp' | 'mouseEnter' | 'mouseLeave' | 'contextMenu' | 'mouseWheel' | 'mouseMove' | 'keyDown' | 'keyUp' | 'char'; + modifiers: ('shift' | 'control' | 'alt' | 'meta' | 'isKeypad' | 'isAutoRepeat' | 'leftButtonDown' | 'middleButtonDown' | 'rightButtonDown' | 'capsLock' | 'numLock' | 'left' | 'right')[]; + } + + interface SendInputKeyboardEvent extends SendInputEvent { + keyCode: string; + } + + interface SendInputMouseEvent extends SendInputEvent { + x: number; + y: number; + button?: 'left' | 'middle' | 'right'; + globalX?: number; + globalY?: number; + movementX?: number; + movementY?: number; + clickCount?: number; + } + + interface SendInputMouseWheelEvent extends SendInputEvent { + deltaX?: number; + deltaY?: number; + wheelTicksX?: number; + wheelTicksY?: number; + accelerationRatioX?: number; + accelerationRatioY?: number; + hasPreciseScrollingDeltas?: boolean; + canScroll?: boolean; + } + + /** + * Debugger API serves as an alternate transport for remote debugging protocol. + */ + interface Debugger extends NodeJS.EventEmitter { + /** + * Attaches the debugger to the webContents. + * @param protocolVersion Requested debugging protocol version. + */ + attach(protocolVersion?: string): void; + /** + * @returns Whether a debugger is attached to the webContents. + */ + isAttached(): boolean; + /** + * Detaches the debugger from the webContents. + */ + detach(): void; + /** + * Send given command to the debugging target. + * @param method Method name, should be one of the methods defined by the remote debugging protocol. + * @param commandParams JSON object with request parameters. + * @param callback Response defined by the ‘returns’ attribute of the command description in the remote debugging protocol. + */ + sendCommand(method: string, commandParams?: any, callback?: (error: Error, result: any) => void): void; + /** + * Emitted when debugging session is terminated. This happens either when + * webContents is closed or devtools is invoked for the attached webContents. + */ + on(event: 'detach', listener: (event: Event, reason: string) => void): this; + /** + * Emitted whenever debugging target issues instrumentation event. + * Event parameters defined by the ‘parameters’ attribute in the remote debugging protocol. + */ + on(event: 'message', listener: (event: Event, method: string, params: any) => void): this; + on(event: string, listener: Function): this; + } + + // https://github.com/electron/electron/blob/master/docs/api/web-frame.md + + /** + * The web-frame module allows you to customize the rendering of the current web page. + */ + interface WebFrame { + /** + * Changes the zoom factor to the specified factor, zoom factor is + * zoom percent / 100, so 300% = 3.0. + */ + setZoomFactor(factor: number): void; + /** + * @returns The current zoom factor. + */ + getZoomFactor(): number; + /** + * Changes the zoom level to the specified level, 0 is "original size", and each + * increment above or below represents zooming 20% larger or smaller to default + * limits of 300% and 50% of original size, respectively. + */ + setZoomLevel(level: number): void; + /** + * @returns The current zoom level. + */ + getZoomLevel(): number; + /** + * Sets the maximum and minimum zoom level. + */ + setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + /** + * Sets a provider for spell checking in input fields and text areas. + */ + setSpellCheckProvider(language: string, autoCorrectWord: boolean, provider: { + /** + * @returns Whether the word passed is correctly spelled. + */ + spellCheck: (text: string) => boolean; + }): void; + /** + * Sets the scheme as secure scheme. Secure schemes do not trigger mixed content + * warnings. For example, https and data are secure schemes because they cannot be + * corrupted by active network attackers. + */ + registerURLSchemeAsSecure(scheme: string): void; + /** + * Resources will be loaded from this scheme regardless of the current page’s Content Security Policy. + */ + registerURLSchemeAsBypassingCSP(scheme: string): void; + /** + * Registers the scheme as secure, bypasses content security policy for resources, + * allows registering ServiceWorker and supports fetch API. + */ + registerURLSchemeAsPrivileged(scheme: string): void; + /** + * Inserts text to the focused element. + */ + insertText(text: string): void; + /** + * Evaluates `code` in page. + * In the browser window some HTML APIs like `requestFullScreen` can only be + * invoked by a gesture from the user. Setting `userGesture` to `true` will remove + * this limitation. + */ + executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + /** + * @returns Object describing usage information of Blink’s internal memory caches. + */ + getResourceUsage(): ResourceUsages; + /** + * Attempts to free memory that is no longer being used (like images from a previous navigation). + */ + clearCache(): void; + } + + interface ResourceUsages { + fonts: ResourceUsage; + images: ResourceUsage; + cssStyleSheets: ResourceUsage; + xslStyleSheets: ResourceUsage; + scripts: ResourceUsage; + other: ResourceUsage; + } + + interface ResourceUsage { + count: number; + decodedSize: number; + liveSize: number; + purgeableSize: number; + purgedSize: number; + size: number; + } + + // https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md + + /** + * Use the webview tag to embed 'guest' content (such as web pages) in your Electron app. + * The guest content is contained within the webview container. + * An embedded page within your app controls how the guest content is laid out and rendered. + * + * Unlike an iframe, the webview runs in a separate process than your app. + * It doesn't have the same permissions as your web page and all interactions between your app + * and embedded content will be asynchronous. This keeps your app safe from the embedded content. + */ + interface WebViewElement extends HTMLElement { + /** + * Returns the visible URL. Writing to this attribute initiates top-level navigation. + * Assigning src its own value will reload the current page. + * The src attribute can also accept data URLs, such as data:text/plain,Hello, world!. + */ + src: string; + /** + * If "on", the webview container will automatically resize within the bounds specified + * by the attributes minwidth, minheight, maxwidth, and maxheight. + * These constraints do not impact the webview unless autosize is enabled. + * When autosize is enabled, the webview container size cannot be less than + * the minimum values or greater than the maximum. + */ + autosize: string; + /** + * If "on", the guest page in webview will have node integration and can use node APIs + * like require and process to access low level system resources. + */ + nodeintegration: string; + /** + * If "on", the guest page in webview will be able to use browser plugins. + */ + plugins: string; + /** + * Specifies a script that will be loaded before other scripts run in the guest page. + * The protocol of script's URL must be either file: or asar:, + * because it will be loaded by require in guest page under the hood. + * + * When the guest page doesn't have node integration this script will still have access to all Node APIs, + * but global objects injected by Node will be deleted after this script has finished executing. + */ + preload: string; + /** + * Sets the referrer URL for the guest page. + */ + httpreferrer: string; + /** + * Sets the user agent for the guest page before the page is navigated to. + * Once the page is loaded, use the setUserAgent method to change the user agent. + */ + useragent: string; + /** + * If "on", the guest page will have web security disabled. + */ + disablewebsecurity: string; + /** + * Sets the session used by the page. If partition starts with persist:, + * the page will use a persistent session available to all pages in the app with the same partition. + * If there is no persist: prefix, the page will use an in-memory session. + * By assigning the same partition, multiple pages can share the same session. + * If the partition is unset then default session of the app will be used. + * + * This value can only be modified before the first navigation, + * since the session of an active renderer process cannot change. + * Subsequent attempts to modify the value will fail with a DOM exception. + */ + partition: string; + /** + * If "on", the guest page will be allowed to open new windows. + */ + allowpopups: string; + /** + * A list of strings which specifies the blink features to be enabled separated by ,. + */ + blinkfeatures: string; + /** + * A list of strings which specifies the blink features to be disabled separated by ,. + */ + disableblinkfeatures: string; + /** + * A value that links the webview to a specific webContents. + * When a webview first loads a new webContents is created and this attribute is set + * to its instance identifier. Setting this attribute on a new or existing webview connects + * it to the existing webContents that currently renders in a different webview. + * + * The existing webview will see the destroy event and will then create a new webContents when a new url is loaded. + */ + guestinstance: string; + /** + * Loads the url in the webview, the url must contain the protocol prefix, e.g. the http:// or file://. + */ + loadURL(url: string, options?: LoadURLOptions): void; + /** + * @returns URL of guest page. + */ + getURL(): string; + /** + * @returns The title of guest page. + */ + getTitle(): string; + /** + * @returns Whether the web page is destroyed. + */ + isDestroyed(): boolean; + /** + * @returns Whether the web page is focused. + */ + isFocused(): boolean; + /** + * @returns Whether guest page is still loading resources. + */ + isLoading(): boolean; + /** + * Returns a boolean whether the guest page is waiting for a first-response for the main resource of the page. + */ + isWaitingForResponse(): boolean; + /** + * Stops any pending navigation. + */ + stop(): void; + /** + * Reloads the guest page. + */ + reload(): void; + /** + * Reloads the guest page and ignores cache. + */ + reloadIgnoringCache(): void; + /** + * @returns Whether the guest page can go back. + */ + canGoBack(): boolean; + /** + * @returns Whether the guest page can go forward. + */ + canGoForward(): boolean; + /** + * @returns Whether the guest page can go to offset. + */ + canGoToOffset(offset: number): boolean; + /** + * Clears the navigation history. + */ + clearHistory(): void; + /** + * Makes the guest page go back. + */ + goBack(): void; + /** + * Makes the guest page go forward. + */ + goForward(): void; + /** + * Navigates to the specified absolute index. + */ + goToIndex(index: number): void; + /** + * Navigates to the specified offset from the "current entry". + */ + goToOffset(offset: number): void; + /** + * @returns Whether the renderer process has crashed. + */ + isCrashed(): boolean; + /** + * Overrides the user agent for the guest page. + */ + setUserAgent(userAgent: string): void; + /** + * @returns The user agent for guest page. + */ + getUserAgent(): string; + /** + * Injects CSS into the guest page. + */ + insertCSS(css: string): void; + /** + * Evaluates code in page. If userGesture is set, it will create the user gesture context in the page. + * HTML APIs like requestFullScreen, which require user action, can take advantage of this option for automation. + */ + executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + /** + * Opens a DevTools window for guest page. + */ + openDevTools(): void; + /** + * Closes the DevTools window of guest page. + */ + closeDevTools(): void; + /** + * @returns Whether guest page has a DevTools window attached. + */ + isDevToolsOpened(): boolean; + /** + * @returns Whether DevTools window of guest page is focused. + */ + isDevToolsFocused(): boolean; + /** + * Starts inspecting element at position (x, y) of guest page. + */ + inspectElement(x: number, y: number): void; + /** + * Opens the DevTools for the service worker context present in the guest page. + */ + inspectServiceWorker(): void; + /** + * Set guest page muted. + */ + setAudioMuted(muted: boolean): void; + /** + * @returns Whether guest page has been muted. + */ + isAudioMuted(): boolean; + /** + * Executes editing command undo in page. + */ + undo(): void; + /** + * Executes editing command redo in page. + */ + redo(): void; + /** + * Executes editing command cut in page. + */ + cut(): void; + /** + * Executes editing command copy in page. + */ + copy(): void; + /** + * Executes editing command paste in page. + */ + paste(): void; + /** + * Executes editing command pasteAndMatchStyle in page. + */ + pasteAndMatchStyle(): void; + /** + * Executes editing command delete in page. + */ + delete(): void; + /** + * Executes editing command selectAll in page. + */ + selectAll(): void; + /** + * Executes editing command unselect in page. + */ + unselect(): void; + /** + * Executes editing command replace in page. + */ + replace(text: string): void; + /** + * Executes editing command replaceMisspelling in page. + */ + replaceMisspelling(text: string): void; + /** + * Inserts text to the focused element. + */ + insertText(text: string): void; + /** + * Starts a request to find all matches for the text in the web page. + * The result of the request can be obtained by subscribing to found-in-page event. + * @returns The request id used for the request. + */ + findInPage(text: string, options?: FindInPageOptions): number; + /** + * Stops any findInPage request for the webview with the provided action. + */ + stopFindInPage(action: StopFindInPageAtion): void; + /** + * Prints webview's web page. Same with webContents.print([options]). + */ + print(options?: PrintOptions): void; + /** + * Prints webview's web page as PDF, Same with webContents.printToPDF(options, callback) + */ + printToPDF(options: PrintToPDFOptions, callback: (error: Error, data: Buffer) => void): void; + /** + * Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments. + * The renderer process can handle the message by listening to the channel event with the ipcRenderer module. + * See webContents.send for examples. + */ + send(channel: string, ...args: any[]): void; + /** + * Sends an input event to the page. + * See webContents.sendInputEvent for detailed description of event object. + */ + sendInputEvent(event: SendInputEvent): void + /** + * Changes the zoom factor to the specified factor. + * Zoom factor is zoom percent divided by 100, so 300% = 3.0. + */ + setZoomFactor(factor: number): void; + /** + * Changes the zoom level to the specified level. + * The original size is 0 and each increment above or below represents + * zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively. + */ + setZoomLevel(level: number): void; + /** + * Shows pop-up dictionary that searches the selected word on the page. + * Note: This API is available only on macOS. + */ + showDefinitionForSelection(): void; + /** + * @returns The WebContents associated with this webview. + */ + getWebContents(): WebContents; + /** + * Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback). + */ + capturePage(callback: (image: NativeImage) => void): void; + /** + * Captures a snapshot of the webview's page. Same as webContents.capturePage([rect, ]callback). + */ + capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void; + /** + * Fired when a load has committed. This includes navigation within the current document + * as well as subframe document-level loads, but does not include asynchronous resource loads. + */ + addEventListener(type: 'load-commit', listener: (event: WebViewElement.LoadCommitEvent) => void, useCapture?: boolean): void; + /** + * Fired when the navigation is done, i.e. the spinner of the tab will stop spinning, and the onload event is dispatched. + */ + addEventListener(type: 'did-finish-load', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * This event is like did-finish-load, but fired when the load failed or was cancelled, e.g. window.stop() is invoked. + */ + addEventListener(type: 'did-fail-load', listener: (event: WebViewElement.DidFailLoadEvent) => void, useCapture?: boolean): void; + /** + * Fired when a frame has done navigation. + */ + addEventListener(type: 'did-frame-finish-load', listener: (event: WebViewElement.DidFrameFinishLoadEvent) => void, useCapture?: boolean): void; + /** + * Corresponds to the points in time when the spinner of the tab starts spinning. + */ + addEventListener(type: 'did-start-loading', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Corresponds to the points in time when the spinner of the tab stops spinning. + */ + addEventListener(type: 'did-stop-loading', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when details regarding a requested resource is available. + * status indicates socket connection to download the resource. + */ + addEventListener(type: 'did-get-response-details', listener: (event: WebViewElement.DidGetResponseDetails) => void, useCapture?: boolean): void; + /** + * Fired when a redirect was received while requesting a resource. + */ + addEventListener(type: 'did-get-redirect-request', listener: (event: WebViewElement.DidGetRedirectRequestEvent) => void, useCapture?: boolean): void; + /** + * Fired when document in the given frame is loaded. + */ + addEventListener(type: 'dom-ready', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when page title is set during navigation. explicitSet is false when title is synthesized from file URL. + */ + addEventListener(type: 'page-title-updated', listener: (event: WebViewElement.PageTitleUpdatedEvent) => void, useCapture?: boolean): void; + /** + * Fired when page receives favicon URLs. + */ + addEventListener(type: 'page-favicon-updated', listener: (event: WebViewElement.PageFaviconUpdatedEvent) => void, useCapture?: boolean): void; + /** + * Fired when page enters fullscreen triggered by HTML API. + */ + addEventListener(type: 'enter-html-full-screen', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when page leaves fullscreen triggered by HTML API. + */ + addEventListener(type: 'leave-html-full-screen', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when the guest window logs a console message. + */ + addEventListener(type: 'console-message', listener: (event: WebViewElement.ConsoleMessageEvent) => void, useCapture?: boolean): void; + /** + * Fired when a result is available for webview.findInPage request. + */ + addEventListener(type: 'found-in-page', listener: (event: WebViewElement.FoundInPageEvent) => void, useCapture?: boolean): void; + /** + * Fired when the guest page attempts to open a new browser window. + */ + addEventListener(type: 'new-window', listener: (event: WebViewElement.NewWindowEvent) => void, useCapture?: boolean): void; + /** + * Emitted when a user or the page wants to start navigation. + * It can happen when the window.location object is changed or a user clicks a link in the page. + * + * This event will not emit when the navigation is started programmatically with APIs + * like .loadURL and .back. + * + * It is also not emitted during in-page navigation, such as clicking anchor links + * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. + * + * Calling event.preventDefault() does NOT have any effect. + */ + addEventListener(type: 'will-navigate', listener: (event: WebViewElement.WillNavigateEvent) => void, useCapture?: boolean): void; + /** + * Emitted when a navigation is done. + * + * This event is not emitted for in-page navigations, such as clicking anchor links + * or updating the window.location.hash. Use did-navigate-in-page event for this purpose. + */ + addEventListener(type: 'did-navigate', listener: (event: WebViewElement.DidNavigateEvent) => void, useCapture?: boolean): void; + /** + * Emitted when an in-page navigation happened. + * + * When in-page navigation happens, the page URL changes but does not cause + * navigation outside of the page. Examples of this occurring are when anchor links + * are clicked or when the DOM hashchange event is triggered. + */ + addEventListener(type: 'did-navigate-in-page', listener: (event: WebViewElement.DidNavigateInPageEvent) => void, useCapture?: boolean): void; + /** + * Fired when the guest page attempts to close itself. + */ + addEventListener(type: 'close', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when the guest page has sent an asynchronous message to embedder page. + */ + addEventListener(type: 'ipc-message', listener: (event: WebViewElement.IpcMessageEvent) => void, useCapture?: boolean): void; + /** + * Fired when the renderer process is crashed. + */ + addEventListener(type: 'crashed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when the gpu process is crashed. + */ + addEventListener(type: 'gpu-crashed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Fired when a plugin process is crashed. + */ + addEventListener(type: 'plugin-crashed', listener: (event: WebViewElement.PluginCrashedEvent) => void, useCapture?: boolean): void; + /** + * Fired when the WebContents is destroyed. + */ + addEventListener(type: 'destroyed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Emitted when media starts playing. + */ + addEventListener(type: 'media-started-playing', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Emitted when media is paused or done playing. + */ + addEventListener(type: 'media-paused', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Emitted when a page's theme color changes. This is usually due to encountering a meta tag: + * + */ + addEventListener(type: 'did-change-theme-color', listener: (event: WebViewElement.DidChangeThemeColorEvent) => void, useCapture?: boolean): void; + /** + * Emitted when mouse moves over a link or the keyboard moves the focus to a link. + */ + addEventListener(type: 'update-target-url', listener: (event: WebViewElement.UpdateTargetUrlEvent) => void, useCapture?: boolean): void; + /** + * Emitted when DevTools is opened. + */ + addEventListener(type: 'devtools-opened', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Emitted when DevTools is closed. + */ + addEventListener(type: 'devtools-closed', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + /** + * Emitted when DevTools is focused / opened. + */ + addEventListener(type: 'devtools-focused', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + addEventListener(type: string, listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + } + + namespace WebViewElement { + type Event = ElectronPrivate.GlobalEvent; + + interface LoadCommitEvent extends Event { + url: string; + isMainFrame: boolean; + } + + interface DidFailLoadEvent extends Event { + errorCode: number; + errorDescription: string; + validatedURL: string; + isMainFrame: boolean; + } + + interface DidFrameFinishLoadEvent extends Event { + isMainFrame: boolean; + } + + interface DidGetResponseDetails extends Event { + status: boolean; + newURL: string; + originalURL: string; + httpResponseCode: number; + requestMethod: string; + referrer: string; + headers: Headers; + resourceType: string; + } + + interface DidGetRedirectRequestEvent extends Event { + oldURL: string; + newURL: string; + isMainFrame: boolean; + httpResponseCode: number; + requestMethod: string; + referrer: string; + headers: Headers; + } + + interface PageTitleUpdatedEvent extends Event { + title: string; + explicitSet: string; + } + + interface PageFaviconUpdatedEvent extends Event { + favicons: string[]; + } + + interface ConsoleMessageEvent extends Event { + level: number; + message: string; + line: number; + sourceId: string; + } + + interface FoundInPageEvent extends Event { + result: FoundInPageResult; + } + + interface NewWindowEvent extends Event { + url: string; + frameName: string; + disposition: NewWindowDisposition; + options: BrowserWindowOptions; + } + + interface WillNavigateEvent extends Event { + url: string; + } + + interface DidNavigateEvent extends Event { + url: string; + } + + interface DidNavigateInPageEvent extends Event { + url: string; + isMainFrame: boolean; + } + + interface IpcMessageEvent extends Event { + channel: string; + args: any[]; + } + + interface PluginCrashedEvent extends Event { + name: string; + version: string; + } + + interface DidChangeThemeColorEvent extends Event { + themeColor: string; + } + + interface UpdateTargetUrlEvent extends Event { + url: string; + } + } + + /** + * The BrowserWindowProxy object is returned from window.open and provides limited functionality with the child window. + */ + interface BrowserWindowProxy { + /** + * Removes focus from the child window. + */ + blur(): void; + /** + * Forcefully closes the child window without calling its unload event. + */ + close(): void; + /** + * Set to true after the child window gets closed. + */ + closed: boolean; + /** + * Evaluates the code in the child window. + */ + eval(code: string): void; + /** + * Focuses the child window (brings the window to front). + */ + focus(): void; + /** + * Sends a message to the child window with the specified origin or * for no origin preference. + * In addition to these methods, the child window implements window.opener object with no + * properties and a single method. + */ + postMessage(message: string, targetOrigin: string): void; + /** + * Invokes the print dialog on the child window. + */ + print(): void; + } + + // https://github.com/electron/electron/blob/master/docs/api/synopsis.md + + interface CommonElectron { + clipboard: Electron.Clipboard; + crashReporter: Electron.CrashReporter; + nativeImage: typeof Electron.NativeImage; + shell: Electron.Shell; + + app: Electron.App; + autoUpdater: Electron.AutoUpdater; + BrowserWindow: typeof Electron.BrowserWindow; + contentTracing: Electron.ContentTracing; + dialog: Electron.Dialog; + ipcMain: Electron.IpcMain; + globalShortcut: Electron.GlobalShortcut; + Menu: typeof Electron.Menu; + MenuItem: typeof Electron.MenuItem; + powerMonitor: Electron.PowerMonitor; + powerSaveBlocker: Electron.PowerSaveBlocker; + protocol: Electron.Protocol; + screen: Electron.Screen; + session: typeof Electron.Session; + systemPreferences: Electron.SystemPreferences; + Tray: typeof Electron.Tray; + webContents: Electron.WebContentsStatic; + } + + interface ElectronMainAndRenderer extends CommonElectron { + desktopCapturer: Electron.DesktopCapturer; + ipcRenderer: Electron.IpcRenderer; + remote: Electron.Remote; + webFrame: Electron.WebFrame; + } +} + +declare namespace ElectronPrivate { + type GlobalEvent = Event; +} + +interface Document { + createElement(tagName: 'webview'): Electron.WebViewElement; +} + +// https://github.com/electron/electron/blob/master/docs/api/window-open.md + +interface Window { + /** + * Creates a new window. + */ + open(url: string, frameName?: string, features?: string): Electron.BrowserWindowProxy; +} + +// https://github.com/electron/electron/blob/master/docs/api/file-object.md + +interface File { + /** + * Exposes the real path of the filesystem. + */ + path: string; +} + +// https://github.com/electron/electron/blob/master/docs/api/process.md + +declare namespace NodeJS { + + interface ProcessVersions { + /** + * Electron's version string. + */ + electron: string; + /** + * Chrome's version string. + */ + chrome: string; + } + + interface Process { + /** + * Setting this to true can disable the support for asar archives in Node's built-in modules. + */ + noAsar?: boolean; + /** + * Process's type + */ + type: 'browser' | 'renderer'; + /** + * Path to JavaScript source code. + */ + resourcesPath: string; + /** + * For Mac App Store build, this value is true, for other builds it is undefined. + */ + mas?: boolean; + /** + * If the app is running as a Windows Store app (appx), this value is true, for other builds it is undefined. + */ + windowsStore?: boolean; + /** + * When app is started by being passed as parameter to the default app, + * this value is true in the main process, otherwise it is undefined. + */ + defaultApp?: boolean; + /** + * Emitted when Electron has loaded its internal initialization script + * and is beginning to load the web page or the main script. + */ + on(event: 'loaded', listener: Function): this; + on(event: string, listener: Function): this; + /** + * Causes the main thread of the current process crash; + */ + crash(): void; + /** + * Causes the main thread of the current process hang. + */ + hang(): void; + /** + * Sets the file descriptor soft limit to maxDescriptors or the OS hard limit, + * whichever is lower for the current process. + * + * Note: This API is only available on macOS and Linux. + */ + setFdLimit(maxDescriptors: number): void; + /** + * @returns Object giving memory usage statistics about the current process. + * Note: All statistics are reported in Kilobytes. + */ + getProcessMemoryInfo(): ProcessMemoryInfo; + /** + * @returns Object giving memory usage statistics about the entire system. + * Note: All statistics are reported in Kilobytes. + */ + getSystemMemoryInfo(): SystemMemoryInfo; + } + + interface ProcessMemoryInfo { + /** + * The amount of memory currently pinned to actual physical RAM. + */ + workingSetSize: number; + /** + * The maximum amount of memory that has ever been pinned to actual physical RAM. + */ + peakWorkingSetSize: number; + /** + * The amount of memory not shared by other processes, such as JS heap or HTML content. + */ + privateBytes: number; + /** + * The amount of memory shared between processes, typically memory consumed by the Electron code itself. + */ + sharedBytes: number; + } + + interface SystemMemoryInfo { + /** + * The total amount of physical memory available to the system. + */ + total: number; + /** + * The total amount of memory not being used by applications or disk cache. + */ + free: number; + /** + * The total amount of swap memory available to the system. + */ + swapTotal: number; + /** + * The free amount of swap memory available to the system. + */ + swapFree: number; + } +} + +declare module 'electron' { + var electron: Electron.ElectronMainAndRenderer; + export = electron; +} + +interface NodeRequireFunction { + (moduleName: 'electron'): Electron.ElectronMainAndRenderer; +} diff --git a/electron/index.d.ts b/electron/index.d.ts index d55b47df4c..3ee92c80b9 100644 --- a/electron/index.d.ts +++ b/electron/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron v1.4.5 +// Type definitions for Electron v1.4.8 // Project: http://electron.atom.io/ // Definitions by: jedmao , rhysd , Milan Burda , aliib // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -42,6 +42,8 @@ declare namespace Electron { // https://github.com/electron/electron/blob/master/docs/api/app.md + type VibrancyType = 'appearance-based' | 'light' | 'dark' | 'titlebar' | 'selection' | 'menu' | 'popover' | 'sidebar' | 'medium-light' | 'ultra-dark'; + /** * The app module is responsible for controlling the application's lifecycle. */ @@ -1023,6 +1025,14 @@ declare namespace Electron { * Note: This API is available only on macOS. */ setAspectRatio(aspectRatio: number, extraSize?: Size): void; + /** + * Uses Quick Look to preview a file at a given path. + * + * @param path The absolute path to the file to preview with QuickLook. + * @param displayName The name of the file to display on the Quick Look modal view. + * Note: This API is available only on macOS. + */ + previewFile(path: string, displayName?: string): void; /** * Resizes and moves the window to width, height, x, y. */ @@ -1383,6 +1393,13 @@ declare namespace Electron { * @returns All child windows. */ getChildWindows(): BrowserWindow[]; + /** + * Adds a vibrancy effect to the browser window. Passing null or + * an empty string will remove the vibrancy effect on the window. + * + * Note: This API is available only on macOS. + */ + setVibrancy(type: VibrancyType): void; } type WindowLevel = 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock'; @@ -1772,6 +1789,10 @@ declare namespace Electron { * Use WS_THICKFRAME style for frameless windows on Windows */ thickFrame?: boolean; + /** + * Add a type of vibrancy effect to the window, only on macOS + */ + vibrancy?: VibrancyType; /** * Settings of web page’s features. */ @@ -1861,6 +1882,20 @@ declare namespace Electron { * Note: This API is available on macOS and Windows. */ writeBookmark(title: string, url: string, type?: ClipboardType): void; + /** + * The text on the find pasteboard. This method uses synchronous IPC when called from the renderer process. + * The cached value is reread from the find pasteboard whenever the application is activated. + * + * Note: This API is available on macOS. + */ + readFindText(): string; + /** + * Writes the text into the find pasteboard as plain text. + * This method uses synchronous IPC when called from the renderer process. + * + * Note: This API is available on macOS. + */ + writeFindText(text: string): void; } type ClipboardType = '' | 'selection'; @@ -2455,7 +2490,7 @@ declare namespace Electron { } type MenuItemType = 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio'; - type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close' | 'quit' | 'togglefullscreen' | 'resetzoom' | 'zoomin' | 'zoomout'; + type MenuItemRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'pasteandmatchstyle' | 'selectall' | 'delete' | 'minimize' | 'close' | 'quit' | 'togglefullscreen' | 'resetzoom' | 'zoomin' | 'zoomout' | 'reload' | 'toggledevtools'; type MenuItemRoleMac = 'about' | 'hide' | 'hideothers' | 'unhide' | 'startspeaking' | 'stopspeaking' | 'front' | 'zoom' | 'window' | 'help' | 'services'; interface MenuItemOptions { @@ -2913,7 +2948,9 @@ declare namespace Electron { * - Each header name produces an array-valued property on the headers object. * - Each header value is pushed into the array associated with its header name. */ - headers: Headers; + headers: { + [key: string]: string[] + }; /** * A string indicating the HTTP protocol version number. Typical values are ‘1.0’ or ‘1.1’. */ @@ -3282,7 +3319,7 @@ declare namespace Electron { * * Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc. */ - setCertificateVerifyProc(proc: (hostname: string, cert: Certificate, callback: (accepted: boolean) => void) => void): void; + setCertificateVerifyProc(proc: ((hostname: string, cert: Certificate, callback: (accepted: boolean) => void) => void) | null): void; /** * Sets the handler which can be used to respond to permission requests for the session. */ @@ -4393,8 +4430,10 @@ declare namespace Electron { /** * Evaluates code in page. * @param code Code to evaluate. + * + * @returns Promise */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; /** * Mute the audio on the current web page. */ @@ -4425,7 +4464,11 @@ declare namespace Electron { /** * Sets the maximum and minimum zoom level. */ - setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + /** + * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. + */ + setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Executes the editing command undo in web page. */ @@ -4847,6 +4890,55 @@ declare namespace Electron { * Extra headers separated by "\n" */ extraHeaders?: string; + /** + * POST data + */ + postData?: (UploadRawData | UploadFileSystem | UploadBlob)[]; + } + + interface UploadRawData { + /** + * rawData + */ + type: 'rawData'; + /** + * Data to be uploaded. + */ + bytes: Buffer; + } + + interface UploadFileSystem { + /** + * fileSystem + */ + type: 'fileSystem'; + /** + * FileSystem url to read data for upload. + */ + fileSystemURL: string; + /** + * Defaults to 0. + */ + offset: number; + /** + * Number of bytes to read from offset. Defaults to 0. + */ + length: number; + /** + * Last Modification time in number of seconds sine the UNIX epoch. + */ + modificationTime: number; + } + + interface UploadBlob { + /** + * blob + */ + type: 'blob'; + /** + * UUID of blob data to upload. + */ + blobUUID: string; } interface PrintOptions { @@ -4898,10 +4990,22 @@ declare namespace Electron { * PEM encoded data. */ data: string; + /** + * Issuer principal + */ + issuer: CertificatePrincipal; /** * Issuer's Common Name. */ issuerName: string; + /** + * Issuer certificate (if not self-signed) + */ + issuerCert: Certificate; + /** + * Subject principal + */ + subject: CertificatePrincipal; /** * Subject's Common Name. */ @@ -4924,6 +5028,33 @@ declare namespace Electron { fingerprint: string; } + interface CertificatePrincipal { + /** + * Common Name + */ + commonName: string; + /** + * Organization names + */ + organizations: string[]; + /** + * Organization Unit names + */ + organizationUnits: string[]; + /** + * Locality + */ + locality: string; + /** + * State or province + */ + state: string; + /** + * Country or region + */ + country: string; + } + interface LoginRequest { method: string; url: string; @@ -5120,7 +5251,11 @@ declare namespace Electron { /** * Sets the maximum and minimum zoom level. */ - setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; + /** + * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. + */ + setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Sets a provider for spell checking in input fields and text areas. */ @@ -5144,7 +5279,7 @@ declare namespace Electron { * Registers the scheme as secure, bypasses content security policy for resources, * allows registering ServiceWorker and supports fetch API. */ - registerURLSchemeAsPrivileged(scheme: string): void; + registerURLSchemeAsPrivileged(scheme: string, options?: RegisterURLSchemeOptions): void; /** * Inserts text to the focused element. */ @@ -5154,8 +5289,10 @@ declare namespace Electron { * In the browser window some HTML APIs like `requestFullScreen` can only be * invoked by a gesture from the user. Setting `userGesture` to `true` will remove * this limitation. + * + * @returns Promise */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; /** * @returns Object describing usage information of Blink’s internal memory caches. */ @@ -5184,6 +5321,14 @@ declare namespace Electron { size: number; } + interface RegisterURLSchemeOptions { + secure?: boolean; + bypassCSP?: boolean; + allowServiceWorkers?: boolean; + supportFetchAPI?: boolean; + corsEnabled?: boolean; + } + // https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md /** @@ -5257,6 +5402,10 @@ declare namespace Electron { * If "on", the guest page will be allowed to open new windows. */ allowpopups: string; + /** + * A list of strings which specifies the web preferences to be set on the webview, separated by ,. + */ + webpreferences: string; /** * A list of strings which specifies the blink features to be enabled separated by ,. */ @@ -5365,8 +5514,10 @@ declare namespace Electron { /** * Evaluates code in page. If userGesture is set, it will create the user gesture context in the page. * HTML APIs like requestFullScreen, which require user action, can take advantage of this option for automation. + * + * @returns Promise */ - executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; + executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; /** * Opens a DevTools window for guest page. */ @@ -5377,7 +5528,7 @@ declare namespace Electron { closeDevTools(): void; /** * @returns Whether guest page has a DevTools window attached. - */ + isDevToolsOpened(): boolean; /** * @returns Whether DevTools window of guest page is focused. diff --git a/ember/ember-1.11.3.d.ts b/ember/ember-1.11.3.d.ts index d19327ddb2..eef72fd87c 100644 --- a/ember/ember-1.11.3.d.ts +++ b/ember/ember-1.11.3.d.ts @@ -6,6 +6,8 @@ /// /// +/* this is an older file, do not lint */ +/* tslint:disable */ declare var Handlebars: HandlebarsStatic; declare namespace EmberStates { diff --git a/ember/ember-tests.ts b/ember/ember-tests.ts index 30156975b1..dda0e157c4 100644 --- a/ember/ember-tests.ts +++ b/ember/ember-tests.ts @@ -146,7 +146,7 @@ people2.everyProperty('isHappy', true); people2.someProperty('isHappy', true); // Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html -var promise = new Em.RSVP.Promise(function(resolve: Function, reject: Function) { +var promise = new Em.RSVP.Promise(function(resolve: Function, reject: Function) { // on success resolve('ok!'); @@ -159,3 +159,16 @@ promise.then(function(value: any) { }, function(reason: any) { // on rejection }); + +var mix1 = Ember.Mixin.create({ + foo: 1 +}); + +var mix2 = Ember.Mixin.create({ + bar: 2 +}); + +var component1 = Ember.Component.extend( mix1, mix2, { + lyft: Ember.inject.service(), + cars: Ember.computed.readOnly('lyft.cars') +}); diff --git a/ember/index.d.ts b/ember/index.d.ts index dad59a2fb1..708adc160c 100644 --- a/ember/index.d.ts +++ b/ember/index.d.ts @@ -32,7 +32,7 @@ declare namespace EmberStates { Transition object can be externally `abort`ed, while the promise cannot. */ - promise: Ember.RSVP.Promise; + promise: Ember.RSVP.Promise; /** Custom state can be stored on a Transition's `data` object. @@ -56,7 +56,7 @@ declare namespace EmberStates { @arg {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ - then(onFulfilled: Function, onRejected?: Function, label?: string): Ember.RSVP.Promise; + then(onFulfilled: Function, onRejected?: Function, label?: string): Ember.RSVP.Promise; /** Forwards to the internal `promise` property which you can @@ -69,7 +69,7 @@ declare namespace EmberStates { Useful for tooling. @return {Promise} */ - catch(onRejection: Function, label?: string): Ember.RSVP.Promise; + catch(onRejection: Function, label?: string): Ember.RSVP.Promise; /** Forwards to the internal `promise` property which you can @@ -82,7 +82,7 @@ declare namespace EmberStates { Useful for tooling. @return {Promise} */ - finally(callback: Function, label?: string): Ember.RSVP.Promise; + finally(callback: Function, label?: string): Ember.RSVP.Promise; /** Aborts the Transition. Note you can also implicitly abort a transition @@ -127,7 +127,7 @@ declare namespace EmberStates { @arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error @arg {String} name the name of the event to fire */ - trigger(ignoreFailure:boolean, eventName: string): void; + trigger(ignoreFailure: boolean, eventName: string): void; /** Fires an event on the current list of resolved/resolving handlers within this transition. Useful for firing events @@ -149,11 +149,14 @@ declare namespace EmberStates { @return {Promise} a promise that fulfills with the same value that the final redirecting transition fulfills with */ - followRedirects(): Ember.RSVP.Promise; + followRedirects(): Ember.RSVP.Promise; } } +// Get an alias to the global Array type to use in inner scope below. +type GlobalArray = T[]; + declare namespace EmberTesting { namespace Test { @@ -203,18 +206,9 @@ interface Array { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Ember.Enumerable): any; - enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: Ember.Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Ember.Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Ember.Enumerable): any; - enumerableContentDidChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): any[]; - enumerableContentWillChange(removing: Ember.Enumerable, adding: number): any[]; - enumerableContentWillChange(removing: number, adding: Ember.Enumerable): any[]; - enumerableContentWillChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any[]; + enumerableContentDidChange(start: number, removing: Ember.Enumerable | number, adding: Ember.Enumerable | number): any; + enumerableContentDidChange(removing: Ember.Enumerable | number, adding: Ember.Enumerable | number): any; + enumerableContentWillChange(removing: Ember.Enumerable | number, adding: Ember.Enumerable | number): Ember.Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: any): boolean; @@ -301,8 +295,7 @@ interface Array { notifyPropertyChange(keyName: string): any[]; propertyDidChange(keyName: string): any[]; propertyWillChange(keyName: string): any[]; - removeObserver(key: string, target: any, method: string): Ember.Observable; - removeObserver(key: string, target: any, method: Function): Ember.Observable; + removeObserver(key: string, target: any, method: Function | string): Ember.Observable; set(keyName: string, value: any): any[]; setProperties(hash: {}): any[]; toggleProperty(keyName: string): any; @@ -326,15 +319,13 @@ interface ApplicationCreateArguments { LOG_TRANSITIONS_INTERNAL?: boolean; } +type ApplicationInitializerFunction = (container: Ember.Container, application: Ember.Application) => void; + interface ApplicationInitializerArguments { name?: string; initialize?: ApplicationInitializerFunction; } -interface ApplicationInitializerFunction { - (container: Ember.Container, application: Ember.Application): void; -} - interface CoreObjectArguments { /** An overridable method called when objects are instantiated. By default, does nothing unless it is @@ -356,17 +347,14 @@ interface EnumerableConfigurationOptions { didChange?: boolean ; } -interface ItemIndexEnumerableCallbackTarget { - (callback: ItemIndexEnumerableCallback, target?: any): any[]; -} +type ItemIndexEnumerableCallbackTarget = (callback: ItemIndexEnumerableCallback, target?: any) => any[]; -interface ItemIndexEnumerableCallback { - (item: any, index: number, enumerable: Ember.Enumerable): void; -} -interface ReduceCallback { - (previousValue: any, item: any, index: number, enumerable: Ember.Enumerable): void; -} +type ItemIndexEnumerableCallback = (item: any, index: number, enumerable: Ember.Enumerable) => void; + + +type ReduceCallback = (previousValue: any, item: any, index: number, enumerable: Ember.Enumerable) => void; + interface TransitionsHash { contexts: any[]; @@ -393,12 +381,7 @@ interface RenderOptions { view?: string; } -interface ModifyObserver { - (obj: any, path: string, target: any, method?: Function): void; - (obj: any, path: string, target: any, method?: string): void; - (obj: any, path: string, func: Function, method?: Function): void; - (obj: any, path: string, func: Function, method?: string): void; -} +type ModifyObserver = (obj: any, path: string | null, target: Function | any, method?: Function | string) => void; declare namespace Ember { /** @@ -543,18 +526,9 @@ declare namespace Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: string): boolean; @@ -621,18 +595,9 @@ declare namespace Ember { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: string): boolean; @@ -697,8 +662,7 @@ declare namespace Ember { copy(): Binding; disconnect(): Binding; from(path: string): Binding; - to(path: string): Binding; - to(pathTuple: any[]): Binding; + to(path: string | any[]): Binding; toString(): string; } class Button extends Component implements TargetActionSupport { @@ -750,7 +714,7 @@ declare namespace Ember { and actions are targeted at the view object. There is no access to the surrounding context or outer controller; all contextual information is passed in. **/ - class Component { + class Component extends Object { static detect(obj: any): boolean; static detectInstance(obj: any): boolean; /** @@ -827,7 +791,7 @@ declare namespace Ember { replaceRoute(name: string, ...args: any[]): void; transitionToRoute(name: string, ...args: any[]): void; controllers: {}; - model : any; + model: any; needs: string[]; queryParams: any; target: any; @@ -902,13 +866,6 @@ declare namespace Ember { static isClass: boolean; static isMethod: boolean; - /** - Creates a new subclass. - @method extend - @static - @param {Object} [args] - Object containing values to use within the new class - **/ - static extend(args?: CoreObjectArguments): T; /** Creates a new subclass. @method extend @@ -916,15 +873,10 @@ declare namespace Ember { @param {Mixin} [mixins] - One or more Mixin classes @param {Object} [args] - Object containing values to use within the new class **/ - static extend(mixins?: Mixin, args?: CoreObjectArguments): T; + static extend(args?: CoreObjectArguments): T; + static extend(mixin1: Mixin, args?: CoreObjectArguments): T; + static extend(mixin1: Mixin, mixin2: Mixin, args?: CoreObjectArguments): T; - /** - Creates a new subclass. - @method extend - @param {Object} [args] - Object containing values to use within the new class - Non-static method because Ember classes aren't currently 'real' TypeScript classes. - **/ - extend(args ?: CoreObjectArguments): T; /** Creates a new subclass. @method extend @@ -932,7 +884,7 @@ declare namespace Ember { @param {Object} [args] - Object containing values to use within the new class Non-static method because Ember classes aren't currently 'real' TypeScript classes. **/ - extend(mixins ? : Mixin, args ?: CoreObjectArguments): T; + extend(mixin1 ?: Mixin, mixin2 ?: Mixin, args ?: CoreObjectArguments): T; /** Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. @@ -1062,18 +1014,9 @@ declare namespace Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: string): boolean; @@ -1198,6 +1141,15 @@ declare namespace Ember { rootURL: string; } var IS_BINDING: RegExp; + var inject: { + controller(name?: string): Controller; + service(name?: string): Service; + }; + class Helper extends Object { + static helper( h: (a: any) => any): Helper; + compute(params: any[], hash: any): any; + recompute(params: any[], hash: any): any; + } class Instrumentation { getProperties(obj: any, list: any[]): {}; getProperties(obj: any, ...args: string[]): {}; @@ -1258,18 +1210,9 @@ declare namespace Ember { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: string): boolean; @@ -1330,18 +1273,9 @@ declare namespace Ember { someProperty(key: string, value?: string): boolean; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: string): boolean; @@ -1401,18 +1335,9 @@ declare namespace Ember { clear(): any[]; compact(): any[]; contains(obj: any): boolean; - enumerableContentDidChange(start: number, removing: number, adding: number): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any; - enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any; - enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any; - enumerableContentDidChange(removing: number, adding: number): any; - enumerableContentDidChange(removing: Enumerable, adding: number): any; - enumerableContentDidChange(removing: number, adding: Enumerable): any; - enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any; - enumerableContentWillChange(removing: number, adding: number): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable; - enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable; - enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable; + enumerableContentDidChange(start: number, removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; + enumerableContentWillChange(removing: Enumerable | number, adding: Enumerable | number): Enumerable; every(callback: Function, target?: any): boolean; everyBy(key: string, value?: string): boolean; everyProperty(key: string, value?: any): boolean; @@ -1477,8 +1402,7 @@ declare namespace Ember { notifyPropertyChange(keyName: string): Observable; propertyDidChange(keyName: string): Observable; propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: string): void; - removeObserver(key: string, target: any, method: Function): void; + removeObserver(key: string, target: any, method: Function | string): void; set(keyName: string, value: any): Observable; setProperties(hash: {}): Observable; toggleProperty(keyName: string): any; @@ -1531,8 +1455,7 @@ declare namespace Ember { notifyPropertyChange(keyName: string): Observable; propertyDidChange(keyName: string): Observable; propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: string): Observable; - removeObserver(key: string, target: any, method: Function): Observable; + removeObserver(key: string, target: any, method: Function | string): Observable; set(keyName: string, value: any): Observable; setProperties(hash: {}): Observable; toggleProperty(keyName: string): any; @@ -1572,8 +1495,7 @@ declare namespace Ember { notifyPropertyChange(keyName: string): Observable; propertyDidChange(keyName: string): Observable; propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: string): void; - removeObserver(key: string, target: {}, method: Function): void; + removeObserver(key: string, target: {}, method: Function | string): void; set(keyName: string, value: any): Observable; setProperties(hash: {}): Observable; /** @@ -1598,17 +1520,16 @@ declare namespace Ember { // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js namespace RSVP { - interface PromiseResolve { - (value?: any): void; - } - interface PromiseReject { - (reason?: any): void; - } - interface PromiseResolverFunction { - (resolve: PromiseResolve, reject: PromiseReject): void; + type PromiseResolve = (value?: T) => void; + type PromiseReject = (reason?: U) => void; + type PromiseResolverFunction = (resolve: PromiseResolve, reject: PromiseReject) => void; + + interface Thenable { + then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => X | Thenable): Thenable; + then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => void): Thenable; } - class Promise { + class Promise implements Thenable { /** Promise objects represent the eventual result of an asynchronous operation. The @@ -1621,7 +1542,7 @@ declare namespace Ember { Useful for tooling. @constructor */ - constructor(resolver: PromiseResolverFunction, label?: string); + constructor(resolver: PromiseResolverFunction, label?: string); /** The primary way of interacting with a promise is through its `then` method, @@ -1634,8 +1555,9 @@ declare namespace Ember { Useful for tooling. @return {Promise} */ - then(onFulfilled?: Function, onRejected?: Function): Promise; - + then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => X | Thenable): Promise; + // tslint:disable-next-line + then(onFulfilled?: (value: T) => V | Thenable, onRejected?: (error: any) => void): Promise; /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. @@ -1646,7 +1568,7 @@ declare namespace Ember { Useful for tooling. @return {Promise} */ - catch(onRejection: Function, label?: string): Promise; + catch(onRejection: (a: any) => U, label?: string): Promise; /** `finally` will be invoked regardless of the promise's fate just as native @@ -1658,8 +1580,10 @@ declare namespace Ember { Useful for tooling. @return {Promise} */ - finally(callback: Function, label?: string): Promise; + finally(callback: (a: T) => V, label?: string): Promise; } + + function all(promises: GlobalArray>): Promise; } /** @@ -1698,7 +1622,7 @@ declare namespace Ember { resolves. Otherwise, non-promise return values are not utilized in any way. */ - afterModel(resolvedModel: any, transition: EmberStates.Transition): RSVP.Promise; + afterModel(resolvedModel: any, transition: EmberStates.Transition): RSVP.Promise; /** This hook is the first of the route entry validation hooks @@ -1727,7 +1651,7 @@ declare namespace Ember { resolves. Otherwise, non-promise return values are not utilized in any way. */ - beforeModel(transition: EmberStates.Transition): RSVP.Promise; + beforeModel(transition: EmberStates.Transition): RSVP.Promise; /** The controller associated with this route. @@ -1840,7 +1764,7 @@ declare namespace Ember { the promise resolves, and the resolved value of the promise will be used as the model for this route. */ - model(params: {}, transition: EmberStates.Transition): any|RSVP.Promise; + model(params: {}, transition: EmberStates.Transition): any|RSVP.Promise; /** Returns the model of a parent (or any ancestor) route @@ -1863,7 +1787,7 @@ declare namespace Ember { @method paramsFor @param {String} name */ - paramsFor(name: string) : any; + paramsFor(name: string): any; /** Configuration hash for this route's queryParams. @@ -2174,7 +2098,7 @@ declare namespace Ember { @param {Function} method The function of the subscription @return this */ - off(name: string, target:any , method: Function): Evented; + off(name: string, target: any, method: Function): Evented; /** Checks to see if object has any subscriptions for named event. @@ -2211,6 +2135,28 @@ declare namespace Ember { router: Router; options: any; } + class Service extends CoreObject implements Observable { + /* Observable */ + addObserver: ModifyObserver; + beginPropertyChanges(): Observable; + cacheFor(keyName: string): any; + decrementProperty(keyName: string, decrement?: number): number; + endPropertyChanges(): Observable; + get(keyName: string): any; + getProperties(...args: string[]): {}; + getProperties(keys: string[]): {}; + getWithDefault(keyName: string, defaultValue: any): any; + hasObserverFor(key: string): boolean; + incrementProperty(keyName: string, increment?: number): number; + notifyPropertyChange(keyName: string): Observable; + propertyDidChange(keyName: string): Observable; + propertyWillChange(keyName: string): Observable; + removeObserver(key: string, target: {}, method: Function | string): void; + set(keyName: string, value: any): Observable; + setProperties(hash: {}): Observable; + toggleProperty(keyName: string): boolean; + /* /Observable */ + } var STRINGS: boolean; class State extends Object implements Evented { static detect(obj: any): boolean; @@ -2298,11 +2244,11 @@ declare namespace Ember { class Adapter extends Ember.Object { constructor (); } - class Promise extends Ember.RSVP.Promise { + class Promise extends Ember.RSVP.Promise { constructor (); } function oninjectHelpers(callback: Function): void; - function promise(resolver: Function, label: string): Ember.Test.Promise; + function promise(resolver: (a: T) => any, label: string): Ember.Test.Promise; function unregisterHelper(name: string): void; function registerHelper(name: string, helperMethod: Function): void; function registerAsyncHelper(name: string, helperMethod: Function): void; @@ -2315,7 +2261,7 @@ declare namespace Ember { function unregisterWaiter(callback: Function): void; function unregisterWaiter(context: any, callback: Function): void; - function resolve(result: any): Ember.Test.Promise; + function resolve(result: T): Ember.Test.Promise; } class TextArea extends Component implements TextSupport { static detect(obj: any): boolean; @@ -2385,10 +2331,7 @@ declare namespace Ember { actionContext: any; } var ViewUtils: {}; // TODO: define interface - function addListener(obj: any, eventName: string, target: any, method: Function, once?: boolean): void; - function addListener(obj: any, eventName: string, target: any, method: string, once?: boolean): void; - function addListener(obj: any, eventName: string, func: Function, method: Function, once?: boolean): void; - function addListener(obj: any, eventName: string, func: Function, method: string, once?: boolean): void; + function addListener(obj: any, eventName: string, target: Function | any, method: Function | string, once?: boolean): void; var addObserver: ModifyObserver; /** Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. @@ -2423,6 +2366,7 @@ declare namespace Ember { notEmpty(dependentKey: string): ComputedProperty; oneWay(dependentKey: string): ComputedProperty; or(...args: string[]): ComputedProperty; + readOnly(dependentString: string): ComputedProperty; }; // ReSharper restore DuplicatingLocalDeclaration function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller; @@ -2495,35 +2439,25 @@ declare namespace Ember { function propertyIsEnumerable(prop: string): boolean; function propertyWillChange(obj: any, keyName: string): void; function removeChainWatcher(obj: any, keyName: string, node: any): void; - function removeListener(obj: any, eventName: string, target: any, method: Function): void; - function removeListener(obj: any, eventName: string, target: any, method: string): void; - function removeListener(obj: any, eventName: string, func: Function, method: Function): void; - function removeListener(obj: any, eventName: string, func: Function, method: string): void; + function removeListener(obj: any, eventName: string, target: Function | any, method: Function | string): void; function removeObserver(obj: any, path: string, target: any, method: Function): any; function required(): Descriptor; function rewatch(obj: any): void; var run: { + (method: Function): void; (target: any, method: Function): void; begin(): void; cancel(timer: any): void; - debounce(target: any, method: Function, ...args: any[]): void; - debounce(target: any, method: string, ...args: any[]): void; + debounce(target: any, method: Function | string, ...args: any[]): void; end(): void; - join(target: any, method: Function, ...args: any[]): any; - join(target: any, method: string, ...args: any[]): any; - later(target: any, method: Function, ...args: any[]): string; - later(target: any, method: string, ...args: any[]): string; - next(target: any, method: Function, ...args: any[]): number; - next(target: any, method: string, ...args: any[]): number; - once(target: any, method: Function, ...args: any[]): number; - once(target: any, method: string, ...args: any[]): number; - schedule(queue: string, target: any, method: Function, ...args: any[]): void; - schedule(queue: string, target: any, method: string, ...args: any[]): void; - scheduleOnce(queue: string, target: any, method: Function, ...args: any[]): void; - scheduleOnce(queue: string, target: any, method: string, ...args: any[]): void; + join(target: any, method: Function | string, ...args: any[]): any; + later(target: any, method: Function | string, ...args: any[]): string; + next(target: any, method: Function | string, ...args: any[]): number; + once(target: any, method: Function | string, ...args: any[]): number; + schedule(queue: string, target: any, method: Function | string, ...args: any[]): void; + scheduleOnce(queue: string, target: any, method: Function | string, ...args: any[]): void; sync(): void; - throttle(target: any, method: Function, ...args: any[]): void; - throttle(target: any, method: string, ...args: any[]): void; + throttle(target: any, method: Function | string, ...args: any[]): void; queues: any[]; }; function runLoadHooks(name: string, object: any): void; @@ -2557,230 +2491,22 @@ declare namespace Ember { function watchPath(obj: any, keyPath: string): void; function watchedEvents(obj: {}): any[]; function wrap(func: Function, superFunc: Function): Function; - var _ContainerProxyMixin : Mixin; + var _ContainerProxyMixin: Mixin; var _RegistryProxyMixin: Mixin; function getOwner(object: any): any; function setOwner(object: any, owner: any): void; - var testing : boolean; - var MODEL_FACTORY_INJECTIONS : boolean; + var testing: boolean; + var MODEL_FACTORY_INJECTIONS: boolean; function assign(original: any, ...sources: any[]): any; } -declare namespace Em { - var $: typeof Ember.$; - var A: typeof Ember.A; - class ActionHandlerMixin extends Ember.ActionHandlerMixin { } - class Application extends Ember.Application { } - class Array extends Ember.Array { } - class ArrayProxy extends Ember.ArrayProxy { } - var BOOTED: typeof Ember.BOOTED; - class Binding extends Ember.Binding { } - class Button extends Ember.Button { } - class Checkbox extends Ember.Checkbox { } - class Comparable extends Ember.Comparable { } - class Component extends Ember.Component { } - class ComputedProperty extends Ember.ComputedProperty { } - class Container extends Ember.Container { } - class Controller extends Ember.Controller { } - class ControllerMixin extends Ember.ControllerMixin { } - class Copyable extends Ember.Copyable {} - class CoreObject extends Ember.CoreObject { } - class DAG extends Ember.DAG {} - var DEFAULT_GETTER_FUNCTION : typeof Ember.DEFAULT_GETTER_FUNCTION; - class DefaultResolver extends Ember.DefaultResolver { } - class Descriptor extends Ember.Descriptor { } - var ENV: typeof Ember.ENV; - var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; - class EachProxy extends Ember.EachProxy { } - class Enumerable extends Ember.Enumerable { } - var Error: typeof Ember.Error; - class EventDispatcher extends Ember.EventDispatcher { } - class Evented extends Ember.Evented { } - var FROZEN_ERROR: typeof Ember.FROZEN_ERROR; - class Freezable extends Ember.Freezable { } - var GUID_KEY: typeof Ember.GUID_KEY; - namespace Handlebars { - var compile: typeof Ember.Handlebars.compile; - var precompile: typeof Ember.Handlebars.precompile; - class Compiler extends Ember.Handlebars.Compiler { } - class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler{ } - var registerPartial: typeof Ember.Handlebars.registerPartial; - var K: typeof Ember.Handlebars.K; - var createFrame: typeof Ember.Handlebars.createFrame; - var Exception: typeof Ember.Handlebars.Exception; - class SafeString extends Ember.Handlebars.SafeString { } - var parse: typeof Ember.Handlebars.parse; - var print: typeof Ember.Handlebars.print; - var logger: typeof Ember.Handlebars.logger; - var log: typeof Ember.Handlebars.log; - } - class HashLocation extends Ember.HashLocation { } - class HistoryLocation extends Ember.HistoryLocation { } - var IS_BINDING: typeof Ember.IS_BINDING; - class Instrumentation extends Ember.Instrumentation { } - var K: typeof Ember.K; - var LOG_BINDINGS: typeof Ember.LOG_BINDINGS; - var LOG_STACKTRACE_ON_DEPRECATION: typeof Ember.LOG_STACKTRACE_ON_DEPRECATION; - var LOG_VERSION: typeof Ember.LOG_VERSION; - class Location extends Ember.Location {} - var Logger: typeof Ember.Logger; - var MANDATORY_SETTER_FUNCTION: typeof Ember.MANDATORY_SETTER_FUNCTION; - var META_KEY: typeof Ember.META_KEY; - class Map extends Ember.Map { } - class MapWithDefault extends Ember.MapWithDefault { } - class Mixin extends Ember.Mixin { } - class MutableArray extends Ember.MutableArray { } - class MutableEnumberable extends Ember.MutableEnumberable { } - var NAME_KEY: typeof Ember.NAME_KEY; - class Namespace extends Ember.Namespace { } - class NativeArray extends Ember.NativeArray { } - class NoneLocation extends Ember.NoneLocation { } - var ORDER_DEFINITION: typeof Ember.ORDER_DEFINITION; - class Object extends Ember.Object { } - class ObjectProxy extends Ember.ObjectProxy { } - class Observable extends Ember.Observable { } - class OrderedSet extends Ember.OrderedSet { } - class Registry extends Ember.Registry { } - namespace RSVP { - interface PromiseResolve extends Ember.RSVP.PromiseResolve { } - interface PromiseReject extends Ember.RSVP.PromiseReject { } - interface PromiseResolverFunction extends Ember.RSVP.PromiseResolverFunction { } - class Promise extends Ember.RSVP.Promise { } - } - class Route extends Ember.Route {} - class Router extends Ember.Router { } - class RouterDSL extends Ember.RouterDSL { } - var STRINGS: typeof Ember.STRINGS; - class State extends Ember.State { } - class StateManager extends Ember.StateManager { } - var String : typeof Ember.String; - var TEMPLATES: typeof Ember.TEMPLATES; - class TargetActionSupport extends Ember.TargetActionSupport {} - namespace Test { - class Adapter extends Ember.Test.Adapter { } - class Promise extends Ember.Test.Promise { } - var oninjectHelpers: typeof Ember.Test.oninjectHelpers; - var promise: typeof Ember.Test.promise; - var unregisterHelper: typeof Ember.Test.unregisterHelper; - var registerHelper: typeof Ember.Test.registerHelper; - var registerAsyncHelper: typeof Ember.Test.registerAsyncHelper; - var adapter: typeof Ember.Test.adapter; - var QUnitAdapter: typeof Ember.Test.QUnitAdapter; - var registerWaiter: typeof Ember.Test.registerWaiter; - var unregisterWaiter: typeof Ember.Test.unregisterWaiter - var resolve: typeof Ember.Test.resolve; - } - class TextArea extends Ember.TextArea { } - class TextField extends Ember.TextField { } - class TextSupport extends Ember.TextSupport { } - var VERSION: typeof Ember.VERSION; - class ViewTargetActionSupport extends Ember.ViewTargetActionSupport { } - var ViewUtils: typeof Ember.ViewUtils; - var addListener: typeof Ember.addListener; - var addObserver: typeof Ember.addObserver; - var alias: typeof Ember.alias; - var aliasMethod: typeof Ember.aliasMethod; - var assert: typeof Ember.assert; - var beginPropertyChanges: typeof Ember.beginPropertyChanges; - var bind: typeof Ember.bind; - var cacheFor: typeof Ember.cacheFor; - var canInvoke: typeof Ember.canInvoke; - var changeProperties: typeof Ember.changeProperties; - var compare: typeof Ember.compare; - var computed: typeof Ember.computed; - var controllerFor: typeof Ember.controllerFor; - var copy: typeof Ember.copy; - var create: typeof Ember.create; - var debug: typeof Ember.debug; - var defineProperty: typeof Ember.defineProperty; - var deprecate: typeof Ember.deprecate; - var deprecateFunc: typeof Ember.deprecateFunc - var destroy: typeof Ember.destroy; - var empty: typeof Ember.empty; - var endPropertyChanges: typeof Ember.endPropertyChanges; - var finishChains: typeof Ember.finishChains; - var generateController: typeof Ember.generateController; - var generateGuid: typeof Ember.generateGuid; - var get: typeof Ember.get; - var getPath: typeof Ember.getPath; - var getWithDefault: typeof Ember.getWithDefault; - var guidFor: typeof Ember.guidFor; - var handleErrors: typeof Ember.handleErrors; - var hasListeners: typeof Ember.hasListeners; - var hasOwnProperty: typeof Ember.hasOwnProperty; - var immediateObserver: typeof Ember.immediateObserver; - var inspect: typeof Ember.inspect; - var instrument: typeof Ember.instrument; - var isArray: typeof Ember.isArray; - var isEmpty: typeof Ember.isEmpty; - var isEqual: typeof Ember.isEqual; - var isGlobalPath: typeof Ember.isGlobalPath; - var isNamespace: typeof Ember.isNamespace; - var isNone: typeof Ember.isNone; - var isPrototypeOf: typeof Ember.isPrototypeOf; - var isWatching: typeof Ember.isWatching; - var keys: typeof Ember.keys; - var listenersDiff: typeof Ember.listenersDiff; - var listenersFor: typeof Ember.listenersFor; - var listenersUnion: typeof Ember.listenersUnion; - var lookup: typeof Ember.lookup; - var makeArray: typeof Ember.makeArray; - var merge: typeof Ember.merge; - var meta: typeof Ember.meta; - var mixin: typeof Ember.mixin; - var none: typeof Ember.none; - var observer: typeof Ember.observer; - var observersFor: typeof Ember.observersFor; - var onLoad: typeof Ember.onLoad; - var onError: typeof Ember.onError; - var overrideChains: typeof Ember.overrideChains; - var platform: typeof Ember.platform; - var propertyDidChange: typeof Ember.propertyDidChange; - var propertyIsEnumerable: typeof Ember.propertyIsEnumerable; - var propertyWillChange: typeof Ember.propertyWillChange; - var removeChainWatcher: typeof Ember.removeChainWatcher; - var removeListener: typeof Ember.removeListener; - var removeObserver: typeof Ember.removeObserver; - var required: typeof Ember.required; - var rewatch: typeof Ember.rewatch; - var run: typeof Ember.run; - var runLoadHooks: typeof Ember.runLoadHooks; - var sendEvent: typeof Ember.sendEvent; - var set: typeof Ember.set; - var setPath: typeof Ember.setPath; - var setProperties: typeof Ember.setProperties; - var subscribe: typeof Ember.subscribe; - var toLocaleString: typeof Ember.toLocaleString; - var toString: typeof Ember.toString; - var tryCatchFinally: typeof Ember.tryCatchFinally; - var tryInvoke: typeof Ember.tryInvoke; - var trySet: typeof Ember.trySet; - var trySetPath: typeof Ember.trySetPath; - var typeOf: typeof Ember.typeOf; - var unwatch: typeof Ember.unwatch; - var unwatchKey: typeof Ember.unwatchKey; - var unwatchPath: typeof Ember.unwatchPath; - var uuid: typeof Ember.uuid; - var valueOf: typeof Ember.valueOf; - var warn: typeof Ember.warn; - var watch: typeof Ember.watch; - var watchKey: typeof Ember.watchKey; - var watchPath: typeof Ember.watchPath; - var watchedEvents: typeof Ember.watchedEvents; - var wrap: typeof Ember.wrap; - var _ContainerProxyMixin : typeof Ember._ContainerProxyMixin; - var _RegistryProxyMixin: typeof Ember._RegistryProxyMixin; - var getOwner: typeof Ember.getOwner; - var setOwner: typeof Ember.setOwner; - var testing: typeof Ember.testing; - var MODEL_FACTORY_INJECTIONS: typeof Ember.MODEL_FACTORY_INJECTIONS; - var assign: typeof Ember.assign; -} +import Em = Ember; + /** - * External ambient module - to allow "import Ember = require('Ember');" to work correctly + * External ambient module - to allow "import Ember from 'ember';" to work correctly */ -declare module "Ember" { - export = Ember; +declare module "ember" { + export default Ember; } diff --git a/ember/tsconfig.json b/ember/tsconfig.json index 0bfee35a23..5f0384fae4 100644 --- a/ember/tsconfig.json +++ b/ember/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,4 +16,4 @@ "index.d.ts", "ember-tests.ts" ] -} \ No newline at end of file +} diff --git a/ember/tslint.json b/ember/tslint.json new file mode 100644 index 0000000000..e2cf959984 --- /dev/null +++ b/ember/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "../tslint.json", + "rules": { + // Heavy use of Function type in this older package. + "forbidden-types": false, + // not sure what this means + "no-single-declare-module": false + } +} diff --git a/enhanced-resolve/enhanced-resolve-tests.ts b/enhanced-resolve/enhanced-resolve-tests.ts new file mode 100644 index 0000000000..6588bb125b --- /dev/null +++ b/enhanced-resolve/enhanced-resolve-tests.ts @@ -0,0 +1,42 @@ +import resolve = require('enhanced-resolve'); +import { Context } from 'enhanced-resolve/lib/concord'; +import { ResolveResult } from 'enhanced-resolve/lib/common-types' +import Resolver = require('enhanced-resolve/lib/Resolver') + +resolve('lib', 'string', function (err) { }); + +let context: Context = { + referrer: 'hi' +}; + +resolve(context, 'path', 'string', function () { }); + +let resolver: Resolver +resolver = resolve.ResolverFactory.createResolver({ + extensions: ['.js'], + fileSystem: {} +}); + +const nfs = new resolve.NodeJsInputFileSystem(); + +const snfs = new resolve.SyncNodeJsInputFileSystem(); + +const cfs = new resolve.CachedInputFileSystem(nfs, 4); +const cfs2 = new resolve.CachedInputFileSystem(snfs, 4); + +let result: ResolveResult + +result = resolve.sync(context, 'path', 'string'); +result = resolve.sync('path', 'string'); + +resolve.context('lib', 'string', function (err) { }); +resolve.context(context, 'path', 'string', function () { }); + +result = resolve.context.sync(context, 'path', 'string'); +result = resolve.context.sync('path', 'string'); + +resolve.create('lib', 'string', function (err) { }); +resolve.create(context, 'path', 'string', function () { }); + +result = resolve.create.sync(context, 'path', 'string'); +result = resolve.create.sync('path', 'string'); diff --git a/enhanced-resolve/index.d.ts b/enhanced-resolve/index.d.ts new file mode 100644 index 0000000000..142e644bd1 --- /dev/null +++ b/enhanced-resolve/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for enhanced-resolve v2.3.0 +// Project: http://github.com/webpack/enhanced-resolve.git +// Definitions by: e-cloud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +import fs = require('fs'); +import { + ResolveResult, + LoggingCallbackWrapper, + ErrorCallback, + CommonFileSystemMethod, + BaseFileSystem, + ResolverRequest +} from './lib/common-types'; +import { Context } from './lib/concord'; +import Resolver = require('./lib/Resolver'); + +declare namespace Resolve { + function sync(path: string, request: string): ResolveResult; + function sync(context: Context, path: string, request: string): ResolveResult; + + function context(path: string, request: string, callback: LoggingCallbackWrapper): void; + function context(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + + namespace context { + function sync(path: string, request: string): ResolveResult; + function sync(context: Context, path: string, request: string): ResolveResult; + } + + function loader(path: string, request: string, callback: LoggingCallbackWrapper): void; + function loader(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + + namespace context { + function sync(path: string, request: string): ResolveResult; + function sync(context: Context, path: string, request: string): ResolveResult; + } + + function create(path: string, request: string, callback: LoggingCallbackWrapper): void; + function create(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + + export namespace create { + function sync(path: string, request: string): ResolveResult; + function sync(context: Context, path: string, request: string): ResolveResult; + } + + export namespace ResolverFactory { + interface ResolverOption { + modules?: string[]; + descriptionFiles?: string[]; + plugins?: any[]; + mainFields?: string[]; + aliasFields?: string[]; + mainFiles?: string[]; + extensions: string[]; + enforceExtension?: boolean; + moduleExtensions?: string[]; + enforceModuleExtension?: boolean; + alias?: AliasItem[] | {}; + symlinks?: string[] | boolean; + resolveToContext?: boolean; + unsafeCache?: boolean | {}; + cachePredicate?: (val: ResolverRequest) => boolean; + fileSystem: any; + resolver?: Resolver; + } + interface AliasItem { + name: string; + alias: string; + onlyModule: boolean; + } + function createResolver(options: ResolverOption): Resolver; + } + + class NodeJsInputFileSystem { + readdir(path: string, callback: (err: Error, files: string[]) => void): void; + + isSync(): boolean; + + stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; + + readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + + readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + } + + class SyncNodeJsInputFileSystem { + isSync(): boolean; + + stat: CommonFileSystemMethod; + readdir: CommonFileSystemMethod; + readFile(path: string, encoding?: string, callback?: (err: NodeJS.ErrnoException, result: Buffer) => void): void; + readFile(path: string, callback?: (err: NodeJS.ErrnoException, result: Buffer) => void): void; + readlink: CommonFileSystemMethod; + } + + class CachedInputFileSystem { + fileSystem: BaseFileSystem; + _statStorage: Storage; + _readdirStorage: Storage; + _readFileStorage: Storage; + _readJsonStorage: Storage; + _readlinkStorage: Storage; + _stat: CommonFileSystemMethod; + _readdir: CommonFileSystemMethod; + _readFile: CommonFileSystemMethod; + _readJson: CommonFileSystemMethod; + _readlink: CommonFileSystemMethod; + + constructor(fileSystem: BaseFileSystem, duration: number); + + isSync(): boolean; + + stat(path: string, callback: ErrorCallback): void; + + readdir(path: string, callback: ErrorCallback): void; + + readFile(path: string, callback: ErrorCallback): void; + + readJson(path: string, callback: ErrorCallback): void; + + readlink(path: string, callback: ErrorCallback): void; + + purge(what?: string | string[]): void; + } +} + +declare function Resolve(path: string, request: string, callback: LoggingCallbackWrapper): void; +declare function Resolve(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + +export = Resolve; diff --git a/enhanced-resolve/lib/AliasFieldPlugin.d.ts b/enhanced-resolve/lib/AliasFieldPlugin.d.ts new file mode 100644 index 0000000000..d49ba745b8 --- /dev/null +++ b/enhanced-resolve/lib/AliasFieldPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class AliasFieldPlugin { + source: string; + field: string; + target: string; + + constructor(source: string, field: string, target: string); + + apply(resolver: Resolver): void; +} +export = AliasFieldPlugin; diff --git a/enhanced-resolve/lib/AliasPlugin.d.ts b/enhanced-resolve/lib/AliasPlugin.d.ts new file mode 100644 index 0000000000..4d9635f1c5 --- /dev/null +++ b/enhanced-resolve/lib/AliasPlugin.d.ts @@ -0,0 +1,17 @@ +import Resolver = require('./Resolver'); +import Resolve = require('../'); + +declare class AliasPlugin { + source: string; + options: Resolve.ResolverFactory.AliasItem; + target: string; + name: string; + alias: string; + onlyModule: boolean; + + constructor(source: string, options: Resolve.ResolverFactory.AliasItem, target: string); + + apply(resolver: Resolver): void; +} + +export = AliasPlugin; diff --git a/enhanced-resolve/lib/AppendPlugin.d.ts b/enhanced-resolve/lib/AppendPlugin.d.ts new file mode 100644 index 0000000000..7a5f7e1a62 --- /dev/null +++ b/enhanced-resolve/lib/AppendPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class AppendPlugin { + source: string; + appending: string; + target: string; + + constructor(source: string, appending: string, target: string); + + apply(resolver: Resolver): void; +} +export = AppendPlugin; diff --git a/enhanced-resolve/lib/CloneBasenamePlugin.d.ts b/enhanced-resolve/lib/CloneBasenamePlugin.d.ts new file mode 100644 index 0000000000..8a4483902e --- /dev/null +++ b/enhanced-resolve/lib/CloneBasenamePlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class CloneBasenamePlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = CloneBasenamePlugin; diff --git a/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts b/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts new file mode 100644 index 0000000000..89d0880350 --- /dev/null +++ b/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class ConcordExtensionsPlugin { + source: string; + options: {}; + target: string; + + constructor(source: string, options: {}, target: string); + + apply(resolver: Resolver): void; +} +export = ConcordExtensionsPlugin; diff --git a/enhanced-resolve/lib/ConcordMainPlugin.d.ts b/enhanced-resolve/lib/ConcordMainPlugin.d.ts new file mode 100644 index 0000000000..9d2fdf3d44 --- /dev/null +++ b/enhanced-resolve/lib/ConcordMainPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class ConcordMainPlugin { + source: string; + options: {}; + target: string; + + constructor(source: string, options: {}, target: string); + + apply(resolver: Resolver): void; +} +export = ConcordMainPlugin; diff --git a/enhanced-resolve/lib/ConcordModulesPlugin.d.ts b/enhanced-resolve/lib/ConcordModulesPlugin.d.ts new file mode 100644 index 0000000000..3afbd32a9c --- /dev/null +++ b/enhanced-resolve/lib/ConcordModulesPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class ConcordModulesPlugin { + source: string; + options: {}; + target: string; + + constructor(source: string, options: {}, target: string); + + apply(resolver: Resolver): void; +} +export = ConcordModulesPlugin; diff --git a/enhanced-resolve/lib/DescriptionFilePlugin.d.ts b/enhanced-resolve/lib/DescriptionFilePlugin.d.ts new file mode 100644 index 0000000000..f9f560de46 --- /dev/null +++ b/enhanced-resolve/lib/DescriptionFilePlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class DescriptionFilePlugin { + source: string; + target: string; + filenames: string[]; + + constructor(source: string, filenames: string[] | string, target: string); + + apply(resolver: Resolver): void; +} +export = DescriptionFilePlugin; diff --git a/enhanced-resolve/lib/DescriptionFileUtils.d.ts b/enhanced-resolve/lib/DescriptionFileUtils.d.ts new file mode 100644 index 0000000000..db7cd77723 --- /dev/null +++ b/enhanced-resolve/lib/DescriptionFileUtils.d.ts @@ -0,0 +1,8 @@ +import Resolver = require('./Resolver'); +declare function loadDescriptionFile( + resolver: Resolver, directory: string, filenames: string[], + callback: (...args: any[]) => any +): void; +declare function getField(content: any, field: string): any; +declare function cdUp(directory: string): string | null; +export { loadDescriptionFile, getField, cdUp }; diff --git a/enhanced-resolve/lib/DirectoryExistsPlugin.d.ts b/enhanced-resolve/lib/DirectoryExistsPlugin.d.ts new file mode 100644 index 0000000000..d4483985ab --- /dev/null +++ b/enhanced-resolve/lib/DirectoryExistsPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class DirectoryExistsPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = DirectoryExistsPlugin; diff --git a/enhanced-resolve/lib/FileExistsPlugin.d.ts b/enhanced-resolve/lib/FileExistsPlugin.d.ts new file mode 100644 index 0000000000..061a8475c2 --- /dev/null +++ b/enhanced-resolve/lib/FileExistsPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class FileExistsPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = FileExistsPlugin; diff --git a/enhanced-resolve/lib/FileKindPlugin.d.ts b/enhanced-resolve/lib/FileKindPlugin.d.ts new file mode 100644 index 0000000000..86c0e68543 --- /dev/null +++ b/enhanced-resolve/lib/FileKindPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class FileKindPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = FileKindPlugin; diff --git a/enhanced-resolve/lib/JoinRequestPlugin.d.ts b/enhanced-resolve/lib/JoinRequestPlugin.d.ts new file mode 100644 index 0000000000..66238fddb9 --- /dev/null +++ b/enhanced-resolve/lib/JoinRequestPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class JoinRequestPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = JoinRequestPlugin; diff --git a/enhanced-resolve/lib/LogInfoPlugin.d.ts b/enhanced-resolve/lib/LogInfoPlugin.d.ts new file mode 100644 index 0000000000..26dcecac87 --- /dev/null +++ b/enhanced-resolve/lib/LogInfoPlugin.d.ts @@ -0,0 +1,9 @@ +import Resolver = require('./Resolver'); +declare class LogInfoPlugin { + source: string; + + constructor(source: string); + + apply(resolver: Resolver): void; +} +export = LogInfoPlugin; diff --git a/enhanced-resolve/lib/MainFieldPlugin.d.ts b/enhanced-resolve/lib/MainFieldPlugin.d.ts new file mode 100644 index 0000000000..8a8882d6f0 --- /dev/null +++ b/enhanced-resolve/lib/MainFieldPlugin.d.ts @@ -0,0 +1,19 @@ +import Resolver = require('./Resolver'); +declare class MainFieldPlugin { + source: string; + options: { + name: string; + forceRelative: boolean; + }; + target: string; + + constructor( + source: string, options: { + name: string; + forceRelative: boolean; + }, target: string + ); + + apply(resolver: Resolver): void; +} +export = MainFieldPlugin; diff --git a/enhanced-resolve/lib/ModuleAppendPlugin.d.ts b/enhanced-resolve/lib/ModuleAppendPlugin.d.ts new file mode 100644 index 0000000000..3380d33622 --- /dev/null +++ b/enhanced-resolve/lib/ModuleAppendPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class ModuleAppendPlugin { + source: string; + appending: string; + target: string; + + constructor(source: string, appending: string, target: string); + + apply(resolver: Resolver): void; +} +export = ModuleAppendPlugin; diff --git a/enhanced-resolve/lib/ModuleKindPlugin.d.ts b/enhanced-resolve/lib/ModuleKindPlugin.d.ts new file mode 100644 index 0000000000..a4b945a09d --- /dev/null +++ b/enhanced-resolve/lib/ModuleKindPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class ModuleKindPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = ModuleKindPlugin; diff --git a/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts b/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts new file mode 100644 index 0000000000..d744870022 --- /dev/null +++ b/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class ModulesInHierachicDirectoriesPlugin { + source: string; + target: string; + directories: string[]; + + constructor(source: string, directories: string[], target: string); + + apply(resolver: Resolver): void; +} +export = ModulesInHierachicDirectoriesPlugin; diff --git a/enhanced-resolve/lib/ModulesInRootPlugin.d.ts b/enhanced-resolve/lib/ModulesInRootPlugin.d.ts new file mode 100644 index 0000000000..87654ce919 --- /dev/null +++ b/enhanced-resolve/lib/ModulesInRootPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class ModulesInRootPlugin { + source: string; + path: string; + target: string; + + constructor(source: string, path: string, target: string); + + apply(resolver: Resolver): void; +} +export = ModulesInRootPlugin; diff --git a/enhanced-resolve/lib/NextPlugin.d.ts b/enhanced-resolve/lib/NextPlugin.d.ts new file mode 100644 index 0000000000..7ffbefa643 --- /dev/null +++ b/enhanced-resolve/lib/NextPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class NextPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = NextPlugin; diff --git a/enhanced-resolve/lib/ParsePlugin.d.ts b/enhanced-resolve/lib/ParsePlugin.d.ts new file mode 100644 index 0000000000..933d6d50ff --- /dev/null +++ b/enhanced-resolve/lib/ParsePlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class ParsePlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = ParsePlugin; diff --git a/enhanced-resolve/lib/Resolver.d.ts b/enhanced-resolve/lib/Resolver.d.ts new file mode 100644 index 0000000000..4d2f3ee477 --- /dev/null +++ b/enhanced-resolve/lib/Resolver.d.ts @@ -0,0 +1,26 @@ +/// +import Tapable = require('tapable'); +import { ResolveParseResult, ResolverRequest, LoggingCallbackWrapper, BaseFileSystem } from './common-types'; +import { Context } from './concord'; +declare class Resolver extends Tapable { + fileSystem: BaseFileSystem; + + constructor(fileSystem: BaseFileSystem); + + resolveSync(context: Context, path: string, request: string): null; + + resolve(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): any; + + doResolve(type: string, request: ResolverRequest, message: string | null, callback: LoggingCallbackWrapper): any; + + parse(identifier: string): ResolveParseResult | null; + + isModule(path: string): boolean; + + isDirectory(path: string): boolean; + + join(path: string, request: string): string; + + normalize(path: string): string; +} +export = Resolver; diff --git a/enhanced-resolve/lib/ResultPlugin.d.ts b/enhanced-resolve/lib/ResultPlugin.d.ts new file mode 100644 index 0000000000..47e5b2324a --- /dev/null +++ b/enhanced-resolve/lib/ResultPlugin.d.ts @@ -0,0 +1,9 @@ +import Resolver = require('./Resolver'); +declare class ResultPlugin { + source: string; + + constructor(source: string); + + apply(resolver: Resolver): void; +} +export = ResultPlugin; diff --git a/enhanced-resolve/lib/Storage.d.ts b/enhanced-resolve/lib/Storage.d.ts new file mode 100644 index 0000000000..4260b42ee7 --- /dev/null +++ b/enhanced-resolve/lib/Storage.d.ts @@ -0,0 +1,34 @@ +/// +import { CommonFileSystemMethod } from './common-types'; + +declare class Storage { + duration: number; + running: { + [name: string]: ((...args: any[]) => any)[] + }; + data: { + [name: string]: any[] + }; + levels: string[][]; + count: number; + interval: NodeJS.Timer | null; + needTickCheck: boolean; + nextTick: number | null; + passive: boolean; + + constructor(duration: number); + + ensureTick(): void; + + finished(name: string): void; + + provide(name: string, provider: CommonFileSystemMethod, callback: (...args: any[]) => any): any; + + tick(): true | undefined; + + checkTicks(): void; + + purge(what?: string | string[]): void; +} + +export default Storage; diff --git a/enhanced-resolve/lib/SymlinkPlugin.d.ts b/enhanced-resolve/lib/SymlinkPlugin.d.ts new file mode 100644 index 0000000000..e5f500637b --- /dev/null +++ b/enhanced-resolve/lib/SymlinkPlugin.d.ts @@ -0,0 +1,10 @@ +import Resolver = require('./Resolver'); +declare class SymlinkPlugin { + source: string; + target: string; + + constructor(source: string, target: string); + + apply(resolver: Resolver): void; +} +export = SymlinkPlugin; diff --git a/enhanced-resolve/lib/TryNextPlugin.d.ts b/enhanced-resolve/lib/TryNextPlugin.d.ts new file mode 100644 index 0000000000..eeb4d1e795 --- /dev/null +++ b/enhanced-resolve/lib/TryNextPlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class TryNextPlugin { + source: string; + message: string | null; + target: string; + + constructor(source: string, message: string | null, target: string); + + apply(resolver: Resolver): void; +} +export = TryNextPlugin; diff --git a/enhanced-resolve/lib/UnsafeCachePlugin.d.ts b/enhanced-resolve/lib/UnsafeCachePlugin.d.ts new file mode 100644 index 0000000000..8b8c8f5f09 --- /dev/null +++ b/enhanced-resolve/lib/UnsafeCachePlugin.d.ts @@ -0,0 +1,13 @@ +import Resolver = require('./Resolver'); +import { ResolverRequest } from './common-types'; +declare class UnsafeCachePlugin { + source: string; + filterPredicate: (str: ResolverRequest) => boolean; + cache: {}; + target: string; + + constructor(source: string, filterPredicate: (str: ResolverRequest) => boolean, cache: {}, target: string); + + apply(resolver: Resolver): void; +} +export = UnsafeCachePlugin; diff --git a/enhanced-resolve/lib/UseFilePlugin.d.ts b/enhanced-resolve/lib/UseFilePlugin.d.ts new file mode 100644 index 0000000000..c7d23c7b8d --- /dev/null +++ b/enhanced-resolve/lib/UseFilePlugin.d.ts @@ -0,0 +1,11 @@ +import Resolver = require('./Resolver'); +declare class UseFilePlugin { + source: string; + filename: string; + target: string; + + constructor(source: string, filename: string, target: string); + + apply(resolver: Resolver): void; +} +export = UseFilePlugin; diff --git a/enhanced-resolve/lib/common-types.d.ts b/enhanced-resolve/lib/common-types.d.ts new file mode 100644 index 0000000000..30c39d1210 --- /dev/null +++ b/enhanced-resolve/lib/common-types.d.ts @@ -0,0 +1,63 @@ +import { Context } from './concord'; + +export interface ResolveError extends Error { + details: string; + missing: string[]; + recursion: boolean; +} + +export interface ResolveParseResult { + request: string; + query: string; + module: boolean; + directory: boolean; + file: boolean; +} + +export interface ResolveResult { + path: boolean | string; + query: string; +} + +export interface ResolverRequest { + request: string; + relativePath?: string; + descriptionFileData?: any; + descriptionFileRoot?: string; + descriptionFilePath?: string; + context: Context; + path: string; + query?: string; + directory?: boolean; + module?: boolean; +} + +export interface LoggingCallbackTools { + log?(msg: string): void; + stack?: string[]; + missing?: string[] | { + push: (item: string) => void; + }; +} + +export interface LoggingCallbackWrapper extends LoggingCallbackTools { + (err?: Error | null, ...args: any[]): any; +} + +export interface ErrorCallback { + (err: Error | null, ...args: any[]): any; +} + +export interface CommonFileSystemMethod { + (name: string, callback: (err: Error | null, ...args: any[]) => void): void; +} + +export interface BaseFileSystem { + stat: CommonFileSystemMethod; + readdir?: CommonFileSystemMethod; + readFile?(path: string, encoding: string, callback: ErrorCallback): void; + readFile?(path: string, callback: ErrorCallback): void; + readJson?: CommonFileSystemMethod; + readlink?: CommonFileSystemMethod; + isSync: () => boolean; +} diff --git a/enhanced-resolve/lib/concord.d.ts b/enhanced-resolve/lib/concord.d.ts new file mode 100644 index 0000000000..d11f1047df --- /dev/null +++ b/enhanced-resolve/lib/concord.d.ts @@ -0,0 +1,38 @@ +export interface Type { + type: string | null | undefined; + features: string[]; +} + +export interface Context { + supportedResourceTypes?: string[]; + environments?: string[]; + referrer: string; +} + +declare function parseType(type: string): Type; +declare function isTypeMatched(baseType: string | Type, testedType: string | Type): boolean; +declare function isResourceTypeSupported(context: Context, type: string): boolean | undefined; +declare function isEnvironment(context: Context, env: string | Type): boolean | undefined; +declare function isGlobMatched(glob: string, relativePath: string): boolean; +declare function isConditionMatched(context: Context, condition: string): boolean; +declare function isKeyMatched(context: Context, key: string): string | boolean; +declare function getField(context: Context, configuration: any, field: string): undefined; +declare function getMain(context: Context, configuration: any): undefined; +declare function getExtensions(context: Context, configuration: any): undefined; +declare function matchModule(context: Context, configuration: any, request: string): any; +declare function matchType(context: Context, configuration: any, relativePath: string): undefined; + +export { + parseType, + isTypeMatched, + isResourceTypeSupported, + isEnvironment, + isGlobMatched, + isConditionMatched, + isKeyMatched, + getField, + getMain, + getExtensions, + matchModule, + matchType +}; diff --git a/enhanced-resolve/lib/getPaths.d.ts b/enhanced-resolve/lib/getPaths.d.ts new file mode 100644 index 0000000000..abc2754510 --- /dev/null +++ b/enhanced-resolve/lib/getPaths.d.ts @@ -0,0 +1,5 @@ +export default function getPaths(path: string): { + paths: string[]; + seqments: string[]; +}; +export declare function basename(path: string): string | null; diff --git a/enhanced-resolve/lib/globToRegExp.d.ts b/enhanced-resolve/lib/globToRegExp.d.ts new file mode 100644 index 0000000000..8fc134e6a8 --- /dev/null +++ b/enhanced-resolve/lib/globToRegExp.d.ts @@ -0,0 +1,2 @@ +declare function globToRegExp(glob: string): RegExp; +export { globToRegExp }; diff --git a/enhanced-resolve/lib/lib-tests.ts b/enhanced-resolve/lib/lib-tests.ts new file mode 100644 index 0000000000..a41e5d9aeb --- /dev/null +++ b/enhanced-resolve/lib/lib-tests.ts @@ -0,0 +1,149 @@ +import AliasFieldPlugin = require('enhanced-resolve/lib/AliasFieldPlugin'); + +import AliasPlugin = require('enhanced-resolve/lib/AliasPlugin'); + +import AppendPlugin = require('enhanced-resolve/lib/AppendPlugin'); + +import CloneBasenamePlugin = require('enhanced-resolve/lib/CloneBasenamePlugin'); + +import ConcordExtensionsPlugin = require('enhanced-resolve/lib/ConcordExtensionsPlugin'); + +import ConcordMainPlugin = require('enhanced-resolve/lib/ConcordMainPlugin'); + +import ConcordModulesPlugin = require('enhanced-resolve/lib/ConcordModulesPlugin'); + +import DescriptionFilePlugin = require('enhanced-resolve/lib/DescriptionFilePlugin'); + +import DescriptionFileUtils = require('enhanced-resolve/lib/DescriptionFileUtils'); + +import DirectoryExistsPlugin = require('enhanced-resolve/lib/DirectoryExistsPlugin'); + +import FileExistsPlugin = require('enhanced-resolve/lib/FileExistsPlugin'); + +import FileKindPlugin = require('enhanced-resolve/lib/FileKindPlugin'); + +import getPaths, { basename } from 'enhanced-resolve/lib/getPaths'; + +import { globToRegExp } from 'enhanced-resolve/lib/globToRegExp'; + +import JoinRequestPlugin = require('enhanced-resolve/lib/JoinRequestPlugin'); + +import LogInfoPlugin = require('enhanced-resolve/lib/LogInfoPlugin'); + +import MainFieldPlugin = require('enhanced-resolve/lib/MainFieldPlugin'); + +import ModuleAppendPlugin = require('enhanced-resolve/lib/ModuleAppendPlugin'); + +import ModuleKindPlugin = require('enhanced-resolve/lib/ModuleKindPlugin'); + +import ModulesInHierachicDirectoriesPlugin = require('enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin'); + +import ModulesInRootPlugin = require('enhanced-resolve/lib/ModulesInRootPlugin'); + +import NextPlugin = require('enhanced-resolve/lib/NextPlugin'); + +import ParsePlugin = require('enhanced-resolve/lib/ParsePlugin'); + +import Resolver = require('enhanced-resolve/lib/Resolver'); + +import ResultPlugin = require('enhanced-resolve/lib/ResultPlugin'); + +import Storage from 'enhanced-resolve/lib/Storage' + +import SymlinkPlugin = require('enhanced-resolve/lib/SymlinkPlugin'); + +import TryNextPlugin = require('enhanced-resolve/lib/TryNextPlugin'); + +import UnsafeCachePlugin = require('enhanced-resolve/lib/UnsafeCachePlugin'); + +import UseFilePlugin = require('enhanced-resolve/lib/UseFilePlugin'); + +import resolve = require('../'); + +import { BaseFileSystem } from 'enhanced-resolve/lib/common-types' + +const aplugin = new AliasFieldPlugin('a', 'b', 'c'); + +const aplugin2 = new AliasPlugin('a', { + onlyModule: false, + name: 'a', + alias: 'b' +}, 'string') + +const aplugin3 = new AppendPlugin('a', 'b', 'c'); + +const cplugin = new CloneBasenamePlugin('a', 'c'); + +const cplugin2 = new ConcordExtensionsPlugin('a', { + any: 'string', + right: false +}, 'b'); + +const cplugin3 = new ConcordMainPlugin('string', { + any: 'string', + right: false +}, 'string'); + +const cplugin4 = new ConcordModulesPlugin('string', { + any: 'string', + right: false +}, 'string'); + +const dplugin = new DescriptionFilePlugin('string', 'string', 'string'); + +DescriptionFileUtils.cdUp('./lib'); +DescriptionFileUtils.getField({}, 'hi'); +DescriptionFileUtils.loadDescriptionFile(resolve.ResolverFactory.createResolver({ + extensions: [''], + fileSystem: {} +}), './lib', ['file'], function () { }); + +const dplugin1 = new DirectoryExistsPlugin('string', 'string'); + +const fplugin = new FileExistsPlugin('string', 's'); + +const fplugin2 = new FileKindPlugin('string', 's'); + +getPaths('./lib'); + +basename('./lib'); + +globToRegExp('lib/**'); + +const jplugin = new JoinRequestPlugin('string', 's'); + +const lplugin = new LogInfoPlugin('string'); + +const mplugin = new MainFieldPlugin('string', { + name: 'hi', + forceRelative: false +}, 's'); + +const mplugin2 = new ModuleAppendPlugin('string', 'ap', 's'); + +const mplugin3 = new ModuleKindPlugin('string', 's'); + +const mplugin4 = new ModulesInHierachicDirectoriesPlugin('string', ['arr'], 's'); + +const mplugin5 = new ModulesInRootPlugin('string', 'ap', 's'); + +const nplugin = new NextPlugin('string', 'ap'); + +const pplugin = new ParsePlugin('string', 'ap'); + +const resolver = new Resolver({} as BaseFileSystem); + +const rplugin = new ResultPlugin('string'); + +const splugin = new SymlinkPlugin('string', 's'); + +const tplugin = new TryNextPlugin('string', 'ap', 's'); + +const uplugin = new UnsafeCachePlugin('string', function (e) { return false }, { + hi: 'string', + hello: true +}, 's'); + +const uplugin2 = new UseFilePlugin('string', 'ap', 's'); + +const s = new Storage(4); diff --git a/enhanced-resolve/tsconfig.json b/enhanced-resolve/tsconfig.json new file mode 100644 index 0000000000..96a70f3bf2 --- /dev/null +++ b/enhanced-resolve/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "include": [ + "index.d.ts", + "enhanced-resolve-tests.ts", + "lib/*.ts" + ] +} diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 77bd63e3e6..a97c33051e 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -1,4 +1,3 @@ -/* import { shallow, mount, render, describeWithDOM, spyLifecycle } from "enzyme"; import * as React from "react"; import {Component, ReactElement, HTMLAttributes} from "react"; @@ -39,7 +38,8 @@ namespace ShallowWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ShallowWrapper + numOrStringVal: number | string, + elementWrapper: ShallowWrapper, {}> function test_shallow_options() { shallow(, { @@ -307,6 +307,10 @@ namespace ShallowWrapperTest { function test_isEmptyRender() { boolVal = shallowWrapper.isEmptyRender(); } + + function test_svg() { + numOrStringVal = shallowWrapper.find('svg').props().strokeWidth; + } } @@ -319,7 +323,7 @@ namespace ReactWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ReactWrapper + elementWrapper: ReactWrapper, {}> function test_unmount() { reactWrapper = reactWrapper.unmount(); @@ -593,7 +597,7 @@ namespace CheerioWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: CheerioWrapper + elementWrapper: CheerioWrapper, {}> function test_find() { elementWrapper = cheerioWrapper.find('.selector'); @@ -821,4 +825,4 @@ namespace CheerioWrapperTest { function test_everyWhere() { boolVal = cheerioWrapper.everyWhere((aCheerioWrapper: CheerioWrapper) => true); } -}*/ \ No newline at end of file +} diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts index d531d12f03..63907a5c58 100644 --- a/enzyme/index.d.ts +++ b/enzyme/index.d.ts @@ -3,9 +3,9 @@ // Definitions by: Marian Palkus , Cap3 , Ivo Stratev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes as ReactHTMLAttributes } from "react"; +import { ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react"; -type HTMLAttributes = ReactHTMLAttributes<{}>; +type HTMLAttributes = ReactHTMLAttributes<{}> & ReactSVGAttributes<{}>; export class ElementClass extends Component { } diff --git a/event-stream/index.d.ts b/event-stream/index.d.ts index 6b78d7fc9a..b1b215865e 100644 --- a/event-stream/index.d.ts +++ b/event-stream/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for event-stream v3.3.2 +// Type definitions for event-stream v3.3.2 // Project: https://github.com/dominictarr/event-stream // Definitions by: David Gardiner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/eventemitter2/index.d.ts b/eventemitter2/index.d.ts index 0372b675dc..33ffe20b09 100644 --- a/eventemitter2/index.d.ts +++ b/eventemitter2/index.d.ts @@ -23,7 +23,7 @@ interface EventEmitter2Configuration { * max listeners that can be assigned to an event, default 10. */ maxListeners?: number; - + /** * show event name in memory leak message when more than maximum amount of listeners is assigned, default false */ diff --git a/expect/expect-tests.ts b/expect/expect-tests.ts index 09277eec1f..69ed58b956 100644 --- a/expect/expect-tests.ts +++ b/expect/expect-tests.ts @@ -1,9 +1,9 @@ /// -import expect, - {Expectation, Extension, Spy, createSpy, isSpy, assert, spyOn, extend, restoreSpies} +import {Expectation, Extension, Spy, createSpy, isSpy, assert, spyOn, extend, restoreSpies} from 'expect'; +import * as expect from 'expect'; describe('chaining assertions', function () { it('should allow chaining for array-like applications', function () { diff --git a/expect/index.d.ts b/expect/index.d.ts index f2c25f6225..d43bcda98a 100644 --- a/expect/index.d.ts +++ b/expect/index.d.ts @@ -3,68 +3,70 @@ // Definitions by: Justin Reidy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare namespace expect { + export class Expectation { + constructor(actual: any); + toExist(message?: string): Expectation; + toBeTruthy(message?: string): Expectation; + toNotExist(message?: string): Expectation; + toBeFalsy(message?: string): Expectation; + toBe(value: any, message?: string): Expectation; + toNotBe(value: any, message?: string): Expectation; + toEqual(value: any, message?: string): Expectation; + toNotEqual(value: any, message?: string): Expectation; + toThrow(value?: any, message?: string): Expectation; + toNotThrow(value?: any, message?: string): Expectation; + toBeA(value: any, message?: string): Expectation; + toBeAn(value: any, message?: string): Expectation; + toNotBeA(value: any, message?: string): Expectation; + toNotBeAn(value: any, message?: string): Expectation; + toMatch(value: any, message?: string): Expectation; + toNotMatch(value: any, message?: string): Expectation; + toBeLessThan(value: any, message?: string): Expectation; + toBeFewerThan(value: any, message?: string): Expectation; + toBeGreaterThan(value: any, message?: string): Expectation; + toBeMoreThan(value: any, message?: string): Expectation; + toInclude(value: any, compareValues?: any, message?: string): Expectation; + toContain(value: any, compareValues?: any, message?: string): Expectation; + toExclude(value: any, compareValues?: any, message?: string): Expectation; + toNotContain(value: any, compareValues?: any, message?: string): Expectation; + toHaveBeenCalled(message?: string): Expectation; + toHaveBeenCalledWith(...args: Array): Expectation; + toNotHaveBeenCalled(message?: string): Expectation; + withContext(context: any): Expectation; + withArgs(...args: Array): Expectation; + } + + export interface Extension { + [name: string]: (args?: Array) => void; + } + + export interface Call { + context: Spy; + arguments: Array; + } + + export interface Spy { + __isSpy: Boolean; + calls: Array; + andCall(fn: Function): Spy; + andCallThrough(): Spy; + andThrow(object: Object): Spy; + andReturn(value: any): Spy; + getLastCall(): Call; + restore(): void; + destroy(): void; + } + + + export function createSpy(fn?: Function, restore?: Function): Spy; + export function spyOn(object: Object, methodName: string): Spy; + export function isSpy(object: any): Boolean; + export function restoreSpies(): void; + export function assert(condition: any, messageFormat: string, ...extraArgs: Array): void; + export function extend(extension: Extension): void; -export declare class Expectation { - constructor(actual: any); - toExist(message?: string): Expectation; - toBeTruthy(message?: string): Expectation; - toNotExist(message?: string): Expectation; - toBeFalsy(message?: string): Expectation; - toBe(value: any, message?: string): Expectation; - toNotBe(value: any, message?: string): Expectation; - toEqual(value: any, message?: string): Expectation; - toNotEqual(value: any, message?: string): Expectation; - toThrow(value?: any, message?: string): Expectation; - toNotThrow(value?: any, message?: string): Expectation; - toBeA(value: any, message?: string): Expectation; - toBeAn(value: any, message?: string): Expectation; - toNotBeA(value: any, message?: string): Expectation; - toNotBeAn(value: any, message?: string): Expectation; - toMatch(value: any, message?: string): Expectation; - toNotMatch(value: any, message?: string): Expectation; - toBeLessThan(value: any, message?: string): Expectation; - toBeFewerThan(value: any, message?: string): Expectation; - toBeGreaterThan(value: any, message?: string): Expectation; - toBeMoreThan(value: any, message?: string): Expectation; - toInclude(value: any, compareValues?: any, message?: string): Expectation; - toContain(value: any, compareValues?: any, message?: string): Expectation; - toExclude(value: any, compareValues?: any, message?: string): Expectation; - toNotContain(value: any, compareValues?: any, message?: string): Expectation; - toHaveBeenCalled(message?: string): Expectation; - toHaveBeenCalledWith(...args: Array): Expectation; - toNotHaveBeenCalled(message?: string): Expectation; - withContext(context: any): Expectation; - withArgs(...args: Array): Expectation; } +declare function expect(actual: any): expect.Expectation; -export interface Extension { - [name: string]: (args?: Array) => void; -} - -export interface Call { - context: Spy; - arguments: Array; -} - -export interface Spy { - __isSpy: Boolean; - calls: Array; - andCall(fn: Function): Spy; - andCallThrough(): Spy; - andThrow(object: Object): Spy; - andReturn(value: any): Spy; - getLastCall(): Call; - restore(): void; - destroy(): void; -} - -declare function expect(actual: any): Expectation; - -export declare function createSpy(fn?: Function, restore?: Function): Spy; -export declare function spyOn(object: Object, methodName: string): Spy; -export declare function isSpy(object: any): Boolean; -export declare function restoreSpies(): void; -export declare function assert(condition: any, messageFormat: string, ...extraArgs: Array): void; -export declare function extend(extension: Extension): void; - -export default expect; +export = expect; diff --git a/express-debug/index.d.ts b/express-debug/index.d.ts index 2a0fbd6d51..546e26fbf4 100644 --- a/express-debug/index.d.ts +++ b/express-debug/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for express-debug 1.1.1 +// Type definitions for express-debug 1.1.1 // Project: https://github.com/devoidfury/express-debug // Definitions by: Federico Bond // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/f1/f1-tests.ts b/f1/f1-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/f1/index.d.ts b/f1/index.d.ts new file mode 100644 index 0000000000..a7771d063d --- /dev/null +++ b/f1/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for f1 8.0 +// Project: https://github.com/jam3/f1 +// Definitions by: Neo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface F1Options { + onState: void; + onUpdate: void; + + name: string; + + targets: any; + states: any; + transitions: any[]; + parsers: any; +} + +interface F1 extends NodeJS.EventEmitter { + targets(targets: any): F1; + states(states: any): F1; + transitions(transitions: any[]): F1; + parsers(parser: any): F1; + init(initState: string): F1; + + destroy(): void; + apply(): void; + + go(state: string, callback?: void): F1; + set(state: string): F1; + step(deltaTime: number): F1; + update(): F1; +} + +declare function f1(settings?: F1Options): F1; diff --git a/f1/tsconfig.json b/f1/tsconfig.json new file mode 100644 index 0000000000..58542c2d70 --- /dev/null +++ b/f1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "f1-tests.ts" + ] +} diff --git a/f1/tslint.json b/f1/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/f1/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/fast-stats/index.d.ts b/fast-stats/index.d.ts index d1c4ae9620..1bfe4ad737 100644 --- a/fast-stats/index.d.ts +++ b/fast-stats/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fast-stats 0.0.2 +// Type definitions for fast-stats 0.0.2 // Project: https://github.com/bluesmoon/node-faststats // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/fb/index.d.ts b/fb/index.d.ts index f641fa9820..a968d9f3c0 100644 --- a/fb/index.d.ts +++ b/fb/index.d.ts @@ -29,13 +29,13 @@ interface PageTabDialogParams { interface RequestsDialogParams { method: string; // "apprequests" - app_id: string; + app_id?: string; redirect_uri?: string; to?: string; message: string; action_type?: string; // "send" | "askfor" | "turn" object_id?: string; - filters: string /* "app_users" | "app_non_users" */ | { + filters: string[] | { name: string; user_ids: string[]; }; diff --git a/fbemitter/fbemitter-tests.ts b/fbemitter/fbemitter-tests.ts index 11e1ce74a5..2085f9ac51 100644 --- a/fbemitter/fbemitter-tests.ts +++ b/fbemitter/fbemitter-tests.ts @@ -2,6 +2,7 @@ /// /// /// + 'use strict'; /** diff --git a/finalhandler/index.d.ts b/finalhandler/index.d.ts index 07bbe63c91..a238c0d2a5 100644 --- a/finalhandler/index.d.ts +++ b/finalhandler/index.d.ts @@ -5,7 +5,6 @@ /// - import {ServerRequest, ServerResponse} from "http"; declare function finalHandler(req: ServerRequest, res: ServerResponse, options?: finalHandler.Options): (err: any) => void; diff --git a/flux/index.d.ts b/flux/index.d.ts index 8f51cfb1e5..252d1c7920 100644 --- a/flux/index.d.ts +++ b/flux/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Flux +// Type definitions for Flux // Project: http://facebook.github.io/flux/ // Definitions by: Steve Baker , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/form-data/form-data-tests.ts b/form-data/form-data-tests.ts index 2df21510c0..6d1b9d6cb9 100644 --- a/form-data/form-data-tests.ts +++ b/form-data/form-data-tests.ts @@ -132,3 +132,10 @@ import * as ImportUsingES6Syntax from 'form-data'; console.log(json); }); } + +() => { + var form = new FormData(); + form.getLength((err: Error, length: number): void => { + // nothing + }); +} diff --git a/form-data/index.d.ts b/form-data/index.d.ts index 606ffdbd4a..e4bd6ca2e1 100644 --- a/form-data/index.d.ts +++ b/form-data/index.d.ts @@ -5,15 +5,18 @@ // Imported from: https://github.com/soywiz/typescript-node-definitions/form-data.d.ts +/// + export = FormData; -declare class FormData { +import * as stream from "stream"; + +declare class FormData extends stream.Readable { append(key: string, value: any, options?: any): void; getHeaders(): FormData.Dictionary; - // TODO expand pipe - pipe(to: any): any; submit(params: string | Object, callback: (error: any, response: any) => void): any; getBoundary(): string; + getLength(callback: (err: Error, length: number) => void): void; } declare namespace FormData { diff --git a/fromjs/index.d.ts b/fromjs/index.d.ts index 937baa7cd2..d2de8cc024 100644 --- a/fromjs/index.d.ts +++ b/fromjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fromjs v2.1.6.1 +// Type definitions for fromjs v2.1.6.1 // Project: https://github.com/suckgamony/fromjs // Definitions by: Glenn Dierckx // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index 5d53a4d28f..c24ee5a49d 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -18,6 +18,9 @@ export declare function copySync(src: string, dest: string): void; export declare function copySync(src: string, dest: string, filter: CopyFilter): void; export declare function copySync(src: string, dest: string, options: CopyOptions): void; +export declare function move(src: string, dest: string, callback?: (err: Error) => void): void; +export declare function move(src: string, dest: string, options: MoveOptions, callback?: (err: Error) => void): void; + export declare function createFile(file: string, callback?: (err: Error) => void): void; export declare function createFileSync(file: string): void; @@ -89,6 +92,11 @@ export interface CopyOptions { limit?: number; } +export interface MoveOptions { + clobber? : boolean; + limit?: number; +} + export interface OpenOptions { encoding?: string; flag?: string; diff --git a/fs-mock/index.d.ts b/fs-mock/index.d.ts index ffab4b94eb..25c6fc3e0f 100644 --- a/fs-mock/index.d.ts +++ b/fs-mock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fs-mock 1.1.3 +// Type definitions for fs-mock 1.1.3 // Project: https://github.com/sakren/node-fs-mock // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ftp/index.d.ts b/ftp/index.d.ts index 9411367229..07d3ebc45a 100644 --- a/ftp/index.d.ts +++ b/ftp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ftp 0.3.8 +// Type definitions for ftp 0.3.8 // Project: https://github.com/mscdex/node-ftp // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ftpd/index.d.ts b/ftpd/index.d.ts index 7aee0bb578..6e3230dd3b 100644 --- a/ftpd/index.d.ts +++ b/ftpd/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ftpd 0.2.11 +// Type definitions for ftpd 0.2.11 // Project: https://github.com/sstur/nodeftpd // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/fullcalendar/index.d.ts b/fullcalendar/index.d.ts index fc687696f1..0c55872014 100644 --- a/fullcalendar/index.d.ts +++ b/fullcalendar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for FullCalendar 2.7.2 +// Type definitions for FullCalendar 2.7.2 // Project: http://fullcalendar.io/ // Definitions by: Neil Stalker , Marcelo Camargo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -136,7 +136,13 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr eventAfterAllRender?: (view: ViewObject) => void; eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void; - //scheduler options + //scheduler options + resourceAreaWidth?:number, + schedulerLicenseKey?:string, + customButtons?:any, + resourceLabelText?:any, + resourceColumns?:any, + displayEventTime?:any, } /** diff --git a/fuse/index.d.ts b/fuse/index.d.ts index 9f1de6ff03..5376144e22 100644 --- a/fuse/index.d.ts +++ b/fuse/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Fuse.js 2.2.0 +// Type definitions for Fuse.js 2.5.0 // Project: https://github.com/krisk/Fuse // Definitions by: Greg Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,7 +9,8 @@ declare class Fuse { } declare namespace fuse { - interface IFuseOptions extends ISearchOptions { + interface IFuseOptions { + id?: string; caseSensitive?: boolean; include?: string[]; shouldSort?: boolean; @@ -18,9 +19,9 @@ declare namespace fuse { getFn?: (obj: any, path: string) => any; keys?: string[] | { name:string; weight:number} []; verbose?:boolean; - } - - interface ISearchOptions { + tokenize?: boolean; + tokenSeparator? : RegExp; + matchAllTokens?: boolean; location?: number; distance?: number; threshold?: number; diff --git a/fxn/index.d.ts b/fxn/index.d.ts new file mode 100644 index 0000000000..228a7e934a --- /dev/null +++ b/fxn/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for fxn 0.0.4 +// Project: https://github.com/poly/fxn +// Definitions by: Adam Charron +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS'; + +export interface HttpHeaders { + [item: string]: string; +} + +export abstract class Controller { + + protected _method: HttpMethod; + protected _path: string; + protected _requestHeaders: Object; + protected _headers: Object; + protected _status: number; + protected _responder: Function; + protected _securityPolicies: Object; + protected params: any; + + constructor(path: string, method: string, requestHeaders: Object, params: Object, responder: Function); + convertMethod(method: HttpMethod, id: number): string; + run(): void; + notImplemented(msg: string, details: Object): boolean; + before(): void; + after(): void; + get(): void; + put(): void; + post(): void; + del(): void; + options(): void; + index(): void; + show(): void; + update(): void; + create(): void; + destroy(): void; + status(value: number): boolean; + setHeaders(): HttpHeaders; + setHeader(key: string, value: string): string; + appendHeader(key: string, value: string): string; + getHeader(key: string, value: string): string; + code(code: number): number; + getStatus(): number; + render(data: Buffer | String | Object): void; + allowOrigin(value: string): this; + securityPolicy(directive: string, src: string): string; + redirect(location: string): void; +} + +export abstract class Daemon { + constructor(string: string); +} + +export abstract class Application { + constructor(string: string); + send: Function; +} + +export abstract class Router {} +export abstract class Scheduler {} diff --git a/fxn/tsconfig.json b/fxn/tsconfig.json new file mode 100644 index 0000000000..0f2be78cfb --- /dev/null +++ b/fxn/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/gapi.auth2/index.d.ts b/gapi.auth2/index.d.ts index 3613febb09..593cae78d8 100644 --- a/gapi.auth2/index.d.ts +++ b/gapi.auth2/index.d.ts @@ -103,6 +103,8 @@ declare namespace gapi.auth2 { export interface BasicProfile { getId(): string; getName(): string; + getGivenName(): string; + getFamilyName(): string; getImageUrl(): string; getEmail(): string; } diff --git a/gapi.translate/index.d.ts b/gapi.translate/index.d.ts index 0fa655b0f3..66bb1719ae 100644 --- a/gapi.translate/index.d.ts +++ b/gapi.translate/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Translate API +// Type definitions for Google Translate API // Project: https://developers.google.com/translate/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/gapi.urlshortener/index.d.ts b/gapi.urlshortener/index.d.ts index e9fc5e4305..a7cdcb1364 100644 --- a/gapi.urlshortener/index.d.ts +++ b/gapi.urlshortener/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Url Shortener API +// Type definitions for Google Url Shortener API // Project: https://developers.google.com/url-shortener/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/gapi.youtubeanalytics/index.d.ts b/gapi.youtubeanalytics/index.d.ts index 0466da2cc2..6595cad721 100644 --- a/gapi.youtubeanalytics/index.d.ts +++ b/gapi.youtubeanalytics/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for YouTube Analytics API +// Type definitions for YouTube Analytics API // Project: https://developers.google.com/youtube/analytics/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 6d7e18a12e..28d5c990bc 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google API Client +// Type definitions for Google API Client // Project: https://code.google.com/p/google-api-javascript-client/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -127,27 +127,7 @@ declare namespace gapi.auth { } declare namespace gapi.client { - /** - * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. - * @param name The name of the API to load. - * @param version The version of the API to load. - * @return promise The promise that get's resolved after the request is finished. - */ - export function load(name: string, version: string): Promise - - /** - * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. - * @param name The name of the API to load. - * @param version The version of the API to load - * @param callback the function that is called once the API interface is loaded - * @param url optional, the url of your app - if using Google's APIs, don't set it - */ - export function load(name: string, version: string, callback: () => any, url?: string): void; - /** - * Creates a HTTP request for making RESTful requests. - * An object encapsulating the various arguments for this method. - */ - export function request(args: { + interface RequestOptions { /** * The URL to handle the request */ @@ -172,7 +152,29 @@ declare namespace gapi.client { * If supplied, the request is executed immediately and no gapi.client.HttpRequest object is returned */ callback?: () => any; - }): HttpRequest; + } + + /** + * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. + * @param name The name of the API to load. + * @param version The version of the API to load. + * @return promise The promise that get's resolved after the request is finished. + */ + export function load(name: string, version: string): Promise + + /** + * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. + * @param name The name of the API to load. + * @param version The version of the API to load + * @param callback the function that is called once the API interface is loaded + * @param url optional, the url of your app - if using Google's APIs, don't set it + */ + export function load(name: string, version: string, callback: () => any, url?: string): void; + /** + * Creates a HTTP request for making RESTful requests. + * An object encapsulating the various arguments for this method. + */ + export function request(args: RequestOptions): HttpRequest; /** * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. * @param method The method to be executed. diff --git a/globalize/index.d.ts b/globalize/index.d.ts index ece0790c10..4fdff6bac8 100644 --- a/globalize/index.d.ts +++ b/globalize/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Globalize +// Type definitions for Globalize // Project: https://github.com/jquery/globalize // Definitions by: Grégoire Castre , Aram Taieb // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/gm/index.d.ts b/gm/index.d.ts index 93174e9b24..288ce150ce 100644 --- a/gm/index.d.ts +++ b/gm/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gm 1.17.0 +// Type definitions for gm 1.17.0 // Project: https://github.com/aheckmann/gm // Definitions by: Joel Spadin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/google-drive-realtime-api/index.d.ts b/google-drive-realtime-api/index.d.ts index 025ce08a86..6cfd9b1cc1 100644 --- a/google-drive-realtime-api/index.d.ts +++ b/google-drive-realtime-api/index.d.ts @@ -16,8 +16,9 @@ // gapi is a global var introduced by https://apis.google.com/js/api.js declare namespace gapi.drive.realtime { + export type CollaborativeObjectType = 'EditableString' | 'Map' | 'List' - type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; + export type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Collaborator @@ -65,7 +66,7 @@ declare namespace gapi.drive.realtime { // see gapi.drive.realtime.CollaborrativeType for possible values; for custom collaborative objects, this value is // application-defined. // Addition: the possible values for standard objects are EditableString, List, and Map. - type:string; + type:CollaborativeObjectType; // Adds an event listener to the event target. The same handler can only be added once per the type. // Even if you add the same handler multiple times using the same type then it will only be called once @@ -107,9 +108,9 @@ declare namespace gapi.drive.realtime { // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeMap export class CollaborativeMap extends CollaborativeObject { - size:string; + size:number; - static type:string; // equals "Map" + static type:'Map'; // Removes all entries. clear():void; @@ -154,7 +155,7 @@ declare namespace gapi.drive.realtime { // The text of this collaborative string. Reading from this property is equivalent to calling getText(). Writing to this property is equivalent to calling setText(). text:string; - static type:string; // equals "EditableString" + static type:'EditableString'; // Appends a string to the end of this one. append(text:string):void; @@ -186,7 +187,7 @@ declare namespace gapi.drive.realtime { // The length of a list cannot be extended in this way. length:number; - static type:string; // equals "List" + static type:"List"; // Returns a copy of the contents of this collaborative list as an array. // Changes to the returned object will not affect the original collaborative list. @@ -344,9 +345,68 @@ declare namespace gapi.drive.realtime { undo():void; } + export type EventType = 'object_changed' | 'values_set' | 'values_added' | 'values_removed' | 'value_changed' | + 'text_inserted' | 'text_deleted' | 'collaborator_joined' | 'collaborator_left' | 'reference_shifted' | + 'document_save_state_changed' | 'undo_redo_state_changed' | 'attribute_changed'; + export const EventType:{ + // A collaborative object has changed. This event wraps a specific event, and bubbles to ancestors. + // Defaults to object_changed. + OBJECT_CHANGED:'object_changed' + + // Values in a list are changed in place. + // Defaults to values_set. + VALUES_SET:'values_set', + + // New values have been added to the list. + // values_added + VALUES_ADDED:'values_added' + + // Values have been removed from the list. + // values_removed + VALUES_REMOVED:'values_removed' + + // A map or custom object value has changed. Note this could be a new value or deleted value. + // value_changed + VALUE_CHANGED:'value_changed' + + // Text has been inserted into a string. + // text_inserted + TEXT_INSERTED:'text_inserted' + + // Text has been removed from a string. + // text_deleted + TEXT_DELETED:'text_deleted' + + // A new collaborator joined the document. Listen on the gapi.drive.realtime.Document for these changes. + // collaborator_joined + COLLABORATOR_JOINED:'collaborator_joined' + + // A collaborator left the document. Listen on the gapi.drive.realtime.Document for these changes. + // collaborator_left + COLLABORATOR_LEFT:'collaborator_left' + + // An index reference changed. + // reference_shifted + REFERENCE_SHIFTED:'reference_shifted' + + // The document save state changed. Listen on the gapi.drive.realtime.Document for these changes. + // document_save_state_changed + DOCUMENT_SAVE_STATE_CHANGED:'document_save_state_changed' + + // The model canUndo/canRedo state changed. Listen on the gapi.drive.realtime.Model for these changes. + // undo_redo_state_changed + UNDO_REDO_STATE_CHANGED:'undo_redo_state_changed' + + // A metadata attribute of the document changed. This is fired on changes to: + // gapi.drive.realtime.Attribute.IS_READ_ONLY + // Listen on the gapi.drive.realtime.Document for these changes. + // attribute_changed + ATTRIBUTE_CHANGED:'attribute_changed' + } + // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.BaseModelEvent - interface BaseModelEvent { + export interface BaseModelEvent { // Whether this event bubbles. bubbles : boolean; @@ -373,7 +433,7 @@ declare namespace gapi.drive.realtime { target : CollaborativeObject; // The type of the event. - type : string; + type : EventType; // The user id of the user that initiated this event. userId : string; @@ -399,6 +459,7 @@ declare namespace gapi.drive.realtime { Array of string The list of names from the hierarchy of compound operations that initiated the event. Value must not be null. + isLocal boolean True if the event originated in the local session. @@ -417,7 +478,7 @@ declare namespace gapi.drive.realtime { // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.ObjectChangedEvent - interface ObjectChangedEvent extends BaseModelEvent { + export interface ObjectChangedEvent extends BaseModelEvent { // parameters as in BaseModelEvent above except for addition of: // events: // Array of gapi.drive.realtime.BaseModelEvent @@ -435,7 +496,7 @@ declare namespace gapi.drive.realtime { new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[], isLocal:boolean, isUndo:boolean, isRedo:boolean, index:number, values:V[], movedFromList:CollaborativeList, movedFromIndex:number):ValuesAddedEvent; - + // The index of the first added value index:number; @@ -523,7 +584,7 @@ declare namespace gapi.drive.realtime { "missing_property" | "not_found" | "forbidden" | "server_error" | "client_error" | "token_refresh_required" | "invalid_element_type" | "no_write_permission" | "fatal_network_error" | "unexpected_element"; - export var ErrorType : { + export const ErrorType : { // Another user created the document's initial state after // gapi.drive.realtime.load was called but before the local // creation was saved. @@ -627,12 +688,12 @@ declare namespace gapi.drive.realtime { opt_initializerFn? : (m:Model) => void, opt_errorFn? : (e:gapi.drive.realtime.Error) => void ) : Document; - + /* Loads an existing file by id. https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime#.load - + @Param fileId {string} Id of the file to load. - + @Param onLoaded {function(non-null gapi.drive.realtime.Document)} A callback that will be called when the realtime document is ready. The created or opened realtime document object will be passed to this function. @@ -649,8 +710,22 @@ declare namespace gapi.drive.realtime { fileId:string, onLoaded? : (d:Document) => void, opt_initializerFn? : (m:Model) => void, - opt_errorFn? : (e:gapi.drive.realtime.Error) => void + opt_errorFn? : (e:Error) => void ):void; + + export function loadAppDataDocument( + onLoaded:(x:Document) => void, + opt_initializerFn?:(x:Model) => void, + opt_errorFn?:(e:Error) => void + ):void + + // Loads an in-memory document from a json string. + // This document does not talk to the server and will only exist in memory for as long as the browser session exists. + export function loadFromJson( + json:string, + opt_errorFn?:(e:Error) => void + ):Document + } @@ -674,29 +749,21 @@ declare namespace gapi.drive.realtime.databinding { } -declare namespace gapi.drive.realtime.EventType { - export var TEXT_INSERTED: string - export var TEXT_DELETED: string - export var OBJECT_CHANGED: string - // List - export var VALUES_ADDED:string; - export var VALUES_REMOVED:string; - export var VALUES_SET:string; -} - - // rtclient is a global var introduced by realtime-client-utils.js declare namespace rtclient { // INCOMPLETE export interface RealtimeLoader { start():void; load():void; + handleErrors(e:gapi.drive.realtime.Error):void; } interface RealtimeLoaderFactory { new (options:LoaderOptions) : RealtimeLoader; } // *********************************** + // NOTE THIS IS OUT OF DATE. realtime-client-utils.js has been rewritten, with the new version "Realtime Utils 1.0.0". + // Will add typings for the new version later. // The remainder of this file types some (not all) things in realtime-client-utils.js, found here: // https://developers.google.com/google-apps/realtime/realtime-quickstart // and diff --git a/google-libphonenumber/index.d.ts b/google-libphonenumber/index.d.ts index 0c0e1efda3..13659182a9 100644 --- a/google-libphonenumber/index.d.ts +++ b/google-libphonenumber/index.d.ts @@ -11,6 +11,21 @@ declare namespace libphonenumber { RFC3966 } + export enum PhoneNumberType { + FIXED_LINE = 0, + MOBILE = 1, + FIXED_LINE_OR_MOBILE = 2, + TOLL_FREE = 3, + PREMIUM_RATE = 4, + SHARED_COST = 5, + VOIP = 6, + PERSONAL_NUMBER = 7, + PAGER = 8, + UAN = 9, + VOICEMAIL = 10, + UNKNOWN = -1 + } + interface PhoneNumber { } @@ -30,6 +45,7 @@ declare namespace libphonenumber { isPossibleNumber(phoneNumber: PhoneNumber): boolean; isPossibleNumberWithReason(phoneNumber: PhoneNumber): PhoneNumberUtil.ValidationResult; isValidNumberForRegion(phoneNumber: PhoneNumber, region: string): boolean; + getNumberType(phoneNumber: PhoneNumber): PhoneNumberType; getRegionCodeForNumber(phoneNumber: PhoneNumber): string; isNANPACountry(regionCode: string): boolean; format(phoneNumber: PhoneNumber, format: PhoneNumberFormat): string; diff --git a/google-maps/google-maps-tests.ts b/google-maps/google-maps-tests.ts index c723a9ded3..a6af09776c 100644 --- a/google-maps/google-maps-tests.ts +++ b/google-maps/google-maps-tests.ts @@ -1,27 +1,41 @@ - - import GoogleMapsLoader = require('google-maps'); - -GoogleMapsLoader.load(function(google) { - var loadedMap = google.maps.Map; -}); +GoogleMapsLoader.URL = 'https://maps.googleapis.com/maps/api/js'; GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm'; - -GoogleMapsLoader.CLIENT = 'yourclientkey'; -GoogleMapsLoader.VERSION = '3.14'; - -GoogleMapsLoader.SENSOR = true; - GoogleMapsLoader.LIBRARIES = ['geometry', 'places']; - +GoogleMapsLoader.CLIENT = 'yourclientkey'; +GoogleMapsLoader.CHANNEL = 'myChannel'; GoogleMapsLoader.LANGUAGE = 'fr'; +GoogleMapsLoader.REGION = 'GB'; +GoogleMapsLoader.VERSION = '3.14'; +GoogleMapsLoader.WINDOW_CALLBACK_NAME = '__google_maps_api_provider_initializator__'; -GoogleMapsLoader.release(function() { - console.log('No google maps api around'); +var callback: GoogleMapsLoader.CallBack = function (google) { + var uluru = {lat: -25.363, lng: 131.044}; + + var map = new google.maps.Map(document.getElementById('map'), { + zoom: 4, + center: uluru + }); + + var marker = new google.maps.Marker({ + position: uluru, + map: map + }); +}; + + +GoogleMapsLoader.createLoader(); + +var isLoaded: boolean = GoogleMapsLoader.isLoaded(); + +GoogleMapsLoader.load(callback); +GoogleMapsLoader.release(callback); + +GoogleMapsLoader.onLoad(function () { + console.log("loaded!") }); -GoogleMapsLoader.onLoad(function(google) { - var loadedMap = google.maps.Map; - console.log('I just loaded google maps api'); -}); +var url: string = GoogleMapsLoader.createUrl(); + +GoogleMapsLoader.makeMock(); diff --git a/google-maps/index.d.ts b/google-maps/index.d.ts index f5c28f1581..86a9e137e7 100644 --- a/google-maps/index.d.ts +++ b/google-maps/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for google-maps 3.1.0 +// Type definitions for google-maps 3.2.1 // Project: https://www.npmjs.com/package/google-maps // Definitions by: Deividas Bakanas , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,20 +6,29 @@ /// declare namespace GoogleMapsLoader { + type google = { maps: typeof google.maps }; interface CallBack { - (google: { maps: { Map: google.maps.Map } }): void; + (google: google): void; } + export var KEY: string; - export var CLIENT: string; - export var VERSION: string; - export var SENSOR: boolean; + export var URL: string; export var LIBRARIES: Array; + export var CLIENT: string; + export var CHANNEL: string; export var LANGUAGE: string; + export var REGION: string; + export var VERSION: string; + export var WINDOW_CALLBACK_NAME: string; + export function release(callBack: Function): void; export function onLoad(callBack?: CallBack): void; export function load(callBack?: CallBack): void; export function isLoaded(): boolean; - + export function createLoader(): void; + export function createUrl(): string; + export function makeMock(): void; } + export = GoogleMapsLoader; export as namespace GoogleMapsLoader; diff --git a/googlemaps/google.maps-tests.ts b/googlemaps/google.maps-tests.ts index e119cf25bc..e960c8915b 100644 --- a/googlemaps/google.maps-tests.ts +++ b/googlemaps/google.maps-tests.ts @@ -4,10 +4,10 @@ var map = new google.maps.Map(document.querySelector("☺")); /***** Data *****/ - + new google.maps.Data(); new google.maps.Data({ map: map }); - + var latLng = new google.maps.LatLng(52.201203, -1.724370), feature = new google.maps.Data.Feature(), geometry = new google.maps.Data.Geometry(); @@ -61,7 +61,7 @@ data.loadGeoJson("http://magicGeoJsonSource.com"); data.loadGeoJson( "http://magicGeoJsonSource.com", { idPropertyName: "test" }); - + data.loadGeoJson( "http://magicGeoJsonSource.com", { idPropertyName: "test" }, @@ -99,7 +99,7 @@ var setPropertyEvent: google.maps.Data.SetPropertyEvent = { newValue: {}, oldValue: {} }; - + var removePropertyEvent: google.maps.Data.RemovePropertyEvent = { feature: feature, name: "test", @@ -140,3 +140,16 @@ var mapTypeStyle: google.maps.MapTypeStyle ={ elementType: 'labels', stylers: [], }; + +// https://developers.google.com/maps/documentation/javascript/adding-a-google-map +function initMap() { + var uluru = {lat: -25.363, lng: 131.044}; + var map = new google.maps.Map(document.getElementById('map'), { + zoom: 4, + center: uluru + }); + var marker = new google.maps.Marker({ + position: uluru, + map: map + }); +} diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index c4168645a6..1364536e27 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -394,7 +394,7 @@ declare namespace google.maps { */ icon?: string|Icon|Symbol; /** - * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. + * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. * Only the first character of the string will be displayed. * @type {(string|MarkerLabel)} */ @@ -489,7 +489,7 @@ declare namespace google.maps { /** The text to be displayed in the label. Only the first character of this string will be shown. */ text?: string; } - + export interface MarkerShape { coords?: number[]; type?: string; diff --git a/graphql-relay/graphql-relay-tests.ts b/graphql-relay/graphql-relay-tests.ts new file mode 100644 index 0000000000..1ee0b5e111 --- /dev/null +++ b/graphql-relay/graphql-relay-tests.ts @@ -0,0 +1,230 @@ +import { + GraphQLString, + GraphQLObjectType, + GraphQLFieldResolver, + GraphQLFieldConfigMap, + GraphQLResolveInfo, + GraphQLTypeResolver, + GraphQLFieldConfig, + GraphQLInterfaceType, + GraphQLInputType, + GraphQLInputFieldConfigMap, + GraphQLNonNull, + GraphQLID, +} from "graphql"; +import { + // Connections + connectionArgs, + forwardConnectionArgs, + backwardConnectionArgs, + connectionDefinitions, + connectionFromArray, + connectionFromPromisedArray, + cursorForObjectInConnection, + // Object Identification + nodeDefinitions, + toGlobalId, + fromGlobalId, + globalIdField, + pluralIdentifyingRootField, + // Mutations + mutationWithClientMutationId, +} from "."; +// Connections +// connectionArgs returns the arguments that fields should provide when they return a connection type that supports bidirectional pagination. +connectionArgs.first = 10; +connectionArgs.after = "a"; +connectionArgs.before = "b"; +connectionArgs.last = 10; +// forwardConnectionArgs returns the arguments that fields should provide when they return a connection type that only supports forward pagination. +forwardConnectionArgs.after = "a"; +forwardConnectionArgs.first = 10; +// backwardConnectionArgs returns the arguments that fields should provide when they return a connection type that only supports backward pagination. +backwardConnectionArgs.before = "b"; +backwardConnectionArgs.last = 10; +// connectionDefinitions returns a connectionType and its associated edgeType, given a node type. +let resolve: GraphQLFieldResolver = (source, args, context, info) => { + info.fieldName = "f"; +}; +const fields: GraphQLFieldConfigMap = {}; +let t: GraphQLObjectType; +let e: GraphQLObjectType; +let def = connectionDefinitions({ + connectionFields: fields, + edgeFields: fields, + name: "N", + nodeType: new GraphQLObjectType({ + name: "N", + fields: {}, + }), + resolveCursor: resolve, + resolveNode: resolve, +}); +t = def.connectionType; +e = def.edgeType; +// connectionFromArray is a helper method that takes an array and the arguments from connectionArgs, does pagination and filtering, and returns an object in the shape expected by a connectionType's resolve function. +const conn = connectionFromArray([1, 2, 3], { + after: "a", + before: "b", + first: 1, + last: 5, +}); +conn.edges.map((e) => { e.cursor.toLowerCase(); e.node.toExponential(); }); +conn.pageInfo.endCursor = "e"; +conn.pageInfo.hasNextPage = true; +conn.pageInfo.hasPreviousPage = true; +conn.pageInfo.startCursor = "s"; +// connectionFromPromisedArray is similar to connectionFromArray, but it takes a promise that resolves to an array, and returns a promise that resolves to the expected shape by connectionType. +const conn2 = connectionFromPromisedArray(new Promise((resolve) => { + resolve(); +}), { + after: "a", + before: "b", + first: 1, + last: 5, + }); +conn2.then((res) => { + res = conn; +}); +// cursorForObjectInConnection is a helper method that takes an array and a member object, and returns a cursor for use in the mutation payload. +cursorForObjectInConnection(["a"], "b").toLowerCase(); +// An example usage of these methods from the test schema: +let shipType: GraphQLObjectType = new GraphQLObjectType({ + name: "ShipType", + fields: {}, +}); +const {connectionType: ShipConnection} = + connectionDefinitions({ nodeType: shipType }); +const factionType = new GraphQLObjectType({ + name: "Faction", + fields: () => ({ + ships: { + type: ShipConnection, + args: connectionArgs, + resolve: (faction, args) => connectionFromArray( + faction.ships.map((id: any) => id), + args + ), + } + }), +}); +// Object Identification +// nodeDefinitions returns the Node interface that objects can implement, and returns the node root field to include on the query type. To implement this, it takes a function to resolve an ID to an object, and to determine the type of a given object. +const resolver: GraphQLTypeResolver = () => { + return new GraphQLObjectType({ + name: "T", + fields: {}, + }); +}; +const idFetcher = (id: string, context: number, info: GraphQLResolveInfo) => { + info.fieldName = "f"; +}; +const nodeDef = nodeDefinitions(idFetcher, resolver); +const fieldConfig: GraphQLFieldConfig = nodeDef.nodeField; +const interfaceType: GraphQLInterfaceType = nodeDef.nodeInterface; +// toGlobalId takes a type name and an ID specific to that type name, and returns a "global ID" that is unique among all types. +toGlobalId("t", "i").toLowerCase(); +// fromGlobalId takes the "global ID" created by toGlobalID, and returns the type name and ID used to create it. +const fgi = fromGlobalId("gid"); +fgi.id.toLowerCase(); +fgi.type.toUpperCase(); +// globalIdField creates the configuration for an id field on a node. +const idFetcher2 = (object: any, context: any, info: GraphQLResolveInfo) => { + return ""; +}; +const gif: GraphQLFieldConfig = globalIdField("t", idFetcher2); +// pluralIdentifyingRootField creates a field that accepts a list of non-ID identifiers (like a username) and maps them to their corresponding objects. +const input: GraphQLInputType = GraphQLString; +const prf: GraphQLFieldConfig = pluralIdentifyingRootField({ + argName: "a", + inputType: input, + outputType: input, + resolveSingleInput: (input: any, context: any, info: GraphQLResolveInfo) => { + return ""; + }, + description: "d", +}); +// An example usage of these methods from the test schema: +const {nodeInterface, nodeField} = nodeDefinitions( + (globalId) => { + var {type, id} = fromGlobalId(globalId); + return "data[type][id]"; + }, + (obj) => { + return obj.ships ? factionType : shipType; + } +); + +const factionType2 = new GraphQLObjectType({ + name: 'Faction', + fields: () => ({ + id: globalIdField(), + }), + interfaces: [nodeInterface] +}); + +const queryType = new GraphQLObjectType({ + name: 'Query', + fields: () => ({ + node: nodeField + }) +}); +// Mutations +// mutationWithClientMutationId takes a name, input fields, output fields, and a mutation method to map from the input fields to the output fields, performing the mutation along the way. It then creates and returns a field configuration that can be used as a top-level field on the mutation type. +const gifcm: GraphQLInputFieldConfigMap = {}; +const gfcm: GraphQLFieldConfigMap = {}; +mutationWithClientMutationId({ + name: "M", + description: "D", + inputFields: gifcm, + mutateAndGetPayload: (object: any, + ctx: any, + info: GraphQLResolveInfo) => { + return new Promise((resolve) => { + resolve(info.fieldName); + }); + }, + outputFields: gfcm, +}); +// An example usage of these methods from the test schema: +const data: any = {}; +var shipMutation = mutationWithClientMutationId({ + name: 'IntroduceShip', + inputFields: { + shipName: { + type: new GraphQLNonNull(GraphQLString) + }, + factionId: { + type: new GraphQLNonNull(GraphQLID) + } + }, + outputFields: { + ship: { + type: shipType, + resolve: (payload) => data['Ship'][payload.shipId] + }, + faction: { + type: factionType, + resolve: (payload) => data['Faction'][payload.factionId] + } + }, + mutateAndGetPayload: ({shipName, factionId}) => { + var newShip = { + id: "11", + name: shipName + }; + // data.Ship[newShip.id] = newShip; + // data.Faction[factionId].ships.push(newShip.id); + return { + shipId: newShip.id, + factionId, + }; + } +}); + +var mutationType = new GraphQLObjectType({ + name: 'Mutation', + fields: () => ({ + introduceShip: shipMutation + }) +}); diff --git a/graphql-relay/index.d.ts b/graphql-relay/index.d.ts new file mode 100644 index 0000000000..3672a2d1c0 --- /dev/null +++ b/graphql-relay/index.d.ts @@ -0,0 +1,310 @@ +// Type definitions for graphql-relay 0.4 +// Project: https://github.com/graphql/graphql-relay-js +// Definitions by: Arvitaly , nitintutlani , Grelinfo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +import { + GraphQLBoolean, + GraphQLInt, + GraphQLNonNull, + GraphQLList, + GraphQLObjectType, + GraphQLString, + GraphQLFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLFieldConfigMap, + GraphQLFieldConfigArgumentMap, + GraphQLResolveInfo, + GraphQLInterfaceType, + GraphQLInputType, + GraphQLOutputType, + GraphQLFieldResolver, + GraphQLTypeResolver, + Thunk +} from "graphql"; + +// connection/connection.js + +/** + * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field + * whose return type is a connection type with forward pagination. + */ +interface ForwardConnectionArgs { + after: ConnectionCursor; + first: number; +} +export const forwardConnectionArgs: GraphQLFieldConfigArgumentMap & { + after: ConnectionCursor; + first: number; +}; + +/** + * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field + * whose return type is a connection type with backward pagination. + */ +interface BackwardConnectionArgs { + before: ConnectionCursor; + last: number; +} +export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap & { + before: ConnectionCursor; + last: number; +}; + +/** + * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field + * whose return type is a connection type with bidirectional pagination. + */ +export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionArgs & BackwardConnectionArgs; + +interface ConnectionConfig { + name?: string | null; + nodeType: GraphQLObjectType; + resolveNode?: GraphQLFieldResolver | null; + resolveCursor?: GraphQLFieldResolver | null; + edgeFields?: Thunk> | null; + connectionFields?: Thunk> | null; +} + +interface GraphQLConnectionDefinitions { + edgeType: GraphQLObjectType; + connectionType: GraphQLObjectType; +} + +/** + * Returns a GraphQLObjectType for a connection with the given name, + * and whose nodes are of the specified type. + */ +export function connectionDefinitions( + config: ConnectionConfig +): GraphQLConnectionDefinitions; + +// connection/connectiontypes.js + +/** + * An flow type alias for cursors in this implementation. + */ +export type ConnectionCursor = string; + +/** + * A flow type designed to be exposed as `PageInfo` over GraphQL. + */ +export interface PageInfo { + startCursor: ConnectionCursor; + endCursor: ConnectionCursor; + hasPreviousPage: boolean; + hasNextPage: boolean; +} + +/** + * A flow type designed to be exposed as a `Connection` over GraphQL. + */ +export interface Connection { + edges: Array>; + pageInfo: PageInfo; +} + +/** + * A flow type designed to be exposed as a `Edge` over GraphQL. + */ +interface Edge { + node: T; + cursor: ConnectionCursor; +} + +/** + * A flow type describing the arguments a connection field receives in GraphQL. + */ +interface ConnectionArguments { + before?: ConnectionCursor; + after?: ConnectionCursor; + first?: number; + last?: number; +} + + +// connection/arrayconnection.js + +interface ArraySliceMetaInfo { + sliceStart: number; + arrayLength: number; +} + +/** + * A simple function that accepts an array and connection arguments, and returns + * a connection object for use in GraphQL. It uses array offsets as pagination, + * so pagination will only work if the array is static. + */ +export function connectionFromArray( + data: T[], + args: ConnectionArguments +): Connection; + +/** + * A version of `connectionFromArray` that takes a promised array, and returns a + * promised connection. + */ +export function connectionFromPromisedArray( + dataPromise: Promise, + args: ConnectionArguments +): Promise>; + +/** + * Given a slice (subset) of an array, returns a connection object for use in + * GraphQL. + * +* This function is similar to `connectionFromArray`, but is intended for use +* cases where you know the cardinality of the connection, consider it too large +* to materialize the entire array, and instead wish pass in a slice of the +* total result large enough to cover the range specified in `args`. +*/ +export function connectionFromArraySlice( + arraySlice: T[], + args: ConnectionArguments, + meta: ArraySliceMetaInfo +): Connection; + +/** + * A version of `connectionFromArraySlice` that takes a promised array slice, + * and returns a promised connection. + */ +export function connectionFromPromisedArraySlice( + dataPromise: Promise, + args: ConnectionArguments, + arrayInfo: ArraySliceMetaInfo +): Promise>; + +/** + * Creates the cursor string from an offset. + */ +export function offsetToCursor(offset: number): ConnectionCursor; + +/** + * Rederives the offset from the cursor string. + */ +export function cursorToOffset(cursor: ConnectionCursor): number; + +/** + * Return the cursor associated with an object in an array. + */ +export function cursorForObjectInConnection( + data: T[], + object: T +): ConnectionCursor; + +/** + * Given an optional cursor and a default offset, returns the offset + * to use; if the cursor contains a valid offset, that will be used, + * otherwise it will be the default. + */ +export function getOffsetWithDefault( + cursor?: ConnectionCursor, + defaultOffset?: number +): number; + +// mutation/mutation.js + +type mutationFn = ( + object: any, + ctx: any, + info: GraphQLResolveInfo +) => Promise | any; + +/** + * A description of a mutation consumable by mutationWithClientMutationId + * to create a GraphQLFieldConfig for that mutation. + * + * The inputFields and outputFields should not include `clientMutationId`, + * as this will be provided automatically. + * + * An input object will be created containing the input fields, and an + * object will be created containing the output fields. + * + * mutateAndGetPayload will receieve an Object with a key for each + * input field, and it should return an Object with a key for each + * output field. It may return synchronously, or return a Promise. + */ +interface MutationConfig { + name: string; + description?: string; + inputFields: Thunk; + outputFields: Thunk>; + mutateAndGetPayload: mutationFn; +} + +/** + * Returns a GraphQLFieldConfig for the mutation described by the + * provided MutationConfig. + */ +export function mutationWithClientMutationId( + config: MutationConfig +): GraphQLFieldConfig; + +// node/node.js + +interface GraphQLNodeDefinitions { + nodeInterface: GraphQLInterfaceType; + nodeField: GraphQLFieldConfig; +} + +type typeResolverFn = ((any: any) => GraphQLObjectType) | + ((any: any) => Promise); + +/** + * Given a function to map from an ID to an underlying object, and a function + * to map from an underlying object to the concrete GraphQLObjectType it + * corresponds to, constructs a `Node` interface that objects can implement, + * and a field config for a `node` root field. + * + * If the typeResolver is omitted, object resolution on the interface will be + * handled with the `isTypeOf` method on object types, as with any GraphQL + * interface without a provided `resolveType` method. + */ +export function nodeDefinitions( + idFetcher: ((id: string, context: TContext, info: GraphQLResolveInfo) => any), + typeResolver?: GraphQLTypeResolver +): GraphQLNodeDefinitions; + +interface ResolvedGlobalId { + type: string; + id: string; +} + +/** + * Takes a type name and an ID specific to that type name, and returns a + * "global ID" that is unique among all types. + */ +export function toGlobalId(type: string, id: string): string; + +/** + * Takes the "global ID" created by toGlobalID, and returns the type name and ID + * used to create it. + */ +export function fromGlobalId(globalId: string): ResolvedGlobalId; + +/** + * Creates the configuration for an id field on a node, using `toGlobalId` to + * construct the ID from the provided typename. The type-specific ID is fetched + * by calling idFetcher on the object, or if not provided, by accessing the `id` + * property on the object. + */ +export function globalIdField( + typeName?: string, + idFetcher?: (object: any, context: any, info: GraphQLResolveInfo) => string +): GraphQLFieldConfig; + + +// node/plural.js + +interface PluralIdentifyingRootFieldConfig { + argName: string; + inputType: GraphQLInputType; + outputType: GraphQLOutputType; + resolveSingleInput: (input: any, context: any, info: GraphQLResolveInfo) => any; + description?: string; +} + +export function pluralIdentifyingRootField( + config: PluralIdentifyingRootFieldConfig +): GraphQLFieldConfig; \ No newline at end of file diff --git a/graphql-relay/tsconfig.json b/graphql-relay/tsconfig.json new file mode 100644 index 0000000000..bf46522ecc --- /dev/null +++ b/graphql-relay/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + "graphql" + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "graphql-relay-tests.ts" + ] +} \ No newline at end of file diff --git a/graphql-relay/tslint.json b/graphql-relay/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/graphql-relay/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/greensock/index.d.ts b/greensock/index.d.ts index 95c2ad6a4c..65f7ee52e7 100644 --- a/greensock/index.d.ts +++ b/greensock/index.d.ts @@ -44,7 +44,7 @@ declare type TweenConfig = { autoCSS?: boolean; callbackScope?: Object; } - + //com.greensock.core declare class Animation { static ticker: IDispatcher; @@ -161,7 +161,7 @@ declare class TimelineLite extends SimpleTimeline { static exportRoot(vars?: Object, omitDelayedCalls?: boolean): TimelineLite; from(target: Object, duration: number, vars: Object, position?: any): TimelineLite; fromTo(target: Object, duration: number, fromVars: Object, toVars: Object, position?: any): TimelineLite; - getChildren(nested?: boolean, tweens?: boolean, timelines?: boolean, ignoreBeforeTime?: number): Tween | Timeline[]; + getChildren(nested?: boolean, tweens?: boolean, timelines?: boolean, ignoreBeforeTime?: number): (Tween | Timeline)[]; getLabelTime(label: string): number; getTweensOf(target: Object, nested?: boolean): Tween[]; recent(): Animation; @@ -185,8 +185,9 @@ declare class TimelineMax extends TimelineLite { getActive(nested?: boolean, tweens?: boolean, timelines?: boolean): Tween | Timeline[]; getLabelAfter(time: number): string; getLabelBefore(time: number): string; - getLabelsArray(): any[]; + getLabelsArray(): {name: string; time: number;}[]; removeCallback(callback: Function, timeOrLabel?: any): TimelineMax; + removePause(position: any): TimelineMax; repeat(): number; repeat(value: number): TimelineMax; repeatDelay(): number; diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 399f25e04b..7bf2fa3780 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Gridstack +// Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ // Definitions by: Pascal Senn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/gsap/Core.d.ts b/gsap/Core.d.ts index 776ec5f88e..30b07a3e19 100644 --- a/gsap/Core.d.ts +++ b/gsap/Core.d.ts @@ -1,4 +1,4 @@ -declare class Animation { +declare class Animation { /** Base class for all TweenLite, TweenMax, TimelineLite, and TimelineMax classes, providing core methods/properties/functionality, but there is no reason to create an instance of this class directly. */ constructor(duration?: number, vars?: any); diff --git a/gsap/Ease.d.ts b/gsap/Ease.d.ts index e52520aaf0..932222ff56 100644 --- a/gsap/Ease.d.ts +++ b/gsap/Ease.d.ts @@ -1,4 +1,4 @@ -declare class Ease { +declare class Ease { constructor(func?: Function, extraParams?: any[], type?: number, power?: number); /** Translates the tween's progress ratio into the corresponding ease ratio. */ diff --git a/gsap/TweenLite.d.ts b/gsap/TweenLite.d.ts index b1aad2b0e8..21150acf22 100644 --- a/gsap/TweenLite.d.ts +++ b/gsap/TweenLite.d.ts @@ -1,4 +1,4 @@ -declare class TweenLite { +declare class TweenLite { constructor(target: any, duration: number, vars: any); /** Provides An easy way to change the default easing equation. */ diff --git a/gulp-util/index.d.ts b/gulp-util/index.d.ts index feea14ec8e..ee059ca986 100644 --- a/gulp-util/index.d.ts +++ b/gulp-util/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gulp-util v3.0.x +// Type definitions for gulp-util v3.0.x // Project: https://github.com/gulpjs/gulp-util // Definitions by: jedmao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,7 @@ import vinyl = require('vinyl'); import chalk = require('chalk'); import through2 = require('through2'); -export class File extends vinyl { } +export { vinyl as File }; /** * Replaces a file extension in a path. Returns the new path. diff --git a/halogen/index.d.ts b/halogen/index.d.ts index 909812ff4b..5a6448899c 100644 --- a/halogen/index.d.ts +++ b/halogen/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for halogen +// Type definitions for halogen 0.2 // Project: https://github.com/yuanyan/halogen // Definitions by: Vincent Rouffiat // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/handsontable/handsontable-tests.ts b/handsontable/handsontable-tests.ts index d062f9c629..eb48441244 100644 --- a/handsontable/handsontable-tests.ts +++ b/handsontable/handsontable-tests.ts @@ -250,7 +250,7 @@ function test_HandsontableMethods() { hot.getRowHeight(123); hot.getSchema(); hot.getSelected(); - hot.getSelectedRange(); + const range: ht.Range = hot.getSelectedRange(); hot.getSettings(); hot.getSourceData(123, 123, 123, 123); hot.getSourceDataAtCell(123, 123); @@ -267,6 +267,7 @@ function test_HandsontableMethods() { hot.loadData([]); hot.populateFromArray(123, 123, [], 123, 123, 'foo', 'foo', 'foo', []); hot.propToCol('foo'); + hot.propToCol(123); hot.removeCellMeta(123, 123, 'foo'); hot.removeHook('foo', function() {}); hot.render(); @@ -283,4 +284,8 @@ function test_HandsontableMethods() { hot.unlisten(); hot.updateSettings({}, true); hot.validateCells(function() {}); + + Handsontable.renderers.NumericRenderer(hot, new HTMLTableDataCellElement(), 0, 0, "prop", 1.235, {}); + Handsontable.renderers.TextRenderer(hot, new HTMLTableDataCellElement(), 0, 0, "prop", 1.235, {}); + Handsontable.Dom.addEvent(new HTMLElement(), "eventName", () => {}); } diff --git a/handsontable/index.d.ts b/handsontable/index.d.ts index 7a82509baa..eeef57394e 100644 --- a/handsontable/index.d.ts +++ b/handsontable/index.d.ts @@ -250,7 +250,7 @@ declare namespace ht { getRowHeight(row: number): number; getSchema(): Object; getSelected(): any[]; - getSelectedRange(): any; + getSelectedRange(): Range; getSettings(): Object; getSourceData(r?: number, c?: number, r2?: number, c2?: number): any[]; getSourceDataAtCell(row: number, column: number): any; @@ -266,7 +266,7 @@ declare namespace ht { listen(): void; loadData(data: any[]): void; populateFromArray(row: number, col: number, input: any[], endRow?: number, endCol?: number, source?: string, method?: string, direction?: string, deltas?: any[]): any; - propToCol(prop: string): number; + propToCol(prop: string | number): number; removeCellMeta(row: number, col: number, key: string): void; removeHook(key: string, callback: Function): void; render(): void; @@ -284,9 +284,79 @@ declare namespace ht { updateSettings(settings: Object, init: boolean): void; validateCells(callback: Function): void; } + + interface Selection { + start: CellPosition; + end: CellPosition; + } + + interface Range { + from: CellPosition; + to: CellPosition; + } + + interface HandsontableRegisterer { + getInstance(id: string): Methods; + registerInstance(id: string, instance: Methods): void; + removeInstance(id: string): void; + } + + interface ColumnProperties extends CellProperties { + data?: string; + editor?: string; + selectOptions?: any[]; + } + + interface CellProperties { + renderer?: ( + instance: Methods, + td: HTMLTableDataCellElement, + row: number, + col: number, + prop: string, + value: any, + tdCellProperties: Object) => void; + type?: string; + readOnly?: boolean; + language?: string; + format?: string; + validator?: (value: string, callback: (condition: boolean) => void) => void; + } + + interface CellPosition { + row: number; + col: number; + } } declare var Handsontable: { new (element: Element, options: ht.Options): ht.Methods; + renderers: { + TextRenderer( + instance: any, + td: HTMLTableCellElement, + row: number, + col: number, + prop: string, + value: any, + cellProperties: any): void; + NumericRenderer( + instance: any, + td: HTMLTableCellElement, + row: number, + col: number, + prop: string, + value: any, + cellProperties: any): void; + } + Dom: { + addEvent(element: HTMLElement, eventName: string, callback: Function): void; + } }; + +declare module "handsontable" { + export var Handsontable: { + new (element: Element, options: ht.Options): ht.Methods; + }; +} diff --git a/hapi-decorators/hapi-decorators-tests.ts b/hapi-decorators/hapi-decorators-tests.ts index 57d0c1a232..2a05f67e4d 100644 --- a/hapi-decorators/hapi-decorators-tests.ts +++ b/hapi-decorators/hapi-decorators-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as hapi from 'hapi'; import { controller, get, post, put, cache, config, route, validate, Controller } from 'hapi-decorators'; diff --git a/hapi-decorators/tsconfig.json b/hapi-decorators/tsconfig.json index a763c6c6cd..3c7877c976 100644 --- a/hapi-decorators/tsconfig.json +++ b/hapi-decorators/tsconfig.json @@ -17,4 +17,4 @@ "index.d.ts", "hapi-decorators-tests.ts" ] -} \ No newline at end of file +} diff --git a/hapi/hapi-8.2.0.d.ts b/hapi/hapi-8.2.0.d.ts index d3f51873d9..9a9355412d 100644 --- a/hapi/hapi-8.2.0.d.ts +++ b/hapi/hapi-8.2.0.d.ts @@ -304,9 +304,9 @@ export interface ISessionHandler { export interface IStrictSessionHandler { (request: Request, reply: IStrictReply): void; -} + } -export interface IRequestHandler { + export interface IRequestHandler { (request: Request): T; } diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index 2ee355e9d1..97c4a77b44 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -116,8 +116,8 @@ server.route([{ server.route({ method: 'GET', path: '/hello6', - handler: function (request, reply) { - request.log('info', { route: '/hello' }, Date.now()); + handler: function (request: Hapi.Request, reply: Hapi.IReply) { + request.log('info', { route: '/hello' }, Date.now()); reply('hello world'); } }); diff --git a/hellosign-embedded/index.d.ts b/hellosign-embedded/index.d.ts index 45b70774ff..ec77a92b92 100644 --- a/hellosign-embedded/index.d.ts +++ b/hellosign-embedded/index.d.ts @@ -1,12 +1,68 @@ -// Type definitions for hellosign-embedded v1.2.0 +// Type definitions for hellosign-embedded v1.2.0 // Project: https://github.com/HelloFax/hellosign-embedded // Definitions by: Brian Surowiec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module HelloSign { - interface MessageEvent { - event: string; + interface SignedMessageEvent { + event: 'signature_request_signed'; + signature_id: string; } + interface DeclinedMessageEvent { + event: 'signature_request_declined'; + signature_id: string; + } + + interface CanceledMessageEvent { + event: 'signature_request_canceled'; + } + + interface SentMessageEvent { + event: 'signature_request_sent'; + signature_request_id: string; + signature_request_info: { + title: string; + message: string; + signatures: Array<{ + signature_id: string; + signer_email_address: string; + signer_name: string; + order: number; + status_code: string; + signed_at: number; + last_viewed_at: number; + last_reminded_at: number; + has_pin: boolean; + }>; + cc_email_addresses: Array; + }; + } + + interface TemplateCreatedMessageEvent { + event: 'template_created'; + template_id: string; + template_info: { + title: string; + message: string; + signer_roles: Array<{ + name: string; + order: number; + }>; + cc_roles: Array<{ + name: string; + }>; + }; + } + + interface ErrorMessageEvent { + event: 'error'; + description: string; + } + + type MessageEvent = SignedMessageEvent | DeclinedMessageEvent | + CanceledMessageEvent | SentMessageEvent | TemplateCreatedMessageEvent | + ErrorMessageEvent; + interface ClientCultures { /** * English (United States) @@ -169,6 +225,20 @@ declare module HelloSign { */ EVENT_CANCELED: string; + /** + * The user sent a signature request + * + * @default signature_request_sent + */ + EVENT_SENT: string; + + /** + * The template was created or edited + * + * @default template_created + */ + EVENT_TEMPLATE_CREATED: string; + /** * An error occurred in the iFrame * diff --git a/highcharts/highcharts-more.d.ts b/highcharts/highcharts-more.d.ts index dd5950fe35..14f4940784 100644 --- a/highcharts/highcharts-more.d.ts +++ b/highcharts/highcharts-more.d.ts @@ -3,6 +3,8 @@ // Definitions by: Maciej Suchecki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import * as Highcharts from "highcharts"; + declare var HighchartsMore: (H: Highcharts.Static) => Highcharts.Static; export = HighchartsMore; export as namespace HighchartsMore; diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index 459d812bcc..316e2f42a6 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -2212,6 +2212,7 @@ function test_ChartObject() { chart.showLoading("Loading label"); var firstXAxis = chart.xAxis[0]; var firstYAxis = chart.yAxis[0]; + var legend = chart.legend; } function test_ElementObject() { @@ -2338,3 +2339,8 @@ function test_SeriesObject() { var xAxis = series.xAxis; var yAxis = series.yAxis; } +function test_LegendObject() { + var legend = $('#container').highcharts().legend; + legend.update({}); + legend.update({}, false); +} diff --git a/highcharts/highstock.d.ts b/highcharts/highstock.d.ts index f312286745..6784e83eb1 100644 --- a/highcharts/highstock.d.ts +++ b/highcharts/highstock.d.ts @@ -3,6 +3,8 @@ // Definitions by: David Deutsch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import * as Highcharts from "highcharts"; + declare namespace __Highstock { interface ChartObject extends Highcharts.ChartObject { options: Options; @@ -28,10 +30,10 @@ declare namespace __Highstock { } interface RangeSelectorButton { - type: string; //Defines the timespan, can be one of 'millisecond', 'second', 'minute', 'day', 'week', 'month', 'ytd' (year to date), 'year' and 'all'. - count?: number; - text: string; - dataGrouping?: any; //not sure how this works + type: string; //Defines the timespan, can be one of 'millisecond', 'second', 'minute', 'day', 'week', 'month', 'ytd' (year to date), 'year' and 'all'. + count?: number; + text: string; + dataGrouping?: any; //not sure how this works } interface RangeSelectorOptions { @@ -59,24 +61,24 @@ declare namespace __Highstock { } interface ScrollbarOptions { - barBackgroundColor?: string; - barBorderColor?: string; - barBorderRadius?: number; - barBorderWidth?: number; - buttonArrowColor?: string; - buttonBackgroundColor?: string; - buttonBorderColor?: string; - buttonBorderRadius?: number; - buttonBorderWidth?: number; - enabled?: boolean; - height?: number; - liveRedraw?: boolean; - minWidth?: number; - rifleColor?: string; - trackBackgroundColor?: string; - trackBorderColor?: string; - trackBorderRadius?: number; - trackBorderWidth?: number; + barBackgroundColor?: string; + barBorderColor?: string; + barBorderRadius?: number; + barBorderWidth?: number; + buttonArrowColor?: string; + buttonBackgroundColor?: string; + buttonBorderColor?: string; + buttonBorderRadius?: number; + buttonBorderWidth?: number; + enabled?: boolean; + height?: number; + liveRedraw?: boolean; + minWidth?: number; + rifleColor?: string; + trackBackgroundColor?: string; + trackBorderColor?: string; + trackBorderRadius?: number; + trackBorderWidth?: number; } interface Options extends Highcharts.Options { @@ -96,26 +98,29 @@ declare namespace __Highstock { } -interface JQuery { - highcharts(type: "StockChart"): __Highstock.ChartObject; - /** - * Creates a new Highcharts.Chart for the current JQuery selector; usually - * a div selected by $('#container') - * @param {Highcharts.Options} options Options for this chart - * @return current {JQuery} selector the current JQuery selector - **/ - highcharts(type: "StockChart", options: __Highstock.Options): JQuery; - /** - * Creates a new Highcharts.Chart for the current JQuery selector; usually - * a div selected by $('#container') - * @param {Highcharts.Options} options Options for this chart - * @param callback Callback function used to manipulate the constructed chart instance - * @return current {JQuery} selector the current JQuery selector - **/ - highcharts(type: "StockChart", options: __Highstock.Options, callback: (chart: __Highstock.ChartObject) => void): JQuery; +declare global { + interface JQuery { + highcharts(type: "StockChart"): __Highstock.ChartObject; + /** + * Creates a new Highcharts.Chart for the current JQuery selector; usually + * a div selected by $('#container') + * @param {Highcharts.Options} options Options for this chart + * @return current {JQuery} selector the current JQuery selector + **/ + highcharts(type: "StockChart", options: __Highstock.Options): JQuery; + /** + * Creates a new Highcharts.Chart for the current JQuery selector; usually + * a div selected by $('#container') + * @param {Highcharts.Options} options Options for this chart + * @param callback Callback function used to manipulate the constructed chart instance + * @return current {JQuery} selector the current JQuery selector + **/ + highcharts(type: "StockChart", options: __Highstock.Options, callback: (chart: __Highstock.ChartObject) => void): JQuery; - highcharts(type: string): Highcharts.ChartObject; - highcharts(type: string, options: Highcharts.Options): JQuery; - highcharts(type: string, options: Highcharts.Options, callback: (chart: Highcharts.ChartObject) => void): JQuery; + highcharts(type: string): Highcharts.ChartObject; + highcharts(type: string, options: Highcharts.Options): JQuery; + highcharts(type: string, options: Highcharts.Options, callback: (chart: Highcharts.ChartObject) => void): JQuery; + } } + diff --git a/highcharts/index.d.ts b/highcharts/index.d.ts index 626ff59482..e425c0458b 100644 --- a/highcharts/index.d.ts +++ b/highcharts/index.d.ts @@ -5977,6 +5977,8 @@ declare namespace Highcharts { yAxis: AxisObject[]; renderer: RendererObject; + + legend: LegendObject; } interface Chart { @@ -6456,6 +6458,16 @@ declare namespace Highcharts { */ yAxis: AxisObject; } + + interface LegendObject { + /** + * Update the legend with new options. + * @param {LegendOptions} options New options that will be merged into the legend's existing options. + * @param [boolean] redraw - Whether to redraw the chart. Defaults to true. + * @since 5.0.0 + */ + update(options: LegendOptions, redraw?: boolean): void; + } } declare global { diff --git a/history/index.d.ts b/history/index.d.ts index b099b9beaa..6b61fa1b77 100644 --- a/history/index.d.ts +++ b/history/index.d.ts @@ -1,10 +1,8 @@ // Type definitions for history v2.0.0 -// Project: https://github.com/rackt/history +// Project: https://github.com/mjackson/history // Definitions by: Sergey Buturlakin , Nathan Brown // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// types based on https://github.com/rackt/history/blob/master/docs/Terms.md - export as namespace History; export type Action = string; diff --git a/hoek/hoek-tests.ts b/hoek/hoek-tests.ts new file mode 100644 index 0000000000..09f82a7e2a --- /dev/null +++ b/hoek/hoek-tests.ts @@ -0,0 +1,290 @@ +import * as Hoek from "hoek"; + +/** + * Import the entire module as above or use named imports: + * import { clone, merge, assert } from "hoek"; + * "Tests" taken straight from hoek API reference and adapted to TypeScript. + */ + +// clone(obj) + +let nestedObj = { + w: /^something$/ig, + x: { + a: [1, 2, 3], + b: 123456, + c: new Date() + }, + y: 'y', + z: new Date() +}; + +let copy = Hoek.clone(nestedObj); + +copy.x.b = 100; + +console.log(copy.y); // results in 'y' +console.log(nestedObj.x.b); // results in 123456 +console.log(copy.x.b); // results in 100 + +// cloneWithShallow(obj, keys) + +nestedObj = { + w: /^something$/ig, + x: { + a: [1, 2, 3], + b: 123456, + c: new Date() + }, + y: 'y', + z: new Date() +}; + +copy = Hoek.cloneWithShallow(nestedObj, ['x']); + +copy.x.b = 100; + +console.log(copy.y); // results in 'y' +console.log(nestedObj.x.b); // results in 100 +console.log(copy.x.b); // results in 100 + +// merge(target, source, isNullOverride, isMergeArrays) + +let target = { a: 1, b: 2 }; +let source = { a: 0, c: 5 }; +let source2 = { a: null, c: 5 }; + +Hoek.merge(target, source); // results in {a: 0, b: 2, c: 5} +Hoek.merge(target, source2); // results in {a: null, b: 2, c: 5} +Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5} + +let targetArray = [1, 2, 3]; +let sourceArray = [4, 5]; + +Hoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5] +Hoek.merge(targetArray, sourceArray, true, false); // results in [4, 5] + +// applyToDefaults(defaults, options, isNullOverride) + +let defaults = { host: "localhost", port: 8000 }; +let options = { port: 8080 }; + +let config = Hoek.applyToDefaults(defaults, options); // results in { host: "localhost", port: 8080 } + +defaults = { host: "localhost", port: 8000 }; +let options1 = { host: null, port: 8080 }; + +config = Hoek.applyToDefaults(defaults, options1, true); // results in { host: null, port: 8080 } + +// applyToDefaultsWithShallow(defaults, options, keys) + +let defaults1 = { + server: { + host: "localhost", + port: 8000 + }, + name: 'example' +}; + +let options2 = { server: { port: 8080 } }; + +let config1 = Hoek.applyToDefaultsWithShallow(defaults1, options2, ['server']); // results in { server: { port: 8080 }, name: 'example' } + +// deepEqual(b, a, [options]) + +Hoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true +Hoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true +Hoek.deepEqual(Object.create(null), {}); //results in false + +// unique(array, key) + +let array = [1, 2, 2, 3, 3, 4, 5, 6]; + +let newArray = Hoek.unique(array); // results in [1,2,3,4,5,6] + +let array1 = [{ id: 1 }, { id: 1 }, { id: 2 }]; + +let newArray1 = Hoek.unique(array1, "id"); // results in [{id: 1}, {id: 2}] + +// mapToObject(array, key) + +array = [1, 2, 3]; +let newObject = Hoek.mapToObject(array); // results in {"1": true, "2": true, "3": true} + +array1 = [{ id: 1 }, { id: 2 }]; +newObject = Hoek.mapToObject(array1, "id"); // results in {"1": true, "2": true} + +// intersect(array1, array2) + +array = [1, 2, 3]; +let array2 = [1, 4, 5]; + +let newArray2 = Hoek.intersect(array, array2); // results in [1] + +// contain(ref, values, [options]) + +Hoek.contain('aaa', 'a', { only: true }); // true +Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true }); // true +Hoek.contain([1, 2, 2], [1, 2], { once: true }); // false +Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true + +// flatten(array, [target]) + +let array3 = [1, [2, 3]]; + +let flattenedArray = Hoek.flatten(array); // results in [1, 2, 3] + +array3 = [1, [2, 3]]; +let target1 = [4, [5]]; + +flattenedArray = Hoek.flatten(array3, target1); // results in [4, [5], 1, 2, 3] + +// reach(obj, chain, [options]) + +let chain = 'a.b.c'; +let obj = { a: { b: { c: 1 } } }; + +Hoek.reach(obj, chain); // returns 1 + +chain = 'a.b.-1'; +let obj1 = { a: { b: [2, 3, 6] } }; + +Hoek.reach(obj1, chain); // returns 6 + +// reachTemplate(obj, template, [options]) + +chain = 'a.b.c'; +obj = { a: { b: { c: 1 } } }; + +Hoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2' + +// transform(obj, transform, [options]) + +let source1 = { + address: { + one: '123 main street', + two: 'PO Box 1234' + }, + title: 'Warehouse', + state: 'CA' +}; + +let result = Hoek.transform(source1, { + 'person.address.lineOne': 'address.one', + 'person.address.lineTwo': 'address.two', + 'title': 'title', + 'person.address.region': 'state' +}); +// Results in +// { +// person: { +// address: { +// lineOne: '123 main street', +// lineTwo: 'PO Box 1234', +// region: 'CA' +// } +// }, +// title: 'Warehouse' +// } + +// shallow(obj) + +let shallow = Hoek.shallow({ a: { b: 1 } }); + +// stringify(obj) + +let a: any = {}; +a.b = a; +Hoek.stringify(a); // Returns '[Cannot display object: Converting circular structure to JSON]' + +// Timer + +let timerObj = new Hoek.Timer(); +console.log("Time is now: " + timerObj.ts); +console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds'); + +// Bench + +let benchObj = new Hoek.Bench(); +console.log("Elapsed time from initialization: " + benchObj.elapsed() + 'milliseconds'); + +// base64urlEncode(value) + +Hoek.base64urlEncode("hoek"); + +// base64urlDecode(value) + +Hoek.base64urlDecode("aG9law=="); + +// escapeHtml(string) + +let string = ' hey '; +let escapedString = Hoek.escapeHtml(string); // returns <html> hey </html> + +// escapeHeaderAttribute(attribute) + +a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); //returns I said \"go w\\o me\" + +// escapeRegex(string) + +a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); // returns 4\^f\$s\.4\*5\+\-_\?%\=#\!\:@\|~\\\/`"\(>\)\[<\]d\{\}s\, + +// assert(condition, message) + +let x = 1, y = 2; + +Hoek.assert(x === y, 'x should equal y'); // Throws 'x should equal y' + +Hoek.assert(x === y, new Error('x should equal y')); // Throws the given error object + +// abort(message) + +Hoek.abort("Error message"); + +// displayStack(slice) + +let stack = Hoek.displayStack(); +console.log(stack); + +// callStack(slice) + +let stack2 = Hoek.callStack(); +console.log(stack2); + +// nextTick(fn) + +let myFn = function () { + console.log('Do this later'); +}; + +let nextFn = Hoek.nextTick(myFn); + +nextFn(); +console.log('Do this first'); + +// Results in: +// +// Do this first +// Do this later + +// once(fn) + +myFn = function () { + console.log('Ran myFn'); +}; + +let onceFn = Hoek.once(myFn); +onceFn(); // results in "Ran myFn" +onceFn(); // results in undefined + +// ignore + +Hoek.ignore(); + +// uniqueFilename(path, extension) + +let result1 = Hoek.uniqueFilename('./test/modules', 'txt'); // results in "full/path/test/modules/{random}.txt" + +// isInteger(value) + +result = Hoek.isInteger('23'); diff --git a/hoek/index.d.ts b/hoek/index.d.ts new file mode 100644 index 0000000000..98e2188fec --- /dev/null +++ b/hoek/index.d.ts @@ -0,0 +1,211 @@ +// Type definitions for hoek 4.1 +// Project: https://github.com/hapijs/hoek +// Definitions by: Prashant Tiwari +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface ContainOptions { + /** Perform a deep comparison of the values? */ + deep?: boolean; + /** Allow only one occurrence of each value? */ + once?: boolean; + /** Don't allow values not explicitly listed? */ + only?: boolean; + /** Allow partial match of the values? */ + part?: boolean; +} + +interface ReachOptions { + /** String to split chain path on. Defaults to ".". */ + separator?: string; + /** Value to return if the path or value is not present. Default is undefined. */ + default?: any; + /** Throw an error on missing member? Default is false. */ + strict?: boolean; + /** Allow traversing functions for properties? */ + functions?: boolean; +} + +// Object + +/** + * Clone an object or an array. + */ +export function clone(obj: T): T; + +/** + * Clone an object or array. + * */ +export function cloneWithShallow(obj: any, keys: string[]): any; + +/** + * Merge all the properties of source into target. */ +export function merge(target: T1, source: T2, isNullOverride?: boolean, isMergeArrays?: boolean): T1 & T2; + +/** + * Apply options to a copy of the defaults. + * */ +export function applyToDefaults(defaults: T1, options: T2, isNullOverride?: boolean): T1 & T2; + +/** + * Apply options to a copy of the defaults. + */ +export function applyToDefaultsWithShallow(defaults: T1, options: T2, keys?: string[]): T1 & T2; + +/** + * Perform a deep comparison of the two values. + */ +export function deepEqual(b: T, a: T, options?: any): T; + +/** + * Remove duplicate items from Array. + */ +export function unique(array: T[], key?: string): T[]; + +/** + * Convert an Array into an Object. + */ +export function mapToObject(array: any[], key?: string): any; + +/** + * Find the common unique items in two arrays. + */ +export function intersect(array1: any[], array2: any[]): any; + +/** + * Test if the reference value contains the provided values. + */ +export function contain(ref: any, values: any, options?: ContainOptions): boolean; + +/** + * Flatten an array. + */ +export function flatten(array: any[], target?: any[]): any[]; + +/** + * Convert an object key chain string to reference. + */ +export function reach(obj: any, chain: any, options?: ReachOptions): any; + +/** + * Replace string parameters ({name}) with their corresponding object key values. + */ +export function reachTemplate(obj: any, template: string, options?: ReachOptions): any; + +/** + * Transform an existing object into a new one based on the supplied obj and transform map. + */ +export function transform(obj: any, transform: any, options?: ReachOptions): any; + +/** + * Perform a shallow copy by copying the references of all the top level children. + */ +export function shallow(obj: any): any; + +/** + * Convert an object to string. Any errors are caught and reported back in the form of the returned string. + */ +export function stringify(obj: any): string; + +// Timer + +/** + * A Timer object. + */ +export class Timer { + /** The number of milliseconds elapsed since the epoch. */ + ts: number; + /** The time (ms) elapsed since the timer was created. */ + elapsed(): number; +} + +// Bench + +/** + * Same as Timer, except ts stores the internal node clock. + */ +export class Bench { + /** The number of milliseconds on the node clock elapsed since the epoch. */ + ts: number; + /** The time (ms) elapsed since the timer was created. */ + elapsed(): number; +} + +// Binary Encoding/Decoding + +/** + * Encode value of string or buffer type in Base64 or URL encoding. + */ +export function base64urlEncode(value: string): string; + +/** + * Decode string into Base64 or URL encoding. + */ +export function base64urlDecode(value: string): string; + +// Escaping Characters + +/** + * Escape html characters. + */ +export function escapeHtml(htmlString: string): string; + +/** + * Escape attribute value for use in HTTP header. + */ +export function escapeHeaderAttribute(attribute: string): string; + +/** + * Escape string for Regex construction. + */ +export function escapeRegex(regexString: string): string; + +// Errors + +/** + * Print message or throw error if condition fails. + */ +export function assert(condition: boolean, message: string | Error): void | Error; + +/** + * Throw if process.env.NODE_ENV === 'test'. Else display most recent stack and exit process. + */ +export function abort(message: string | Error): void; + +/** + * Display the trace stack. + */ +export function displayStack(slice?: any): string[]; + +/** + * Return a trace stack array. + */ +export function callStack(slice?: any): any[]; + +// Function + +/** + * Wrap fn in process.nextTick. + */ +export function nextTick(fn: () => void): () => void; + +/** + * Make sure fn is only run once. + */ +export function once(fn: () => void): () => void; + +/** + * A simple no-op function. + */ +export function ignore(): void; + +// Miscellaneous + +/** + * path to prepend to a randomly generated file name. + */ +export function uniqueFilename(path: string, extension?: string): string; + +/** + * Check value to see if it is an integer. + */ +export function isInteger(value: any): boolean; diff --git a/hoek/tsconfig.json b/hoek/tsconfig.json new file mode 100644 index 0000000000..ea03427572 --- /dev/null +++ b/hoek/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "hoek-tests.ts" + ] +} \ No newline at end of file diff --git a/hoek/tslint.json b/hoek/tslint.json new file mode 100644 index 0000000000..192203ab54 --- /dev/null +++ b/hoek/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file diff --git a/html2canvas/index.d.ts b/html2canvas/index.d.ts index 8c3d9e7b8d..3e661b34fa 100644 --- a/html2canvas/index.d.ts +++ b/html2canvas/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for html2canvas.js v0.5.0-bata.4 +// Type definitions for html2canvas.js v0.5.0-bata.4 // Project: https://github.com/niklasvh/html2canvas // Definitions by: Richard Hepburn , Pei-Tang Huang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/http-errors/index.d.ts b/http-errors/index.d.ts index 7766aa3508..883fbf0ac1 100644 --- a/http-errors/index.d.ts +++ b/http-errors/index.d.ts @@ -3,89 +3,90 @@ // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module 'http-errors' { + namespace createHttpError { -declare namespace createHttpError { + // See https://github.com/jshttp/http-errors/blob/1.3.1/index.js#L42 + interface HttpError extends Error { + status: number; + statusCode: number; + expose: boolean; + } - // See https://github.com/jshttp/http-errors/blob/1.3.1/index.js#L42 - interface HttpError extends Error { - status: number; - statusCode: number; - expose: boolean; + type HttpErrorConstructor = new(msg?: string) => HttpError; + + interface CreateHttpError { + // See https://github.com/Microsoft/TypeScript/issues/227#issuecomment-50092674 + [code: string]: new () => HttpError; + + (...args: Array): HttpError; + + Continue: HttpErrorConstructor; + SwitchingProtocols: HttpErrorConstructor; + Processing: HttpErrorConstructor; + OK: HttpErrorConstructor; + Created: HttpErrorConstructor; + Accepted: HttpErrorConstructor; + NonAuthoritativeInformation: HttpErrorConstructor; + NoContent: HttpErrorConstructor; + ResetContent: HttpErrorConstructor; + PartialContent: HttpErrorConstructor; + MultiStatus: HttpErrorConstructor; + AlreadyReported: HttpErrorConstructor; + IMUsed: HttpErrorConstructor; + MultipleChoices: HttpErrorConstructor; + MovedPermanently: HttpErrorConstructor; + Found: HttpErrorConstructor; + SeeOther: HttpErrorConstructor; + NotModified: HttpErrorConstructor; + UseProxy: HttpErrorConstructor; + Unused: HttpErrorConstructor; + TemporaryRedirect: HttpErrorConstructor; + PermanentRedirect: HttpErrorConstructor; + BadRequest: HttpErrorConstructor; + Unauthorized: HttpErrorConstructor; + PaymentRequired: HttpErrorConstructor; + Forbidden: HttpErrorConstructor; + NotFound: HttpErrorConstructor; + MethodNotAllowed: HttpErrorConstructor; + NotAcceptable: HttpErrorConstructor; + ProxyAuthenticationRequired: HttpErrorConstructor; + RequestTimeout: HttpErrorConstructor; + Conflict: HttpErrorConstructor; + Gone: HttpErrorConstructor; + LengthRequired: HttpErrorConstructor; + PreconditionFailed: HttpErrorConstructor; + PayloadTooLarge: HttpErrorConstructor; + URITooLong: HttpErrorConstructor; + UnsupportedMediaType: HttpErrorConstructor; + RangeNotSatisfiable: HttpErrorConstructor; + ExpectationFailed: HttpErrorConstructor; + ImATeapot: HttpErrorConstructor; + MisdirectedRequest: HttpErrorConstructor; + UnprocessableEntity: HttpErrorConstructor; + Locked: HttpErrorConstructor; + FailedDependency: HttpErrorConstructor; + UnorderedCollection: HttpErrorConstructor; + UpgradeRequired: HttpErrorConstructor; + PreconditionRequired: HttpErrorConstructor; + TooManyRequests: HttpErrorConstructor; + RequestHeaderFieldsTooLarge: HttpErrorConstructor; + UnavailableForLegalReasons: HttpErrorConstructor; + InternalServerError: HttpErrorConstructor; + NotImplemented: HttpErrorConstructor; + BadGateway: HttpErrorConstructor; + ServiceUnavailable: HttpErrorConstructor; + GatewayTimeout: HttpErrorConstructor; + HTTPVersionNotSupported: HttpErrorConstructor; + VariantAlsoNegotiates: HttpErrorConstructor; + InsufficientStorage: HttpErrorConstructor; + LoopDetected: HttpErrorConstructor; + BandwidthLimitExceeded: HttpErrorConstructor; + NotExtended: HttpErrorConstructor; + NetworkAuthenticationRequired: HttpErrorConstructor; + } } - - type HttpErrorConstructor = new(msg?: string) => HttpError; - interface CreateHttpError { - // See https://github.com/Microsoft/TypeScript/issues/227#issuecomment-50092674 - [code: string]: new () => HttpError; - - (...args: Array): HttpError; - - Continue: HttpErrorConstructor; - SwitchingProtocols: HttpErrorConstructor; - Processing: HttpErrorConstructor; - OK: HttpErrorConstructor; - Created: HttpErrorConstructor; - Accepted: HttpErrorConstructor; - NonAuthoritativeInformation: HttpErrorConstructor; - NoContent: HttpErrorConstructor; - ResetContent: HttpErrorConstructor; - PartialContent: HttpErrorConstructor; - MultiStatus: HttpErrorConstructor; - AlreadyReported: HttpErrorConstructor; - IMUsed: HttpErrorConstructor; - MultipleChoices: HttpErrorConstructor; - MovedPermanently: HttpErrorConstructor; - Found: HttpErrorConstructor; - SeeOther: HttpErrorConstructor; - NotModified: HttpErrorConstructor; - UseProxy: HttpErrorConstructor; - Unused: HttpErrorConstructor; - TemporaryRedirect: HttpErrorConstructor; - PermanentRedirect: HttpErrorConstructor; - BadRequest: HttpErrorConstructor; - Unauthorized: HttpErrorConstructor; - PaymentRequired: HttpErrorConstructor; - Forbidden: HttpErrorConstructor; - NotFound: HttpErrorConstructor; - MethodNotAllowed: HttpErrorConstructor; - NotAcceptable: HttpErrorConstructor; - ProxyAuthenticationRequired: HttpErrorConstructor; - RequestTimeout: HttpErrorConstructor; - Conflict: HttpErrorConstructor; - Gone: HttpErrorConstructor; - LengthRequired: HttpErrorConstructor; - PreconditionFailed: HttpErrorConstructor; - PayloadTooLarge: HttpErrorConstructor; - URITooLong: HttpErrorConstructor; - UnsupportedMediaType: HttpErrorConstructor; - RangeNotSatisfiable: HttpErrorConstructor; - ExpectationFailed: HttpErrorConstructor; - ImATeapot: HttpErrorConstructor; - MisdirectedRequest: HttpErrorConstructor; - UnprocessableEntity: HttpErrorConstructor; - Locked: HttpErrorConstructor; - FailedDependency: HttpErrorConstructor; - UnorderedCollection: HttpErrorConstructor; - UpgradeRequired: HttpErrorConstructor; - PreconditionRequired: HttpErrorConstructor; - TooManyRequests: HttpErrorConstructor; - RequestHeaderFieldsTooLarge: HttpErrorConstructor; - UnavailableForLegalReasons: HttpErrorConstructor; - InternalServerError: HttpErrorConstructor; - NotImplemented: HttpErrorConstructor; - BadGateway: HttpErrorConstructor; - ServiceUnavailable: HttpErrorConstructor; - GatewayTimeout: HttpErrorConstructor; - HTTPVersionNotSupported: HttpErrorConstructor; - VariantAlsoNegotiates: HttpErrorConstructor; - InsufficientStorage: HttpErrorConstructor; - LoopDetected: HttpErrorConstructor; - BandwidthLimitExceeded: HttpErrorConstructor; - NotExtended: HttpErrorConstructor; - NetworkAuthenticationRequired: HttpErrorConstructor; - } + var createHttpError: createHttpError.CreateHttpError; + export = createHttpError; } - -declare var createHttpError: createHttpError.CreateHttpError; -export = createHttpError; diff --git a/http-string-parser/index.d.ts b/http-string-parser/index.d.ts index cf844edbd2..93310b0384 100644 --- a/http-string-parser/index.d.ts +++ b/http-string-parser/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for http-string-parser +// Type definitions for http-string-parser // Project: https://github.com/apiaryio/http-string-parser // Definitions by: MIZUNE Pine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/httperr/index.d.ts b/httperr/index.d.ts index aa7e237db1..dbb00673e9 100644 --- a/httperr/index.d.ts +++ b/httperr/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for httperr v1.0.0 +// Type definitions for httperr v1.0.0 // Project: https://github.com/pluma/httperr // Definitions by: Troy Gerwien // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/i18n/index.d.ts b/i18n/index.d.ts index ac7829eb07..7c7697cc22 100644 --- a/i18n/index.d.ts +++ b/i18n/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for i18n-node 0.5.0 +// Type definitions for i18n-node 0.5.0 // Project: https://github.com/mashpie/i18n-node // Definitions by: Maxime LUCE // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/i18next/i18next-tests.ts b/i18next/i18next-tests.ts index f781fe7be9..23c67cc742 100644 --- a/i18next/i18next-tests.ts +++ b/i18next/i18next-tests.ts @@ -60,5 +60,7 @@ i18n.t('helloWorld', { defaultValue: 'default', count: 10 }); + +const options:i18n.Options = i18n.options; const currentLanguage:string = i18n.language; const userLanguageCodes:string[] = i18n.languages; diff --git a/i18next/index.d.ts b/i18next/index.d.ts index 39e0f2a1a2..b0cb04b267 100644 --- a/i18next/index.d.ts +++ b/i18next/index.d.ts @@ -130,9 +130,11 @@ declare namespace i18n { on(languageChanged: 'languageChanged', listener: (lng: string) => void): void; off(event: string, listener: () => void): void; + + options: Options; } } -declare var i18n:i18n.I18n; +declare var i18n: i18n.I18n; export = i18n; diff --git a/icepick/icepick-tests.ts b/icepick/icepick-tests.ts index 8c7b654492..5458509d42 100644 --- a/icepick/icepick-tests.ts +++ b/icepick/icepick-tests.ts @@ -27,7 +27,7 @@ class Foo {} // assoc(collection, key, value) { let coll = { a: 1, b: 2 }; - let newColl = i.assoc(coll, "b", 3); // {a: 1, b: 3} + let newColl = i.assoc(coll, "b", 3); // {a: 1, b: 3} let arr = ["a", "b", "c"]; let newArr = i.assoc(arr, 2, "d"); // ["a", "b", "d"] @@ -36,7 +36,7 @@ class Foo {} // alias: set(collection, key, value) { let coll = { a: 1, b: 2 }; - let newColl = i.set(coll, "b", 3); // {a: 1, b: 3} + let newColl = i.set(coll, "b", 3); // {a: 1, b: 3} let arr = ["a", "b", "c"]; let newArr = i.set(arr, 2, "d"); // ["a", "b", "d"] @@ -70,7 +70,7 @@ class Foo {} } }; - let newColl = i.assocIn(coll, ["c", "d"], "baz"); + let newColl = i.assocIn(coll, ["c", "d"], "baz"); let coll2 = {}; let newColl2 = i.assocIn(coll2, ["a", "b", "c"], 1); @@ -86,7 +86,7 @@ class Foo {} } }; - let newColl = i.setIn(coll, ["c", "d"], "baz"); + let newColl = i.setIn(coll, ["c", "d"], "baz"); let coll2 = {}; let newColl2 = i.setIn(coll2, ["a", "b", "c"], 1); @@ -99,7 +99,7 @@ class Foo {} { b: 2 } ]); - let result = i.getIn(coll, [1, "b"]); // 2 + let result = i.getIn(coll, [1, "b"]) as number; // 2 } // updateIn(collection, path, callback) @@ -166,9 +166,13 @@ class Foo {} }; let result = i.chain(o) - .assocIn(["a", 2], 4) + .assocIn(["a", 2], 4) + .setIn(["a", 1], 5) + .updateIn(["d"], function(d) { return d * 2 }) .merge({ b: { c: 2, c2: 3 } }) - .assoc("e", 2) + .assoc("e", 2) + .set("f", 3) .dissoc("d") - .value(); + .getIn(['a', 0]) + .value() as number; } diff --git a/icepick/index.d.ts b/icepick/index.d.ts index 184f0e12b1..bffe424d1b 100644 --- a/icepick/index.d.ts +++ b/icepick/index.d.ts @@ -1,15 +1,15 @@ -// Type definitions for icepick v1.1.0 +// Type definitions for icepick v1.3.0 // Project: https://github.com/aearly/icepick -// Definitions by: Nathan Brown +// Definitions by: Nathan Brown , Tobias Cohen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export declare function freeze(collection: T): T; export declare function thaw(collection: T): T; -export declare function assoc(collection: T, key: number | string, value: any): T; +export declare function assoc(collection: T, key: number | string, value: V): T; export declare function dissoc(collection: T, key: number | string): T; -export declare function assocIn(collection: T, path: Array, value: any): T; -export declare function getIn(collection: any, path: Array): Result; +export declare function assocIn(collection: T, path: Array, value: V): T; +export declare function getIn(collection: T, path: Array): any; export declare function updateIn(collection: T, path: Array, callback: (value: V) => V): T; export {assoc as set}; @@ -44,17 +44,17 @@ interface IcepickWrapper { freeze(): IcepickWrapper; thaw(): IcepickWrapper; - assoc(key: number | string, value: any): IcepickWrapper; - set(key: number | string, value: any): IcepickWrapper; + assoc(key: number | string, value: V): IcepickWrapper; + set(key: number | string, value: V): IcepickWrapper; dissoc(key: number | string): IcepickWrapper; unset(key: number | string): IcepickWrapper; - assocIn(path: Array, value: any): IcepickWrapper; - setIn(path: Array, value: any): IcepickWrapper; + assocIn(path: Array, value: V): IcepickWrapper; + setIn(path: Array, value: V): IcepickWrapper; - getIn(collection: any, path: Array): IcepickWrapper; - updateIn(collection: T, path: Array, callback: (value: V) => V): IcepickWrapper; + getIn(path: Array): IcepickWrapper; + updateIn(path: Array, callback: (value: V) => V): IcepickWrapper; assign(source1: S1): IcepickWrapper; assign(s1: S1, s2: S2): IcepickWrapper; diff --git a/immutable/immutable-tests.ts b/immutable/immutable-tests.ts index 50520cde2f..e3e0d357eb 100644 --- a/immutable/immutable-tests.ts +++ b/immutable/immutable-tests.ts @@ -46,7 +46,10 @@ list = list.asImmutable(); let indexedSeq: immutable.Seq.Indexed = list.toSeq(); // Iterable tests -let value: number = list.get(0); +let optionalValue: number | undefined; +let value: number; + +optionalValue = list.get(0); value = list.get(0, 1); list = list.interpose(0); list = list.interleave(list, list1); @@ -77,8 +80,8 @@ value = list.hashCode(); bool = list.has(1); bool = list.includes(1); bool = list.contains(1); -value = list.first(); -value = list.last(); +optionalValue = list.first(); +optionalValue = list.last(); let toArr: number[] = list.toArray(); let toMap: immutable.Map = list.toMap(); let toOrderedMap: immutable.OrderedMap = list.toOrderedMap(); @@ -177,23 +180,23 @@ tuple = list.findLastEntry( null, 0 ); -value = list.findKey( +optionalValue = list.findKey( (value: number, key: number, iter: immutable.List) => true, null ); -value = list.findLastKey( +optionalValue = list.findLastKey( (value: number, key: number, iter: immutable.List) => true, null ); -value = list.keyOf(0); -value = list.lastKeyOf(0); -value = list.max((valA: number, valB: number) => 0); -value = list.maxBy( +optionalValue = list.keyOf(0); +optionalValue = list.lastKeyOf(0); +optionalValue = list.max((valA: number, valB: number) => 0); +optionalValue = list.maxBy( (value: number, key: number, iter: immutable.List) => "foo", (valueA: string, valueB: string) => 0 ); -value = list.min((valA: number, valB: number) => 0); -value = list.minBy( +optionalValue = list.min((valA: number, valB: number) => 0); +optionalValue = list.minBy( (value: number, key: number, iter: immutable.List) => "foo", (valueA: string, valueB: string) => 0 ); @@ -279,7 +282,7 @@ let stack: immutable.Stack = immutable.Stack(); bool = immutable.Stack.isStack(stack); stack = immutable.Stack.of(0, 1, 2, 3, 4, 5); stack = immutable.Stack(list); -value = stack.peek(); +optionalValue = stack.peek(); stack = stack.clear(); stack = stack.unshift(0, 1, 2); stack = stack.unshiftAll(list); diff --git a/immutable/index.d.ts b/immutable/index.d.ts index 9cadb3c29e..c8f0a24cc9 100644 --- a/immutable/index.d.ts +++ b/immutable/index.d.ts @@ -988,7 +988,7 @@ declare namespace Immutable { /** * Alias for `Stack.first()`. */ - peek(): T; + peek(): T | undefined; // Persistent changes @@ -1521,8 +1521,8 @@ declare namespace Immutable { * `index` may be a negative number, which indexes back from the end of the * Iterable. `s.get(-1)` gets the last item in the Iterable. */ - get(index: number, notSetValue?: T): T; - + get(index: number, notSetValue: T): T; + get(index: number): T | undefined; // Conversion to Seq @@ -1758,7 +1758,8 @@ declare namespace Immutable { * so if `notSetValue` is not provided and this method returns `undefined`, * that does not guarantee the key was not found. */ - get(key: K, notSetValue?: V): V; + get(key: K, notSetValue: V): V; + get(key: K): V | undefined; /** * True if a key exists within this `Iterable`, using `Immutable.is` to determine equality @@ -1775,12 +1776,12 @@ declare namespace Immutable { /** * The first value in the Iterable. */ - first(): V; + first(): V | undefined; /** * The last value in the Iterable. */ - last(): V; + last(): V | undefined; // Reading deep values @@ -2231,9 +2232,12 @@ declare namespace Immutable { */ reduce( reducer: (reduction: R, value: V, key: K, iter: this) => R, - initialReduction?: R, + initialReduction: R, context?: any ): R; + reduce( + reducer: (reduction: R, value: V, key: K, iter: this) => R + ): R | undefined; /** * Reduces the Iterable in reverse (from the right side). @@ -2243,9 +2247,12 @@ declare namespace Immutable { */ reduceRight( reducer: (reduction: R, value: V, key: K, iter: this) => R, - initialReduction?: R, + initialReduction: R, context?: any ): R; + reduceRight( + reducer: (reduction: R, value: V, key: K, iter: this) => R + ): R | undefined; /** * True if `predicate` returns true for all entries in the Iterable. @@ -2312,9 +2319,13 @@ declare namespace Immutable { */ find( predicate: (value: V, key: K, iter: this) => boolean, - context?: any, - notSetValue?: V + context: any, + notSetValue: V ): V; + find( + predicate: (value: V, key: K, iter: this) => boolean, + context?: any + ): V | undefined; /** * Returns the last value for which the `predicate` returns true. @@ -2323,18 +2334,26 @@ declare namespace Immutable { */ findLast( predicate: (value: V, key: K, iter: this) => boolean, - context?: any, - notSetValue?: V + context: any, + notSetValue: V ): V; + findLast( + predicate: (value: V, key: K, iter: this) => boolean, + context?: any + ): V | undefined; /** * Returns the first [key, value] entry for which the `predicate` returns true. */ findEntry( predicate: (value: V, key: K, iter: this) => boolean, - context?: any, - notSetValue?: V + context: any, + notSetValue: V ): [K, V]; + findEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: any + ): [K, V] | undefined; /** * Returns the last [key, value] entry for which the `predicate` @@ -2344,9 +2363,13 @@ declare namespace Immutable { */ findLastEntry( predicate: (value: V, key: K, iter: this) => boolean, - context?: any, - notSetValue?: V + context: any, + notSetValue: V ): [K, V]; + findLastEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: any + ): [K, V] | undefined; /** * Returns the key for which the `predicate` returns true. @@ -2354,7 +2377,7 @@ declare namespace Immutable { findKey( predicate: (value: V, key: K, iter: this) => boolean, context?: any - ): K; + ): K | undefined; /** * Returns the last key for which the `predicate` returns true. @@ -2364,17 +2387,17 @@ declare namespace Immutable { findLastKey( predicate: (value: V, key: K, iter: this) => boolean, context?: any - ): K; + ): K | undefined; /** * Returns the key associated with the search value, or undefined. */ - keyOf(searchValue: V): K; + keyOf(searchValue: V): K | undefined; /** * Returns the last key associated with the search value, or undefined. */ - lastKeyOf(searchValue: V): K; + lastKeyOf(searchValue: V): K | undefined; /** * Returns the maximum value in this collection. If any values are @@ -2391,7 +2414,7 @@ declare namespace Immutable { * If `comparator` returns 0 and either value is NaN, undefined, or null, * that value will be returned. */ - max(comparator?: (valueA: V, valueB: V) => number): V; + max(comparator?: (valueA: V, valueB: V) => number): V | undefined; /** * Like `max`, but also accepts a `comparatorValueMapper` which allows for @@ -2403,7 +2426,7 @@ declare namespace Immutable { maxBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number - ): V; + ): V | undefined; /** * Returns the minimum value in this collection. If any values are @@ -2420,7 +2443,7 @@ declare namespace Immutable { * If `comparator` returns 0 and either value is NaN, undefined, or null, * that value will be returned. */ - min(comparator?: (valueA: V, valueB: V) => number): V; + min(comparator?: (valueA: V, valueB: V) => number): V | undefined; /** * Like `min`, but also accepts a `comparatorValueMapper` which allows for @@ -2432,7 +2455,7 @@ declare namespace Immutable { minBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number - ): V; + ): V | undefined; // Comparison @@ -2540,5 +2563,4 @@ declare namespace Immutable { export interface Iterator { next(): { value: T; done: boolean; } } - } diff --git a/immutable/tsconfig.json b/immutable/tsconfig.json index dcf2c26e73..c13d74d116 100644 --- a/immutable/tsconfig.json +++ b/immutable/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,4 +16,4 @@ "index.d.ts", "immutable-tests.ts" ] -} \ No newline at end of file +} diff --git a/inquirer/index.d.ts b/inquirer/index.d.ts index b60dfef00d..618da5593d 100644 --- a/inquirer/index.d.ts +++ b/inquirer/index.d.ts @@ -111,7 +111,7 @@ declare namespace inquirer { * A key/value hash containing the client answers in each prompt. */ interface Answers { - [key: string]: any; + [key: string]: any; } namespace ui { diff --git a/ip/index.d.ts b/ip/index.d.ts index 1c00f1320e..0e3bb7bd14 100644 --- a/ip/index.d.ts +++ b/ip/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-ip +// Type definitions for node-ip // Project: https://github.com/indutny/node-ip // Definitions by: Peter Harris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/is/index.d.ts b/is/index.d.ts index a07a6054e6..3c0e279eea 100644 --- a/is/index.d.ts +++ b/is/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for is.js +// Type definitions for is.js // Project: http://arasatasaygin.github.io/is.js/ // Definitions by: Rodrigo Cabral // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/iscroll/iscroll-5.d.ts b/iscroll/iscroll-5.d.ts index 31e9acaf6c..b4a8d62763 100644 --- a/iscroll/iscroll-5.d.ts +++ b/iscroll/iscroll-5.d.ts @@ -65,6 +65,9 @@ interface IScrollOptions { click?: boolean; invertWheelDirection?: boolean; eventPassthrough?: string | boolean; + + // iScroll probe edition + probeType?: number; } declare class IScroll { diff --git a/jasmine-data_driven_tests/index.d.ts b/jasmine-data_driven_tests/index.d.ts index 9f0be21477..9874f61cb8 100644 --- a/jasmine-data_driven_tests/index.d.ts +++ b/jasmine-data_driven_tests/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jasmine Data Driven Tests +// Type definitions for Jasmine Data Driven Tests // Project: https://github.com/gburghardt/jasmine-data_driven_tests // Definitions by: Anthony MacKinnon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jasmine-jquery/index.d.ts b/jasmine-jquery/index.d.ts index cfca2cc265..cbd713fd37 100644 --- a/jasmine-jquery/index.d.ts +++ b/jasmine-jquery/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jasmine-JQuery 1.5.8 +// Type definitions for Jasmine-JQuery 1.5.8 // Project: https://github.com/velesin/jasmine-jquery // Definitions by: Gregor Stamac // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jcanvas/index.d.ts b/jcanvas/index.d.ts index 8d10dfdcb7..a5c1b7204f 100644 --- a/jcanvas/index.d.ts +++ b/jcanvas/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jCanvas 15.2 +// Type definitions for jCanvas 15.2 // Project: https://github.com/caleb531/jcanvas // Definitions by: Rogier Schouten // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jdataview/index.d.ts b/jdataview/index.d.ts index 6ed80f870a..b91a6813ec 100644 --- a/jdataview/index.d.ts +++ b/jdataview/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jDataView +// Type definitions for jDataView // Project: https://github.com/jDataView/jDataView // Definitions by: Ingvar Stepanyan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jest/index.d.ts b/jest/index.d.ts index dc0260cebb..cf50596d55 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -91,7 +91,7 @@ declare namespace jest { } interface ProvidesCallback { - (cb?: DoneCallback): any; + (cb: DoneCallback): any; } interface Lifecycle { @@ -99,7 +99,7 @@ declare namespace jest { } interface It { - (name: string, fn: ProvidesCallback): void; + (name: string, fn?: ProvidesCallback): void; only: It; skip: It; concurrent: It; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index 4b81f6282c..913a671fa1 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -358,3 +358,12 @@ describe('genMockFromModule', function () { }); }); }); + +/** + * Pass strictNullChecks + */ +describe('strictNullChecks', function () { + it('does not complain when using done callback', (done) => { + done(); + }) +}); diff --git a/jest/tsconfig.json b/jest/tsconfig.json index 0ad43c6b19..da1e33c024 100644 --- a/jest/tsconfig.json +++ b/jest/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/johnny-five/index.d.ts b/johnny-five/index.d.ts index 8f480c5e3e..c5e058c335 100644 --- a/johnny-five/index.d.ts +++ b/johnny-five/index.d.ts @@ -32,9 +32,9 @@ export interface AccelerometerMMA7361Option extends AccelerometerGeneralOption { export declare class Accelerometer { constructor(option: AccelerometerGeneralOption | AccelerometerAnalogOption | AccelerometerMPU6050Option | AccelerometerMMA7361Option); - on(event: string, cb: () => void): void; - on(event: "change", cb: () => void): void; - on(event: "data", cb: (freq: any) => void): void; + on(event: string, cb: () => void): this; + on(event: "change", cb: () => void): this; + on(event: "data", cb: (freq: any) => void): this; hasAxis(name: string): void; enable(): void; disable(): void; @@ -71,12 +71,12 @@ export interface ButtonOptions { export declare class Button { constructor(pin: number | string | ButtonOptions); - on(event: string, cb: () => void): void; - on(event: "hold", cb: (holdTime: number) => void): void; - on(event: "down", cb: () => void): void; - on(event: "press", cb: () => void): void; - on(event: "up", cb: () => void): void; - on(event: "release", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "hold", cb: (holdTime: number) => void): this; + on(event: "down", cb: () => void): this; + on(event: "press", cb: () => void): this; + on(event: "up", cb: () => void): this; + on(event: "release", cb: () => void): this; } export interface BoardOptions { @@ -91,9 +91,9 @@ export interface Repl { export declare class Board { constructor(option?: BoardOptions); - on(event: string, cb: () => void): void; - on(event: "ready", cb: () => void): void; - on(event: "connect", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "ready", cb: () => void): this; + on(event: "connect", cb: () => void): this; pinMode(pin: number, mode: number): void; analogWrite(pin: number, value: number): void; analogRead(pin: number, cb: (item: number) => void): void; @@ -170,9 +170,9 @@ export interface IMUMPU6050Option extends IMUGeneralOption { export declare class IMU { constructor(option: IMUGeneralOption | IMUMPU6050Option); - on(event: string, cb: () => void): void; - on(event: "change", cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; + on(event: string, cb: () => void): this; + on(event: "change", cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; } export declare module IR { @@ -182,11 +182,11 @@ export declare module IR { export class Motion { constructor(option: number | MotionOption); - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "motionstart", cb: () => void): void; - on(event: "motionend", cb: () => void): void; - on(event: "calibrated", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "motionstart", cb: () => void): this; + on(event: "motionend", cb: () => void): this; + on(event: "calibrated", cb: () => void): this; } export interface PloximityOption { @@ -196,9 +196,9 @@ export declare module IR { export class Proximity { constructor(option: number | PloximityOption); - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "change", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "change", cb: () => void): this; } export interface ArrayOption { @@ -220,10 +220,10 @@ export declare module IR { calibrate(): void; calibrateUntil(predicate: () => void): void; loadCalibration(option: LoadCalibrationOption): void; - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "calibratedData", cb: (data: any) => void): void; - on(event: "line", cb: (data: any) => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "calibratedData", cb: (data: any) => void): this; + on(event: "line", cb: (data: any) => void): this; } } } @@ -234,10 +234,10 @@ export interface JoystickOption { export declare class Joystick { constructor(option: JoystickOption); - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "change", cb: () => void): void; - on(event: "axismove", cb: (error: Error, date: Date) => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "change", cb: () => void): this; + on(event: "axismove", cb: (error: Error, date: Date) => void): this; axis: Array; raw: Array; @@ -468,9 +468,9 @@ export declare class Sensor { scale(): Sensor; booleanAt(barrier: number): boolean; within(range: Array, cb: () => void): void; - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "change", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "change", cb: () => void): this; } export interface ServoGeneralOption { @@ -505,8 +505,8 @@ export declare class Servo { stop(): void; cw(speed: number): void; ccw(speed: number): void; - on(event: string, cb: () => void): void; - on(event: "move:complete", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "move:complete", cb: () => void): this; } export interface ShiftRegisterOption { @@ -529,9 +529,9 @@ export declare class Sonar { constructor(option: number | string | SonarOption); within(range: Array, cb: () => void): void; within(range: Array, unit: string, cb: () => void): void; - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "change", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "change", cb: () => void): this; } export interface StepperOption { @@ -568,9 +568,9 @@ export declare class Stepper { within(range: Array, cb: () => void): void; within(range: Array, unit: string, cb: () => void): void; - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "change", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "change", cb: () => void): this; } export interface TemperatureOption { @@ -582,7 +582,7 @@ export interface TemperatureOption { export declare class Temperature { constructor(option: TemperatureOption); - on(event: string, cb: () => void): void; - on(event: "data", cb: (data: any) => void): void; - on(event: "change", cb: () => void): void; + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "change", cb: () => void): this; } diff --git a/johnny-five/johnny-five-tests.ts b/johnny-five/johnny-five-tests.ts index 919f1fd7d5..da5cff19f6 100644 --- a/johnny-five/johnny-five-tests.ts +++ b/johnny-five/johnny-five-tests.ts @@ -250,4 +250,6 @@ board.on('ready', function(){ return (raw / 100) + 10; } }); +}).on("ready", function(){ + console.log("Everything is ready!!!"); }); diff --git a/jqgrid/index.d.ts b/jqgrid/index.d.ts index d711f0753c..00310f43ad 100644 --- a/jqgrid/index.d.ts +++ b/jqgrid/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQuery jqgrid Plugin 1.3 +// Type definitions for jQuery jqgrid Plugin 1.3 // Project: https://github.com/tonytomov/jqGrid // Definitions by: Lokesh Peta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery-handsontable/index.d.ts b/jquery-handsontable/index.d.ts index 7b4deaabdf..fbf8bcda33 100644 --- a/jquery-handsontable/index.d.ts +++ b/jquery-handsontable/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery-handsontable +// Type definitions for jquery-handsontable // Project: http://handsontable.com // Definitions by: Ted John // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -292,6 +292,11 @@ declare namespace Handsontable { */ manualRowResize?: boolean; + /** + * Turns on Manual row move, if set to a boolean or define initial row order, if set to an array of row indexes. + */ + manualRowMove?: boolean; + /** * Setting to true enables the copyPaste plugin, which enables the copying and pasting to the clipboard. */ diff --git a/jquery-jsonrpcclient/index.d.ts b/jquery-jsonrpcclient/index.d.ts index 45995ec97b..911e9d08ec 100644 --- a/jquery-jsonrpcclient/index.d.ts +++ b/jquery-jsonrpcclient/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.jsonrpc 0.7.0 +// Type definitions for jquery.jsonrpc 0.7.0 // Project: https://github.com/Textalk/jquery.jsonrpcclient.js // Definitions by: Maksim Karelov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery-mousewheel/index.d.ts b/jquery-mousewheel/index.d.ts index e57d73be5b..dbc91e126c 100644 --- a/jquery-mousewheel/index.d.ts +++ b/jquery-mousewheel/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery-mousewheel v3.1.13 +// Type definitions for jquery-mousewheel v3.1.13 // Project: https://github.com/jquery/jquery-mousewheel // Definitions by: Brian Surowiec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery-param/index.d.ts b/jquery-param/index.d.ts new file mode 100644 index 0000000000..44568f99d1 --- /dev/null +++ b/jquery-param/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for jquery-param v1.0.0 +// Project: https://github.com/knowledgecode/jquery-param +// Definitions by: Pat Sissons +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace param; + +export = param; + +declare function param(obj: any): string; diff --git a/jquery-param/jquery-param-tests.ts b/jquery-param/jquery-param-tests.ts new file mode 100644 index 0000000000..cdea4dd342 --- /dev/null +++ b/jquery-param/jquery-param-tests.ts @@ -0,0 +1,3 @@ +import param = require('jquery-param'); + +const test1 = param({ a: 'A', b: 'B', c: 'C' }); diff --git a/jquery-param/tsconfig.json b/jquery-param/tsconfig.json new file mode 100644 index 0000000000..cd5ade28aa --- /dev/null +++ b/jquery-param/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery-param-tests.ts" + ] +} \ No newline at end of file diff --git a/jquery-steps/index.d.ts b/jquery-steps/index.d.ts index 4b250e6708..6abe640417 100644 --- a/jquery-steps/index.d.ts +++ b/jquery-steps/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for jQuery Steps v1.1.0 +// Type definitions for jQuery Steps v1.1.1 // Project: http://www.jquery-steps.com/ // Definitions by: Joseph Blank // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Updated by: Nicholas Wong interface JQuery { - JQuerySteps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; + steps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; } declare module JQuerySteps { @@ -194,7 +195,7 @@ declare module JQuerySteps { /** * The animation effect which will be used for step transitions. Default value is none or 0. - * This can be none (0), fade (1), slide (2) or slideLeft (3). + * This can be none (0), fade (1), slide (2) or slideLeft (3). */ transitionEffect?: string|number; @@ -343,7 +344,7 @@ declare module JQuerySteps { /** * Indicates how the content will be loaded. - * This can be html (0), iframe (1), or async (2). + * This can be html (0), iframe (1), or async (2). */ contentMode?: string|number; diff --git a/jquery-steps/jquery-steps-tests.ts b/jquery-steps/jquery-steps-tests.ts index 09b91025ff..35346d1f7b 100644 --- a/jquery-steps/jquery-steps-tests.ts +++ b/jquery-steps/jquery-steps-tests.ts @@ -59,7 +59,7 @@ var settings: JQuerySteps.Settings = { onStepChanging: onStepChangingFunc } -var wizard = $('.wizard').JQuerySteps(settings); +var wizard = $('.wizard').steps(settings); var newStep1: JQuerySteps.Step = { content: '
Content
', diff --git a/jquery-validation-unobtrusive/index.d.ts b/jquery-validation-unobtrusive/index.d.ts index 0be13613af..f1997a1002 100644 --- a/jquery-validation-unobtrusive/index.d.ts +++ b/jquery-validation-unobtrusive/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Microsoft jQuery Unobtrusive Validation v3.2.3 +// Type definitions for Microsoft jQuery Unobtrusive Validation v3.2.3 // Project: https://github.com/aspnet/jquery-validation-unobtrusive // Definitions by: Matt Brooks // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery.are-you-sure/index.d.ts b/jquery.are-you-sure/index.d.ts index 5bb4840210..5a7e547e50 100644 --- a/jquery.are-you-sure/index.d.ts +++ b/jquery.are-you-sure/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.are-you-sure.js +// Type definitions for jquery.are-you-sure.js // Project: https://github.com/codedance/jquery.AreYouSure // Definitions by: Jon Egerton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery.blockui/index.d.ts b/jquery.blockui/index.d.ts index 42a6bf3f35..6763de1a0f 100644 --- a/jquery.blockui/index.d.ts +++ b/jquery.blockui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQuery BlockUI Plugin +// Type definitions for jQuery BlockUI Plugin // Project: http://malsup.com/jquery/block/ // Definitions by: Jeffrey Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jquery.contextmenu/index.d.ts b/jquery.contextmenu/index.d.ts index 5748c76edc..64db123173 100644 --- a/jquery.contextmenu/index.d.ts +++ b/jquery.contextmenu/index.d.ts @@ -25,7 +25,8 @@ interface JQueryContextMenuOptions { hide?: () => void; }; callback?: (key: any, options: any) => any; - items: any; + items?: any; + build?: (triggerElement: JQuery, e: Event) => any; reposition?: boolean; className?: string; itemClickEvent?: string; diff --git a/jquery.datatables/index.d.ts b/jquery.datatables/index.d.ts index 81c5027619..bca787fe8d 100644 --- a/jquery.datatables/index.d.ts +++ b/jquery.datatables/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for JQuery DataTables 1.10.8 +// Type definitions for JQuery DataTables 1.10.8 // Project: http://www.datatables.net // Definitions by: Kiarash Ghiaseddin , Omid Rad , Armin Sander // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -908,15 +908,9 @@ declare namespace DataTables { * @param d Data to use for the row. */ data(d: any[] | Object): DataTable; - + /** - * Get the id of the selected row. - * - * @param hash Set to true to append a hash (#) to the start of the row id. - */ - id(hash?: boolean): string; - /** * Get the id of the selected row. Since: 1.10.8 * * @param hash true - Append a hash (#) to the start of the row id. This can be useful for then using the id as a selector @@ -1712,7 +1706,7 @@ declare namespace DataTables { //#region "language-settings" - // these are all optional + // these are all optional interface LanguageSettings { emptyTable?: string; info?: string; diff --git a/jquery.datatables/jquery.dataTables-tests.ts b/jquery.datatables/jquery.dataTables-tests.ts index fae4892c55..591b875cdb 100644 --- a/jquery.datatables/jquery.dataTables-tests.ts +++ b/jquery.datatables/jquery.dataTables-tests.ts @@ -82,21 +82,21 @@ $(document).ready(function () { width: "200px" } col = - { - data: "", - orderData: [10, 11, 20], - render: "", - } + { + data: "", + orderData: [10, 11, 20], + render: "", + } col = - { - data: colDataObject, - render: colRenderObject, - } + { + data: colDataObject, + render: colRenderObject, + } col = - { - data: colDataFunc, - render: colRenderFunc, - } + { + data: colDataFunc, + render: colRenderFunc, + } //#endregion "Column" @@ -124,16 +124,16 @@ $(document).ready(function () { }; colDef = - { - targets: "2", - cellType: "th", - }; + { + targets: "2", + cellType: "th", + }; colDef = - { - targets: ["2", 5], - cellType: "th", - }; + { + targets: ["2", 5], + cellType: "th", + }; //#endregion "ColumnDef" @@ -230,41 +230,41 @@ $(document).ready(function () { config = - { - ajax: ajaxFunc, - deferLoading: [10, 100], - lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], - order: [0, 'asc'], - orderFixed: [[0, 'asc'], [1, 'asc']], - renderer: { - header: "bootstrap", - pageButton: "jqueryui" - }, - search: { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, - searchCols: [ - null, - { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, - { "search": "" }, - { "search": "", "smart": true }, - null - ], - }; + { + ajax: ajaxFunc, + deferLoading: [10, 100], + lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], + order: [0, 'asc'], + orderFixed: [[0, 'asc'], [1, 'asc']], + renderer: { + header: "bootstrap", + pageButton: "jqueryui" + }, + search: { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, + searchCols: [ + null, + { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, + { "search": "" }, + { "search": "", "smart": true }, + null + ], + }; config = - { - ajax: { - data: {}, - dataSrc: "", - }, - }; + { + ajax: { + data: {}, + dataSrc: "", + }, + }; config = - { - ajax: { - data: ajaxDataFunc, + { + ajax: { + data: ajaxDataFunc, dataSrc: function (data: any) { }, - }, - }; + }, + }; //#endregion "Settings" @@ -393,11 +393,11 @@ $(document).ready(function () { var select = $('