diff --git a/.gitignore b/.gitignore index 35dd5a667e..a79d28de0c 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ node_modules .sublimets .settings/launch.json +yarn.lock diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 44f0d8e9a0..1036be548d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -401,6 +401,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii) * [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000) * [:link:](ejs/ejs.d.ts) [ejs.js](http://ejs.co) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) +* [:link:](ejson/ejson.d.ts) [ejson](https://www.npmjs.com/package/ejson) by [Shantanu Bhadoria](https://github.com/shantanubhadoria) * [:link:](elasticsearch/elasticsearch.d.ts) [elasticsearch](https://www.elastic.co) by [Casper Skydt](https://github.com/CasperSkydt/DefinitelyTyped), [Blake Smith](https://github.com/bfsmith/DefinitelyTyped) * [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) * [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io), [Milan Burda](https://github.com/miniak) @@ -1189,7 +1190,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ng-stomp/ng-stomp.d.ts) [ngStomp](https://github.com/beevelop/ng-stomp) by [Lukasz Potapczuk](https://github.com/lpotapczuk) * [:link:](ngstorage/ngstorage.d.ts) [ngstorage](https://github.com/gsklee/ngStorage) by [Jakub Pistek](https://github.com/kubiq) * [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi) -* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook), [Hans Bakker](https://github.com/wind-rider) +* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook), [Hans Bakker](https://github.com/wind-rider), [Shantanu Bhadoria](https://github.com/shantanubhadoria) * [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) * [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](oauth2-server/oauth2-server.d.ts) [Node OAuth2 Server](https://github.com/thomseddon/node-oauth2-server) by [Robbie Van Gorkom](https://github.com/vangorra) @@ -1664,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/Headroom/headroom.d.ts b/Headroom/headroom.d.ts index ac505fac18..6e180d869f 100644 --- a/Headroom/headroom.d.ts +++ b/Headroom/headroom.d.ts @@ -8,10 +8,11 @@ interface HeadroomOptions { tolerance?: any; classes?: { initial?: string; - pinned?: string; - unpinned?: string; - top?: string; + notBottom?:string; notTop?: string; + pinned?: string; + top?: string; + unpinned?: string; }; scroller?: Element; onPin?: () => void; diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 730bd78af2..a864dbcb13 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,8 +1,17 @@ -case 1. Add a new type definition. -- [ ] checked compilation succeeds with `--target es6` and `--noImplicitAny` options. -- [ ] has correct [naming convention](http://definitelytyped.org/guides/contributing.html#naming-the-file) -- [ ] has a [test file](http://definitelytyped.org/guides/contributing.html#tests) with the suffix of `-tests.ts` or `-tests.tsx`. +Please fill in this template. -case 2. Improvement to existing type definition. -- documentation or source code reference which provides context for the suggested changes. url http://api.jquery.com/html . - - it has been reviewed by a DefinitelyTyped member. +- [ ] Prefer to make your PR against the `types-2.0` branch. +- [ ] Test the change in your own code. +- [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request). +- [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped#common-mistakes). +- [ ] Run `npm run lint -- package-name` if a `tslint.json` is present. + +If adding a new definition: +- [ ] The package does not provide its own types, and you can not add them. +- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. +- [ ] Run `tsc` without errors. +- [ ] 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: <> +- [ ] Increase the version number in the header if appropriate. diff --git a/README.md b/README.md index b188982fbf..ab2080714b 100644 --- a/README.md +++ b/README.md @@ -4,36 +4,222 @@ > The repository for *high quality* TypeScript type definitions. -For more information see the [definitelytyped.org](http://definitelytyped.org) website. +Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date. -## Usage -Include a line like this: +## What are declaration files? -```typescript -/// +See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). + + +## How do I get them? + +### npm + +This is the preferred method. This is only available for TypeScript 2.0+ users. For example: + +```sh +npm install --save-dev @types/node ``` -## Contributions +The types should then be automatically included by the compiler. +See more in the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). + +For an NPM package "foo", typings for it will be at "@types/foo". +If you can't find your package, look for it on [TypeSearch](https://microsoft.github.io/TypeSearch/). + +If you still can't find it, check if it [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own typings. +This is usually provided in a `"types"` or `"typings"` field in the `package.json`, +or just look for any ".d.ts" files in the package and manually include them with a `/// `. + + +### Other methods + +These can be used by TypeScript 1.0. + +* [Typings](https://github.com/typings/typings) +* [NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped) +* Manually download from the `master` branch of this repository + +You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). + + +## How can I contribute? DefinitelyTyped only works because of contributions by users like you! -Please see the [contribution guide](http://definitelytyped.org/guides/contributing.html) on how to contribute to DefinitelyTyped. +### Test -## How to get the definitions +Before you share your improvement with the world, use it yourself. -* Directly from the GitHub repos -* [NuGet packages](http://nuget.org/packages?q=DefinitelyTyped) -* [Typings - TypeScript Definition Manager](https://github.com/typings/typings) +#### Test editing an exiting package -## List of definitions +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 follow the steps below. -* See [CONTRIBUTORS.md](CONTRIBUTORS.md) -## Requested definitions +#### Test a new package + +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 + +Once you've tested your package, you can share it on DefinitelyTyped. + +First, [fork](https://guides.github.com/activities/forking/) this repository. +Then inside your repository: + +* `git checkout types-2.0` + +New work should generally be done on the `types-2.0` branch. +If you want your changes to be available to `typings` users, then you may edit `master` instead. + + +#### Edit an existing package + +* `cd my-package-to-edit` +* Make changes. Remember to edit tests. +* You may also want to add yourself to "Definitions by" section of the package header. +* `npm install -g typescript@2.0` and run `tsc`. + +When you make a PR to edit an existing package, `dt-bot` should @-mention previous authors. +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 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. +(You can use `npm info foo` to check for the existence of the `foo` package.) + +Your package should have this structure: + +| File | Purpose | +| --- | --- | +| 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. | + +Generate these by running `npm run new-package -- new-package-name`. + +You may edit the `tsconfig.json` to add new files or to add the `"jsx"` compiler option. + +DefinitelyTyped members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. + +For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/base64-js). + + +#### Common mistakes + +* First, follow advice from the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html). +* Formatting: Either use all tabs, or always use 4 spaces. Also, always use semicolons, and use egyptian braces. +* `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(); } +* `const Class: { new(): IClass; }`: + Prefer to use a class declaration `class Class { constructor(); }` instead of a new-able constant. +* `namespace foo {}`: + Do not add a namespace just so that the `import * as foo` syntax will work. + If it is commonJs module with a single export, you should use the `import foo = require("foo")` syntax. + See more explanation [here](https://stackoverflow.com/questions/39415661/why-cant-i-import-a-class-or-function-with-import-as-x-from-y). +* `getMeAT(): T`: + If a type parameter does not appear in the types of any parameters, you don't really have a generic function, you just have a disguised type assertion. + Prefer to use a real type assertion, e.g. `getMeAT() as number`. + Example where a type parameter is acceptable: `function id(value: T): T;`. + Example where it is not acceptable: `function parseJson(json: string): T;`. + Exception: `new Map()` is OK. + + +#### Removing a package + +When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from DefinitelyTyped to avoid confusion. +Make a PR doing the following: +* Delete the directory. +* Add a new entry to `notNeededPackages.json`. + - `libraryName`: Descriptive name of the library, e.g. "Angular 2" instead of "angular2". (May be identical to "typingsPackageName".) + - `typingsPackageName`: This is the name of the directory you just deleted. + - `sourceRepoURL`: This should point to the repository that contains the typings. + - `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version. +* Any other packages in DefinitelyTyped that referenced the deleted package should be updated to reference the bundled types. + To do this, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. + + +#### Lint + +To lint a package, just add a `tslint.json` to that package containing `{ "extends": "../tslint.json" }`. All new packages must be linted. +If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example: + +```json +{ + "extends": "../tslint.json", + "rules": { + // This package uses the Function type, and it will take effort to fix. + "forbidden-types": false + } +} +``` + +(To indicate that a lint rule truly does not apply, use `// tslint:disable:rule-name` or better, `//tslint:disable-next-line:rule-name`.) + +Only `.d.ts` files are linted. +Test the linter by running `npm run lint -- package-name`. Do not use a globally installed tslint. + + +## FAQ + +#### What exactly is the relationship between this repository and the `@types` packages on NPM? + +The `types-2.0` branch is automatically published to the `@types` scope on NPM thanks to [types-publisher](https://github.com/Microsoft/types-publisher). +This usually happens within an hour of changes being merged. + +Changes to the `master` branch are also manually merged into the `types-2.0` branch, but this takes longer. + +#### 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 ``. + +#### What do I do about older versions of typings? + +Currently we don't support this, though it is [planned](https://github.com/Microsoft/types-publisher/issues/3). +If you're adding a new major version of a library, you can copy `index.d.ts` to `foo-v2.3.d.ts` and edit `index.d.ts` to be the new version. + +#### I notice some packages having a `package.json` here. + +Usually you won't need this. When publishing a package we will normally automatically create a `package.json` for it. +A `package.json` may be included for the sake of specifying dependencies. Here's an [example](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/pikaday/package.json). +We do not allow other fields, such as `"description"`, to be defined manually. +Also, if you need to reference an older version of typings, you must do that by adding `"dependencies": { "@types/foo": "x.y.z" }` to the package.json. + +#### I notice some `tsconfig.json` are missing `"noImplicitAny": true` or `"strictNullChecks": true`. + +Then they are wrong. You can help by submitting a pull request to fix them. + +#### Definitions in types-2.0 seem written differently than in master. + +If you're targeting types-2.0, write it like the types-2.0 definitions. +If you're targeting master, we may change it to the new style when merging from master to types-2.0. + +#### Can I request a definition? Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). + ## License This project is licensed under the MIT license. diff --git a/acl/acl.d.ts b/acl/acl.d.ts index d222f9ebb6..eaa728cb2c 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -20,7 +20,7 @@ declare module "acl" { type Callback = (err: Error) => any; type AnyCallback = (err: Error, obj: any) => any; type AllowedCallback = (err: Error, allowed: boolean) => any; - type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value; + type GetUserId = (req: http.IncomingMessage, res: http.ServerResponse) => Value; interface AclStatic { new (backend: Backend, logger: Logger, options: Option): Acl; diff --git a/ajv/ajv.d.ts b/ajv/ajv.d.ts index d8bfd56ef3..304fba2512 100644 --- a/ajv/ajv.d.ts +++ b/ajv/ajv.d.ts @@ -82,7 +82,7 @@ declare module "ajv" { passContext?: boolean; loopRequired?: number; ownProperties?: boolean; - multipleOfPrecision?: boolean; + multipleOfPrecision?: boolean | number; errorDataPath?: string, messages?: boolean; beautify?: boolean; diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 4f5dbe90f7..ae5baad50e 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -23,6 +23,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(); diff --git a/angular-dynamic-locale/angular-dynamic-locale.d.ts b/angular-dynamic-locale/angular-dynamic-locale.d.ts index 4b7a1f9656..210a50f4aa 100644 --- a/angular-dynamic-locale/angular-dynamic-locale.d.ts +++ b/angular-dynamic-locale/angular-dynamic-locale.d.ts @@ -20,6 +20,7 @@ declare namespace angular.dynamicLocale { interface tmhDynamicLocaleProvider extends angular.IServiceProvider { localeLocationPattern(location: string): tmhDynamicLocaleProvider; localeLocationPattern(): string; + storageKey(storageKey: string): void; useStorage(storageName: string): void; useCookieStorage(): void; } diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 68d645abfa..f100fd4d4b 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -160,6 +160,7 @@ declare namespace angular.material { hideDelay(delay: number): T; position(position: string): T; parent(parent?: string|Element|JQuery): T; // default: root node + toastClass(toastClass: string): T; } interface ISimpleToastPreset extends IToastPreset { @@ -338,6 +339,7 @@ declare namespace angular.material { onRemoving?: Function; onDomRemoved?: Function; origin?: string|JQuery|Element; + onCloseSuccess?: ((panel: IPanelRef, closeReason: string) => any); } interface IPanelRef { @@ -355,6 +357,9 @@ declare namespace angular.material { removeClass(oldClass: string): void; toggleClass(toggleClass: string): void; updatePosition(position: IPanelPosition): void; + registerInterceptor(type: string, callback: () => angular.IPromise): IPanelRef; + removeInterceptor(type: string, callback: () => angular.IPromise): IPanelRef; + removeAllInterceptors(type?: string): IPanelRef; } interface IPanelPosition { @@ -370,8 +375,8 @@ declare namespace angular.material { centerVertically(): IPanelPosition; center(): IPanelPosition; addPanelPosition(xPosition: string, yPosition: string): IPanelPosition; - withOffsetX(offsetX: string): IPanelPosition; - withOffsetY(offsetY: string): IPanelPosition; + withOffsetX(offsetX: string|((panel: IPanelPosition) => string)): IPanelPosition; + withOffsetY(offsetY: string|((panel: IPanelPosition) => string)): IPanelPosition; } interface IPanelAnimation { @@ -404,5 +409,18 @@ declare namespace angular.material { SCALE: string, FADE: string, }; + interceptorTypes: { + CLOSE: string, + }; + closeReasons: { + CLICK_OUTSIDE: string, + ESCAPE: string, + }; + absPosition: { + TOP: string, + RIGHT: string, + BOTTOM: string, + LEFT: string, + }; } } diff --git a/angular-protractor/angular-protractor.d.ts b/angular-protractor/angular-protractor.d.ts index d33eeddace..b05eda4a13 100644 --- a/angular-protractor/angular-protractor.d.ts +++ b/angular-protractor/angular-protractor.d.ts @@ -1829,8 +1829,8 @@ declare namespace protractor { function wrapDriver(webdriver: webdriver.WebDriver, opt_baseUrl?: string, opt_rootElement?: string): Protractor; } -interface cssSelectorHelper { - (cssLocator: string): protractor.ElementFinder; +interface selectorHelper { + (cssLocator: string | Function | HTMLElement | Document | Array): protractor.ElementFinder; } interface cssArraySelectorHelper { @@ -1841,7 +1841,7 @@ declare var browser: protractor.IBrowser; declare var by: protractor.IProtractorLocatorStrategy; declare var By: protractor.IProtractorLocatorStrategy; declare var element: protractor.Element; -declare var $: cssSelectorHelper; +declare var $: selectorHelper; declare var $$: cssArraySelectorHelper; declare module 'protractor' { diff --git a/angular-signalr-hub/angular-signalr-hub-tests.ts b/angular-signalr-hub/angular-signalr-hub-tests.ts index d20457bcdc..1e7c90c962 100644 --- a/angular-signalr-hub/angular-signalr-hub-tests.ts +++ b/angular-signalr-hub/angular-signalr-hub-tests.ts @@ -1,5 +1,5 @@ -/// /// +/// angular .module('app', ['SignalR']) diff --git a/angular-signalr-hub/angular-signalr-hub.d.ts b/angular-signalr-hub/angular-signalr-hub.d.ts index 03fa6427eb..8d331ffd75 100644 --- a/angular-signalr-hub/angular-signalr-hub.d.ts +++ b/angular-signalr-hub/angular-signalr-hub.d.ts @@ -3,8 +3,14 @@ // Definitions by: Adam Santaniello // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// /// +declare module "angular-signalr-hub" { + let _: string; + export = _; +} + declare namespace ngSignalr { interface HubFactory { /** diff --git a/angular-touchspin/angular-touchspin-tests.ts b/angular-touchspin/angular-touchspin-tests.ts index c6e229c7f5..c69c6b3140 100644 --- a/angular-touchspin/angular-touchspin-tests.ts +++ b/angular-touchspin/angular-touchspin-tests.ts @@ -2,9 +2,9 @@ /// angular - .module('touchspin-tests', ['lm.touchspin']) - .config(function(touchspinConfigProvider: angularTouchSpin.ITouchSpinConfigProvider) { - touchspinConfigProvider.defaults({ + .module('touchspin-tests', ['nk.touchspin']) + .config(function(touchspinConfigProvider: angular.touchspin.ITouchSpinConfigProvider) { + touchspinConfigProvider.defaults({ min: 0, max: 0, step: 0, diff --git a/angular-touchspin/angular-touchspin.d.ts b/angular-touchspin/angular-touchspin.d.ts index 5423b17e55..adae8cc92c 100644 --- a/angular-touchspin/angular-touchspin.d.ts +++ b/angular-touchspin/angular-touchspin.d.ts @@ -11,7 +11,7 @@ declare module "angular-touchspin" { export = _; } -declare namespace angularTouchSpin { +declare namespace angular.touchspin { interface ITouchSpinOptions { min?: number; max?: number; diff --git a/angular-ui-router-default/angular-ui-router-default-tests.ts b/angular-ui-router-default/angular-ui-router-default-tests.ts new file mode 100644 index 0000000000..2b6bfbe61e --- /dev/null +++ b/angular-ui-router-default/angular-ui-router-default-tests.ts @@ -0,0 +1,39 @@ +/// + +angular.module("test", [ + "ui.router", + "ui.router.default" +]) + .config(function($stateProvider: angular.ui.IStateProvider) { + $stateProvider + .state('concrete', { + // no abstract or default + }) + .state('string', { + abstract: true, + default: 'concrete' + }) + .state('func_str', { + abstract: true, + default: function($rootScope): string { return $rootScope.test; } + }) + .state('func_promise', { + abstract: true, + default: function($q: ng.IQService): ng.IPromise { + return $q.when("concrete"); + } + }) + .state('injection_str', { + abstract: true, + default: ["$rootScope", function($rootScope) { + return $rootScope.test; + }] + }) + .state('injection_promise', { + abstract: true, + default: ["$q", function($q: ng.IQService) { + return $q.when("concrete"); + }] + }) + ; + }); diff --git a/angular-ui-router-default/angular-ui-router-default.d.ts b/angular-ui-router-default/angular-ui-router-default.d.ts new file mode 100644 index 0000000000..9d102681cf --- /dev/null +++ b/angular-ui-router-default/angular-ui-router-default.d.ts @@ -0,0 +1,17 @@ +// Type definitions for angular-ui-router-default 0.5+ +// Project: https://github.com/nonplus/angular-ui-router-default +// Definitions by: Stepan Riha +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace angular.ui { + export type StateDefaultSpecifier = string + | ((...args: any[]) => string) + | ((...args: any[]) => ng.IPromise) + | (string | ((...args: any[]) => string))[] + | (string | ((...args: any[]) => ng.IPromise))[]; + interface IState { + default?: StateDefaultSpecifier + } +} diff --git a/angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts b/angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts new file mode 100644 index 0000000000..3f14b2a40f --- /dev/null +++ b/angular-ui-router-uib-modal/angular-ui-router-uib-modal-tests.ts @@ -0,0 +1,30 @@ +/// + +angular.module("test", [ + "ui.bootstrap", + "ui.router", + "ui.router.default" +]) + .config(function($stateProvider: angular.ui.IStateProvider) { + $stateProvider + .state('contacts', { + // no modal + resolve: { + a: function() { + return "a"; + }, + b: function() { + return ["a", "b"]; + } + } + }) + .state('contacts.contact', { + // boolean modal + modal: true + }) + .state('contacts.contact.edit', { + // string[] modal + modal: ["a", "b"] + }) + ; + }); diff --git a/angular-ui-router-uib-modal/angular-ui-router-uib-modal.d.ts b/angular-ui-router-uib-modal/angular-ui-router-uib-modal.d.ts new file mode 100644 index 0000000000..598fe964fe --- /dev/null +++ b/angular-ui-router-uib-modal/angular-ui-router-uib-modal.d.ts @@ -0,0 +1,12 @@ +// Type definitions for angular-ui-uib-modal 0.11+ (ui.router module) +// Project: https://github.com/nonplus/angular-ui-router-uib-modal +// Definitions by: Stepan Riha +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace angular.ui { + interface IState { + modal?: boolean | string[]; + } +} diff --git a/angularjs/angular-sanitize-tests.ts b/angularjs/angular-sanitize-tests.ts index d065392c79..8fdf3e3eed 100644 --- a/angularjs/angular-sanitize-tests.ts +++ b/angularjs/angular-sanitize-tests.ts @@ -1,10 +1,32 @@ /// -var shouldBeString: string; +/////////////////////////////////////////////////////////////////////////////// +// Variables +/////////////////////////////////////////////////////////////////////////////// +let shouldBeString: string; +let testInputText: string = 'TEST'; -declare var $sanitizeService: ng.sanitize.ISanitizeService; -shouldBeString = $sanitizeService(shouldBeString); +/////////////////////////////////////////////////////////////////////////////// +// Test sanitize service +/////////////////////////////////////////////////////////////////////////////// +declare let $sanitizeService: ng.sanitize.ISanitizeService; +shouldBeString = $sanitizeService(testInputText); -declare var $linky: ng.sanitize.filter.ILinky; -shouldBeString = $linky(shouldBeString); -shouldBeString = $linky(shouldBeString, shouldBeString); +/////////////////////////////////////////////////////////////////////////////// +// Test `linky` filter +/////////////////////////////////////////////////////////////////////////////// +declare let $linky: ng.sanitize.filter.ILinky; + +// Should be string for simple text and target parameters +shouldBeString = $linky(testInputText, testInputText); + +// Should be string for simple text, target and attributes parameters +let attributesAsFunction = () => { +}; +shouldBeString = $linky(shouldBeString, testInputText, { + "attributeKey1": "attributeValue1", + "attributeKey2": "attributeValue2" +}); +shouldBeString = $linky(shouldBeString, testInputText, (url: string) => { + return {"attributeKey1": "attributeValue1"} +}); \ No newline at end of file diff --git a/angularjs/angular-sanitize.d.ts b/angularjs/angular-sanitize.d.ts index d87515adca..36cad6f77e 100644 --- a/angularjs/angular-sanitize.d.ts +++ b/angularjs/angular-sanitize.d.ts @@ -29,12 +29,25 @@ declare namespace angular.sanitize { // see https://github.com/angular/angular.js/tree/v1.2.0/src/ngSanitize/filter /////////////////////////////////////////////////////////////////////////// export module filter { - - // Finds links in text input and turns them into html links. - // Supports http/https/ftp/mailto and plain email address links. - // see http://code.angularjs.org/1.2.0/docs/api/ngSanitize.filter:linky + /** + * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and plain email address links. + * @param text Input text. + * @param target ILinkyTargetType Window (_blank|_self|_parent|_top) or named frame to open links in. + * @param attributes Add custom attributes to the link element. + * @return Html-linkified and sanitized text. + * see https://docs.angularjs.org/api/ngSanitize/filter/linky + */ interface ILinky { - (text: string, target?: string): string; + (text: string, target: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string; } + } } +/////////////////////////////////////////////////////////////////////////////// +// Extend angular $filter declarations to include filters from angular.sanitize module +/////////////////////////////////////////////////////////////////////////////// +declare namespace angular { + interface IFilterService { + (name: 'linky'): angular.sanitize.filter.ILinky; + } +} \ No newline at end of file diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 4c03e7c219..0b0314b7d6 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -192,8 +192,25 @@ mod.controller({ MyCtrl2: function() {}, MyCtrl3: ['$fooService', function($fooService: any) { }] }); -mod.directive('name', function ($scope: ng.IScope) { }) -mod.directive('name', ['$scope', function ($scope: ng.IScope) { }]) +mod.directive('myDirectiveA', ($rootScope: ng.IRootScopeService) => { + return (scope, el, attrs) => { + let foo = 'none'; + el.click(e => { + foo = e.type; + $rootScope.$apply(); + }); + scope.$watch(() => foo, () => el.text(foo)); + }; +}); +mod.directive('myDirectiveB', ['$rootScope', function ($rootScope: ng.IRootScopeService) { + return { + link(scope, el, attrs) { + el.click(e => { + el.hide(); + }); + } + }; +}]); mod.directive({ myFooDir: () => ({ template: 'my-foo-dir.tpl.html' @@ -279,8 +296,14 @@ namespace TestQ { b: string; c: boolean; } + interface TValue { + e: number; + f: boolean; + } var tResult: TResult; var promiseTResult: angular.IPromise; + var tValue: TValue; + var promiseTValue: angular.IPromise; var $q: angular.IQService; var promiseAny: angular.IPromise; @@ -349,6 +372,22 @@ namespace TestQ { let result: angular.IPromise; result = $q.when(tResult); result = $q.when(promiseTResult); + + result = $q.when(tValue, (result: TValue) => tResult); + result = $q.when(tValue, (result: TValue) => tResult, (any) => any); + result = $q.when(tValue, (result: TValue) => tResult, (any) => any, (any) => any); + + result = $q.when(promiseTValue, (result: TValue) => tResult); + result = $q.when(promiseTValue, (result: TValue) => tResult, (any) => any); + result = $q.when(promiseTValue, (result: TValue) => tResult, (any) => any, (any) => any); + + result = $q.when(tValue, (result: TValue) => promiseTResult); + result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any); + result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any, (any) => any); + + result = $q.when(promiseTValue, (result: TValue) => promiseTResult); + result = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => any); + result = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => any, (any) => any); } } diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index e879668039..b16438bdcb 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1041,6 +1041,7 @@ declare namespace angular { * @param value Value or a promise */ when(value: IPromise|T): IPromise; + when(value: IPromise|T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1769,7 +1770,7 @@ declare namespace angular { /////////////////////////////////////////////////////////////////////////// interface IDirectiveFactory { - (...args: any[]): IDirective; + (...args: any[]): IDirective | IDirectiveLinkFn; } interface IDirectiveLinkFn { @@ -1777,8 +1778,8 @@ declare namespace angular { scope: IScope, instanceElement: JQuery, instanceAttributes: IAttributes, - controller: {}, - transclude: ITranscludeFunction + controller?: IController | IController[] | {[key: string]: IController}, + transclude?: ITranscludeFunction ): void; } @@ -1806,7 +1807,6 @@ declare namespace angular { controller?: string | Injectable; controllerAs?: string; /** - * @deprecated * Deprecation warning: although bindings for non-ES6 class controllers are currently bound to this before * the controller constructor is called, this use is now deprecated. Please place initialization code that * relies upon bindings inside a $onInit method on the controller, instead. diff --git a/apn/apn.d.ts b/apn/apn.d.ts index cf11b13c0e..c77f3ddf6d 100644 --- a/apn/apn.d.ts +++ b/apn/apn.d.ts @@ -137,6 +137,7 @@ declare module "apn" { } export interface NotificationAlertOptions { title?:string; + subtitle?:string; body:string; "title-loc-key"?:string; "title-loc-args"?:string[]; diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 96d5773fa5..45c89556a6 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -346,24 +346,24 @@ interface Client { * Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error" * event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish" * or request "error" events were fired. - * @param request The http.ServerRequest object to track + * @param request The http.IncomingMessage object to track * @param response The http.ServerResponse object for this request * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. */ - trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: { + trackRequest(request: any /* http.IncomingMessage */, response: any /* http.ServerResponse */, properties?: { [key: string]: string; }): void; /** * Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events. * Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags). - * @param request The http.ServerRequest object to track + * @param request The http.IncomingMessage object to track * @param response The http.ServerResponse object for this request * @param ellapsedMilliseconds The duration for this request. Defaults to 0. * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. * @param error An error that was returned for this request if it was unsuccessful. Defaults to null. */ - trackRequestSync(request: any /*http.ServerRequest */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: { + trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: { [key: string]: string;}, error?: any) : void; /** diff --git a/arcgis-js-api/arcgis-js-api.d.ts b/arcgis-js-api/arcgis-js-api.d.ts index 65765fbb09..d27429b428 100644 --- a/arcgis-js-api/arcgis-js-api.d.ts +++ b/arcgis-js-api/arcgis-js-api.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript v3.17 +// Type definitions for ArcGIS API for JavaScript v3.18 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -44,6 +44,7 @@ declare module "esri" { import QueryTask = require("esri/tasks/QueryTask"); import TextSymbol = require("esri/symbols/TextSymbol"); import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask"); + import WCSConnection = require("esri/layers/WCSConnection"); import WMSLayerInfo = require("esri/layers/WMSLayerInfo"); import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo"); @@ -483,12 +484,14 @@ declare module "esri" { featureLayers: FeatureLayer[]; /** Reference to the map object. */ map?: Map; - /** The point feature layer containing the origin points. */ - originsLayer: FeatureLayer; + /** The point feature layers containing the origin points. */ + originsLayers: FeatureLayer[]; /** The name of the output layer to be shown in the Result layer name input box. */ outputLayerName?: string; /** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */ portalUrl?: string; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer?: boolean; } export interface CoordinatesLocationProviderOptions { /** The attribute field in the graphic object that contains the longitude (X) values. */ @@ -563,12 +566,14 @@ declare module "esri" { export interface CreateWatershedsOptions { /** The URL to the GPServer used to execute an analysis job. */ analysisGpServer?: string; - /** The feature layer containing input points used for calculating watersheds. */ - inputLayer: FeatureLayer; + /** The feature layers containing input points used for calculating watersheds. */ + inputLayers: FeatureLayer[]; /** Reference to the map object. */ map?: Map; /** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */ portalUrl?: string; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer?: boolean; } export interface CutOptions { /** The feature(s) added to the feature layer by the cut operation. */ @@ -939,6 +944,10 @@ declare module "esri" { outFields?: string[]; /** Displays or hides the attachment column. */ showAttachments?: boolean; + /** Displays or hides tooltips for column headers. */ + showColumnHeaderTooltips?: boolean; + /** Shows or hides cyclical relationship. */ + showCyclicalRelationships?: boolean; /** Displays the data type of the field right under the field label. */ showDataTypes?: boolean; /** Displays or hides total number of features and selected number of features in the grid header. */ @@ -947,6 +956,8 @@ declare module "esri" { showGridHeader?: boolean; /** Displays or hides 'Options' drop-down menu of the FeatureTable. */ showGridMenu?: boolean; + /** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */ + showRelatedRecords?: boolean; /** Displays or hides the 'Statistics' option in column menus for numeric fields. */ showStatistics?: boolean; /** Enables an interaction between the map and the feature table. */ @@ -1996,6 +2007,30 @@ declare module "esri" { /** The URL to use for connecting to a socket. */ socketUrl?: string; } + export interface StretchFilterOptions { + /** Indicates whether to perform dynamic range adjustment using the current pixel data. */ + dra?: boolean; + /** An array of gamma values, for example [0.8, 0.8, 0.8]. */ + gamma?: number[]; + /** The maximum value of stretched pixels. */ + max?: number; + /** Percent of pixels clipped on the right histogram tail, for example 0.25. */ + maxPercent?: number; + /** The minimum value of stretched pixels. */ + min?: number; + /** Percent of pixels clipped on the left histogram tail, for example 1.5. */ + minPercent?: number; + /** The number of standard deviations for StandardDeviation stretch, for example 2.5. */ + numberOfStandardDeviations?: number; + /** The output pixel type. */ + outputPixelType?: string; + /** An array of arrays containing custom statistics objects. */ + statistics?: any[][]; + /** See the constants table for a list of possible stretchType values. */ + stretchType?: number; + /** Indicates whether to perform non-linear gamma stretch. */ + useGamma?: boolean; + } export interface SummarizeNearbyOptions { /** The URL to the GPServer used to execute an analysis job. */ analysisGpServer?: string; @@ -2023,6 +2058,8 @@ declare module "esri" { showCredits?: boolean; /** When true, the help links will be shown. */ showHelp?: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer?: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder?: boolean; /** An array of possible statistics attribute field names and summary types that you wish to calculate for all nearby features. */ @@ -2031,8 +2068,8 @@ declare module "esri" { summaryLayer?: FeatureLayer; /** An array of possible feature layers summarizing toward. */ summaryLayers: FeatureLayer[]; - /** The point, line, or polygon feature layer from which distances will be measured to features in summarizeLayer. */ - sumNearbyLayer: FeatureLayer; + /** The point, line, or polygon feature layers from which distances will be measured to features in summarizeLayer. */ + sumNearbyLayers: FeatureLayer[]; /** If true. */ sumShape?: boolean; /** Type of units shown as the defeault value in the Find nearest features using a option. */ @@ -2184,27 +2221,37 @@ declare module "esri" { /** Region of preview scale thumbnails. */ region?: string; } + export interface WCSConnectionOptions { + /** The coverage identifier, defaults to the first coverage. */ + coverageId?: string; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version?: string; + } + export interface WCSLayerOptions { + /** The coverage identifier, defaults to the first coverage. */ + coverageId?: string; + /** Sets the layer's draw mode. */ + drawMode?: boolean; + /** Sets the context of the Canvas. */ + drawType?: string; + /** A function that takes a pixelData object as input and processes it. */ + pixelFilter?: Function; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version?: string; + /** A WCS Connection object. */ + wcsConnection?: WCSConnection; + } export interface WFSLayerOptions { - /** Full WFS body request sent to WFS server via POST method. */ - getFeatureRequest?: string; - /** URL used when executing getFeature request. */ - getFeatureUrl?: string; + /** Use this to append custom parameters to WFS requests. */ + customParameters?: any; /** The template that defines the content to display in the map info window when the user clicks on a feature. */ infoTemplate?: InfoTemplate; - /** For "ondemand" mode only. */ - inverseFilter?: boolean; - /** When true, the XY coordinates should be swapped (this is required for some WFS vendors, versions, and WKIDS). */ - inverseResponse?: boolean; /** Specifies the maximum number of features to return in one response. */ maxFeatures?: number; /** The query mode for the WFS layer. */ mode?: string; - /** For "ondemand" mode only. */ - nsGeometryFieldName?: string; - /** The full layer name including the namespace as a prefix. */ - nsLayerName?: string; - /** When true, more details will be printed to console when the first connection to a WFS server is established. */ - showDetails?: boolean; + /** The simple layer name (excluding the namespace). */ + name?: string; /** URL to the WFS server. */ url: string; /** OGC WFS version number. */ @@ -2235,6 +2282,10 @@ declare module "esri" { title?: string; } export interface WMSLayerOptions { + /** The customLayerParameters object used for the WMS Layer. */ + customLayerParameters?: any; + /** The customParameters object used for the WMS Layer. */ + customParameters?: any; /** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */ format?: string; /** An optional resourceInfo object. */ @@ -2267,6 +2318,10 @@ declare module "esri" { title?: string; } export interface WMTSLayerOptions { + /** The customLayerParameters object used for the WMTS Layer. */ + customLayerParameters?: any; + /** The customParameters object used for the WMTS Layer. */ + customParameters?: any; /** A WMTSLayerInfo object that when ResourceInfo options are not specified the map will display the first layer in the WMTS capabilities that matches the properties specified by WMTSLayerInfo. */ layerInfo?: WMTSLayerInfo; /** When true, tile resampling is enabled. */ @@ -2783,7 +2838,7 @@ declare module "esri/TimeExtent" { * Returns a new time extent indicating the intersection between "this" and the argument time extent. * @param timeExtent The input time extent. */ - intersection(timeExtent: number): TimeExtent; + intersection(timeExtent: TimeExtent): TimeExtent; /** * Returns a new time extent with the given offset from "this' time extent. * @param offsetValue The length of time to offset from "this" time extent. @@ -2946,7 +3001,7 @@ declare module "esri/arcgis/Portal" { /** The prefix selected by the organization's administrator to be used with the customBaseURL. */ urlKey: string; /** User information for the accessing user is returned only when a token is passed in. */ - user: any; + user: PortalUser; /** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */ useStandardizedQuery: boolean; /** @@ -3951,6 +4006,8 @@ declare module "esri/dijit/ElevationProfile" { startup(): void; /** Fires when the elevation profile is cleared. */ on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle; + /** Fires after the profile is generated. */ + on(type: "elevation-values", listener: (event: { data: any; target: ElevationProfile }) => void): esri.Handle; /** Fires when the widget has fully loaded. */ on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle; /** Fires when the title of the elevation profile is changed */ @@ -3967,6 +4024,7 @@ declare module "esri/dijit/FeatureTable" { import FeatureLayer = require("esri/layers/FeatureLayer"); import Map = require("esri/map"); import FeatureEditResult = require("esri/layers/FeatureEditResult"); + import Graphic = require("esri/graphic"); /** Creates an instance of the FeatureTable widget within the provided DOM node. */ class FeatureTable { @@ -4012,6 +4070,10 @@ declare module "esri/dijit/FeatureTable" { selectedRows: any[]; /** Displays or hides the attachment column. */ showAttachments: boolean; + /** Displays or hides tooltips for column headers. */ + showColumnHeaderTooltips: boolean; + /** Relies on showRelatedRecords property. */ + showCyclicalRelationships: boolean; /** Displays or hides the data type of the field right under the field label in the column header. */ showDataTypes: boolean; /** Displays or hides total number of features and selected number of features in the grid header. */ @@ -4020,6 +4082,8 @@ declare module "esri/dijit/FeatureTable" { showGridHeader: boolean; /** Displays or hides 'Options' drop-down menu of the FeatureTable. */ showGridMenu: boolean; + /** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */ + showRelatedRecords: boolean; /** Displays or hides the 'Statistics' option in column menus for numeric fields. */ showStatistics: boolean; /** Enables an interaction between the map and the feature table. */ @@ -4032,35 +4096,55 @@ declare module "esri/dijit/FeatureTable" { * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ constructor(params: esri.FeatureTableOptions, srcNodeRef: Node | string); - /** Removes all current selections including subsets from filterSelectedRecords(). */ + /** Centers the map on combined extent of selected rows. */ + centerOnSelection(): void; + /** Removes all filters and selections in the table. */ + clearFilter(): void; + /** Removes all selections. */ clearSelection(): void; /** Destroys the FeatureTable widget. */ destroy(): void; /** - * Allows users to see the sub-set of currently selected records (uses dGrid.query). - * @param toggle When true only a subset of currently selected features will be displayed in the FeatureTable. + * Filters the table based on the provided row ids. + * @param ids Array of row ids. */ - filterSelectedRecords(toggle: boolean): void; + filterRecordsByIds(ids: number[]): void; + /** Allows users to see the sub-set of records. */ + filterSelectedRecords(): void; /** * Queries and gets selected features from the FeatureLayer instead of the store. - * @param id Array of row ids + * @param id Row id or an array of row ids */ - getFeatureDataById(id: number[]): any; + getFeatureDataById(id: number | number[]): any; /** * Gets row object by the row ID. * @param id row ID */ getRowDataById(id: number): any; - /** Refreshes the data in the grid. */ + /** Refreshes the data in the table. */ refresh(): void; /** Resizes the grid's container. */ resize(): void; + /** + * Allows users to select rows(s) based on row id(s). + * @param ids Row id or an array of row ids + * @param scrollToRow Indicates whether the table should scroll to selected rows. + */ + selectRows(ids: number | number[], scrollToRow?: boolean): void; + /** + * Sorts a given field in ascending or descending order. + * @param field Name of the field + * @param descending Defines whether the specified field will be sorted in ascending or descending order. + */ + sort(field: string, descending?: boolean): void; /** Finalizes the creation of the widget. */ startup(): void; + /** This event fires in response to clearSelection() method. */ + on(type: "clear-selection", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when the grid column is resized. */ - on(type: "column-resize", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "column-resize", listener: (event: { resizeEvent: any; target: FeatureTable }) => void): esri.Handle; /** Fires when a column is hidden or shown via 'Options' drop-down menu. */ - on(type: "column-state-change", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "column-state-change", listener: (event: { stateChangeEvent: any; target: FeatureTable }) => void): esri.Handle; /** Fires when grid editor field loses focus after being changed. */ on(type: "data-change", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when grid editor is hidden. */ @@ -4072,19 +4156,23 @@ declare module "esri/dijit/FeatureTable" { /** Fires when an error occurs in the grid. */ on(type: "error", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when grid is filtered. */ - on(type: "filter", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "filter", listener: (event: { ids: number[]; target: FeatureTable }) => void): esri.Handle; /** Fires when the FeatureTable is loaded. */ on(type: "load", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when the grid is refreshed. */ on(type: "refresh", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when a row is deselected. */ - on(type: "row-deselect", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "row-deselect", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle; /** Fires when a row is selected. */ - on(type: "row-select", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "row-select", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle; + /** Fires when attachment is displayed in the table. */ + on(type: "show-attachments", listener: (event: { attachments: any; dialog: any; featureId: number; target: FeatureTable }) => void): esri.Handle; + /** Fires when related records are displayed in the table. */ + on(type: "show-related-records", listener: (event: { features: Graphic[]; relationship: any; row: any; target: FeatureTable }) => void): esri.Handle; /** Fires when the statistics dialog box shows the calculated statistics on a column with numeric data. */ on(type: "show-statistics", listener: (event: { statistics: any; target: FeatureTable }) => void): esri.Handle; /** Fires when a column is sorted. */ - on(type: "sort", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "sort", listener: (event: { sortEvent: any; target: FeatureTable }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = FeatureTable; @@ -4168,7 +4256,7 @@ declare module "esri/dijit/Geocoder" { import GraphicsLayer = require("esri/layers/GraphicsLayer"); import Symbol = require("esri/symbols/Symbol"); - /** Starting with version 3.13, the Search Widget supersedes the Geocoder Widget and is deprecated. */ + /** The Geocoder widget was deprecated in version 3.13 and replaced by the Search widget. */ class Geocoder { /** Currently selected locator object. */ activeGeocoder: any; @@ -9403,6 +9491,8 @@ declare module "esri/layers/FeatureLayer" { labelingInfo: LabelClass[]; /** Unique ID of the layer that the FeatureLayer was constructed against. */ layerId: number; + /** The maximum allowable offset, only applicable for layers that are not editable. */ + maxAllowableOffset: number; /** The maximum number of results that will be returned from a query. */ maxRecordCount: number; /** Maximum visible scale for the layer. */ @@ -10914,7 +11004,7 @@ declare module "esri/layers/VectorTileLayer" { import SpatialReference = require("esri/SpatialReference"); import TileInfo = require("esri/layers/TileInfo"); - /** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */ + /** A VectorTileLayer renders cached tiles of data. */ class VectorTileLayer extends Layer { /** The full extent of the layer. */ fullExtent: Extent; @@ -10946,6 +11036,224 @@ declare module "esri/layers/VectorTileLayer" { export = VectorTileLayer; } +declare module "esri/layers/WCSConnection" { + import esri = require("esri"); + import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription"); + import DimensionalDefinition = require("esri/layers/DimensionalDefinition"); + + /** (Currently in beta), a helper class to discover available coverages in an OGC Web Coverage Service. */ + class WCSConnection { + /** Resamples pixel by bilinear interpolation. */ + static INTERPOLATION_BILINEAR: any; + /** Resamples pixel by cubic convolution. */ + static INTERPOLATION_CUBICCONVOLUTION: any; + /** Resamples pixel by nearest neighbor. */ + static INTERPOLATION_NEARESTNEIGHBOR: any; + /** An array of coverages offered by the WCS server. */ + coverages: WCSCoverageDescription[]; + /** Multiple dimensional definitions are usually used to filter data. */ + multidimensionalDefinition: DimensionalDefinition[]; + /** The name of the WCS server. */ + name: string; + /** Key-value pairs for URLs of different WCS operations: GetCapabilitiesDescribeCoverage */ + onlineResources: any; + /** An array of string values indicating WCS 2.0.1 profiles. */ + profiles: string[]; + /** An array of supported formats by the server. */ + supportedFormats: string[]; + /** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */ + supportedInterpolations: number[]; + /** An array of supported WCS versions by the server. */ + supportedVersions: string[]; + /** URL to a WCS Server endpoint. */ + url: string; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version: string; + /** + * Creates a new WCSConnection. + * @param url URL to a WCS Server endpoint. + * @param options Optional parameters. + */ + constructor(url: string, options?: esri.WCSConnectionOptions); + /** Triggered when successfully retrieved list of coverages. */ + on(type: "onConnected", listener: (event: { target: WCSConnection }) => void): esri.Handle; + /** Triggered when an error occurred. */ + on(type: "onConnectionFailed", listener: (event: { error: Error; target: WCSConnection }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = WCSConnection; +} + +declare module "esri/layers/WCSCoverageDescription" { + import Extent = require("esri/geometry/Extent"); + import Point = require("esri/geometry/Point"); + import TimeInfo = require("esri/layers/TimeInfo"); + + /** (Currently in beta), the WCSCoverageDescription models the coverage properties offered by the WCS Server. */ + class WCSCoverageDescription { + /** Resamples pixel by bilinear interpolation. */ + static INTERPOLATION_BILINEAR: any; + /** Resamples pixel by cubic convolution. */ + static INTERPOLATION_CUBICCONVOLUTION: any; + /** Resamples pixel by nearest neighbor. */ + static INTERPOLATION_NEARESTNEIGHBOR: any; + /** An array of band names. */ + bandInfo: string[]; + /** Number of columns at the source resolution. */ + columns: number; + /** The coverage description text. */ + description: string; + /** Coverage extent in the native spatial reference. */ + extent: Extent; + /** The coverage id. */ + id: string; + /** Coverage extent in WGS84. */ + lonLatEnvelope: Extent; + /** A parsed multidimensional object that describes variables and dimensions. */ + multiDimensionalInfo: any; + /** A parsed coverage description object in a structure similar to WCS Coverage Description schema. */ + nativeCoverageDescription: any; + /** Coverage's source resolution. */ + resolution: Point; + /** Number of rows at the source resolution. */ + rows: number; + /** Generalized from the following properties:SupportedFormats for WCS 1.0.0 and 1.1.xserviceParameters.supportedFormats for WCS 2.0.1. */ + supportedFormats: string[]; + /** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */ + supportedInterpolations: number[]; + /** Temporal information for the layer, such as time extent. */ + timeInfo: TimeInfo; + /** The current version of the coverage. */ + version: string; + /** + * Creates a new WCSCoverageDescription. + * @param coverageDocument The coverage description XML. + * @param version The version of the coverage description document. + */ + constructor(coverageDocument: string, version: string); + } + export = WCSCoverageDescription; +} + +declare module "esri/layers/WCSLayer" { + import esri = require("esri"); + import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription"); + import Extent = require("esri/geometry/Extent"); + import DimensionalDefinition = require("esri/layers/DimensionalDefinition"); + import TimeInfo = require("esri/layers/TimeInfo"); + import WCSConnection = require("esri/layers/WCSConnection"); + import Point = require("esri/geometry/Point"); + import Layer = require("esri/layers/layer"); + + /** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */ + class WCSLayer { + /** Resamples pixel by bilinear interpolation. */ + static INTERPOLATION_BILINEAR: any; + /** Resamples pixel by cubic convolution. */ + static INTERPOLATION_CUBICCONVOLUTION: any; + /** Resamples pixel by nearest neighbor. */ + static INTERPOLATION_NEARESTNEIGHBOR: any; + /** Zero-based array of current band selections. */ + bandIds: number[]; + /** A reference to a WCSCoverageDescription object. */ + coverageDescription: WCSCoverageDescription; + /** The coverage identifier, defaults to the first coverage. */ + coverageId: string; + /** The extent of the full coverage. */ + extent: Extent; + /** Raster format of the layer. */ + format: string; + /** Current interpolation method. */ + interpolation: number; + /** When the layer is loaded, the value becomes "true", and layer properties can be accessed. */ + loaded: boolean; + /** Multiple dimensional definitions are usually used to filter data. */ + multidimensionalDefinition: DimensionalDefinition[]; + /** Opacity or transparency of layer. */ + opacity: number; + /** A function that takes a pixelData object as input and processes it. */ + pixelFilter: Function; + /** The pixel type of the image service. */ + pixelType: string; + /** The projected extent in the map's spatial reference. */ + projectedFullExtent: Extent; + /** When true, the layer is suspended. */ + suspended: boolean; + /** Temporal information for the layer, such as time extent. */ + timeInfo: TimeInfo; + /** URL to a WCS Server endpoint. */ + url: string; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version: string; + /** The visibility of the layer. */ + visible: boolean; + /** A WCS Connection object. */ + wcsConnection: WCSConnection; + /** + * Creates a new WCSLayer. + * @param url URL to a WCS Server endpoint. + * @param options Optional parameters. + */ + constructor(url: string, options?: esri.WCSLayerOptions); + /** Returns the context of the Canvas. */ + getContext(): any; + /** + * Returns an array of graphics as a Promise. + * @param mapPoint The map point location in which to identify. + */ + identify(mapPoint: Point): any; + /** Resumes layer drawing. */ + resume(): void; + /** + * Sets the opacity of the layer. + * @param opacity Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency. + */ + setOpacity(opacity: number): void; + /** + * Sets a pixelFilter on the layer. + * @param pixelFilter The function defining the PixelFilter to set on the layer. + * @param doNotRefresh When true the layer will not refresh the map image. + */ + setPixelFilter(pixelFilter: Function, doNotRefresh?: boolean): void; + /** + * Determines if the layer will update its content based on the map's current time extent. + * @param use Use true to update the layer's content based on the map's current time extent. + */ + setUseMapTime(use: boolean): void; + /** + * Sets the visibility of the layer. + * @param isVisible Indicate whether to set layer visibility. + */ + setVisibility(isVisible: boolean): void; + /** Suspends layer drawing. */ + suspend(): void; + /** Fires when there is a problem retrieving a layer. */ + on(type: "error", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle; + /** Fires after layer properties for the layer are successfully populated. */ + on(type: "load", listener: (event: { layer: Layer; target: WCSLayer }) => void): esri.Handle; + /** Fires when the layer opacity has been changed, and returns an object with the opacity value. */ + on(type: "opacity-change", listener: (event: { opacity: number; target: WCSLayer }) => void): esri.Handle; + /** This event is fired when the layer's refreshInterval is modified. */ + on(type: "refresh-interval-change", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer resumes drawing. */ + on(type: "resume", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer's minScale and/or maxScale is changed. */ + on(type: "scale-range-change", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer's scale visibility changes. */ + on(type: "scale-visibility-change", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer suspends drawing */ + on(type: "suspend", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer has finished updating its content. */ + on(type: "update-end", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer begins to update its content. */ + on(type: "update-start", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. */ + on(type: "visibility-change", listener: (event: { visible: boolean; target: WCSLayer }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = WCSLayer; +} + declare module "esri/layers/WFSLayer" { import esri = require("esri"); import GraphicsLayer = require("esri/layers/GraphicsLayer"); @@ -10957,6 +11265,8 @@ declare module "esri/layers/WFSLayer" { /** (Currently in beta) A layer for OGC Web Feature Services (WFS). */ class WFSLayer extends GraphicsLayer { + /** Use this to append custom parameters to WFS requests. */ + customParameters: any; /** An array of fields in the layer. */ fields: Field[]; /** The full extent of the layer. */ @@ -10987,6 +11297,11 @@ declare module "esri/layers/WFSLayer" { redraw(): void; /** Refreshes the features in the WFS layer. */ refresh(): void; + /** + * Sets the custom parameters used on the WFS layer. + * @param customParameters The customParameters object used append WFS requests. + */ + setCustomParameters(customParameters: any): void; /** Sets the default line symbol to be used if no renderer is specified. */ setLineSymbol(): void; /** Sets the default point symbol to be used if no renderer is specified. */ @@ -11012,12 +11327,20 @@ declare module "esri/layers/WMSLayer" { allExtents: Extent[]; /** Copyright of the WMS service. */ copyright: string; + /** Use this to append different custom parameters to WMS layer requests. */ + customLayerParameters: any; + /** Use this to append custom parameters to all WMS requests. */ + customParameters: any; /** Description of the WMS service. */ description: string; /** Extent of the WMS service. */ extent: Extent; + /** Feature info MIME type to request. */ + featureInfoFormat: string; + /** The URL for the WMS GetFeatureInfo call. */ + getFeatureInfoURL: string; /** The URL for the WMS GetMap call. */ - getMapUrl: string; + getMapURL: string; /** The map image format. */ imageFormat: string; /** List of layers in the WMS service. */ @@ -11034,12 +11357,22 @@ declare module "esri/layers/WMSLayer" { title: string; /** Version of the WMS service. */ version: string; + /** A list of layer names that represent the layers to include in the exported map. */ + visibleLayers: string[]; /** * Creates a new WMSLayer object. * @param url URL to the OGC Web Map Service. * @param options Optional parameters. */ constructor(url: string, options?: esri.WMSLayerOptions); + /** Returns the current map image format. */ + getImageFormat(): string; + /** + * Sets the custom parameters used on the WMS layer. + * @param customParameters The customParameters object used append WMS requests. + * @param customLayerParameters The customLayerParameters object used append specific WMS layer requests. + */ + setCustomParameters(customParameters: any, customLayerParameters?: any): void; /** * Set the map image format; valid values are "png", "jpg", "pdf", "bmp", "gif" and "svg". * @param format The image format. @@ -11106,6 +11439,10 @@ declare module "esri/layers/WMTSLayer" { class WMTSLayer extends TiledMapServiceLayer { /** Copyright information for the service. */ copyright: string; + /** Use this to append different custom parameters to a WMTS tile request. */ + customLayerParameters: any; + /** Use this to append custom parameters to all WMTS requests. */ + customParameters: any; /** The description of the active layer if specified in the capabilties file or the resource info. */ description: string; /** The tile format. */ @@ -11137,6 +11474,12 @@ declare module "esri/layers/WMTSLayer" { * @param WMTSLayerInfo The WMTSLayerInfo for the layer to make active. */ setActiveLayer(WMTSLayerInfo: WMTSLayerInfo): void; + /** + * Sets the custom parameters used on the WMTS layer. + * @param customParameters The customParameters object used append WMTS requests. + * @param customLayerParameters The customLayerParameters object used append specific WMTS layer requests. + */ + setCustomParameters(customParameters: any, customLayerParameters?: any): void; } export = WMTSLayer; } @@ -11315,6 +11658,47 @@ declare module "esri/layers/layer" { export = Layer; } +declare module "esri/layers/pixelfilters/StretchFilter" { + import esri = require("esri"); + + /** A stretch filter used to work with client -side pixel data to enhance raster/image appearances. */ + class StretchFilter { + /** Indicates whether to perform dynamic range adjustment using the current pixel data. */ + dra: boolean; + /** An array of gamma values, for example [0.8, 0.8, 0.8]. */ + gamma: number[]; + /** The maximum value of stretched pixels. */ + max: number; + /** Percent of pixels clipped on the right histogram tail, for example 0.25. */ + maxPercent: number; + /** The minimum value of stretched pixels. */ + min: number; + /** Percent of pixels clipped on the left histogram tail, for example 1.5. */ + minPercent: number; + /** The number of standard deviations for StandardDeviation stretch, for example 2.5. */ + numberOfStandardDeviations: number; + /** The output pixel type. */ + outputPixelType: string; + /** An array of arrays containing custom statistics objects. */ + statistics: any[][]; + /** Number indicating the various stretch types. */ + stretchType: number; + /** Indicates whether to perform non-linear gamma stretch. */ + useGamma: boolean; + /** + * Creates an instance of a StretchFilter. + * @param options Optional parameters. + */ + constructor(options?: esri.StretchFilterOptions); + /** + * It takes a pixelData object as input and processes it. + * @param pixelData The pixelData object used as filter input. + */ + filter(pixelData: any): void; + } + export = StretchFilter; +} + declare module "esri/map" { import esri = require("esri"); import Attribution = require("esri/dijit/Attribution"); @@ -11779,8 +12163,8 @@ declare module "esri/opsdashboard/ExtensionBase" { static POLYLINE: any; /** Read-only: Indicates if the host application is the Windows Operations Dashboard. */ isNative: boolean; - /** Read Only: It will list all of the Portal helper services. */ - portalHelperServices: string; + /** Read-only: It will list all of the Portal helper services. */ + portalHelperServices: any; /** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */ portalUrl: string; /** Get the collection of data sources from the host application. */ @@ -11838,8 +12222,11 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" { class ExtensionConfigurationBase extends ExtensionBase { /** The object that will store the Widget/MapTool/FeatureAction configuration. */ config: any; - /** Indicates that the configuration is ready to be persisted or not. */ - readyToPersistConfig: boolean; + /** + * Indicates if the configuration is ready to be persisted or not. + * @param ready Indicates that the configuration is ready to be persisted or not. + */ + readyToPersistConfig(ready: boolean): void; } export = ExtensionConfigurationBase; } @@ -14127,6 +14514,8 @@ declare module "esri/tasks/FeatureSet" { features: Graphic[]; /** Set of name-value pairs for the attribute's field and alias names. */ fieldAliases: any; + /** The array of fields. */ + fields: any[]; /** The geometry type of the FeatureSet. */ geometryType: string; /** When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. */ @@ -14379,7 +14768,7 @@ declare module "esri/tasks/GeometryService" { url: string; /** * Creates a new GeometryService object. - * @param url URL to the ArcGIS Server REST resource that represents a GeometryService, e.g., http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer. + * @param url URL to the ArcGIS Server REST resource that represents a GeometryService, https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer. */ constructor(url: string); /** @@ -15165,6 +15554,7 @@ declare module "esri/tasks/PrintParameters" { declare module "esri/tasks/PrintTask" { import esri = require("esri"); import PrintParameters = require("esri/tasks/PrintParameters"); + import DataFile = require("esri/tasks/DataFile"); /** The PrintTask class generates a printer-ready version of the map using an Export Web Map Task available with ArGIS Server 10.1 and later. */ class PrintTask { @@ -15184,7 +15574,7 @@ declare module "esri/tasks/PrintTask" { */ execute(printParameters: PrintParameters, callback?: Function, errback?: Function): any; /** Fired when the print operation is complete. */ - on(type: "complete", listener: (event: { url: string; target: PrintTask }) => void): esri.Handle; + on(type: "complete", listener: (event: { result: DataFile; target: PrintTask }) => void): esri.Handle; /** Fired when an error occurs while executing the print task. */ on(type: "error", listener: (event: { error: Error; target: PrintTask }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; diff --git a/archiver/archiver-tests.ts b/archiver/archiver-tests.ts index dcd71ca905..078236bd20 100644 --- a/archiver/archiver-tests.ts +++ b/archiver/archiver-tests.ts @@ -11,4 +11,13 @@ var readStream = FS.createReadStream('./archiver.d.ts'); archiver.pipe(writeStream); archiver.append(readStream, {name: 'archiver.d.ts'}); -archiver.finalize(); \ No newline at end of file +archiver.finalize(); + + +archiver.directory('./path', './someOtherPath'); +archiver.directory('./path', { name: "testName"} ); + +archiver.directory('./', "", {}); +archiver.directory('./', {name: 'test'}, {}); + +archiver.bulk({ mappaing: {} }); \ No newline at end of file diff --git a/archiver/archiver.d.ts b/archiver/archiver.d.ts index b31c8ad619..7b80877768 100644 --- a/archiver/archiver.d.ts +++ b/archiver/archiver.d.ts @@ -25,6 +25,11 @@ declare module "archiver" { interface Archiver extends STREAM.Transform { pipe(writeStream: FS.WriteStream): void; append(source: FS.ReadStream | Buffer | string, name: nameInterface): void; + + directory(dirpath: string, destpath: nameInterface | string): void; + directory(dirpath: string, destpath: nameInterface | string, data: any | Function): void; + + bulk(mappings: any): void; finalize(): void; } diff --git a/assert/assert.d.ts b/assert/assert.d.ts index d7cb02eb38..35220dbb87 100644 --- a/assert/assert.d.ts +++ b/assert/assert.d.ts @@ -1,10 +1,15 @@ -// Type definitions for assert and power-assert -// Project: https://github.com/Jxck/assert -// Project: https://github.com/twada/power-assert +// Type definitions for assert +// Project: https://github.com/defunctzombie/commonjs-assert // 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 { @@ -52,12 +57,6 @@ declare namespace assert { export function ifError(value:any):void; } -// duplicate to node.d.ts -// declare module "assert" { -// export = assert; -// } - -// move to power-assert.d.ts. do not use this definition file. -declare module "power-assert" { +declare module "assert" { export = assert; } diff --git a/async-polling/async-polling-tests.ts b/async-polling/async-polling-tests.ts new file mode 100644 index 0000000000..ec9e5200f2 --- /dev/null +++ b/async-polling/async-polling-tests.ts @@ -0,0 +1,64 @@ +/// + +import * as AsyncPolling from "async-polling"; + +// Tests based on examples in https://github.com/cGuille/async-polling#readme + +AsyncPolling(end => { + end(); +}, 3000).run(); + +function someAsynchroneProcess(callback: (error?: Error, response?: any) => any): any { + callback(); +} + +let polling = AsyncPolling(end => { + someAsynchroneProcess(function (error, response) { + if (error) { + end(error); + return; + } + + end(null, response); + }); +}, 3000); +polling.on("error", (error: Error) => {}); +polling.on("result", (result: any) => {}); +polling.run(); +polling.stop(); + +AsyncPolling(function(end) { + this.stop(); + end(); +}, 3000).run(); + +let i = 0; + +polling = AsyncPolling(function(end) { + ++i; + if (i === 3) { + return end(new Error("i is " + i)); + } + if (i >= 5) { + this.stop(); + return end(null, `#${i} stop`); + } + end(null, `#${i} wait a second...`); +}, 1000); + +const eventNames: AsyncPolling.EventName[] = ["run", "start", "end", "schedule", "stop"]; +eventNames.forEach(eventName => { + polling.on(eventName, () => { + console.log("lifecycle:", eventName); + }); +}); + +polling.on("result", (result: any) => { + console.log("result:", result); +}); + +polling.on("error", (error: Error) => { + console.error("error:", error); +}); + +polling.run(); \ No newline at end of file diff --git a/async-polling/async-polling.d.ts b/async-polling/async-polling.d.ts new file mode 100644 index 0000000000..579d041e37 --- /dev/null +++ b/async-polling/async-polling.d.ts @@ -0,0 +1,18 @@ +// Type definitions for AsyncPolling +// Project: https://github.com/cGuille/async-polling +// Definitions by: Zlatko Andonovski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "async-polling" { + module AsyncPolling { + export type EventName = "run"|"start"|"error"|"result"|"end"|"schedule"|"stop"; + } + + function AsyncPolling(pollingFunc: (end: (err?: Error, result?: Result) => any) => any, delay: number): { + run: () => any; + stop: () => any; + on: (eventName: AsyncPolling.EventName, listener: Function) => any; + } + + export = AsyncPolling; +} \ No newline at end of file diff --git a/async/async-tests.ts b/async/async-tests.ts index 63640cecf6..37c561e641 100644 --- a/async/async-tests.ts +++ b/async/async-tests.ts @@ -1,23 +1,25 @@ /// - -var fs, path; +/// +import * as fs from "fs"; +// var fs = require("fs"); function callback() {} +function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} -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 () { }, @@ -41,9 +43,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, requestApi; async.eachLimit(documents, 20, requestApi, function (err) { }); @@ -73,9 +75,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,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) { @@ -83,13 +85,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) { }); @@ -107,7 +109,7 @@ async.series([ ], function (err, results) { }); -async.series([ +async.series([ function (callback) { callback(null, 'one'); }, @@ -131,7 +133,7 @@ async.series({ }, function (err, results) { }); -async.series({ +async.series({ one: function (callback) { setTimeout(function () { callback(null, 1); @@ -171,7 +173,7 @@ async.parallel([ ], function (err, results) { }); -async.parallel([ +async.parallel([ function (callback) { setTimeout(function () { callback(null, 'one'); @@ -200,7 +202,7 @@ async.parallel({ }, function (err, results) { }); -async.parallel({ +async.parallel({ one: function (callback) { setTimeout(function () { callback(null, 1); @@ -266,7 +268,7 @@ async.waterfall([ ], function (err, result) { }); -var q = async.queue(function (task: any, callback) { +var q = async.queue(function (task: any, callback) { console.log('hello ' + task.name); callback(); }, 2); @@ -319,7 +321,7 @@ q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = async.queue(function (task: string, callback) { +var q2 = async.queue(function (task: string, callback) { console.log('Task: ' + task); callback(); }, 1); @@ -382,10 +384,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) { } @@ -435,3 +437,357 @@ async.dir(function (name, callback) { callback(null, { hello: name }); }, 1000); }, "world"); + +// each + +async.each({ + "a": 1, + "b": 2 +}, function(val: number, next: ErrorCallback): void { + + setTimeout(function(): void { + + console.log(`async.each: ${val}`); + + next(); + + }, 500); + +}, function(err?: Error): void { + + console.log("async.each: done."); + +}); + +async.eachSeries({ + "a": 1, + "b": 2 +}, function(val: number, next: ErrorCallback): void { + + setTimeout(function(): void { + + console.log(`async.eachSeries: ${val}`); + + next(); + + }, 500); + +}, function(err?: Error): void { + + console.log("async.eachSeries: done."); + +}); + +async.eachLimit({ + "a": 1, + "b": 2, + "c": 3, + "d": 4, + "e": 5, + "f": 6 +}, 2, function(val: number, next: ErrorCallback): void { + + setTimeout(function(): void { + + console.log(`async.eachLimit: ${val}`); + + next(); + + }, 500); + +}, function(err?: Error): void { + + console.log("async.eachLimit: done."); + +}); + +// forEachOf/eachOf + +async.eachOf({ + "a": 1, + "b": 2 +}, function(val: number, key: string, next: ErrorCallback): void { + + setTimeout(function(): void { + + console.log(`async.forEachOf/eachOf: ${key} = ${val}`); + + next(); + + }, 500); + +}, function(err?: Error): void { + + console.log("async.forEachOf/eachOf: done."); + +}); + +async.forEachOfSeries({ + "a": 1, + "b": 2 +}, function(val: number, key: string, next: ErrorCallback): void { + + setTimeout(function(): void { + + console.log(`async.forEachOfSeries: ${key} = ${val}`); + + next(); + + }, 500); + +}, function(err?: Error): void { + + console.log("async.forEachOfSeries: done."); + +}); + +async.forEachOfLimit({ + "a": 1, + "b": 2, + "c": 3, + "d": 4, + "e": 5, + "f": 6 +}, 2, function(val: number, key: string, next: ErrorCallback): void { + + setTimeout(function(): void { + + console.log(`async.forEachOfLimit: ${key} = ${val}`); + + next(); + + }, 500); + +}, function(err?: Error): void { + + console.log("async.forEachOfLimit: done."); + +}); + +// map + +async.map({ + "a": 1, + "b": 2, + "c": 3 +}, function(val: number, next: AsyncResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.map: ${val}`); + + next(null, val.toString()); + + }, 500); + +}, function(err: Error, results: string[]): void { + + console.log("async.map: done with results", results); + +}); + +async.mapSeries({ + "a": 1, + "b": 2, + "c": 3 +}, function(val: number, next: AsyncResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.mapSeries: ${val}`); + + next(null, val.toString()); + + }, 500); + +}, function(err: Error, results: string[]): void { + + console.log("async.mapSeries: done with results", results); + +}); + +async.mapLimit({ + "a": 1, + "b": 2, + "c": 3, + "d": 4, + "e": 5, + "f": 6 +}, 2, function(val: number, next: AsyncResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.mapLimit: ${val}`); + + next(null, val.toString()); + + }, 500); + +}, function(err: Error, results: string[]): void { + + console.log("async.mapLimit: done with results", results); + +}); + +// mapValues + +async.mapValues({ + "a": 1, + "b": 2, + "c": 3 +}, function(val: number, key: string, next: AsyncResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.mapValues: ${key} = ${val}`); + + next(null, val.toString()); + + }, 500); + +}, function(err: Error, results: string[]): void { + + console.log("async.mapValues: done with results", results); + +}); + +async.mapValuesSeries({ + "a": 1, + "b": 2, + "c": 3 +}, function(val: number, key: string, next: AsyncResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.mapValuesSeries: ${key} = ${val}`); + + next(null, val.toString()); + + }, 500); + +}, function(err: Error, results: string[]): void { + + console.log("async.mapValuesSeries: done with results", results); + +}); + +// filter/select/reject + +async.filter({ + "a": 1, + "b": 2, + "c": 3 +}, function(val: number, next: AsyncBooleanResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.filter/select: ${val}`); + + next(null, val % 2 === 0); + + }, 500); + +}, function(err: Error, results: number[]): void { + + console.log("async.filter/select: done with results", results); + +}); + +async.reject({ + "a": 1, + "b": 2, + "c": 3 +}, function(val: number, next: AsyncBooleanResultCallback): void { + + setTimeout(function(): void { + + console.log(`async.reject: ${val}`); + + next(null, val % 2 === 0); + + }, 500); + +}, function(err: Error, results: number[]): void { + + console.log("async.reject: done with results", results); + +}); + +// concat + +async.concat({ + "a": "1", + "b": "2", + "c": "3" +}, function(item: string, next: AsyncResultCallback): void { + + console.log(`async.concat: ${item}`); + + next(null, [item, item, item]); + +}, function(err: Error, results: string[]) { + + console.log("async.concat: done with results", results); + +}); + +// detect/find + +async.detect({ + "a": 1, + "b": 2, + "c": 3 +}, function(item: number, next: AsyncBooleanResultCallback): void { + + console.log(`async.detect/find: ${item}`); + + next(null, item > 1); + +}, function(err: Error, result: number) { + + if (err) { + + console.log(err); + + } else { + + console.log("async.detect/find: done with result", result); + } + +}); + +// every/all + +async.every({ + "a": 1, + "b": 2, + "c": 3 +}, function(item: number, next: AsyncBooleanResultCallback): void { + + console.log(`async.every/all: ${item}`); + + next(null, item > 0); + +}, function(err: Error, result: boolean) { + + console.log("async.every/all: done with result", result); + +}); + +// some/any + +async.some({ + "a": 1, + "b": 2, + "c": 3 +}, function(item: number, next: AsyncBooleanResultCallback): void { + + console.log(`async.some/any: ${item}`); + + next(null, item > 2); + +}, function(err: Error, result: boolean) { + + console.log("async.some/any: done with result", result); + +}); diff --git a/async/async.d.ts b/async/async.d.ts index 96da35c1ea..45d39ea955 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -1,24 +1,26 @@ // Type definitions for Async 2.0.1 // Project: https://github.com/caolan/async -// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman +// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Dictionary { [key: string]: T; } -interface ErrorCallback { (err?: Error): 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: (err: string, truthValue: boolean) => void): 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; @@ -26,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; @@ -51,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; @@ -88,104 +90,122 @@ interface AsyncCargo { interface Async { // Collections - each(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; - eachSeries(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; - eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; - forEachOf(obj: any, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void; - forEachOf(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfSeries(obj: any, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void; - forEachOfSeries(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfLimit(obj: any, limit: number, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void; - forEachOfLimit(obj: T[], limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - mapSeries(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - mapValuesLimit(obj: {[name: string]: T}, limit: number, iteratee: (value: string, key: T, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void; - mapValues(obj: {[name: string]: T}, iteratee: (value: string, key: T, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): 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; + 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; + forEachOfSeries: typeof async.forEachOf; + 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; + 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; mapValuesSeries: typeof async.mapValues; - filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - select(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - filterSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - selectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - selectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - reject(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - rejectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - rejectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; - inject(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; - foldl(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; - reduceRight(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; - foldr(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; - detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; + 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; + 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; + 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; + detectSeries: typeof async.detect; + detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; + detectLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; find: typeof async.detect; - detectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; - findSeries: typeof async.detectSeries; - detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; + findSeries: typeof async.detect; findLimit: typeof async.detectLimit; - sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - some(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; - someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; - anyLimit: typeof async.someLimit; - someSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; + 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; + any: typeof async.some; anySeries: typeof async.someSeries; - any(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; - every(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any; - everyLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any; - all(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any; - concat(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - concatSeries(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; + anyLimit: typeof async.someLimit; + 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; + 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; + 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: (err: any) => void): void; - doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void; - until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void; - doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void; - during(test: (testCallback : (error: Error, truth: boolean) => void) => void, fn: AsyncVoidFunction, callback: (err: any) => void): void; - doDuring(fn: AsyncVoidFunction, test: (testCallback: (error: Error, truth: boolean) => void) => void, callback: (err: any) => void): void; - forever(next: (errCallback : (err: Error) => void) => void, errBack: (err: Error) => void) : void; - waterfall(tasks: Function[], callback?: (err: Error, results?: any) => void): 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?: (error: Error, results: any) => void): void; - autoInject(tasks: any, callback?: (error: Error, results: any) => void): void; - retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: (error: Error, results: any) => void): void; - retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: (error: Error, results: any) => void): 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; - allLimit(arr: T[], limit: number, iteratee: AsyncBooleanIterator, cb?: (result: boolean) => any) : any; - everySeries(arr: T[], iteratee: AsyncBooleanIterator, cb?: (result: boolean) => any) : any - allSeries: typeof async.everySeries; + 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?: 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; - 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; - - race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; + race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; // Utils memoize(fn: Function, hasher?: Function): Function; diff --git a/autobahn/autobahn.d.ts b/autobahn/autobahn.d.ts index bb7a0c86ae..496738875e 100644 --- a/autobahn/autobahn.d.ts +++ b/autobahn/autobahn.d.ts @@ -211,7 +211,7 @@ declare namespace autobahn { retry_delay_jitter?: number; url?: string; protocols?: string[]; - onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler; + onchallenge?: OnChallengeHandler; realm?: string; authmethods?: string[]; authid?: string; diff --git a/automapper-ts/automapper-ts-tests.ts b/automapper-ts/automapper-ts-tests.ts new file mode 100644 index 0000000000..5e18f75789 --- /dev/null +++ b/automapper-ts/automapper-ts-tests.ts @@ -0,0 +1,1990 @@ +/// +/// + +var globalScope = this; + +declare module jasmine { + interface Matchers { + toEqualData(data: any): boolean; + fail(message: string): boolean; + } +} + +declare function expect(): jasmine.Matchers; + +module AutoMapperJs { + describe('AutoMapper', () => { + beforeEach(() => { + jasmine.addMatchers(ExtendJasmine.addCustomMatchers()); + + // clear mappings (please, don't try this at home!) + for (var key in (automapper)._mappings) { + if (!(automapper)._mappings.hasOwnProperty(key)) { + continue; + } + delete (automapper)._mappings[key]; + } + }); + + it('should validate mapping using strictMode set to \'true\' (with valid mappings)', () => { + // arrange + automapper.createMap(AssertConfigPropertiesProp, AssertConfigPropertiesProp); + + // act and assert + automapper.assertConfigurationIsValid(true); + }); + + it('should set strictMode to \'true\' when no value is provided and validate (with valid mappings)', () => { + // arrange + automapper.createMap(AssertConfigPropertiesProp, AssertConfigPropertiesProp); + + // act and assert + automapper.assertConfigurationIsValid(); + }); + + it('should validate mapping using strictMode set to \'false\'', () => { + // arrange + automapper.createMap(AssertConfigPropertiesProp, AssertConfigPropertiesProp); + automapper.createMap('AssertMappingConfigUntestableA', 'AssertMappingConfigUntestableB'); + + // act and assert + automapper.assertConfigurationIsValid(false); + }); + + it('should fail when validating mappings using strictMode set to \'true\' (with unvalidatable mappings)', () => { + // arrange + automapper.createMap(AssertConfigPropertiesProp, AssertConfigPropertiesProp); + automapper.createMap('AssertMappingConfigUntestableA', 'AssertMappingConfigUntestableB'); + + // act + try { + automapper.assertConfigurationIsValid(true); + } catch (e) { + // assert + var errorMessage: string = e.message; + var dekeyedErrorMessage = + errorMessage.substr(0, errorMessage.indexOf('\'') + 1) + + errorMessage.substr(errorMessage.lastIndexOf('\'')); + + expect(dekeyedErrorMessage).toEqual(`Mapping '' cannot be validated, since mapping.sourceType or mapping.destinationType are unspecified.`); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should fail when auto mapping a property which does not exist on destination', () => { + // arrange + var srcType = AssertConfigPropertiesProp; + var dstType = AssertConfigPropertiesProp2; + + var srcName = AutoMapperHelper.getClassName(srcType); + var dstName = AutoMapperHelper.getClassName(dstType); + + automapper.createMap(srcType, dstType); + + try { + // act + automapper.assertConfigurationIsValid(true); + } catch (e) { + // assert + expect(e.message).toEqual(`Mapping '${srcName}=>${dstName}' is invalid: Source member 'prop' is configured to be mapped, ` + + `but does not exist on destination type (source: '${srcName}', destination: '${dstName}').`); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should succeed when mapping objects with ignored properties not existing on the other side', () => { + // arrange + var srcType = AssertConfigPropertiesProp; + var dstType = AssertConfigPropertiesProp2; + + var srcName = AutoMapperHelper.getClassName(srcType); + var dstName = AutoMapperHelper.getClassName(dstType); + + automapper + .createMap(srcType, dstType) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }) + .forMember('prop2', (opts: IMemberConfigurationOptions) => { opts.ignore(); }); + + // act and assert + automapper.assertConfigurationIsValid(true); + }); + + it('should fail when auto mapping a property which does not exist on source', () => { + // arrange + var srcType = AssertConfigPropertiesProp; + var dstType = AssertConfigPropertiesPropProp2; + + var srcName = AutoMapperHelper.getClassName(srcType); + var dstName = AutoMapperHelper.getClassName(dstType); + + automapper.createMap(srcType, dstType); + + try { + // act + automapper.assertConfigurationIsValid(true); + } catch (e) { + // assert + expect(e.message).toEqual(`Mapping '${srcName}=>${dstName}' is invalid: Destination member 'prop2' does not exist on source type (source: '${srcName}', destination: '${dstName}').`); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should fail when providing configuration for a property which does not exist on destination', () => { + // arrange + var srcType = AssertConfigPropertiesProp; + var dstType = AssertConfigPropertiesPropProp2; + + var srcName = AutoMapperHelper.getClassName(srcType); + var dstName = AutoMapperHelper.getClassName(dstType); + + automapper + .createMap(srcType, dstType) + .forMember('prop3', (opts: IMemberConfigurationOptions) => { opts.ignore(); }); + + try { + // act + automapper.assertConfigurationIsValid(true); + } catch (e) { + // assert + expect(e.message).toEqual(`Mapping '${srcName}=>${dstName}' is invalid: Destination member 'prop3' is configured, but does not exist on destination type (source: '${srcName}', destination: '${dstName}').`); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should fail when providing configuration for a property which does not exist on source', () => { + // arrange + var srcType = AssertConfigPropertiesProp; + var dstType = AssertConfigPropertiesPropProp2; + + var srcName = AutoMapperHelper.getClassName(srcType); + var dstName = AutoMapperHelper.getClassName(dstType); + + automapper + .createMap(srcType, dstType) + .forSourceMember('prop2', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + try { + // act + automapper.assertConfigurationIsValid(true); + } catch (e) { + // assert + expect(e.message).toEqual(`Mapping '${srcName}=>${dstName}' is invalid: Source member 'prop2' is configured, but does not exist on source type (source: '${srcName}', destination: '${dstName}').`); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + }); + + describe('AutoMapper (asynchronous mapping)', () => { + beforeEach(() => { + jasmine.addMatchers(ExtendJasmine.addCustomMatchers()); + }); + + it('should be able to map asynchronous using forMember', (done) => { + // arrange + var objFrom = { prop: 'prop' }; + + var fromKey = 'async-forMember-'; + var toKey = 'valid-1'; + + // act + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { + var func = (o: IMemberConfigurationOptions, c: IMemberCallback) => { + c(o.intermediatePropertyValue + ' (async)'); + }; + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }) + .forMember('prop', (opts: IMemberConfigurationOptions) => { + return opts.intermediatePropertyValue + ' (sync)'; + }); + + automapper.mapAsync(fromKey, toKey, objFrom, (result: any) => { + // assert + expect(result.prop).toEqual(objFrom.prop + ' (async)' + ' (sync)'); + done(); + }); + }); + + it('should be able to map asynchronous using forMember in combination with a constant value', (done: () => void) => { + // arrange + var objFrom = { prop: 'prop' }; + + var fromKey = 'async-forMember-'; + var toKey = 'valid-2'; + + // act + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { + var func = (o: IMemberConfigurationOptions, c: IMemberCallback) => { + c(o.intermediatePropertyValue + ' (async)'); + }; + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }) + .forMember('prop', 'Async With Constant Value'); + + automapper.mapAsync(fromKey, toKey, objFrom, (result: any) => { + // assert + expect(result.prop).toEqual('Async With Constant Value'); + done(); + }); + }); + + it('should be able to map asynchronous using an asynchronous forMember in combination with a synchronous forMember mapping', (done: () => void) => { + // arrange + var objFrom = { prop1: 'prop1', prop2: 'prop2' }; + + var fromKey = 'async-forMember-'; + var toKey = 'valid-3'; + + // act + automapper + .createMap(fromKey, toKey) + .forMember('prop1', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { + var func = (o: IMemberConfigurationOptions, c: IMemberCallback) => { + c(o.intermediatePropertyValue + ' (async)'); + }; + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }) + .forMember('prop2', (opts: IMemberConfigurationOptions): any => opts.intermediatePropertyValue); + + automapper.mapAsync(fromKey, toKey, objFrom, (result: any) => { + // assert + expect(result.prop1).toEqual(objFrom.prop1 + ' (async)'); + expect(result.prop2).toEqual(objFrom.prop2); + done(); + }); + }); + + it('should fail when mapping an asynchronous mapping using synchronous map function', () => { + // arrange + var objFrom = { prop: 'prop' }; + + var fromKey = 'async-forMember-'; + var toKey = 'invalid-1'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { + var func = (o: IMemberConfigurationOptions, c: IMemberCallback) => { + c(o.intermediatePropertyValue + ' (async)'); + } + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }) + .forMember('prop', (opts: IMemberConfigurationOptions) => { + return opts.intermediatePropertyValue + ' (sync)'; + }); + + // act + try { + var objB = automapper.map(fromKey, toKey, objFrom); + } catch (e) { + // assert + expect(e.message).toEqual('Impossible to use asynchronous mapping using automapper.map(); use automapper.mapAsync() instead.'); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should be able to map asynchronous using forSourceMember', (done: () => void) => { + // arrange + var objFrom = { prop: 'prop' }; + + var fromKey = 'async-forSourceMember-'; + var toKey = 'valid-1'; + + automapper + .createMap(fromKey, toKey) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions, cb: IMemberCallback) => { + var func = (o: ISourceMemberConfigurationOptions, c: IMemberCallback) => { + c('AsyncValue'); + }; + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }); + + // act + automapper.mapAsync(fromKey, toKey, objFrom, (result: any) => { + // assert + expect(result.prop).toEqual('AsyncValue'); + done(); + }); + }); + + it('should be able to use convertUsing to map an object with a custom asynchronous type resolver function', (done: () => void) => { + var objA = { propA: 'propA' }; + + var fromKey = '{D1534A0F-6120-475E-B7E2-BF2489C58571}'; + var toKey = '{1896FF99-1A28-4FE6-800B-072D5616B02D}'; + + automapper + .createMap(fromKey, toKey) + .convertUsing((opts: IResolutionContext, cb: IMapCallback): void => { + var func = (o: IResolutionContext, c: IMapCallback) => { + var res = { propA: o.sourceValue.propA + ' (custom async mapped with resolution context)' }; + c(res); + }; + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }); + + // act + automapper.mapAsync(fromKey, toKey, objA, (result: any) => { + // assert + expect(result.propA).toEqual(objA.propA + ' (custom async mapped with resolution context)'); + done(); + }); + }); + + it('should asynchronously map an array', (done: () => void) => { + // arrange + var arrA = [{ prop1: 'From A', prop2: 'From A too' }]; + + var fromKey = '{60D9DGH6-DSEC-48GF-9BAC-0805FCAF91B7}'; + var toKey = '{AC6D5B97-9AE3-BERT-ZB60-AZFEDZXE541A}'; + + automapper.createMap(fromKey, toKey) + .forMember('prop1', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { + var func = (o: IMemberConfigurationOptions, c: IMemberCallback) => { + c(o.intermediatePropertyValue); + }; + + // do something asynchronous + setTimeout((): void => { + func(opts, cb); + }, 10); + }); + // act + var arrB = automapper.mapAsync(fromKey, toKey, arrA, (result: any) => { + // assert + expect(result).toEqualData(arrA); + done(); + }); + }); + }); + + describe('AutoMapper', () => { + beforeEach(() => { + jasmine.addMatchers(ExtendJasmine.addCustomMatchers()); + }); + + it('should have a global automapper object', () => { + expect(automapper).not.toBeUndefined(); + expect(automapper).not.toBeNull(); + + expect(automapper.createMap).not.toBeUndefined(); + expect(automapper.createMap).not.toBeNull(); + expect(typeof automapper.createMap === 'function').toBeTruthy(); + + expect(automapper.map).not.toBeUndefined(); + expect(automapper.map).not.toBeNull(); + expect(typeof automapper.map === 'function').toBeTruthy(); + }); + + it('should return the Singleton instance when instantiating the Singleton directly', () => { + // arrange + var caught = false; + + // act + var mapper = new AutoMapper(); + expect(automapper).toBe(mapper); + }); + + it('should use created mapping profile', () => { + // arrange + var fromKey = '{5700E351-8D88-4327-A216-3CC94A308EDF}'; + var toKey = '{BB33A261-3CA9-48FC-85E6-2C269F73728D}'; + + automapper.createMap(fromKey, toKey); + + // act + automapper.map(fromKey, toKey, {}); + + // assert + }); + + it('should fail when using a non-existing mapping profile', () => { + // arrange + var caught = false; + + var fromKey = '{5AEFD48C-4472-41E7-BA7E-0977A864E116}'; + var toKey = '{568DCA5E-477E-4739-86B2-38BB237B8EF8}'; + + // act + try { + automapper.map(fromKey, toKey, {}); + } catch (e) { + caught = true; + + // assert + expect(e.message).toEqual('Could not find map object with a source of ' + fromKey + ' and a destination of ' + toKey); + } + + if (!caught) { + // assert + expect().fail('Using a non-existing mapping profile should result in an error.'); + } + }); + + it('should be able to use forAllMemberMappings', () => { + // arrange + var fromKey = '{5700E351-8D88-4327-A216-3CCBHJ808EDF}'; + var toKey = '{BB33A261-3CA9-48FC-85E6-2C269FDFT28D}'; + + var source = { prop1: 'prop1', prop2: 'prop2' }; + var suffix = ' [forAllMembers]'; + + automapper.createMap(fromKey, toKey) + .forMember('prop1', (opts: IMemberConfigurationOptions): any => opts.intermediatePropertyValue) + .forMember('prop2', (opts: IMemberConfigurationOptions): any => opts.intermediatePropertyValue) + .forAllMembers((destinationObject: any, + destinationPropertyName: string, + value: any): void => { + destinationObject[destinationPropertyName] = value + suffix; + }); + + // act + var destination = automapper.map(fromKey, toKey, source); + + // assert + expect(destination.prop1).toEqual(source.prop1 + suffix); + expect(destination.prop2).toEqual(source.prop2 + suffix); + }); + + it('should be able to use forAllMemberMappings when automapping', () => { + // arrange + var fromKey = '{5700E351-8D88-4327-A216-3CCBHJ808EDF}'; + var toKey = '{BB33A261-3CA9-48FC-85E6-2C269FDFT28D}'; + + var source = { prop1: 'prop1', prop2: 'prop2' }; + var suffix = ' [forAllMembers]'; + + automapper.createMap(fromKey, toKey) + .forAllMembers((destinationObject: any, + destinationPropertyName: string, + value: any): void => { + destinationObject[destinationPropertyName] = value + suffix; + }); + + // act + var destination = automapper.map(fromKey, toKey, source); + + // assert + expect(destination.prop1).toEqual(source.prop1 + suffix); + expect(destination.prop2).toEqual(source.prop2 + suffix); + }); + + it('should accept multiple forMember calls for the same destination property and overwrite with the last one specified', () => { + //arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{7AC4134B-ECC1-464B-B144-5B9D8F5B568E}'; + var toKey = '{2BDE907C-1CE6-4CC5-A601-9A94CC665837}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop1', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop2'); }) + .forMember('prop1', (opts: IMemberConfigurationOptions) => { opts.ignore(); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: objA.prop2 }); + }); + + it('should be able to ignore a source property using the forSourceMember function', () => { + // arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{AD88481E-597B-4C1B-967B-3D700B8BAB0F}'; + var toKey = '{2A6714C4-784E-47D3-BBF4-6205834EC8D5}'; + + automapper + .createMap(fromKey, toKey) + .forSourceMember('prop1', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: 'From A too' }); + }); + + it('should be able to custom map a source property using the forSourceMember function', () => { + // arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{AD88481E-597B-4C1B-967B-3D700B8BAB0F}'; + var toKey = '{2A6714C4-784E-47D3-BBF4-6205834EC8D5}'; + + automapper + .createMap(fromKey, toKey) + .forSourceMember('prop1', (opts: ISourceMemberConfigurationOptions) => { return 'Yeah!'; }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop1: 'Yeah!', prop2: 'From A too' }); + }); + + it('should be able to ignore a source property already specified (by forMember) using the forSourceMember function', () => { + // arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{AD88481E-597B-4C1B-967B-3D701B8CAB0A}'; + var toKey = '{2A6714C4-784E-47D3-BBF4-620583DEC86A}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop1', 12) + .forSourceMember('prop1', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: 'From A too' }); + }); + + it('should fail when forSourceMember is used with anything else than a function', () => { + // arrange + var caught = false; + + var fromKey = '{5EE20DF9-84B3-4A6A-8C5D-37AEDC44BE87}'; + var toKey = '{986C959D-2E2E-41FA-9857-8EF519467AEB}'; + + try { + // act + automapper + .createMap(fromKey, toKey) + .forSourceMember('prop1', 12); + } catch (e) { + // assert + caught = true; + expect(e.message).toEqual('Configuration of forSourceMember has to be a function with one (sync) or two (async) options parameters.'); + } + + if (!caught) { + // assert + expect().fail('Using anything else than a function with forSourceMember should result in an error.'); + } + }); + + it('should be able to use forMember to map a source property to a destination property with a different name', () => { + //arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{7AC4134B-ECC1-464B-B144-5B9D8F5B568E}'; + var toKey = '{2BDE907C-1CE6-4CC5-A601-9A94CC665837}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop2'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop1: objA.prop1, prop: objA.prop2 }); + }); + + it('should use forAllMembers function for each mapped destination property when specified', () => { + // arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{C4056539-FA86-4398-A10B-C41D3A791F26}'; + var toKey = '{01C64E8D-CDB5-4307-9011-0C7F1E70D115}'; + + var forAllMembersSpy = jasmine.createSpy('forAllMembersSpy').and.callFake((destinationObject: any, destinationProperty: string, value: any) => { + destinationObject[destinationProperty] = value; + }); + + automapper + .createMap(fromKey, toKey) + .forAllMembers(forAllMembersSpy); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(forAllMembersSpy).toHaveBeenCalled(); + expect(forAllMembersSpy.calls.count()).toBe(Object.keys(objB).length); + }); + + it('should be able to use forMember with a constant value', () => { + // arrange + var objA = { prop: 1 }; + + var fromKey = '{54E67626-B877-4824-82E6-01E9F411B78F}'; + var toKey = '{2D7FDB88-97E9-45EF-A111-C9CC9C188227}'; + + var constantResult = 2; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', constantResult); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.prop).toBe(constantResult); + }); + + it('should be able to use forMember with a function returning a constant value', () => { + // arrange + var objA = { prop: 1 }; + + var fromKey = '{74C12B56-1DD1-4EA0-A640-D1F814971124}'; + var toKey = '{BBC617B8-26C8-42A0-A204-45CC77073355}'; + + var constantResult = 3; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', () => { return constantResult; }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.prop).toBe(constantResult); + }); + + it('should be able to use forMember with a function using the source object', () => { + // arrange + var objA = { prop: { subProp: { value: 1 } } }; + + var fromKey = '{54E67626-B877-4824-82E6-01E9F411B78F}'; + var toKey = '{2D7FDB88-97E9-45EF-A111-C9CC9C188227}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions) => { return opts.sourceObject[opts.sourcePropertyName].subProp.value * 2; }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.prop).toBe(objA.prop.subProp.value * 2); + }); + + it('should be able to use forMember to ignore a property', () => { + // arrange + var objA = { prop: 1 }; + + var fromKey = '{76D26B33-888A-4DF7-ABDA-E5B99E944272}'; + var toKey = '{18192391-85FF-4729-9A08-5954FCFE3954}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions) => { opts.ignore(); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.hasOwnProperty('prop')).not.toBeTruthy(); + }); + + it('should be able to use forMember to map a source property to a destination property with a different name', () => { + // arrange + var objA = { propDiff: 1 }; + + var fromKey = '{A317A36A-AD92-4346-A015-AE06FC862DB4}'; + var toKey = '{03B05E43-3028-44FD-909F-652E2DA5E607}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions) => { opts.mapFrom('propDiff'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.prop).toEqual(objA.propDiff); + }); + + it('should be able to use stack forMember calls to map a source property to a destination property using multiple mapping steps', () => { + // arrange + var birthdayString = '2000-01-01T00:00:00.000Z'; + var objA = { birthdayString: birthdayString }; + + var fromKey = '{564F1F57-FD4F-413C-A9D3-4B1C1333A20B}'; + var toKey = '{F9F45923-2D13-4EF1-9685-4883AD1D2F98}'; + + automapper + .createMap(fromKey, toKey) + .forMember('birthday', (opts: IMemberConfigurationOptions) => { opts.mapFrom('birthdayString'); }) + .forMember('birthday', (opts: IMemberConfigurationOptions) => { return new Date(opts.intermediatePropertyValue); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.birthday instanceof Date).toBeTruthy(); + expect(objB.birthday.toISOString()).toEqual('2000-01-01T00:00:00.000Z'); + }); + + it('should be able to use stack forMember calls to map a source property to a destination property using multiple mapping steps in any order', () => { + // arrange + var birthdayString = '2000-01-01T00:00:00.000Z'; + var objA = { birthdayString: birthdayString }; + + var fromKey = '{1609A9B5-6083-448B-8FD6-51DAD106B63D}'; + var toKey = '{47AF7D2D-A848-4C5B-904F-39402E2DCDD5}'; + + automapper + .createMap(fromKey, toKey) + .forMember('birthday', (opts: IMemberConfigurationOptions) => { return new Date(opts.intermediatePropertyValue); }) + .forMember('birthday', (opts: IMemberConfigurationOptions) => { opts.mapFrom('birthdayString'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.birthday instanceof Date).toBeTruthy(); + expect(objB.birthday.toISOString()).toEqual('2000-01-01T00:00:00.000Z'); + }); + + it('should not map properties that are not an object\'s own properties', () => { + var objA = new ClassA(); + objA.propA = 'propA'; + + var fromKey = '{A317A36A-AD92-4346-A015-AE06FC862DB4}'; + var toKey = '{03B05E43-3028-44FD-909F-652E2DA5E607}'; + + automapper + .createMap(fromKey, toKey); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.propA).toEqual(objA.propA); + }); + + it('should be able to use convertUsing to map an object with a custom type resolver function', () => { + var objA = { propA: 'propA' }; + + var fromKey = '{D1534A0F-6120-475E-B7E2-BF2489C58571}'; + var toKey = '{1896FF99-1A28-4FE6-800B-072D5616B02D}'; + + automapper + .createMap(fromKey, toKey) + .convertUsing(function(resolutionContext: IResolutionContext): any { + return { propA: resolutionContext.sourceValue.propA + ' (custom mapped with resolution context)' }; + }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.propA).toEqual(objA.propA + ' (custom mapped with resolution context)'); + }); + + it('should be able to use convertUsing to map an object with a custom type resolver class', () => { + // arrange + var objA = { propA: 'propA' }; + + var fromKey = '{6E7F5757-1E55-4B55-BB86-44FF5B33DE2F}'; + var toKey = '{8521AE41-C3AF-4FCD-B7C7-A915C037D69E}'; + + automapper + .createMap(fromKey, toKey) + .convertUsing(CustomTypeConverterDefinition); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.propA).toEqual(objA.propA + ' (convertUsing with a class definition)'); + }); + + it('should be able to use convertUsing to map an object with a custom type resolver instance', () => { + // arrange + // NOTE BL The CustomTypeConverter class definition is defined at the bottom, since TypeScript + // does not allow classes to be defined inline. + + var objA = { propA: 'propA' }; + + var fromKey = '{BDF3758C-B38E-4343-95B6-AE0F80C8B9C4}'; + var toKey = '{13DD7AE1-4177-4A80-933B-B60A55859E50}'; + + automapper + .createMap(fromKey, toKey) + .convertUsing(new CustomTypeConverterInstance()); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.propA).toEqual(objA.propA + ' (convertUsing with a class instance)'); + }); + + it('should fail when directly using the type converter base class', () => { + // arrange + var caught = false; + var objA = { propA: 'propA' }; + + var fromKey = 'should fail when directly using '; + var toKey = 'the type converter base class'; + + automapper + .createMap(fromKey, toKey) + .convertUsing(TypeConverter); + + try { + // act + var objB = automapper.map(fromKey, toKey, objA); + } catch (e) { + // assert + caught = true; + expect(e.message).toEqual('The TypeConverter.convert method is abstract. Use a TypeConverter extension class instead.'); + } + + if (!caught) { + // assert + expect().fail('Using the type converter base class directly should fail.'); + } + }); + + it('should fail when convertUsing is used with a function not having exactly one (resolutionContext) parameter.', () => { + // arrange + var caught = false; + + var fromKey = '{1EF9AC11-BAA1-48DB-9C96-9DFC40E33BCA}'; + var toKey = '{C4DA81D3-9072-4140-BFA7-431C35C01F54}'; + + try { + // act + automapper + .createMap(fromKey, toKey) + .convertUsing(() => { + return {}; + }); + + //var objB = automapper.map(fromKey, toKey, objA); + } catch (e) { + // assert + caught = true; + expect(e.message).toEqual('The value provided for typeConverterClassOrFunction is invalid. ' + + 'Error: The function provided does not provide exactly one (resolutionContext) parameter.'); + } + + if (!caught) { + // assert + expect().fail('Using anything else than a function with forSourceMember should result in an error.'); + } + }); + + it('should be able to use convertToType to map a source object to a destination object which is an instance of a given class', () => { + //arrange + var objA = { ApiProperty: 'From A' }; + + + var fromKey = '{7AC4134B-ECC1-464B-B144-5C9D8F5B5A7E}'; + var toKey = '{2BDE907C-1CE6-4CC5-A601-9A94CA6C4737}'; + + automapper + .createMap(fromKey, toKey) + .forMember('property', (opts: IMemberConfigurationOptions) => { opts.mapFrom('ApiProperty'); }) + .convertToType(DemoToBusinessType); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB instanceof DemoToBusinessType).toBeTruthy(); + expect(objB.property).toEqual(objA.ApiProperty); + }); + + it('should be able to use a condition to map or ignore a property', () => { + // arrange + var objA = { prop: 1, prop2: 2 }; + + var fromKey = '{76D23B33-888A-4DF7-BEBE-E5B99E944272}'; + var toKey = '{18192191-85FE-4729-A980-5954FCFE3954}'; + + automapper + .createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions) => { opts.condition((sourceObject: any) => sourceObject.prop === 0); }) + .forMember('prop2', (opts: IMemberConfigurationOptions) => { opts.condition((sourceObject: any) => sourceObject.prop2 === 2); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB.hasOwnProperty('prop')).not.toBeTruthy(); + expect(objB.hasOwnProperty('prop2')).toBeTruthy(); + }); + + it('should be able to ignore all unmapped members using the ignoreAllNonExisting function', () => { + // arrange + var objA = { + propA: 'Prop A', + propB: 'Prop B', + propC: 'Prop C', + propD: 'Prop D' + }; + + var fromKey = '{AD88481E-597B-4C1C-9A7B-3D70DB8BCB0F}'; + var toKey = '{2A6614C4-784E-47D3-BBF4-6205834EA8D1}'; + + automapper + .createMap(fromKey, toKey) + .forMember('propA', (opts: IMemberConfigurationOptions) => opts.mapFrom('propA')) + .ignoreAllNonExisting(); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ propA: 'Prop A' }); + }); + + it('should be able to create a map and use it using class types', () => { + // arrange + var objA = new ClassA(); + objA.propA = 'Value'; + + // act + automapper.createMap(ClassA, ClassB); + var objB = automapper.map(ClassA, ClassB, objA); + + // assert + expect(objB instanceof ClassB).toBeTruthy(); + expect(objB).toEqualData({ propA: 'Value' }); + }); + + it('should throw an error when creating a map using class types and specifying a conflicting destination type', () => { + // arrange + var caught = false; + + // act + try { + automapper + .createMap(ClassA, ClassB) + .convertToType(ClassC); + } catch (e) { + caught = true; + // assert + expect(e.message).toEqual('Destination type class can only be set once.'); + } + + if (!caught) { + // assert + expect(null).fail('AutoMapper should throw an error when creating a map using class types and specifying a conflicting destination type.'); + } + }); + + it('should be able to use forMember to map a nested source property to a destination property', () => { + //arrange + var objA = { prop1: { propProp1: 'From A' }, prop2: 'From A too' }; + + var fromKey = '{7AC4134B-ECC1-464B-B144-5B9D8F5B568E}'; + var toKey = '{2BDE907C-1CE6-4CC5-A601-9A94CC665837}'; + + automapper + .createMap(fromKey, toKey) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp1'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: objA.prop2, propFromNestedSource: objA.prop1.propProp1 }); + }); + + it('should be able to stack forMember calls when mapping a nested source property to a destination property', () => { + //arrange + var objA = { prop1: { propProp1: 'From A' }, prop2: 'From A too' }; + var addition = ' - sure works!'; + + var fromKey = '{7AC4134B-ECC1-464B-B144-5B99CF5B558E}'; + var toKey = '{2BDE907C-1CE6-4CC5-56A1-9A94CC6658C7}'; + + automapper + .createMap(fromKey, toKey) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp1'); }) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { return opts.intermediatePropertyValue + addition; }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: objA.prop2, propFromNestedSource: objA.prop1.propProp1 + addition }); + }); + + it('should be able to stack forMember calls when mapping a nested source property to a destination property in any order', () => { + //arrange + var objA = { prop1: { propProp1: 'From A' }, prop2: 'From A too' }; + var addition = ' - sure works!'; + + var fromKey = '{7AC4134B-ECD1-46EB-B14A-5B9D8F5B5F8E}'; + var toKey = '{BBD6907C-ACE6-4FC8-A60D-1A943C66D83F}'; + + automapper + .createMap(fromKey, toKey) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { return opts.intermediatePropertyValue + addition; }) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp1'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: objA.prop2, propFromNestedSource: objA.prop1.propProp1 + addition }); + }); + + it('should be able to stack forMember mapFrom calls when mapping a nested source property to a destination property', () => { + //arrange + var objA = { prop1: { propProp1: 'From A', propProp2: { propProp2Prop: 'From A' } }, prop2: 'From A too' }; + var addition = ' - sure works!'; + + var fromKey = '{7AC4134B-ECD1-46EB-B14A-5B9D8F5B5F8E}'; + var toKey = '{BBD6907C-ACE6-4FC8-A60D-1A943C66D83F}'; + + automapper + .createMap(fromKey, toKey) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { return opts.intermediatePropertyValue + addition; }) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp2.propProp2Prop'); }) + .forMember('propFromNestedSource', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp1'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: objA.prop2, propFromNestedSource: objA.prop1.propProp1 + addition }); + }); + + it('should be able to use forMember to map to a nested destination', () => { + //arrange + var objA = { prop1: { propProp1: 'From A', propProp2: { propProp2Prop: 'From A' } }, prop2: 'From A too' }; + var addition = ' - sure works!'; + + var fromKey = '{7AC4134B-ECD1-46EB-B14A-5B9D8F5B5F8E}'; + var toKey = '{BBD6907C-ACE6-4FC8-A60D-1A943C66D83F}'; + + automapper + .createMap(fromKey, toKey) + .forMember('nested.property', (opts: IMemberConfigurationOptions) => { return opts.intermediatePropertyValue + addition; }) + .forMember('nested.property', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp2.propProp2Prop'); }) + .forMember('nested.property', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1.propProp1'); }); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop2: objA.prop2, nested: { property: objA.prop1.propProp1 + addition }}); + }); + + it('should be able to use mapFrom to switch properties and ignore a property as well', () => { + // arrange + var objA = { prop1: 'From A', prop2: 'From A too', prop3: 'Also from A (really)' }; + + var fromKey = 'should be able to use mapFrom to switch '; + var toKey = 'properties and ignore a property as well'; + + // act + automapper + .createMap(fromKey, toKey) + .forMember('prop1', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop2'); }) + .forMember('prop2', (opts: IMemberConfigurationOptions) => { opts.mapFrom('prop1'); }) + .forSourceMember('prop3', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop1: objA.prop2, prop2: objA.prop1 }); + }); + + it('should be able to create a new property using a constant value', () => { + // arrange + var objA = { }; + + var fromKey = 'should be able to create a new property '; + var toKey = 'using a constant value'; + + // act + automapper + .createMap(fromKey, toKey) + .forMember('prop4', (opts: IMemberConfigurationOptions) => { return 12; }); + + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop4: 12 }); + }); + + it('should just return source object when no properties are created using null source object', () => { + // arrange + var objA: any = null; + + var fromKey = 'should just return source object when no '; + var toKey = 'properties created using null source object'; + + // act + automapper + .createMap(fromKey, toKey); + + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toBeNull(); + }); + + it('should be able to create a new property using a constant value (null source object)', () => { + // arrange + var objA: any = null; + + var fromKey = 'should be able to create a new property '; + var toKey = 'using a constant value (null source object)'; + + // act + automapper + .createMap(fromKey, toKey) + .forMember('prop4', (opts: IMemberConfigurationOptions) => { return 12; }); + + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData({ prop4: 12 }); + }); + }); + + it('should map a source object with empty nested objects', () => { + // arrange + var src: any = { + homeAddress: null /*{ + address1: '200 Main St', + address2: '200 Main St', + city: 'Los Angeles', + state: 'CA', + zip: '90000' + }*/, + businessAddress: { + address1: '200 Main St', + // address2: '200 Main St', + city: 'Los Angeles', + state: 'CA', + zip: '90000' + } + }; + + var fromKey = '{60E9DC56-D6E1-48FF-9BAC-0805FCAF91B7}'; + var toKey = '{AC6D5A97-9AEF-42C7-BD60-A5F3D17E541A}'; + + automapper + .createMap(fromKey, toKey) + // .forMember('homeAddress.address1', (opts: IMemberConfigurationOptions) => { opts.mapFrom('homeAddress.address1'); }) + .forMember('homeAddress.address2', (opts: IMemberConfigurationOptions) => { opts.mapFrom('homeAddress.address2'); }) + // .forMember('homeAddress.city', (opts: IMemberConfigurationOptions) => { opts.mapFrom('homeAddress.city'); }) + // .forMember('homeAddress.state', (opts: IMemberConfigurationOptions) => { opts.mapFrom('homeAddress.state'); }) + // .forMember('homeAddress.zip', (opts: IMemberConfigurationOptions) => { opts.mapFrom('homeAddress.zip'); }) + + .forMember('businessAddress.address1', (opts: IMemberConfigurationOptions) => { opts.mapFrom('businessAddress.address1'); }) + .forMember('businessAddress.address2', (opts: IMemberConfigurationOptions) => null) + .forMember('businessAddress.city', (opts: IMemberConfigurationOptions) => { opts.mapFrom('businessAddress.city'); }) + .forMember('businessAddress.state', (opts: IMemberConfigurationOptions) => { opts.mapFrom('businessAddress.state'); }) + .forMember('businessAddress.zip', (opts: IMemberConfigurationOptions) => { opts.mapFrom('businessAddress.zip'); }) + ; + + // act + var dst = automapper.map(fromKey, toKey, src); + + // assert + expect(dst).not.toBeNull(); + + expect(dst.homeAddress).toBeNull(); + + expect(dst.businessAddress.address1).toBe(src.businessAddress.address1); + expect(dst.businessAddress.address2).toBeUndefined(); + expect(dst.businessAddress.city).toBe(src.businessAddress.city); + expect(dst.businessAddress.state).toBe(src.businessAddress.state); + expect(dst.businessAddress.zip).toBe(src.businessAddress.zip); + }); + + describe('AutoMapper - Currying support', () => { + beforeEach(() => { + jasmine.addMatchers(ExtendJasmine.addCustomMatchers()); + }); + + it('should be able to use currying when calling createMap', () => { + // arrange + var fromKey = '{808D9D7F-AA89-4D07-917E-A528F055EE64}'; + var toKey1 = '{B364C0A0-9E24-4424-A569-A4C14101947C}'; + var toKey2 = '{1055CA5A-4FC4-44CB-B4D8-B004F43D8840}'; + + var source = { prop: 'Value' }; + + // act + var mapFromKeyCurry = automapper.createMap(fromKey); + + mapFromKeyCurry(toKey1) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + mapFromKeyCurry(toKey2); + + var result1 = automapper.map(fromKey, toKey1, source); + var result2 = automapper.map(fromKey, toKey2, source); + + // assert + expect(typeof mapFromKeyCurry === 'function').toBeTruthy(); + expect(result1.prop).toBeUndefined(); + expect(result2.prop).toEqual(source.prop); + }); + + it('should be able to use currying (one parameter) when calling map', () => { + // arrange + var fromKey = 'should be able to use currying (one parameter)'; + var toKey1 = 'when calling map (1)'; + var toKey2 = 'when calling map (2)'; + + var source = { prop: 'Value' }; + + // act + var createMapFromKeyCurry = automapper.createMap(fromKey); + + createMapFromKeyCurry(toKey1) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + createMapFromKeyCurry(toKey2); + + var result1MapCurry = automapper.map(fromKey); + var result2MapCurry = automapper.map(fromKey); + + var result1 = result1MapCurry(toKey1, source); + var result2 = result2MapCurry(toKey2, source); + + // assert + expect(typeof createMapFromKeyCurry === 'function').toBeTruthy(); + expect(typeof result1MapCurry === 'function').toBeTruthy(); + expect(typeof result2MapCurry === 'function').toBeTruthy(); + + expect(result1.prop).toBeUndefined(); + expect(result2.prop).toEqual(source.prop); + }); + + it('should be able to use currying when calling map', () => { + // arrange + var fromKey = '{FC18523B-5A7C-4193-B938-B6AA2EABB37A}'; + var toKey1 = '{609202F4-15F7-4512-9178-CFAF073800E1}'; + var toKey2 = '{85096AE2-92FB-43D7-8FC3-EC14DDC1DFDD}'; + + var source = { prop: 'Value' }; + + // act + var createMapFromKeyCurry = automapper.createMap(fromKey); + + createMapFromKeyCurry(toKey1) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + createMapFromKeyCurry(toKey2); + + var result1MapCurry = automapper.map(fromKey, toKey1); + var result2MapCurry = automapper.map(fromKey, toKey2); + + var result1 = result1MapCurry(source); + var result2 = result2MapCurry(source); + + // assert + expect(typeof createMapFromKeyCurry === 'function').toBeTruthy(); + expect(typeof result1MapCurry === 'function').toBeTruthy(); + expect(typeof result2MapCurry === 'function').toBeTruthy(); + + expect(result1.prop).toBeUndefined(); + expect(result2.prop).toEqual(source.prop); + }); + + it('should be able to use currying when calling mapAsync', (done: () => void) => { + // arrange + var fromKey = '{1CA8523C-5A7C-4193-B938-B6AA2EABB37A}'; + var toKey1 = '{409212FD-15E7-4512-9178-CFAF073800EG}'; + var toKey2 = '{85096AE2-92FA-43N7-8FA3-EC14DDC1DFDE}'; + + var source = { prop: 'Value' }; + + // act + var createMapFromKeyCurry = automapper.createMap(fromKey); + + createMapFromKeyCurry(toKey1) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions, cb: IMemberCallback) => { cb('Constant Value 1'); }); + + createMapFromKeyCurry(toKey2) + .forMember('prop', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { cb('Constant Value 2'); }); + + var result1MapCurry = automapper.mapAsync(fromKey, toKey1); + var result2MapCurry = automapper.mapAsync(fromKey, toKey2); + + // assert + expect(typeof createMapFromKeyCurry === 'function').toBeTruthy(); + expect(typeof result1MapCurry === 'function').toBeTruthy(); + expect(typeof result2MapCurry === 'function').toBeTruthy(); + + var resCount = 0; + var result1 = result1MapCurry(source, (result: any) => { + // assert + expect(result.prop).toEqual('Constant Value 1'); + if (++resCount === 2) { + done(); + } + }); + + var result2 = result2MapCurry(source, (result: any) => { + // assert + expect(result.prop).toEqual('Constant Value 2'); + if (++resCount === 2) { + done(); + } + }); + }); + + it('should be able to use currying when calling mapAsync with one parameter', (done: () => void) => { + // arrange + var fromKey = '{1CA8523C-5AVC-4193-BS38-B6AA2EABB37A}'; + var toKey = '{409212FD-1527-4512-9178-CFAG073800EG}'; + + var source = { prop: 'Value' }; + + // act + automapper.createMap(fromKey, toKey) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions, cb: IMemberCallback) => { cb('Constant Value'); }); + + var mapAsyncCurry = automapper.mapAsync(fromKey); + + // assert + expect(typeof mapAsyncCurry === 'function').toBeTruthy(); + + var result = mapAsyncCurry(toKey, source, (result: any) => { + // assert + expect(result.prop).toEqual('Constant Value'); + done(); + }); + }); + + it('should be able to use currying when calling mapAsync with two parameters', (done: () => void) => { + // arrange + var fromKey = '{1CA852SC-5AVC-4193-BS38-B6AA2KABB3LA}'; + var toKey = '{409212FD-1Q27-45G2-9178-CFAG073800EG}'; + + var source = { prop: 'Value' }; + + // act + automapper.createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { cb('Constant Value'); }); + + var mapAsyncCurry = automapper.mapAsync(fromKey, toKey); + + // assert + expect(typeof mapAsyncCurry === 'function').toBeTruthy(); + + var result = mapAsyncCurry(source, (result: any) => { + // assert + expect(result.prop).toEqual('Constant Value'); + done(); + }); + }); + + it('should be able to use currying when calling mapAsync with three parameters', (done: () => void) => { + // NOTE BL 20151214 I wonder why anyone would like calling this one? Maybe this one will be removed in + // the future. Please get in touch if you need this one to stay in place... + + // arrange + var fromKey = '{1CA852SC-5AVC-ZZ93-BS38-B6AA2KABB3LA}'; + var toKey = '{409212FD-1Q27-45G2-91BB-CFAG0738WCEG}'; + + var source = { prop: 'Value' }; + + // act + automapper.createMap(fromKey, toKey) + .forMember('prop', (opts: IMemberConfigurationOptions, cb: IMemberCallback) => { cb('Constant Value'); }); + + var mapAsyncCurry = automapper.mapAsync(fromKey, toKey, source); + + // assert + expect(typeof mapAsyncCurry === 'function').toBeTruthy(); + + var result = mapAsyncCurry((result: any) => { + // assert + expect(result.prop).toEqual('Constant Value'); + done(); + }); + }); + + it('should fail when calling mapAsync without parameters', () => { + // arrange + + // act + try { + var mapAsyncCurry = (automapper).mapAsync(); + } catch (e) { + // assert + expect(e.message).toEqual('The mapAsync function expects between 1 and 4 parameters, you provided 0.'); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should fail when calling mapAsync with > 4 parameters', () => { + // arrange + + // act + try { + var mapAsyncCurry = (automapper).mapAsync(undefined, undefined, undefined, undefined, undefined); + } catch (e) { + // assert + expect(e.message).toEqual('The mapAsync function expects between 1 and 4 parameters, you provided 5.'); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + + it('should fail when specifying < 2 parameters to the asynchronous map function', () => { + // arrange + + // act + try { + (new AsyncAutoMapper()).map(undefined); + } catch (e) { + // assert + expect(e.message).toEqual('The AsyncAutoMapper.map function expects between 2 and 5 parameters, you provided 1.'); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + + it('should fail when specifying > 5 parameters to the asynchronous map function', () => { + // arrange + + // act + try { + (new AsyncAutoMapper()).map(undefined, undefined, undefined, undefined, undefined, undefined); + } catch (e) { + // assert + expect(e.message).toEqual('The AsyncAutoMapper.map function expects between 2 and 5 parameters, you provided 6.'); + return; + } + + // assert + expect(null).fail('Expected error was not raised.'); + }); + }); + + describe('AutoMapper.initialize', () => { + beforeEach(() => { + jasmine.addMatchers(ExtendJasmine.addCustomMatchers()); + }); + + it('should use created mapping profile', () => { + // arrange + var fromKey = '{5700E351-8D88-A327-A216-3CC94A308EDE}'; + var toKey = '{BB33A261-3CA9-A8FC-85E6-2C269F73728C}'; + + automapper.initialize((config: IConfiguration) => { + config.createMap(fromKey, toKey); + }); + + // act + automapper.map(fromKey, toKey, {}); + + // assert + }); + + it('should be able to use a naming convention to convert Pascal case to camel case', () => { + automapper.initialize((config: IConfiguration) => { + config.addProfile(new PascalCaseToCamelCaseMappingProfile()); + }); + + const sourceKey = 'PascalCase'; + const destinationKey = 'CamelCase'; + + const sourceObject = { FullName: 'John Doe' }; + + automapper + .createMap(sourceKey, destinationKey) + .withProfile('PascalCaseToCamelCase'); + + var result = automapper.map(sourceKey, destinationKey, sourceObject); + + expect(result).toEqualData({ fullName: 'John Doe' }); + }); + + it('should be able to use a naming convention to convert camelCase to PascalCase', () => { + automapper.initialize((config: IConfiguration) => { + config.addProfile(new CamelCaseToPascalCaseMappingProfile()); + }); + + const sourceKey = 'CamelCase2'; + const destinationKey = 'PascalCase2'; + + const sourceObject = { fullName: 'John Doe' }; + + automapper + .createMap(sourceKey, destinationKey) + .withProfile('CamelCaseToPascalCase'); + + var result = automapper.map(sourceKey, destinationKey, sourceObject); + + expect(result).toEqualData({ FullName: 'John Doe' }); + }); + + it('should be able to use forMember besides using a profile', () => { + automapper.initialize((config: IConfiguration) => { + config.addProfile(new CamelCaseToPascalCaseMappingProfile()); + }); + + const sourceKey = 'CamelCase'; + const destinationKey = 'PascalCase'; + + const sourceObject = { fullName: 'John Doe', age: 20 }; + + automapper + .createMap(sourceKey, destinationKey) + .forMember('theAge', (opts: IMemberConfigurationOptions) => opts.mapFrom('age')) + .withProfile('CamelCaseToPascalCase'); + + var result = automapper.map(sourceKey, destinationKey, sourceObject); + + expect(result).toEqualData({ FullName: 'John Doe', theAge: sourceObject.age }); + }); + + it('should use profile when only profile properties are specified', () => { + automapper.initialize((config: IConfiguration) => { + config.addProfile(new ValidatedAgeMappingProfile2()); + }); + + const sourceKey = '{918D9D7F-AA89-4D07-917E-A528F07EEF42}'; + const destinationKey = '{908D9D6F-BA89-4D17-915E-A528E988EE64}'; + + const sourceObject = { fullName: 'John Doe', proclaimedAge: 21, ageOnId: 15 }; + + automapper + .createMap(sourceKey, destinationKey) + .withProfile('ValidatedAgeMappingProfile2'); + + var result = automapper.map(sourceKey, destinationKey, sourceObject); + + expect(result).toEqualData({ fullName: 'John Doe', age: sourceObject.ageOnId }); + expect(result instanceof Person).toBeTruthy(); + expect(result instanceof BeerBuyingYoungster).not.toBeTruthy(); + }); + + it('should fail when using a non-existimg profile', () => { + // arrange + var caught = false; + var profileName = 'Non-existing profile'; + const sourceKey = 'should fail when using '; + const destinationKey = 'a non-existimg profile'; + const sourceObject = { }; + + // act + try { + automapper + .createMap(sourceKey, destinationKey) + .withProfile(profileName); + var result = automapper.map(sourceKey, destinationKey, sourceObject); + } catch (e) { + caught = true; + + // assert + expect(e.message).toEqual('Could not find profile with profile name \'' + profileName + '\'.'); + } + + if (!caught) { + // assert + expect().fail('Using a non-existing mapping profile should result in an error.'); + } + }); + + it('should merge forMember calls when specifying the same destination property normally and using profile', () => { + automapper.initialize((config: IConfiguration) => { + config.addProfile(new ValidatedAgeMappingProfile()); + }); + + const sourceKey = '{808D9D7F-AA89-4D07-917E-A528F078E642}'; + const destinationKey = '{808D9D6F-BA89-4D17-915E-A528E178EE64}'; + + const sourceObject = { fullName: 'John Doe', proclaimedAge: 21, ageOnId: 15 }; + + automapper + .createMap(sourceKey, destinationKey) + .forMember('ageOnId', (opts: IMemberConfigurationOptions) => opts.ignore()) + .forMember('age', (opts: IMemberConfigurationOptions) => opts.mapFrom('proclaimedAge')) + .convertToType(BeerBuyingYoungster) + .withProfile('ValidatedAgeMappingProfile'); + + var result = automapper.map(sourceKey, destinationKey, sourceObject); + + expect(result).toEqualData({ fullName: 'John Doe', age: sourceObject.ageOnId }); + expect(result instanceof Person).toBeTruthy(); + expect(result instanceof BeerBuyingYoungster).not.toBeTruthy(); + }); + + it('should be able to use currying when calling initialize(cfg => cfg.createMap)', () => { + // arrange + var fromKey = '{808D9D7F-AA89-4D07-917E-A528F078EE64}'; + var toKey1 = '{B364C0A0-9E24-4424-A569-A4C14102147C}'; + var toKey2 = '{1055CA5A-4FC4-44CA-B4D8-B004F43D4440}'; + + var source = { prop: 'Value' }; + + // act + var mapFromKeyCurry: (destinationKey: string) => ICreateMapFluentFunctions; + + automapper.initialize((config: IConfiguration) => { + mapFromKeyCurry = config.createMap(fromKey); + + mapFromKeyCurry(toKey1) + .forSourceMember('prop', (opts: ISourceMemberConfigurationOptions) => { opts.ignore(); }); + + mapFromKeyCurry(toKey2); + }); + + var result1 = automapper.map(fromKey, toKey1, source); + var result2 = automapper.map(fromKey, toKey2, source); + + // assert + expect(typeof mapFromKeyCurry === 'function').toBeTruthy(); + expect(result1.prop).toBeUndefined(); + expect(result2.prop).toEqual(source.prop); + }); + + }); + + describe('AutoMapper', () => { + beforeEach(() => { + jasmine.addMatchers(ExtendJasmine.addCustomMatchers()); + }); + + it('should auto map matching properties', () => { + // arrange + var objA = { prop1: 'From A', prop2: 'From A too' }; + + var fromKey = '{7F5AF9AC-2E9E-4676-8BE1-3E72866B11E8}'; + var toKey = '{8089EBDC-3BBB-4988-95F2-683CC1AD23A3}'; + + automapper.createMap(fromKey, toKey); + + // act + var objB = automapper.map(fromKey, toKey, objA); + + // assert + expect(objB).toEqualData(objA); + }); + + it('should map an array', () => { + // arrange + var arrA = [{ prop1: 'From A', prop2: 'From A too' }]; + + var fromKey = '{60D9DB56-D6E1-48FF-9BAC-0805FCAF91B7}'; + var toKey = '{AC6D5B97-9AE3-4267-BD60-A5FED17E541A}'; + + automapper.createMap(fromKey, toKey); + + // act + var arrB = automapper.map(fromKey, toKey, arrA); + + // assert + expect(arrB).toEqualData(arrA); + }); + + it('should map an array and handle empty items', () => { + // arrange + var arrA = [{ prop1: 'From A', prop2: 'From A too' }, undefined]; + + var fromKey = '{60D9DB56-D6E1-48FF-9BAC-0805FCAF91B7}'; + var toKey = '{AC6D5B97-9AE3-4267-BD60-A5FED17E541A}'; + + automapper.createMap(fromKey, toKey); + + // act + var arrB = automapper.map(fromKey, toKey, arrA); + + // assert + expect(arrB).toEqualData(arrA); + }); + }); + + /** AutoMapper helper functions */ + class AutoMapperHelper { + public static getClassName(classType: new() => any): string { + if (classType && (classType).name) { + return (classType).name; + } + // source: http://stackoverflow.com/a/13914278/702357 + if (classType && classType.constructor) { + let className = classType.toString(); + if (className) { + // classType.toString() is "function classType (...) { ... }" + let matchParts = className.match(/function\s*(\w+)/); + if (matchParts && matchParts.length === 2) { + return matchParts[1]; + } + } + + // for browsers which have name property in the constructor + // of the object, such as chrome + if ((classType.constructor).name) { + return (classType.constructor).name; + } + + if (classType.constructor.toString()) { + var str = classType.constructor.toString(); + + if (str.charAt(0) === '[') { + // executed if the return of object.constructor.toString() is "[object objectClass]" + var arr = str.match(/\[\w+\s*(\w+)\]/); + } else { + // executed if the return of object.constructor.toString() is "function objectClass () {}" + // (IE and Firefox) + var arr = str.match(/function\s*(\w+)/); + } + + if (arr && arr.length === 2) { + return arr[1]; + } + } + } + + throw new Error(`Unable to extract class name from type '${classType}'`); + } + } + + class AssertConfigPropertiesProp { + prop: string = undefined; // TODO Wiki: properties are only available when initialized: http://stackoverflow.com/a/20534039/702357 + } + + class AssertConfigPropertiesProp2 { + prop2: string = undefined; + } + + class AssertConfigPropertiesPropProp2 { + prop: string = undefined; + prop2: string = undefined; + } + + class ClassA { + public propA: string; + } + + class ClassB { + public propA: string; + } + + class ClassC { + public propA: string; + } + + class DemoToBusinessType { + } + + class CustomTypeConverterInstance extends TypeConverter { + public convert(resolutionContext: IResolutionContext): any { + return { propA: resolutionContext.sourceValue.propA + ' (convertUsing with a class instance)' }; + } + } + + class CustomTypeConverterDefinition extends TypeConverter { + public convert(resolutionContext: IResolutionContext): any { + return { propA: resolutionContext.sourceValue.propA + ' (convertUsing with a class definition)' }; + } + } + + class PascalCaseToCamelCaseMappingProfile extends Profile { + public sourceMemberNamingConvention: INamingConvention; + public destinationMemberNamingConvention: INamingConvention; + + public profileName = 'PascalCaseToCamelCase'; + + public configure() { + this.sourceMemberNamingConvention = new PascalCaseNamingConvention(); + this.destinationMemberNamingConvention = new CamelCaseNamingConvention(); + + super.createMap('a', 'b'); + } + } + + class CamelCaseToPascalCaseMappingProfile extends Profile { + public sourceMemberNamingConvention: INamingConvention; + public destinationMemberNamingConvention: INamingConvention; + + public profileName = 'CamelCaseToPascalCase'; + + public configure() { + this.sourceMemberNamingConvention = new CamelCaseNamingConvention(); + this.destinationMemberNamingConvention = new PascalCaseNamingConvention(); + } + } + + class ValidatedAgeMappingProfile extends Profile { + public profileName = 'ValidatedAgeMappingProfile'; + + public configure() { + const sourceKey = '{808D9D7F-AA89-4D07-917E-A528F078E642}'; + const destinationKey = '{808D9D6F-BA89-4D17-915E-A528E178EE64}'; + + this.createMap(sourceKey, destinationKey) + .forMember('proclaimedAge', (opts: IMemberConfigurationOptions) => opts.ignore()) + .forMember('age', (opts: IMemberConfigurationOptions) => opts.mapFrom('ageOnId')) + .convertToType(Person); + } + } + + class ValidatedAgeMappingProfile2 extends Profile { + public profileName = 'ValidatedAgeMappingProfile2'; + + public configure() { + const sourceKey = '{918D9D7F-AA89-4D07-917E-A528F07EEF42}'; + const destinationKey = '{908D9D6F-BA89-4D17-915E-A528E988EE64}'; + + this.createMap(sourceKey, destinationKey) + .forMember('proclaimedAge', (opts: IMemberConfigurationOptions) => opts.ignore()) + .forMember('age', (opts: IMemberConfigurationOptions) => opts.mapFrom('ageOnId')) + .convertToType(Person); + } + } + + class Person { + fullName: string; + age: number; + } + + class BeerBuyingYoungster extends Person { + } + class ExtendJasmine { + public static addCustomMatchers(): jasmine.CustomMatcherFactories { + var customMatchers: jasmine.CustomMatcherFactories = { + /** toEqualData compares to data objects using property matching */ + toEqualData: (util: jasmine.MatchersUtil, customEqualityTesters: Array): any => { + return { + compare: function (actual: any, expected: any): jasmine.CustomMatcherResult { + var pass = ExtendJasmine.equalsData(actual, expected); + return { + pass: pass, + message: pass + ? 'Data sets do equal. Congratulations ;) !' + : 'Data sets do not equal: expected "' + JSON.stringify(expected) + '", actual "' + JSON.stringify(actual) + '".' + }; + } + }; + }, + "fail": (util: jasmine.MatchersUtil, customEqualityTesters: Array): any => { + return { + compare: function (actual: any, message: string): jasmine.CustomMatcherResult { + return { + pass: false, + message: message || 'Jasmine test failed. Please provide a fix.' + }; + } + } + } + }; + return customMatchers; + } + + public static equalsData(actual: any, expected: any): boolean { + var toClass = {}.toString; + + // check array. + var actualType = toClass.call(actual); + var expectedType = toClass.call(expected); + + if (actualType === '[object Array]') { + // check both are arrays + if (expectedType !== '[object Array]') { + return false; + } + + // check both have same length + if (expected.length !== actual.length) { + return false; + } + + for (var i = 0; i < actual.length; i++) { + // check each item in the array + if (!ExtendJasmine.equalsData(actual[i], expected[i])) + return false; + } + } + else if (actualType === '[object Object]') { + // check both are objects + if (expectedType !== '[object Object]') { + return false; + } + + // check each property in the object + for (var propertyName in expected) { + if (!expected.hasOwnProperty(propertyName)) { + continue; + } + + if (!actual.hasOwnProperty(propertyName)) { + return false; + } + + if (!ExtendJasmine.equalsData(actual[propertyName], expected[propertyName])) + return false; + } + } else { + var actualIsUndefined = typeof actual === 'undefined'; + var expectedIsUndefined = typeof expected === 'undefined'; + if (actualIsUndefined !== expectedIsUndefined) { + return false; + } + + return actual === expected; + } + + return true; + } + } +} \ No newline at end of file diff --git a/automapper-ts/automapper-ts.d.ts b/automapper-ts/automapper-ts.d.ts new file mode 100644 index 0000000000..b2bf17a966 --- /dev/null +++ b/automapper-ts/automapper-ts.d.ts @@ -0,0 +1,559 @@ +// Type definitions for automapper-ts +// Project: https://github.com/loedeman/AutoMapper +// Definitions by: Bert Loedeman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module AutoMapperJs { + /** + * AutoMapper implementation, for both creating maps and performing maps. Comparable usage and functionality to the original + * .NET AutoMapper library is the pursuit of this implementation. + */ + class AutoMapper { + /** + * Initializes the mapper with the supplied configuration. + * @param {(config: IConfiguration) => void} Configuration function to call. + */ + initialize(configFunction: (config: IConfiguration) => void): void; + + /** + * Create a createMap curry function which expects only a destination key. + * @param {string} sourceKey The map source key. + * @returns {(destinationKey: string) => ICreateMapFluentFunctions} + */ + createMap(sourceKey: string | (new() => any)): (destinationKey: string | (new() => any)) => ICreateMapFluentFunctions; + + /** + * Create a mapping profile. + * @param {string} sourceKey The map source key. + * @param {string} destinationKey The map destination key. + * @returns {Core.ICreateMapFluentFunctions} + */ + createMap(sourceKey: string | (new() => any), destinationKey: string | (new() => any)): ICreateMapFluentFunctions; + + /** + * Create a map curry function which expects a destination key and a source object. + * @param sourceKey Source key, for instance the source type name. + * @returns {(destinationKey: string, sourceObject: any) => any} + */ + map(sourceKey: string | (new() => any)): (destinationKey: string | (new() => any), sourceObject: any) => any; + + /** + * Create a map curry function which expects only a source object. + * @param sourceKey Source key, for instance the source type name. + * @param destinationKey Destination key, for instance the destination type name. + * @returns {(sourceObject: any) => any} + */ + map(sourceKey: string | (new() => any), destinationKey: string | (new() => any)): (sourceObject: any) => any; + + /** + * Execute a mapping from the source object to a new destination object with explicit mapping configuration and supplied mapping options (using createMap). + * @param sourceKey Source key, for instance the source type name. + * @param destinationKey Destination key, for instance the destination type name. + * @param sourceObject The source object to map. + * @returns {any} Destination object. + */ + map(sourceKey: string | (new() => any), destinationKey: string | (new() => any), sourceObject: any): any; + + /** + * Create a mapAsync curry function which expects a destination key, a source object and a callback function. + * @param sourceKey Source key, for instance the source type name. + * @returns {(destinationKey: string, sourceObject: any, callback: IMapCallback) => void} + */ + mapAsync(sourceKey: string | (new() => any)): (destinationKey: string | (new() => any), sourceObject: any, callback: IMapCallback) => void; + + /** + * Create a map curry function which expects only a source object and a callback function. + * @param sourceKey Source key, for instance the source type name. + * @param destinationKey Destination key, for instance the destination type name. + * @param sourceObject The source object to map. + * @returns {(callback: IMapCallback) => void} + */ + mapAsync(sourceKey: string | (new() => any), destinationKey: string | (new() => any), sourceObject: any): (callback: IMapCallback) => void; + + /** + * Create a map curry function which expects only a source object and a callback function. + * @param sourceKey Source key, for instance the source type name. + * @param destinationKey Destination key, for instance the destination type name. + * @returns {(sourceObject: any, callback: IMapCallback) => void} + */ + mapAsync(sourceKey: string | (new() => any), destinationKey: string | (new() => any)): (sourceObject: any, callback: IMapCallback) => void; + + /** + * Execute an asynchronous mapping from the source object to a new destination object with explicit mapping configuration and supplied mapping options (using createMap). + * @param sourceKey Source key, for instance the source type name. + * @param destinationKey Destination key, for instance the destination type name. + * @param sourceObject The source object to map. + * @param {IMapCallback} callback The callback to call when asynchronous mapping is complete. + */ + mapAsync(sourceKey: string | (new() => any), destinationKey: string | (new() => any), sourceObject: any, callback: IMapCallback): void; + + /** + * Validates mapping configuration by dry-running. Since JS does not + * fully support typing, it only checks if properties match on both + * sides. The function needs IMapping.sourceTypeClass and + * IMapping.destinationTypeClass to function. + * @param {boolean} strictMode Whether or not to fail when properties + * sourceTypeClass or destinationTypeClass + * are unavailable. + */ + assertConfigurationIsValid(strictMode?: boolean): void; + } + + class AsyncAutoMapper { + /* For Test Purposes Only */ + } + + /** + * Converts source type to destination type instead of normal member mapping + */ + class TypeConverter implements ITypeConverter { + /** + * Performs conversion from source to destination type. + * @param {IResolutionContext} resolutionContext Resolution context. + * @returns {any} Destination object. + */ + convert(resolutionContext: IResolutionContext): any; + } + + export class Profile implements IProfile { + /** Profile name */ + public profileName: string; + + /** Naming convention for source members */ + public sourceMemberNamingConvention: INamingConvention; + + /** Naming convention for destination members */ + public destinationMemberNamingConvention: INamingConvention; + + /** + * Create a createMap curry function which expects only a destination key. + * @param {string} sourceKey The map source key. + * @returns {(destinationKey: string) => ICreateMapFluentFunctions} + */ + protected createMap(sourceKey: string): (destinationKey: string) => ICreateMapFluentFunctions; + + /** + * Create a mapping profile. + * @param {string} sourceKey The map source key. + * @param {string} destinationKey The map destination key. + * @returns {Core.ICreateMapFluentFunctions} + */ + protected createMap(sourceKey: string, destinationKey: string): ICreateMapFluentFunctions; + + /** + * Implement this method in a derived class and call the CreateMap method to associate that map with this profile. + * Avoid calling the AutoMapper class / automapper instance from this method. + */ + public configure(): void; + } + + /** + * Defines the PascalCase naming convention strategy. + */ + class PascalCaseNamingConvention implements INamingConvention { + /** Regular expression on how to tokenize a member. */ + splittingExpression: RegExp; + + /** Character to separate on. */ + separatorCharacter: string; + + /** + * Transformation function called when this convention is the destination naming convention. + * @param {string[]} sourcePropertyNameParts Array containing tokenized source property name parts. + * @returns {string} Destination property name + */ + transformPropertyName(sourcePropertyNameParts: string[]): string; + } + + /** + * Defines the camelCase naming convention strategy. + */ + class CamelCaseNamingConvention implements INamingConvention { + /** Regular expression on how to tokenize a member. */ + splittingExpression: RegExp; + + /** Character to separate on. */ + separatorCharacter: string; + + /** + * Transformation function called when this convention is the destination naming convention. + * @param {string[]} sourcePropertyNameParts Array containing tokenized source property name parts. + * @returns {string} Destination property name + */ + transformPropertyName(sourcePropertyNameParts: string[]): string; + } + + + + interface IProperty { + name: string; + metadata: IPropertyMetadata; + level: number; + sourceMapping: boolean; + ignore: boolean; + async: boolean; + children?: IProperty[]; + destinations?: IProperty[]; + conversionValuesAndFunctions: any[]; + conditionFunction?: (sourceObject: any) => boolean; + } + + interface IPropertyMetadata { + mapping: IMapping; + root: IProperty; + parent: IProperty; + destinations: {[name: string]: IPropertyDestinationMetadata}; + destinationCount: number; + } + + interface IPropertyDestinationMetadata { + source: IProperty; + destination: IProperty; + } + + interface IMemberMappingMetaData { + destination: string; + source: string; + sourceMapping: boolean; + ignore: boolean; + async: boolean; + condition: (sourceObject: any) => boolean; + } + + /** + * Member mapping properties. + */ + interface IForMemberMapping { + /** The source member property name. */ + sourceProperty: string; + /** The destination member property name parts for nested property support (e.g. 'type.name'). */ + destinationProperty: string; + /** Source or destination mapping. */ + sourceMapping: boolean; + /** All mapping values and/or functions resulting from stacked for(Source)Member calls. */ + mappingValuesAndFunctions: Array; + /** Whether or not this destination property must be ignored. */ + ignore: boolean; + /** Whether or not this member mapping has an asynchronous mapping function. */ + async: boolean; + /** + * The object will only be mapped when the condition is met. + * @param {any} sourceObject The source object to check. + * @returns {boolean} + */ + conditionFunction: (sourceObject: any) => boolean; + } + + /** + * Interface for returning an object with available 'sub' functions to enable method chaining (e.g. automapper.createMap().forMember().forMember() ...) + */ + interface ICreateMapFluentFunctions { + /** + * Customize configuration for an individual destination member. + * @param sourceProperty The destination member property name. + * @param valueOrFunction The value or function to use for this individual member. + * @returns {IAutoMapperCreateMapChainingFunctions} + */ + forMember: (sourceProperty: string, valueOrFunction: any | + ((opts: IMemberConfigurationOptions) => any) | + ((opts: IMemberConfigurationOptions, cb: IMemberCallback) => void)) => ICreateMapFluentFunctions; + + /** + * Customize configuration for an individual source member. + * @param sourceProperty The source member property name. + * @param sourceMemberConfigFunction The function to use for this individual member. + * @returns {IAutoMapperCreateMapChainingFunctions} + */ + forSourceMember: (sourceProperty: string, + sourceMemberConfigFunction: ((opts: ISourceMemberConfigurationOptions) => any) | + ((opts: ISourceMemberConfigurationOptions, cb: IMemberCallback) => void) + ) => ICreateMapFluentFunctions; + + /** + * Customize configuration for all destination members. + * @param func The function to use for this individual member. + * @returns {IAutoMapperCreateMapChainingFunctions} + */ + forAllMembers: (func: (destinationObject: any, destinationPropertyName: string, value: any) => void) => ICreateMapFluentFunctions; + + /** + * Ignore all members not specified explicitly. + */ + ignoreAllNonExisting: () => ICreateMapFluentFunctions; + + /** + * Skip normal member mapping and convert using a custom type converter (instantiated during mapping). + * @param typeConverterClassOrFunction The converter class or function to use when converting. + */ + convertUsing: (typeConverterClassOrFunction: ((resolutionContext: IResolutionContext) => any) | + ((resolutionContext: IResolutionContext, callback: IMapCallback) => void) | + ITypeConverter | + (new() => ITypeConverter) + ) => void; + + /** + * Specify to which class type AutoMapper should convert. When specified, AutoMapper will create an instance of the given type, instead of returning a new object literal. + * @param typeClass The destination type class. + * @returns {IAutoMapperCreateMapChainingFunctions} + */ + convertToType: (typeClass: new () => any) => ICreateMapFluentFunctions; + + /** + * Specify which profile should be used when mapping. + * @param {string} profileName The profile name. + * @returns {IAutoMapperCreateMapChainingFunctions} + */ + withProfile: (profileName: string) => void; + } + + /** + * The mapping configuration for the current mapping keys/types. + */ + interface IMapping { + /** The mapping source key. */ + sourceKey: string; + + /** The mapping destination key. */ + destinationKey: string; + + /** The mappings for forAllMembers functions. */ + forAllMemberMappings: Array<(destinationObject: any, destinationPropertyName: string, value: any) => void>; + + properties: IProperty[]; + + /** + * Skip normal member mapping and convert using a type converter. + * @param resolutionContext Context information regarding resolution of a destination value + * @returns {any} Destination object. + */ + typeConverterFunction: ((resolutionContext: IResolutionContext) => any) | + ((resolutionContext: IResolutionContext, callback: IMapCallback) => void); + + /** The source type class to convert from. */ + sourceTypeClass: any; + + /** The destination type class to convert to. */ + destinationTypeClass: any; + + /** The profile used when mapping. */ + profile?: IProfile; + + /** Whether or not to ignore all properties not specified using createMap. */ + ignoreAllNonExisting?: boolean; + + /** Whether or not an mapping has to be asynchronous. */ + async: boolean; + + /* + * PERFORMANCE ENHANCEMENTS + */ + + /** + * Item mapping function to use. + */ + mapItemFunction: IMapItemFunction | IAsyncMapItemFunction; + } + + // export interface IMappingMapOptimized extends IMapping { + // final: boolean; + // forMemberMappingsArray: Array; + // } + + /** + * Context information regarding resolution of a destination value + */ + export interface IResolutionContext { + /** Source value */ + sourceValue: any; + + /** Destination value */ + destinationValue: any; + + /** Source property name */ + sourcePropertyName?: string; + + /** Destination property name */ + destinationPropertyName?: string; + + /** Index of current collection mapping */ + arrayIndex?: number; + } + + /** + * Configuration options for forMember mapping function. + */ + interface IMemberConfigurationOptions { + /** + * Map from a custom source property name. + * @param sourcePropertyName The source property to map. + */ + mapFrom: (sourcePropertyName: string) => void; + + /** + * When this configuration function is used, the (destination) property is ignored + * when mapping. + */ + ignore?: () => void; + + /** + * If specified, the property will only be mapped when the condition is fulfilled. + */ + condition: (predicate: ((sourceObject: any) => boolean)) => void; + + /** The source object to map. */ + sourceObject: any; + + /** The source property to map. */ + sourcePropertyName: string; + + /** + * The intermediate destination property value, used for stacking multiple for(Source)Member calls + * while elaborating the intermediate result. + */ + intermediatePropertyValue: any; + } + + /** + * Configuration options for forSourceMember mapping function. + */ + interface ISourceMemberConfigurationOptions { + /** + * When this configuration function is used, the source property is ignored + * when mapping. + */ + ignore: () => void; + } + + /** + * Member callback interface + */ + interface IMemberCallback { + /** + * Callback function to call when the async operation is executed. + * @param {any} callbackValue Callback value to be used as output for the for(Source)Member call. + */ + (callbackValue: any): void; + } + + /** + * Member callback interface + */ + interface IMapCallback { + /** + * Callback function to call when the async operation is executed. + * @param {any} result Callback value to be used as output for the mapAsync call. + */ + (result: any): void; + } + + /** + * Converts source type to destination type instead of normal member mapping + */ + export interface ITypeConverter { + /** + * Performs conversion from source to destination type. + * @param {IResolutionContext} resolutionContext Resolution context. + * @returns {any} Destination object. + */ + convert: (resolutionContext: IResolutionContext) => any; + } + + /** + * Defines a naming convention strategy. + */ + export interface INamingConvention { + /** Regular expression on how to tokenize a member. */ + splittingExpression: RegExp; + + /** Character to separate on. */ + separatorCharacter: string; + + /** + * Transformation function called when this convention is the destination naming convention. + * @param {string[]} sourcePropertyNameParts Array containing tokenized source property name parts. + * @returns {string} Destination property name + */ + transformPropertyName: (sourcePropertyNameParts: string[]) => string; + } + + /** + * Configuration for profile-specific maps. + */ + export interface IConfiguration { + /** + * Add an existing profile + * @param profile {IProfile} Profile to add. + */ + addProfile(profile: IProfile): void; + + /** + * Create a createMap curry function which expects only a destination key. + * @param {string} sourceKey The map source key. + * @returns {(destinationKey: string) => IAutoMapperCreateMapChainingFunctions} + */ + createMap?(sourceKey: string): (destinationKey: string) => ICreateMapFluentFunctions; + + /** + * Create a mapping profile. + * @param {string} sourceKey The map source key. + * @param {string} destinationKey The map destination key. + * @returns {Core.IAutoMapperCreateMapChainingFunctions} + */ + createMap?(sourceKey: string, destinationKey: string): ICreateMapFluentFunctions; + } + + /** + * Provides a named configuration for maps. Naming conventions become scoped per profile. + */ + export interface IProfile { + /** Profile name */ + profileName: string; + + /** Naming convention for source members */ + sourceMemberNamingConvention: INamingConvention; + + /** Naming convention for destination members */ + destinationMemberNamingConvention: INamingConvention; + + /** + * Implement this method in a derived class and call the CreateMap method to associate that map with this profile. + * Avoid calling the AutoMapper class / automapper instance from this method. + */ + configure: () => void; + } + + export interface IMapItemFunction { + (mapping: IMapping, sourceObject: any, destinationObject: any): any; + } + + export interface IAsyncMapItemFunction { + (mapping: IMapping, sourceObject: any, destinationObject: any, callback: IMapCallback): void; + } + + interface ICreateMapParameters { + mapping: IMapping; + destinationProperty: string; + conversionValueOrFunction: any; + sourceMapping: boolean; + fluentFunctions: ICreateMapFluentFunctions; + } + + interface IGetOrCreatePropertyParameters { + propertyNameParts: string[]; + mapping: IMapping; + parent?: IProperty; + propertyArray: IProperty[]; + destination?: string; + sourceMapping: boolean; + } + + interface ICreatePropertyParameters { + name: string; + mapping: IMapping; + parent: IProperty; + propertyArray: IProperty[]; + sourceMapping: boolean; + } +} + +declare var automapper: AutoMapperJs.AutoMapper; \ No newline at end of file diff --git a/awesomplete/awesomplete-tests.ts b/awesomplete/awesomplete-tests.ts new file mode 100644 index 0000000000..8132ad4555 --- /dev/null +++ b/awesomplete/awesomplete-tests.ts @@ -0,0 +1,57 @@ +/// + +var input = document.getElementById("myinput"); +new Awesomplete(input, {list: "#mylist"}); + +new Awesomplete(input, {list: document.querySelector("#mylist")}); + +new Awesomplete(input, { + list: ["Ada", "Java", "JavaScript", "LOLCODE", "Node.js", "Ruby on Rails"] +}); + +var awesomplete = new Awesomplete(input); +awesomplete.list = ["Ada", "Java", "JavaScript", "LOLCODE", "Node.js", "Ruby on Rails"]; + +new Awesomplete(input, { + list: [ + { label: "Belarus", value: "BY" }, + { label: "China", value: "CN" }, + { label: "United States", value: "US" } + ] +}); + +// Same with arrays: +new Awesomplete(input, { + list: [ + [ "Belarus", "BY" ], + [ "China", "CN" ], + [ "United States", "US" ] + ] +}); + +new Awesomplete('input[type="email"]', { + list: ["aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "googlemail.com", "google.com", "hotmail.com", "hotmail.co.uk", "mac.com", "me.com", "mail.com", "msn.com", "live.com", "sbcglobal.net", "verizon.net", "yahoo.com", "yahoo.co.uk"], + data: function (text: string, input: any) { + return input.slice(0, input.indexOf("@")) + "@" + text; + }, + filter: Awesomplete.FILTER_STARTSWITH +}); + +new Awesomplete('input[data-multiple]', { + filter: function(text: string, input: any) { + return Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]); + }, + + replace: function(text: string) { + var before = this.input.value.match(/^.+,\s*|/)[0]; + this.input.value = before + text + ", "; + } +}); + +var ajax = new XMLHttpRequest(); +ajax.open("GET", "https://restcountries.eu/rest/v1/lang/fr", true); +ajax.onload = function() { + var list = JSON.parse(ajax.responseText).map(function(i: any) { return i.name; }); + new Awesomplete(document.querySelector("#ajax-example input"),{ list: list }); +}; +ajax.send(); \ No newline at end of file diff --git a/awesomplete/awesomplete.d.ts b/awesomplete/awesomplete.d.ts new file mode 100644 index 0000000000..d39389f008 --- /dev/null +++ b/awesomplete/awesomplete.d.ts @@ -0,0 +1,49 @@ +// Type definitions for Awesomplete v1.1.0 +// Project: https://leaverou.github.io/awesomplete/ +// Definitions by: webbiesdk , Ben Dixon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Awesomplete { + constructor(input: Element | HTMLElement | string, o?: AwesompleteOptions); + static all: Array; + static $$: (expr: string | NodeSelector, con?: any) => NodeList; + static ITEM: (text: string, input: string) => HTMLElement; + static $: { + (expr: string|Element, con?: NodeSelector): string | Element; + regExpEscape: (s: { replace: (arg0: RegExp, arg1: string) => void }) => any; + create: (tag: string, o: any) => HTMLElement; + fire: (target: EventTarget, type: string, properties: any) => any; + siblingIndex: (el: Element) => number; + }; + static FILTER_STARTSWITH: (text: string, input: string) => boolean; + static FILTER_CONTAINS: (text: string, input: string) => boolean; + static SORT_BYLENGTH: (a: number | any[], b: number | any[]) => number; + static REPLACE: (text: any) => void; + next: () => void; + container: HTMLElement; + select: (selected?: HTMLElement, originalTarget?: HTMLElement) => void; + previous: () => void; + index: number; + opened: number; + list: string | string[] | Element | { label: string, value: any }[] | [string, string][]; + input: HTMLElement | string; + goto: (i: number) => void; + ul: HTMLElement; + close: () => void; + evaluate: () => void; + selected: boolean; + open: () => void; + status: HTMLElement; +} + +interface AwesompleteOptions { + list?: string | string[] | Element | { label: string, value: any }[] | [string, string][]; + minChars?: Number; + maxItems?: Number; + autoFirst?: boolean; + data?: Function; + filter?: Function; + sort?: Function; + item?: Function; + replace?: Function; +} diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts index f562b59d3d..3563000e4c 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/aws-lambda/aws-lambda-tests.ts @@ -2,13 +2,13 @@ import lambda = require('aws-lambda'); -var str: string; -var date: Date; -var anyObj: any; -var num: number; +var str: string = "any string"; +var date: Date = new Date(); +var anyObj: any = { abc: 123 }; +var num: number = 5; var identity: lambda.CognitoIdentity; -var error: Error; -var b: boolean; +var error: Error = new Error(); +var b: boolean = true; var clientCtx: lambda.ClientContext; /* Context */ @@ -37,4 +37,14 @@ function callback(cb: lambda.Callback) { cb(null); cb(error); cb(null, anyObj); -} \ No newline at end of file +} + +/* Compatibility functions */ +context.done(); +context.done(error); +context.done(error, anyObj); +context.succeed(str); +context.succeed(anyObj); +context.succeed(str, anyObj); +context.fail(error); +context.fail(str); \ No newline at end of file diff --git a/aws-lambda/aws-lambda.d.ts b/aws-lambda/aws-lambda.d.ts index c9a66a3783..7b5d5ebbfa 100644 --- a/aws-lambda/aws-lambda.d.ts +++ b/aws-lambda/aws-lambda.d.ts @@ -23,7 +23,9 @@ declare module "aws-lambda" { getRemainingTimeInMillis(): number; // Functions for compatibility with earlier Node.js Runtime v0.10.42 - log(message: string, object: any): void; + // For more details see http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#nodejs-prog-model-oldruntime-context-methods + done(error?: Error, result?: any): void; + fail(error: Error): void; fail(message: string): void; succeed(message: string): void; succeed(object: any): void; diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index 2a92a4bcc4..f484c5fdac 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -22,6 +22,27 @@ declare module "aws-sdk" { constructor(profile: string); } + export module CognitoIdentity { + export interface CognitoIdentityCredentialsParams { + IdentityPoolId?: string; + AccountId?: string; + Logins?: {[k: string]: any}; + + RoleArn?: string; + RoleSessionName?: string; + WebIdentityToken?: string; + ProviderId?: string; + Policy?: string; + DurationSeconds?: number; + + IdentityId?: string; + } + } + + export class CognitoIdentityCredentials extends Credentials { + constructor(params: CognitoIdentity.CognitoIdentityCredentialsParams); + } + export interface Logger { write?: (chunk: any, encoding?: string, callback?: () => void) => void; log?: (...messages: any[]) => void; @@ -361,7 +382,8 @@ declare module "aws-sdk" { endpoint: Endpoint; getObject(params: s3.GetObjectRequest, callback?: (err: Error, data: any) => void): any; - putObject(params: s3.PutObjectRequest, callback: (err: Error, data: any) => void): void; + putObject(params: s3.PutObjectRequest, callback?: (err: Error, data: any) => void): any; + copyObject(params: s3.CopyObjectRequest, callback?: (err: Error, data: any) => void): any; deleteObject(params: s3.DeleteObjectRequest, callback: (err: Error, data: any) => void): void; headObject(params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void; getSignedUrl(operation: string, params: any): string; @@ -506,7 +528,8 @@ declare module "aws-sdk" { interface UpdateParam extends _DDBDC_Writer { Key: _DDBDC_Keys; - AttributeUpdates: { + UpdateExpression?: string; + AttributeUpdates?: { [someKey: string]: { Action: "PUT" | "ADD" | "DELETE"; Value: any @@ -637,7 +660,7 @@ declare module "aws-sdk" { export interface DescribeStackResourcesParams { StackName?: string; // must specify either StackName or PhysicalResourceId - LogicalResourceId?: string; + LogicalResourceId?: string; PhysicalResourceId?: string; // must specify either StackName or PhysicalResourceId } @@ -2241,6 +2264,40 @@ declare module "aws-sdk" { WebsiteRedirectLocation?: string; } + export interface CopyObjectRequest { + Bucket: string; + CopySource: string; + Key: string; + ACL?: string; + CacheControl?: string; + ContentDisposition?: string; + ContentEncoding?: string; + ContentLanguage?: string; + ContentType?: string; + CopySourceIfMatch?: string; + CopySourceIfModifiedSince?: any; + CopySourceIfNoneMatch?: string; + CopySourceIfUnmodifiedSince?: any; + CopySourceSSECustomerAlgorithm?: string; + CopySourceSSECustomerKey?: any; + CopySourceSSECustomerKeyMD5?: string; + Expires?: any; + GrantFullControl?: string; + GrantRead?: string; + GrantReadACP?: string; + GrantWriteACP?: string; + Metadata?: { [key: string]: string; }; + MetadataDirective?: string; + RequestPayer?: string; + SSECustomerAlgorithm?: string; + SSECustomerKey?: any; + SSECustomerKeyMD5?: string; + SSEKMSKeyId?: string; + ServerSideEncryption?: string; + StorageClass?: string; + WebsiteRedirectLocation?: string; + } + export interface GetObjectRequest { Bucket: string; IfMatch?: string; diff --git a/aws-serverless-express/aws-serverless-express-tests.ts b/aws-serverless-express/aws-serverless-express-tests.ts new file mode 100644 index 0000000000..6a0d7694d9 --- /dev/null +++ b/aws-serverless-express/aws-serverless-express-tests.ts @@ -0,0 +1,29 @@ +/// +/// + +import * as awsServerlessExpress from 'aws-serverless-express'; +import * as express from 'express'; + +const app = express(); +const server = awsServerlessExpress.createServer(app, () => {}); + +const mockEvent = { + key: 'value' +}; + +const mockContext = { + callbackWaitsForEmptyEventLoop: true, + functionName: 'testFunction', + functionVersion: '1', + invokedFunctionArn: 'arn', + memoryLimitInMB: 128, + awsRequestId: 'id', + logGroupName: 'group', + logStreamName: 'stream', + getRemainingTimeInMillis: () => 2000, + done: () => false, + fail: (error: any) => false, + succeed: (message: string) => false +}; + +awsServerlessExpress.proxy(server, mockEvent, mockContext); diff --git a/aws-serverless-express/aws-serverless-express.d.ts b/aws-serverless-express/aws-serverless-express.d.ts new file mode 100644 index 0000000000..50aa0e1a0b --- /dev/null +++ b/aws-serverless-express/aws-serverless-express.d.ts @@ -0,0 +1,24 @@ +// Type definitions for aws-serverless-express +// Project: https://github.com/awslabs/aws-serverless-express +// Definitions by: Ben Speakman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module 'aws-serverless-express' { + + import * as http from 'http'; + import * as lambda from 'aws-lambda'; + + export function createServer( + requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => http.Server, + serverListenCallback?: () => any + ): http.Server; + + export function proxy( + server: http.Server, + event: any, + context: lambda.Context + ): void; +} diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index 50e2388624..f3d5930a2f 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -69,6 +69,10 @@ axios.post("http://example.com/", { ] }); +var config: Axios.AxiosXHRConfigBase = {headers: {}}; +config.headers['X-Custom-Header'] = 'baz'; +axios.post("http://example.com/", config); + var getRepoIssue = axios.get("https://api.github.com/repos/mzabriskie/axios/issues/1"); var axiosInstance = axios.create({ diff --git a/axios/axios.d.ts b/axios/axios.d.ts index 9c4705d093..a2c5bfbd45 100644 --- a/axios/axios.d.ts +++ b/axios/axios.d.ts @@ -39,7 +39,7 @@ declare namespace Axios { /** * custom headers to be sent */ - headers?: Object; + headers?: {[key: string]: any}; /** * URL parameters to be sent with the request diff --git a/babel-traverse/babel-traverse.d.ts b/babel-traverse/babel-traverse.d.ts index 17cbda2f23..6970c39f6f 100644 --- a/babel-traverse/babel-traverse.d.ts +++ b/babel-traverse/babel-traverse.d.ts @@ -346,7 +346,7 @@ declare module "babel-traverse" { getData(key: string, def?: any): any; - buildCodeFrameError(msg: string, Error: Error): Error; + buildCodeFrameError(msg: string, Error?: new (msg: string) => TError): TError; traverse(visitor: Visitor, state?: any): void; diff --git a/babyparse/babyparse-tests.ts b/babyparse/babyparse-tests.ts index 29d2d22891..186351ccd5 100644 --- a/babyparse/babyparse-tests.ts +++ b/babyparse/babyparse-tests.ts @@ -329,32 +329,32 @@ var CORE_PARSER_TESTS: ParserTest[] = [ } }, // { - // description: "Comment with non-default character", - // input: 'a,b,c\n!Comment goes here\nd,e,f', - // config: { comments: '!' }, - // expected: { - // data: [['a', 'b', 'c'], ['d', 'e', 'f']], - // errors: [] - // } + // description: "Comment with non-default character", + // input: 'a,b,c\n!Comment goes here\nd,e,f', + // config: { comments: '!' }, + // expected: { + // data: [['a', 'b', 'c'], ['d', 'e', 'f']], + // errors: [] + // } // }, // { - // description: "Bad comments value specified", - // notes: "Should silently disable comment parsing", - // input: 'a,b,c\n5comment\nd,e,f', - // config: { comments: 5 }, - // expected: { - // data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']], - // errors: [] - // } + // description: "Bad comments value specified", + // notes: "Should silently disable comment parsing", + // input: 'a,b,c\n5comment\nd,e,f', + // config: { comments: 5 }, + // expected: { + // data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']], + // errors: [] + // } // }, // { - // description: "Multi-character comment string", - // input: 'a,b,c\n=N(Comment)\nd,e,f', - // config: { comments: "=N(" }, - // expected: { - // data: [['a', 'b', 'c'], ['d', 'e', 'f']], - // errors: [] - // } + // description: "Multi-character comment string", + // input: 'a,b,c\n=N(Comment)\nd,e,f', + // config: { comments: "=N(" }, + // expected: { + // data: [['a', 'b', 'c'], ['d', 'e', 'f']], + // errors: [] + // } // }, { description: "Input with only a commented line", @@ -419,13 +419,13 @@ var CORE_PARSER_TESTS: ParserTest[] = [ } }, // { - // description: "Fast mode with comments", - // input: '// Commented line\na,b,c', - // config: { fastMode: true, comments: "//" }, - // expected: { - // data: [['a', 'b', 'c']], - // errors: [] - // } + // description: "Fast mode with comments", + // input: '// Commented line\na,b,c', + // config: { fastMode: true, comments: "//" }, + // expected: { + // data: [['a', 'b', 'c']], + // errors: [] + // } // }, { description: "Fast mode with preview", @@ -1091,7 +1091,7 @@ function compare(actualData: any[], actualErrors: any[], expected: ParserTestExp } } - if (passed) // final check will catch any other differences + if (passed) // final check will catch any other differences passed = JSON.stringify(actual) == JSON.stringify(expected); // We pass back an object right now, even though it only contains @@ -1228,3 +1228,11 @@ var parser = new Baby.Parser({}) parser.getCharIndex(); parser.abort(); parser.parse(""); + +/** + * Parse Files + */ +Baby.parseFiles('example.csv') +Baby.parseFiles('example.csv', {encoding: 'utf-8'}) +Baby.parseFiles(['example1.csv', 'example2.txt']) +Baby.parseFiles(['example1.csv', 'example2.txt'], {encoding: 'utf-8'}) \ No newline at end of file diff --git a/babyparse/babyparse.d.ts b/babyparse/babyparse.d.ts index 6e8df86c3e..5fd9856ebc 100644 --- a/babyparse/babyparse.d.ts +++ b/babyparse/babyparse.d.ts @@ -9,6 +9,11 @@ declare namespace BabyParse { * Parse a csv string or a csv file */ parse(csvString: string, config?: ParseConfig): ParseResult; + + /** + * Parse single file or multiple files + */ + parseFiles(input: string | string[] | FileObject | FileObject[], config?: ParseConfig): ParseResult; /** * Unparses javascript data objects and returns a csv string @@ -86,6 +91,11 @@ declare namespace BabyParse { data: string | Array; } + interface FileObject { + file: string + config?: ParseConfig + } + interface ParseError { type: string; // A generalization of the error code: string; // Standardized error code diff --git a/bases/bases-tests.ts b/bases/bases-tests.ts new file mode 100644 index 0000000000..5414b18764 --- /dev/null +++ b/bases/bases-tests.ts @@ -0,0 +1,10 @@ +/// +import * as bases from 'bases'; + +let bs16String: string = bases.toBase(200, 16); // => 'c8' +let bs62String: string = bases.toBase(99999, 62); // => 'q0T' +let customBaseString: string = bases.toAlphabet(300, 'aAbBcC'); // => 'Abba' + +let frombs16Int: number = bases.fromBase('c8', 16); // => 200 +let frombs62Int: number = bases.fromBase('q0T', 62); // => 99999 +let customBaseInt: number = bases.fromAlphabet('Abba', 'aAbBcC'); // => 300 diff --git a/bases/bases.d.ts b/bases/bases.d.ts new file mode 100644 index 0000000000..2e62cf685a --- /dev/null +++ b/bases/bases.d.ts @@ -0,0 +1,22 @@ +// Type definitions for bases 0.2.1 +// Project: https://github.com/aseemk/bases.js +// Definitions by: Hari Krishna +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "bases" { + export function toAlphabet(num: number, alphabet: string): string; + + export function fromAlphabet(str: string, alphabet: string): number; + + export function toBase(num: number, base: number): string; + + export function fromBase(str: string, base:number): number; + + export let KNOWN_ALPHABETS: any; + + export let NUMERALS: string; + + export let LETTERS_LOWERCASE: string; + + export let LETTERS_UPPERCASE: string; +} diff --git a/bit-array/bit-array-tests.ts b/bit-array/bit-array-tests.ts new file mode 100644 index 0000000000..20310b2208 --- /dev/null +++ b/bit-array/bit-array-tests.ts @@ -0,0 +1,10 @@ +/// + +import BitArray = require("bit-array"); + +const a = new BitArray(32); +a.set(0, true); +a.set(31, true); +a.toString(); // "10000000000000000000000000000001" +a.get(1); // false +a.get(31); // true \ No newline at end of file diff --git a/bit-array/bit-array-tests.ts.tscparams b/bit-array/bit-array-tests.ts.tscparams new file mode 100644 index 0000000000..85542607d1 --- /dev/null +++ b/bit-array/bit-array-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs diff --git a/bit-array/bit-array.d.ts b/bit-array/bit-array.d.ts new file mode 100644 index 0000000000..bab3d98a46 --- /dev/null +++ b/bit-array/bit-array.d.ts @@ -0,0 +1,105 @@ +// Type definitions for bit-array v0.2.2 +// Project: https://github.com/bramstein/bit-array +// Definitions by: Mudkip +// Definitions: https://github.com/mudkipme/DefinitelyTyped + +declare module "bit-array" { + + class BitArray { + /** + * Creates a new empty BitArray with the given length or initialises the BitArray with the given hex representation. + */ + constructor(size: number, hex?: string); + + /** + * Returns the total number of bits in this BitArray. + */ + size(): number; + + /** + * Sets the bit at index to a value (boolean.) + */ + set(index: number, value: boolean): BitArray; + + /** + * Toggles the bit at index. If the bit is on, it is turned off. Likewise, if the bit is off it is turned on. + */ + toggle(index: number): BitArray; + + /** + * Returns the value of the bit at index (boolean.) + */ + get(index: number): boolean; + + /** + * Resets the BitArray so that it is empty and can be re-used. + */ + reset(): BitArray; + + /** + * Returns a copy of this BitArray. + */ + copy(): BitArray; + + /** + * Returns true if this BitArray equals another. Two BitArrays are considered + * equal if both have the same length and bit pattern. + */ + equals(x: BitArray): boolean; + + /** + * Returns the JSON representation of this BitArray. + */ + toJSON(): string; + + /** + * Returns a string representation of the BitArray with bits + * in mathemetical order. + */ + toBinaryString(): string; + + /** + * Returns a hexadecimal string representation of the BitArray + * with bits in logical order. + */ + toHexString(): string; + + /** + * Returns a string representation of the BitArray with bits + * in logical order. + */ + toString(): string; + + /** + * Convert the BitArray to an Array of boolean values (slow). + */ + toArray(): boolean[]; + + /** + * Returns the total number of bits set to one in this BitArray. + */ + count(): number; + + /** + * Inverts this BitArray. + */ + not(): BitArray; + + /** + * Bitwise OR on the values of this BitArray using BitArray x. + */ + or(x: BitArray): BitArray; + + /** + * Bitwise AND on the values of this BitArray using BitArray x. + */ + and(x: BitArray): BitArray; + + /** + * Bitwise XOR on the values of this BitArray using BitArray x. + */ + xor(x: BitArray): BitArray; + } + + export = BitArray; +} \ No newline at end of file diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index d7995438c1..318e6f8a4c 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -338,6 +338,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/bluebird.d.ts b/bluebird/bluebird.d.ts index 35b506542a..ca8acb2446 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -71,14 +71,19 @@ class Bluebird implements Bluebird.Thenable, Bluebird.Inspection { */ catch(predicate: (error: any) => 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; @@ -317,6 +322,13 @@ class Bluebird implements Bluebird.Thenable, Bluebird.Inspection { */ cancel(): void; + /** + * Basically sugar for doing: somePromise.catch(function(){}); + * + * Which is needed in case error handlers are attached asynchronously to the promise later, which would otherwise result in premature unhandled rejection reporting. + */ + suppressUnhandledRejections(): void; + /** * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. * diff --git a/bonjour/bonjour-tests.ts b/bonjour/bonjour-tests.ts new file mode 100644 index 0000000000..b97794b071 --- /dev/null +++ b/bonjour/bonjour-tests.ts @@ -0,0 +1,21 @@ +/// +import * as bonjour from 'bonjour'; + +var bonjourOptions: bonjour.BonjourOptions; +var bonjourInstance: bonjour.Bonjour; + +var serviceOptions: bonjour.ServiceOptions; +var service: bonjour.Service; + +var browserOptions: bonjour.BrowserOptions; +var browser: bonjour.Browser; + +bonjourOptions = { interface: '192.168.1.1', port: 5353 }; +bonjourInstance = new bonjour.Bonjour(bonjourOptions); + +serviceOptions = { name: 'My Web Server', type: 'http', port: 3000 }; +service = bonjourInstance.publish(serviceOptions); + +browserOptions = { protocol: 'tcp', type: 'http' }; +browser = bonjour.find(browserOptions); + diff --git a/bonjour/bonjour.d.ts b/bonjour/bonjour.d.ts new file mode 100644 index 0000000000..0ffd9f1171 --- /dev/null +++ b/bonjour/bonjour.d.ts @@ -0,0 +1,71 @@ +// Type definitions for bonjour v3.5.0 +// Project: https://github.com/watson/bonjour +// Definitions by: Quentin Lampin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "bonjour" { + export interface BonjourOptions { + multicast?: boolean; + interface?: string; + port?: number; + ip?: string; + ttl?: number; + loopback?: boolean; + reuseAddr?: boolean; + } + + export interface BrowserOptions { + type?: string; + subtypes?: string[]; + protocol?: string; + txt?: Object; + } + + export interface ServiceOptions { + name: string; + host?: string; + port: number; + type: string; + subtypes?: string[]; + protocol?: 'udp'|'tcp'; + txt?: Object; + } + + export interface Service { + name: string; + type: string; + subtypes: string[]; + protocol: string; + host: string; + port: number; + fqdn: string; + rawTxt: Object; + txt: Object; + published: boolean; + + stop: (cb: ()=>any) => void; + start: () => void; + } + + export class Bonjour { + + constructor(opts: BonjourOptions); + publish(options: ServiceOptions):Service; + unpublishAll(cb: ()=>any): void; + find(options:BrowserOptions, onUp: ()=>any): Browser; + findOne(options:any, cb: (service: Service)=>any): Browser; + destroy():void; + } + + export class Browser { + services: Service[]; + + start():void; + update():void; + stop():void; + } + + export function find(options: BrowserOptions, onUp?: ()=>any): Browser; + export function findOne(options: BrowserOptions): Browser; + +} diff --git a/bookshelf/bookshelf-tests.ts b/bookshelf/bookshelf-tests.ts index 5d6080b99a..818ea25f35 100644 --- a/bookshelf/bookshelf-tests.ts +++ b/bookshelf/bookshelf-tests.ts @@ -71,6 +71,12 @@ class Tag extends bookshelf.Model { get tableName() { return 'tags'; } } +User.where('id', 1).fetch({withRelated: ['posts.tags']}).then(function(user) { + console.log(user.related('posts').toJSON()); +}).catch(function(err) { + console.error(err); +}); + new User().where('id', 1).fetch({withRelated: ['posts.tags']}) .then(user => { const posts = user.related('posts'); diff --git a/bookshelf/bookshelf.d.ts b/bookshelf/bookshelf.d.ts index 34f58d62ed..ec340679e7 100644 --- a/bookshelf/bookshelf.d.ts +++ b/bookshelf/bookshelf.d.ts @@ -93,6 +93,8 @@ declare module 'bookshelf' { static fetchAll>() : Promise>; /** @deprecated should use `new` objects instead. */ static forge(attributes? : any, options? : ModelOptions) : T; + static where(properties: { [key: string]: any }): T; + static where(key: string, operatorOrValue: string | number | boolean, valueIfOperator?: string | number | boolean): T; belongsTo>(target : {new(...args : any[]) : R}, foreignKey? : string) : R; belongsToMany>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection; diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index c94b60625f..7ef20b38e7 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -40,6 +40,7 @@ interface BootboxConfirmOptions extends BootboxDialogOptions { interface BootboxPromptOptions extends BootboxBaseOptions { title: string; value?: string; + inputType?: string; callback: (result: string) => any; buttons?: BootboxConfirmPromptButtonMap; } diff --git a/bootstrap-datepicker/bootstrap-datepicker.d.ts b/bootstrap-datepicker/bootstrap-datepicker.d.ts index 1a2bb2124b..007f812c03 100644 --- a/bootstrap-datepicker/bootstrap-datepicker.d.ts +++ b/bootstrap-datepicker/bootstrap-datepicker.d.ts @@ -36,6 +36,7 @@ interface DatepickerOptions { multidateSeparator?: string; orientation?: string; assumeNearbyYear?: any; + viewMode?: string; } interface DatepickerCustomFormatOptions { diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index acdb83b9fd..77d249694e 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -36,7 +36,10 @@ interface NotifySettings { from?: string; align?: string; }; - offset?: number; + offset?: number | { + x?: number; + y?: number; + }; spacing?: number; z_index?: number; delay?: number; @@ -59,4 +62,4 @@ interface NotifyReturn { $ele: JQueryStatic; close: () => void; update: (command: string, update: any) => void; -} \ No newline at end of file +} diff --git a/bootstrap-select/bootstrap-select-tests.ts b/bootstrap-select/bootstrap-select-tests.ts new file mode 100644 index 0000000000..9758b1c9ed --- /dev/null +++ b/bootstrap-select/bootstrap-select-tests.ts @@ -0,0 +1,43 @@ +// Bootstrap Select Test +// ================================================================================ +/// +/// + +$(".selectpicker").selectpicker({ + actionsBox: true, + container: "body", + countSelectedText: "counts > #", + deselectAllText: "test", + dropdownAlignRight: true, + dropupAuto: true, + header: "test", + hideDisabled: true, + iconBase: "fa", + liveSearch: true, + liveSearchNormalize: true, + liveSearchPlaceholder: "test", + liveSearchStyle: "contains", + maxOptions: 10, + maxOptionsText: "test", + mobile: true, + multipleSeparator: ", ", + noneSelectedText: "test", + selectAllText: "test", + selectedTextFormat: "values", + selectOnTab: true, + showContent: true, + showIcon: true, + showSubtext: true, + showTick: true, + size: "auto", + style: "test", + tickIcon: "test", + title: "test", + width: "auto" +}) + +$(".selectpicker").selectpicker("val", "foo") +$(".selectpicker").selectpicker("val", ["foo", "bar"]) +$(".selectpicker").selectpicker("selectAll") +$(".selectpicker").selectpicker("setStyle", "btn-large", "add") + diff --git a/bootstrap-select/bootstrap-select.d.ts b/bootstrap-select/bootstrap-select.d.ts new file mode 100644 index 0000000000..9f1436a624 --- /dev/null +++ b/bootstrap-select/bootstrap-select.d.ts @@ -0,0 +1,44 @@ +// Type definitions for bootstrap-select v1.11.2 +// Project: https://silviomoreto.github.io/bootstrap-select/ +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface BootstrapSelectOptions { + actionsBox?: boolean + container?: string | boolean + countSelectedText?: string | Function + deselectAllText?: string + dropdownAlignRight?: string | boolean + dropupAuto?: boolean + header?: string + hideDisabled?: boolean + iconBase?: string + liveSearch?: boolean + liveSearchNormalize?: boolean + liveSearchPlaceholder?: string + liveSearchStyle?: string + maxOptions?: number | boolean + maxOptionsText?: string | Array | Function + mobile?: boolean + multipleSeparator?: string + noneSelectedText?: string + selectAllText?: string + selectedTextFormat?: string + selectOnTab?: boolean + showContent?: boolean + showIcon?: boolean + showSubtext?: boolean + showTick?: boolean + size?: string | number | boolean + style?: string + tickIcon?: string + title?: string + width?: string | boolean +} + +interface JQuery { + selectpicker(opts?: BootstrapSelectOptions): void + selectpicker(method: string, ...args: Array>): void +} diff --git a/bootstrap-table/bootstrap-table.d.ts b/bootstrap-table/bootstrap-table.d.ts new file mode 100644 index 0000000000..d0356dff84 --- /dev/null +++ b/bootstrap-table/bootstrap-table.d.ts @@ -0,0 +1,12 @@ +// Type definitions for Bootstrap Table v1.11.0 +// Project: http://bootstrap-table.wenzhixin.net.cn/ +// Definitions by: Talat Baig +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface JQuery { + bootstrapTable(options?: any): JQuery; +} + +declare var bootstrapTable: JQueryStatic; diff --git a/braintree-web/braintree-web-tests.ts b/braintree-web/braintree-web-tests.ts index 40b34df418..20fd0219f1 100644 --- a/braintree-web/braintree-web-tests.ts +++ b/braintree-web/braintree-web-tests.ts @@ -50,10 +50,18 @@ braintree.client.create({ selector: '#card-number' }, cvv: { - selector: '#cvv' + selector: '#cvv', + type: 'password' }, - expirationDate: { - selector: '#expiration-date' + expirationMonth: { + selector: '#expiration-month', + select: { + options: ["01 - Jan", "02 - Feb", "03 - Mar", "04 - Apr", "05 - May", "06 - Jun", "07 - Jul", "08 - Aug", "09 - Sep", "10 - Oct", "11 - Nov", "12 - Dec"] + } + }, + expirationYear: { + selector: '#expiration-year', + select: true } } }, function (hostedFieldsErr?: BraintreeError, hostedFieldsInstance?: any) { diff --git a/braintree-web/braintree-web.d.ts b/braintree-web/braintree-web.d.ts index 2cf2d89467..e58cf7455b 100644 --- a/braintree-web/braintree-web.d.ts +++ b/braintree-web/braintree-web.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Braintree-web v3.0.2 +// Type definitions for Braintree-web v3.5.0 // Project: https://github.com/braintree/braintree-web // Definitions by: Guy Shahine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -540,12 +540,17 @@ declare namespace BraintreeWeb { * @typedef {object} field * @property {string} selector A CSS selector to find the container where the hosted field will be inserted. * @property {string} [placeholder] Will be used as the `placeholder` attribute of the input. If `placeholder` is not natively supported by the browser, it will be polyfilled. - * @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field. Note: Input formatting does not work properly on Android and iOS, so input formatting is automatically disabled on those browsers. + * @property {string} [type] Will be used as the `type` attribute of the input. To mask `cvv` input, for instance, `type: "password"` can be used. + * @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field. + * @property {object|boolean} [select] If truthy, this field becomes a `', + modal: `
+
+
+
+
`, + hide: () => $(this.modal).add(this.overlay).fadeOut(100), + show: () => $(this.modal).add(this.overlay).fadeIn(100) + }); + + $.alertable.confirm('You sure?', { + container: 'body' + }); + + $.alertable.prompt('How many?', { + container: 'body' + }); + + $.alertable.defaults.container = 'body'; +} diff --git a/jquery-alertable/jquery-alertable.d.ts b/jquery-alertable/jquery-alertable.d.ts new file mode 100644 index 0000000000..93e219ef18 --- /dev/null +++ b/jquery-alertable/jquery-alertable.d.ts @@ -0,0 +1,29 @@ +// Type definitions for jquery-alertable 1.0.2 +// Project: https://github.com/claviska/jquery-alertable +// Definitions by: Steven Robertson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface JQueryStatic { + alertable: Alertable; +} + +interface Alertable { + alert(message: string, options?: AlertableOptions): JQueryPromise; + confirm(message: string, options?: AlertableOptions): JQueryPromise; + prompt(message: string, options?: AlertableOptions): JQueryPromise; + defaults: AlertableOptions; +} + +interface AlertableOptions { + container?: string; + html?: boolean; + cancelButton?: string; + okButton?: string; + overlay?: string; + prompt?: string; + modal?: string; + hide?: Function; + show?: Function; +} diff --git a/jquery-handsontable/jquery-handsontable.d.ts b/jquery-handsontable/jquery-handsontable.d.ts index 14a6ab1b67..fa979f27f6 100644 --- a/jquery-handsontable/jquery-handsontable.d.ts +++ b/jquery-handsontable/jquery-handsontable.d.ts @@ -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-mockjax/jquery-mockjax-tests.ts b/jquery-mockjax/jquery-mockjax-tests.ts index 36ebd7e64c..85d2fe85b8 100644 --- a/jquery-mockjax/jquery-mockjax-tests.ts +++ b/jquery-mockjax/jquery-mockjax-tests.ts @@ -1,6 +1,6 @@ /// /// -/// +/// class Tests { private _noErrorCallbackExpected: (jqXHR: JQueryXHR, textStatus: string, errorThrown: string) => any; diff --git a/jquery.bbq/jquery.bbq-tests.ts b/jquery.bbq/jquery.bbq-tests.ts index 77eb35b373..9522d6df9a 100644 --- a/jquery.bbq/jquery.bbq-tests.ts +++ b/jquery.bbq/jquery.bbq-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// diff --git a/jquery.colorbox/jquery.colorbox.d.ts b/jquery.colorbox/jquery.colorbox.d.ts index 5437c0bf18..a9e7f8c3e9 100644 --- a/jquery.colorbox/jquery.colorbox.d.ts +++ b/jquery.colorbox/jquery.colorbox.d.ts @@ -6,10 +6,10 @@ /// interface ColorboxResizeSettings { - height?: number; - innerHeight?: number; - width?: number; - innerWidth?: number; + height?: number | string; + innerHeight?: number | string; + width?: number | string; + innerWidth?: number | string; } interface ColorboxSettings { @@ -140,35 +140,35 @@ interface ColorboxSettings { /** * Set a fixed total width. This includes borders and buttons. Example: "100%", "500px", or 500 */ - width?: any; + width?: number | string; /** * Set a fixed total height. This includes borders and buttons. Example: "100%", "500px", or 500 */ - height?: any; + height?: number | string; /** * This is an alternative to 'width' used to set a fixed inner width. This excludes borders and buttons. Example: "50%", "500px", or 500 */ - innerWidth?: any; + innerWidth?: number | string; /** * This is an alternative to 'height' used to set a fixed inner height. This excludes borders and buttons. Example: "50%", "500px", or 500 */ - innerHeight?: any; + innerHeight?: number | string; /** * Set the initial width, prior to any content being loaded. */ - initialWidth?: number; + initialWidth?: number | string; /** * Set the initial height, prior to any content being loaded. */ - initialHeight?: number; + initialHeight?: number | string; /** * Set a maximum width for loaded content. Example: "100%", 500, "500px" */ - maxWidth?: any; + maxWidth?: number | string; /** * Set a maximum height for loaded content. Example: "100%", 500, "500px" */ - maxHeight?: any; + maxHeight?: number | string; /** * If true, adds an automatic slideshow to a content group / gallery. */ @@ -266,15 +266,15 @@ interface ColorboxStatic { */ close(): void; /** - * This method is used to fetch the current HTML element that Colorbox is associated with. + * This method is used to fetch the current HTML element that Colorbox is associated with. */ element(): JQuery; /** - * This allows Colorbox to be resized based on it's own auto-calculations, or to a specific size. This must be called manually after Colorbox's content has loaded. + * This allows Colorbox to be resized based on it's own auto-calculations, or to a specific size. This must be called manually after Colorbox's content has loaded. */ resize(): void; /** - * This allows Colorbox to be resized based on it's own auto-calculations, or to a specific size. This must be called manually after Colorbox's content has loaded. + * This allows Colorbox to be resized based on it's own auto-calculations, or to a specific size. This must be called manually after Colorbox's content has loaded. */ resize(settings: ColorboxResizeSettings): void; /** diff --git a/jquery.colorpicker/jquery.colorpicker.d.ts b/jquery.colorpicker/jquery.colorpicker.d.ts index 0f904b8c1c..22a9dac449 100644 --- a/jquery.colorpicker/jquery.colorpicker.d.ts +++ b/jquery.colorpicker/jquery.colorpicker.d.ts @@ -8,12 +8,12 @@ interface JQueryColorpickerOptions { // Events // TODO: Figure out actual types. - cancel: Function, - close: Function, - init: Function, - select: Function, - ok: Function, - open: Function, + cancel?: Function, + close?: Function, + init?: Function, + select?: Function, + ok?: Function, + open?: Function, alpha?: boolean; altAlpha?: boolean; @@ -32,6 +32,8 @@ interface JQueryColorpickerOptions { colorFormat?: string; draggable?: boolean; duration?: string; + format?: string; + horizontal?: boolean; hsv?: boolean; inline?: boolean; inlineFrame?: boolean; diff --git a/jquery.dataTables/jquery.dataTables-tests.ts b/jquery.dataTables/jquery.dataTables-tests.ts index 6329861604..b8234b69fa 100644 --- a/jquery.dataTables/jquery.dataTables-tests.ts +++ b/jquery.dataTables/jquery.dataTables-tests.ts @@ -147,7 +147,7 @@ $(document).ready(function () { var infoCallbackFunc: DataTables.FunctionInfoCallback = function (settings, start, end, total, pre) { }; var initCallbackFunc: DataTables.FunctionInitComplete = function (settings, json) { }; var preDrawFunc: DataTables.FunctionPreDrawCallback = function (settings) { }; - var rowCallbackFunc: DataTables.FunctionRowCallback = function (row, data) { }; + var rowCallbackFunc: DataTables.FunctionRowCallback = function (row, data, index) { }; var stateLoadCallbackFunc: DataTables.FunctionStateLoadCallback = function (settings) { }; var stateLoadedCallbackFunc: DataTables.FunctionStateLoaded = function (settings, data) { }; var stateSaveCallbackFunc: DataTables.FunctionStateSaveCallback = function (settings, data) { }; @@ -219,6 +219,7 @@ $(document).ready(function () { pagingType: "simple", retrieve: true, renderer: "bootstrap", + rowId: "custId", scrollCollapse: true, search: true, searchCols: [{ "search": "", "smart": true, "regex": false, "caseInsensitive": true }], @@ -261,7 +262,7 @@ $(document).ready(function () { { ajax: { data: ajaxDataFunc, - dataSrc: function (data) { }, + dataSrc: function (data: any) { }, }, }; @@ -305,12 +306,16 @@ $(document).ready(function () { destroy = dt.destroy(true); destroy.$(""); - var draw = dt.draw(); + var draw: DataTables.DataTable = dt.draw(); draw = dt.draw(true); + draw = dt.draw("page"); draw.$(""); var initSettings = dt.init(); + var i18n: string = dt.i18n('buttons.copy', 'Copy to clipboard'); + i18n = dt.i18n('select.rows', { _: '%d rows selected', 1: '1 row selected' }, 0); + var off = dt.off("event"); off = dt.off("event", function () { }); off.$(""); @@ -340,7 +345,8 @@ $(document).ready(function () { "end": 20, "length": 10, "recordsTotal": 57, - "recordsDisplay": 57 + "recordsDisplay": 57, + "serverSide": false }; var page_len_get = dt.page.len(); @@ -398,7 +404,7 @@ $(document).ready(function () { .cache('search') .sort() .unique() - .each(function (d) { + .each(function (d: any) { select.append($('')); }); @@ -517,7 +523,7 @@ $(document).ready(function () { columns = dt.columns("selector", modifier); var columns_cache = columns.cache("order"); - dt.columns('.select-filter').eq(0).each(function (colIdx) { + dt.columns('.select-filter').eq(0).each(function (colIdx: any) { // Create the select list and search operation var select = $('') .appendTo( @@ -704,7 +710,7 @@ $(document).ready(function () { .cache('search') .sort() .unique() - .each(function (d) { + .each(function (d: any) { select.append($('')); }); }); @@ -748,6 +754,8 @@ $(document).ready(function () { var row_19 = dt.row("selector").index(); var row_20 = dt.row("selector").node(); var row_21 = dt.row("selector").remove(); + var row_22: string = dt.row("selector").id(); + var row_23: string = dt.row("selector").id(false); var rows_1 = dt.rows(); var rows_2 = dt.rows().remove(); @@ -764,6 +772,8 @@ $(document).ready(function () { var rows_13 = dt.rows.add([{}, {}]); dt.rows().every(function () { }); dt.rows().every(function (rowIdx, tableLoop, rowLoop) { }); + var rows_14: DataTables.DataTable = dt.rows("selector").ids(); + var rows_15: DataTables.DataTable = dt.rows("selector").ids(false); var table3 = $('#example').DataTable(); table3.row.add({ @@ -828,7 +838,7 @@ $(document).ready(function () { ]) .show(); - dt.rows().eq(0).each(function (rowIdx) { + dt.rows().eq(0).each(function (rowIdx: any) { dt .row(rowIdx) .child( @@ -878,6 +888,20 @@ $(document).ready(function () { //#endregion "Methods-Row" + //#region "Methods-Static" + + // Variable is a stand-in for $.fn.dataTable. See extension of JQueryStatic at the top of jquery.dataTables.d.ts. + var staticFn: DataTables.StaticFunctions; + + // With boolean parameter type, always returns DataTables.DataTable[]. + var static_1: DataTables.DataTable[] = staticFn.tables(true); + // With object parameter type, returns DataTables.DataTable[] when "api" property is false. + static_1 = staticFn.tables({ "visible": true, "api": false }); + // With object parameter type, returns DataTables.DataTable when "api" property is true. + var static_2: DataTables.DataTable = staticFn.tables({ "visible": true, "api": true }); + + //#endregion "Methods-Static" + //#region "Methods-Table" var tables = dt.tables(); @@ -901,5 +925,8 @@ $(document).ready(function () { //#region "Methods-Util" + var util_1: boolean = dt.any(); + var util_2: number = dt.count(); + //#endregion "Methods-Util" }); diff --git a/jquery.dataTables/jquery.dataTables.d.ts b/jquery.dataTables/jquery.dataTables.d.ts index 459676f87d..13d14bd64b 100644 --- a/jquery.dataTables/jquery.dataTables.d.ts +++ b/jquery.dataTables/jquery.dataTables.d.ts @@ -1,4 +1,4 @@ -// Type definitions for JQuery DataTables 1.10.6 +// 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 @@ -182,11 +182,22 @@ declare namespace DataTables { destroy(remove?: boolean): DataTable; /** - * Redraw the table. + * Redraw the DataTables in the current context, optionally updating ordering, searching and paging as required. * - * @param reset Reset (default) or hold the current paging position. A full re-sort and re-filter is performed when this method is called, which is why the pagination reset is the default action. + * @param paging This parameter is used to determine what kind of draw DataTables will perform. */ - draw(reset?: boolean): DataTable; + draw(paging?: boolean | string): DataTable; + + /* + * Look up a language token that was defined in the DataTables' language initialisation object. + * + * @param token The language token to lookup from the language object. + * @param def The default value to use if the DataTables initialisation has not specified a value. + * @param numeric If handling numeric output, the number to be presented should be given in this parameter. If not numeric operator is required (for example button label text) this parameter is not required. + * + * @returns Resulting internationalised string. + */ + i18n(token: string, def: any | string, numeric?: number): string; /* * Get the initialisation options used for the table. Since: DataTables 1.10.6 @@ -363,6 +374,7 @@ declare namespace DataTables { length: number; recordsTotal: number; recordsDisplay: number; + serverSide: boolean } //#endregion "page-methods" @@ -412,6 +424,11 @@ declare namespace DataTables { //#region "util-methods" interface UtilityMethods { + /* + * Get a boolean value to indicate if there are any entries in the API instance's result set (i.e. any data, selected rows, etc). + */ + any(): boolean; + /** * Concatenate two or more API instances together * @@ -420,6 +437,11 @@ declare namespace DataTables { */ concat(a: Object, ...b: Object[]): DataTable; + /** + * Get the number of entries in an API instance's result set, regardless of multi-table grouping (e.g. any data, selected rows, etc). Since: 1.10.8 + */ + count(): number; + /** * Iterate over the contents of the API result set. * @@ -886,6 +908,22 @@ 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 + * false - Do not modify the id value. + * @returns Row id. If the row does not have an id available 'undefined' will be returned. + */ + id(hash?: boolean): string; /** * Get the row index of the row column. @@ -947,6 +985,15 @@ declare namespace DataTables { */ every(fn: (rowIdx: number, tableLoop: number, rowLoop: number) => void): DataTable; + /** + * Get the ids of the selected rows. Since: 1.10.8 + * + * @param hash true - Append a hash (#) to the start of each row id. This can be useful for then using the ids as selectors + * false - Do not modify the id value. + * @returns Api instance with the selected rows in its result set. If a row does not have an id available 'undefined' will be returned as the value. + */ + ids(hash?: boolean): DataTable; + /** * Get the row indexes of the selected rows. */ @@ -1034,11 +1081,12 @@ declare namespace DataTables { isDataTable(table: string): boolean; /** - * Get all DataTables on the page + * Get all DataTable tables that have been initialised - optionally you can select to get only currently visible tables and / or retrieve the tables as API instances. * - * @param visible Get only visible tables + * @param visible As a boolean value this options is used to indicate if you want all tables on the page should be returned (false), or visible tables only (true). + * Since 1.10.8 this option can also be given as an object. */ - tables(visible?: boolean): DataTables.DataTable[]; + tables(visible?: boolean | ObjectTablesStatic): DataTables.DataTable[] | DataTables.DataTable; /** * Version number compatibility check function @@ -1077,6 +1125,18 @@ declare namespace DataTables { throttle(fn: Function, period?: number): Function; } + interface ObjectTablesStatic { + /** + * Get only visible tables (true) or all tables regardless of visibility (false). + */ + visible: boolean + + /** + * Return a DataTables API instance for the selected tables (true) or an array (false). + */ + api: boolean + } + //#endregion "Static-Methods" //#region "Settings" @@ -1234,7 +1294,7 @@ declare namespace DataTables { pageLength?: number; /** - * Pagination button display options. Basic Types: simple, simple_numbers, full, full_numbers + * Pagination button display options. Basic Types: numbers (1.10.8) simple, simple_numbers, full, full_numbers */ pagingType?: string; @@ -1248,6 +1308,11 @@ declare namespace DataTables { */ renderer?: string | RendererSettings; + /** + * Data property name that DataTables will use to set element DOM IDs. Since: 1.10.8 + */ + rowId?: string; + /** * Allow the table to reduce in height when a limited number of rows are shown. Since: 1.10 */ @@ -1620,7 +1685,7 @@ declare namespace DataTables { } interface FunctionRowCallback { - (row: Node, data: any[] | Object): void; + (row: Node, data: any[] | Object, index: number): void; } interface FunctionStateLoadCallback { @@ -1662,6 +1727,7 @@ declare namespace DataTables { zeroRecords?: string; paginate?: LanguagePaginateSettings; aria?: LanguageAriaSettings; + url?: string; } interface LanguagePaginateSettings { diff --git a/jquery.fileupload/jquery.fileupload.d.ts b/jquery.fileupload/jquery.fileupload.d.ts index 7e46241999..70894ba45e 100644 --- a/jquery.fileupload/jquery.fileupload.d.ts +++ b/jquery.fileupload/jquery.fileupload.d.ts @@ -105,6 +105,9 @@ interface JQueryFileInputOptions { */ redirectParamName?: string; + // The HTTP request method must be "POST" or "PUT" + type?: string, + /** * Set the following option to the location of a postMessage window, * to enable postMessage transport uploads: diff --git a/jquery.flagstrap/jquery.flagstrap-tests.ts b/jquery.flagstrap/jquery.flagstrap-tests.ts new file mode 100644 index 0000000000..d274b3b61d --- /dev/null +++ b/jquery.flagstrap/jquery.flagstrap-tests.ts @@ -0,0 +1,77 @@ +/// +/// + +class TestObject { + +} + +$(function () { + // basic test + // written in according to basic example from documentation + var htmlSelect = '
' + + '
' + + '
' + + '
' + + '
' + + '
'; + $('body').html(htmlSelect); + $('#flagstrap').flagStrap(); + + // for this test we expect more than 30 thousands of characters + console.log('characters count: ' + $('#flagstrap').html().length + '\n' + $('#flagstrap').html()); + + // options test + // options -> data attributes + // written in according to options -> data attributes example from documentation + htmlSelect = '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
'; + $('body').html(htmlSelect); + $('#flagstrap2').flagStrap(); + + console.log('\n\ncharacters count: ' + $('#flagstrap2').html().length + '\n' + $('#flagstrap2').html()); + + // options test + // options -> instance options + // written in according to options -> instance options example from documentation + htmlSelect = '
' + + '
' + + '
' + + '
' + + '
' + + '
'; + $('body').html(htmlSelect); + $('#flagstrap3').flagStrap({ + countries: { + "AU": "Australia", + "GB": "United Kingdom", + "US": "United States" + }, + inputName: 'country', + buttonSize: "btn-lg", + buttonType: "btn-primary", + labelMargin: "20px", + scrollable: false, + scrollableHeight: "350px", + onSelect: function(value: any, element: any) { + // + }, + placeholder: { + value: "", + text: "Please select a country" + } + }); + + console.log('\n\ncharacters count: ' + $('#flagstrap3').html().length + '\n' + $('#flagstrap3').html()); +}) + diff --git a/jquery.flagstrap/jquery.flagstrap.d.ts b/jquery.flagstrap/jquery.flagstrap.d.ts new file mode 100644 index 0000000000..a61db5c48d --- /dev/null +++ b/jquery.flagstrap/jquery.flagstrap.d.ts @@ -0,0 +1,84 @@ +// Type definitions for jQuery Flagstrap Plugin v1.0 +// Project: https://github.com/blazeworx/flagstrap +// Definitions by: Felipe de Sena Garcia +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module jQueryFlagStrap { + interface FlagStrapOptions { + /** + * Default: uniquely generated + * the `name` attribute for the actual `select` input + */ + inputName: string; + /** + * Default: uniquely generated + * the `id` attribute for the actual `select` input + */ + inputId?: string; + /** + * Default: "btn-md" + * The bootstrap button size `class` for this drop down + */ + buttonSize: string; + /** + * Default: "btn-default" + * The bootstrap button type `class` for this drop down + */ + buttonType: string; + /** + * Default: "20px" + * The `margin` between `flag` and `text label` + */ + labelMargin: string; + /** + * Default: false + * Scrollable or full height drop down + */ + scrollable: boolean; + /** + * Default: "250px" + * `max-height` for the scrollable drop down + */ + scrollableHeight?: string; + /** + * Default: (all) + * Only show specific countries + * Example: + * + * {"GB": "United Kingdom", "US": "United States"} + * + * will only show the USA and UK. + */ + countries?: Object; + /** + * Default: {value: "", text: "Please select a country"} + * Set the placeholder value and text. To disable the placeholder define as (boolean) false. + */ + placeholder: boolean | FlagStrapPlaceholderOptions; + /** + * Default: null + * This callback gets called each time the select is changed. It receives two parameters, the new value, and the select element. + */ + onSelect?(value: any, element: any): void; + } + + interface FlagStrapStatic { + flagStrap?: void; + } + + interface FlagStrapPlaceholderOptions { + value: string; + text: string; + } +} + +interface JQuery { + /** + * A lightwieght jQuery plugin for creating Bootstrap 3 compatible country select boxes with flags. + */ + + flagStrap(): void; + flagStrap(options: jQueryFlagStrap.FlagStrapOptions): void; +} \ No newline at end of file diff --git a/jquery.pnotify/jquery.pnotify-tests.ts b/jquery.pnotify/jquery.pnotify-tests.ts index 8704da19f3..d0f2c4475e 100644 --- a/jquery.pnotify/jquery.pnotify-tests.ts +++ b/jquery.pnotify/jquery.pnotify-tests.ts @@ -223,7 +223,7 @@ function test_pnotify() { }); var type = "error"; - var stack_bottomright = {"dir1": "up", "dir2": "left", "firstpos1": 25, "firstpos2": 25}; + var stack_bottomright = { "dir1": "up", "dir2": "left", "firstpos1": 25, "firstpos2": 25 }; var opts = { title: "Over Here", @@ -233,8 +233,8 @@ function test_pnotify() { width: "100%", stack: stack_bottomright, type: "error" + } as PNotifyOptions; - }; new PNotify(opts); new PNotify({ diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index 8daee5da1e..03a1e91c1c 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -4,11 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - -// could not pass the Travis Test if enabled -//type NoticeTypeOptions = "notice" | "info" | "success" | "error"; -//type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; -//type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; +type NoticeTypeOptions = "notice" | "info" | "success" | "error"; +type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; +type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; interface PNotifyStack { dir1?: string; @@ -137,7 +135,7 @@ interface PNotifyOptions { /** * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) */ - styling?: string; + styling?: StylingOptions; /** * Additional classes to be added to the notice. (For custom styling.) */ @@ -182,7 +180,7 @@ interface PNotifyOptions { /** * Type of the notice. "notice", "info", "success", or "error". */ - type?: string; + type?: NoticeTypeOptions; /** * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. */ @@ -263,7 +261,7 @@ interface PNotify { /** * The state can be "initializing", "opening", "open", "closing", and "closed" */ - state?: string; + state?: StateOptions; /** * This function is for updating the notice. diff --git a/jquery.rateit/jquery.rateit-tests.ts b/jquery.rateit/jquery.rateit-tests.ts new file mode 100644 index 0000000000..989d5c5565 --- /dev/null +++ b/jquery.rateit/jquery.rateit-tests.ts @@ -0,0 +1,48 @@ +/// + +var rateit_simple = $('.rateit').rateit(); + +var rateit_properties_font = $('.rateit').rateit({ + backingfld: '#backingfield', + icon: '@', + mode: 'font', + ispreset: false, + max: 5, + min: 0, + readonly: false, + resetable: false, + step: 0.5, + value: 2 +}); + +var rateit_properties_bg = $('.rateit').rateit({ + backingfld: '#backingfield', + mode: 'bg', + ispreset: false, + max: 5, + min: 0, + readonly: false, + resetable: false, + step: 0.5, + value: 2, + starheight: 16, + starwidth: 16 +}); + +//getters +var val : number = rateit_properties_bg.rateit('value'); +var min : number = rateit_properties_bg.rateit('min'); +var max : number = rateit_properties_bg.rateit('max'); +var readonly :boolean = rateit_properties_bg.rateit('readonly'); +var ispreset :boolean = rateit_properties_bg.rateit('ispreset'); + + +//setters +rateit_properties_bg.rateit('value',4); +rateit_properties_bg.rateit('min',0); +rateit_properties_bg.rateit('max',6); +rateit_properties_bg.rateit('readonly',true); +rateit_properties_bg.rateit('ispreset',false); + +//reset it +rateit_properties_bg.rateit('reset'); \ No newline at end of file diff --git a/jquery.rateit/jquery.rateit.d.ts b/jquery.rateit/jquery.rateit.d.ts new file mode 100644 index 0000000000..d5540792b5 --- /dev/null +++ b/jquery.rateit/jquery.rateit.d.ts @@ -0,0 +1,45 @@ +// Type definitions for jquery.rateit.js 1.1.1 +// Project: https://github.com/gjunge/rateit.js +// Definitions by: Gidon Junge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +type RateItMode = "bg" | "font"; +interface RateItOptions { + value? : number; + min?: number; + max?: number; + step?:number; + backingfld?:string; + readonly?:boolean; + ispreset? : boolean; + resetable? : boolean; + starwidth?: number; + starheight?: number; + mode?: RateItMode; + icon?: string; +} + +interface JQuery { + rateit() : JQuery; + rateit(options: RateItOptions) : JQuery; + + rateit(method: 'value') : number; + rateit(method: 'value', param: number) : JQuery; + + rateit(method: 'max') : number; + rateit(method: 'max', param: number) : JQuery; + + rateit(method: 'min') : number; + rateit(method: 'min', param: number) : JQuery; + + rateit(method: 'readonly') : boolean; + rateit(method: 'readonly', param: boolean) : JQuery; + + rateit(method: 'ispreset') : boolean; + rateit(method: 'ispreset', param: boolean) : JQuery; + + rateit(method: 'reset') : JQuery; + + rateit(method: string, param: any) : any; +} diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index d031535184..c5ee51df15 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -209,6 +209,50 @@ function test_ajax() { url: "test.js" }); jqXHR.abort('aborting because I can'); + + //Test the promise exposed by the jqXHR object + + // done method + $.ajax({ + url: "test.js" + }).promise().done((data, textStatus, jqXHR) => { + console.log(data, textStatus, jqXHR); + }); + + // fail method + $.ajax({ + url: "test.js" + }).promise().fail((jqXHR, textStatus, errorThrown) => { + console.log(jqXHR, textStatus, errorThrown); + }); + + // always method with successful request + $.ajax({ + url: "test.js" + }).promise().always((data, textStatus, jqXHR) => { + console.log(data, textStatus, jqXHR); + }); + + // always method with failed request + $.ajax({ + url: "test.js" + }).promise().always((jqXHR, textStatus, errorThrown) => { + console.log(jqXHR, textStatus, errorThrown); + }); + + // then method (as of 1.8) + $.ajax({ + url: "test.js" + }).promise().then((data, textStatus, jqXHR) => { + console.log(data, textStatus, jqXHR); + }, (jqXHR, textStatus, errorThrown) => { + console.log(jqXHR, textStatus, errorThrown); + }); + + // generic then method + var p: JQueryPromise = $.ajax({ url: "test.js" }).promise() + .then(() => "Hello") + .then((x) => x.length); } function test_ajaxComplete() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index b08598cc53..f8af62caba 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -344,6 +344,13 @@ interface JQueryPromise extends JQueryGenericPromise { // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + */ + promise(target?: any): JQueryPromise; } /** diff --git a/js-base64/js-base64.d.ts b/js-base64/js-base64.d.ts index 30fd18620d..bd195e3885 100644 --- a/js-base64/js-base64.d.ts +++ b/js-base64/js-base64.d.ts @@ -19,34 +19,36 @@ add methods: - [ ] noConflict */ -interface Base64 { - /** - * .encode - * @param {String} string - * @return {String} - */ - encode(base64: string): string; - - /** - * .encodeURI - * @param {String} string - * @return {String} - */ - encodeURI(base64: string): string - - /** - * .decode - * @param {String} string - * @return {String} - */ - decode(base64: string): string - - /** - * Library version - */ - VERSION:string -} - declare module 'js-base64' { - const Base64: Base64 -} \ No newline at end of file + namespace JSBase64 { + const Base64: Base64Static + interface Base64Static { + /** + * .encode + * @param {String} string + * @return {String} + */ + encode(base64: string): string; + + /** + * .encodeURI + * @param {String} string + * @return {String} + */ + encodeURI(base64: string): string + + /** + * .decode + * @param {String} string + * @return {String} + */ + decode(base64: string): string + + /** + * Library version + */ + VERSION:string + } + } + export = JSBase64 +} diff --git a/jstimezonedetect/jstimezonedetect-tests.ts b/jstimezonedetect/jstimezonedetect-tests.ts new file mode 100644 index 0000000000..c4907aa6b0 --- /dev/null +++ b/jstimezonedetect/jstimezonedetect-tests.ts @@ -0,0 +1,5 @@ +/// + +import * as jstz from 'jstimezonedetect'; + +jstz.determine().name() === 'America/Montreal'; diff --git a/jstimezonedetect/jstimezonedetect.d.ts b/jstimezonedetect/jstimezonedetect.d.ts new file mode 100644 index 0000000000..9709f52724 --- /dev/null +++ b/jstimezonedetect/jstimezonedetect.d.ts @@ -0,0 +1,16 @@ +// Type definitions for jsTimezoneDetect +// Project: https://bitbucket.org/pellepim/jstimezonedetect +// Definitions by: Olivier Lamothe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface JsTimezoneDetect { + determine: ()=> { + name: ()=> string; + } +} + +declare var jstimezonedetect: JsTimezoneDetect; + +declare module "jstimezonedetect" { + export = jstimezonedetect; +} diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts index a6ea0eb290..11c5bd9af4 100644 --- a/jstree/jstree-tests.ts +++ b/jstree/jstree-tests.ts @@ -99,7 +99,7 @@ var treeWithNewCoreProperties = $('#treeWithNewCoreProperties').jstree({ // tree with new checkbox properties var treeWithNewCheckboxProperties = $('#treeWithNewCheckboxProperties').jstree({ checkbox: { - cascade: true, + cascade: '', tie_selection: true } }); diff --git a/kafka-node/kafka-node.d.ts b/kafka-node/kafka-node.d.ts index 19d9bc3010..a16a8c8b75 100644 --- a/kafka-node/kafka-node.d.ts +++ b/kafka-node/kafka-node.d.ts @@ -9,6 +9,7 @@ declare module 'kafka-node' { export class Client { constructor(connectionString: string, clientId: string, options?: ZKOptions); close(callback?: Function): void; + topicExists(topics: Array, callback: Function): void; } export class Producer { @@ -65,6 +66,8 @@ declare module 'kafka-node' { fetch(payloads: Array, cb: (error: any, data: any) => any): void; commit(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; fetchCommits(groupId: string, payloads: Array, cb: (error: any, data: any) => any): void; + fetchLatestOffsets(topics: Array, cb: (error: any, data: any) => any): void; + on(eventName: string, cb: (error: any) => any): void; } export class KeyedMessage { @@ -99,6 +102,8 @@ declare module 'kafka-node' { export interface Topic { topic: string; offset?: number; + encoding?: string; + autoCommit?: boolean; } export interface OffsetRequest { diff --git a/kefir/kefir-tests.ts b/kefir/kefir-tests.ts index 94300550b4..e706f51159 100644 --- a/kefir/kefir-tests.ts +++ b/kefir/kefir-tests.ts @@ -70,6 +70,19 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke Kefir.sequentially(1000, [1, 2]).log('my stream'); Kefir.sequentially(1000, [1, 2]).offLog('my stream'); Kefir.sequentially(1000, [1, 2]).toPromise().then((x: number) => console.log('fulfilled with:', x)); + Kefir.sequentially(1000, [1, 2]).observe({}); + Kefir.sequentially(1000, [1, 2]).observe({ + value: _ => {}, + error: _ => {}, + end: () => {}, + }); + Kefir.sequentially(1000, [1, 2]).observe(); + const subscription = Kefir.sequentially(1000, [1, 2]).observe( + _ => {}, + _ => {}, + () => {} + ); + if (!subscription.closed) subscription.unsubscribe(); } // Modify an observable diff --git a/kefir/kefir.d.ts b/kefir/kefir.d.ts index e726dba915..d2d32c92d8 100644 --- a/kefir/kefir.d.ts +++ b/kefir/kefir.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kefir 3.2.0 +// Type definitions for Kefir 3.3.0 // Project: http://rpominov.github.io/kefir/ // Definitions by: Aya Morisawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,6 +7,17 @@ declare module "kefir" { + export interface Subscription { + unsubscribe(): void; + closed: boolean; // Actually, `readonly` but it's avaiable in tsc starting with 2.0.0 + } + + export interface Observer { + value?: (value: T) => void; + error?: (error: S) => void; + end?: () => void; + } + export interface Observable { // Subscribe / add side effects onValue(callback: (value: T) => void): void; @@ -22,6 +33,13 @@ declare module "kefir" { flatten(transformer?: (value: T) => U[]): Stream; toPromise(PromiseConstructor?: any): any; toESObservable(): any; + // This method is designed to replace all other methods for subscribing + observe(params: Observer): Subscription; + observe( + onValue?: (value: T) => void, + onError?: (error: S) => void, + onEnd?: () => void + ): Subscription; } export interface Stream extends Observable { diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index e8f02f1776..aeaf311aa7 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kendo UI Professional v2016.1.314 +// Type definitions for Kendo UI Professional v2016.3.1028 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -89,10 +89,40 @@ declare namespace kendo { }; }; - var cultures: { - [culture: string]: { - name?: string; - calendar?: { + var cultures: {[culture: string] : { + name?: string; + calendar?: { + AM: string[]; + PM: string[]; + days: { + names: string[]; + namesAbbr: string[]; + namesShort: string[]; + firstDay: number; + }; + months: { + names: string[]; + namesAbbr: string[]; + }; + patterns: { + D: string; + F: string; + G: string; + M: string; + T: string; + Y: string; + d: string; + g: string; + m: string; + s: string; + t: string; + u: string; + y: string; + }; + twoDigitYearMax: number; + }; + calendars?: { + standard: { AM: string[]; PM: string[]; days: { @@ -122,57 +152,25 @@ declare namespace kendo { }; twoDigitYearMax: number; }; - calendars?: { - standard: { - AM: string[]; - PM: string[]; - days: { - names: string[]; - namesAbbr: string[]; - namesShort: string[]; - firstDay: number; - }; - months: { - names: string[]; - namesAbbr: string[]; - }; - patterns: { - D: string; - F: string; - G: string; - M: string; - T: string; - Y: string; - d: string; - g: string; - m: string; - s: string; - t: string; - u: string; - y: string; - }; - twoDigitYearMax: number; - }; - }; - numberFormat?: { - currency: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + }; + numberFormat?: { + currency: { decimals: number; groupSize: number[]; pattern: string[]; - percent: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + symbol: string; }; - } - }; + decimals: number; + groupSize: number[]; + pattern: string[]; + percent: { + decimals: number; + groupSize: number[]; + pattern: string[]; + symbol: string; + }; + }; + }}; function format(format: string, ...values: any[]): string; @@ -490,8 +488,8 @@ declare namespace kendo.data { change(e: Object): void; start(source: kendo.Observable): void; stop(source: kendo.Observable): void; - get(): any; - set(value: any): void; + get (): any; + set (value: any): void; destroy(): void; } @@ -502,7 +500,7 @@ declare namespace kendo.data { } class EventBinding extends Binding { - get(): void; + get (): void; } class TemplateBinding extends Binding { @@ -533,7 +531,7 @@ declare namespace kendo.data { interface BinderOptions { } - class ObservableObject extends Observable { + class ObservableObject extends Observable{ constructor(value?: any); uid: string; init(value?: any): void; @@ -1028,6 +1026,8 @@ declare namespace kendo.data { class DataSource extends Observable{ options: DataSourceOptions; + transport: any; + static create(options?: DataSourceOptions): DataSource; constructor(options?: DataSourceOptions); @@ -1114,7 +1114,7 @@ declare namespace kendo.data { } interface DataSourceFilterItem extends DataSourceFilter { - operator?: string; + operator?: string|Function; field?: string; value?: any; } @@ -1247,6 +1247,7 @@ declare namespace kendo.data { type?: string; change? (e: DataSourceChangeEvent): void; error?(e: DataSourceErrorEvent): void; + push?(e: DataSourcePushEvent): void; sync?(e: DataSourceEvent): void; requestStart?(e: DataSourceRequestStartEvent): void; requestEnd?(e: DataSourceRequestEndEvent): void; @@ -1276,6 +1277,12 @@ declare namespace kendo.data { node?: any; } + interface DataSourcePushEvent extends DataSourceEvent { + items?: DataSourceItemOrGroup[]; + type?: string; + + } + interface DataSourceErrorEvent extends DataSourceEvent { xhr: JQueryXHR; status: string; @@ -1302,10 +1309,10 @@ declare namespace kendo.ui { function progress(container: JQuery, toggle: boolean): void; class Widget extends Observable { - static fn: Widget; + static fn: any; element: JQuery; - options: Object; + options: any; events: string[]; static extend(prototype: Object): Widget; @@ -1388,33 +1395,40 @@ declare namespace kendo.ui { } interface DropTargetAreaDragenterEvent extends DropTargetAreaEvent { - draggable?: JQuery; + draggable?: kendo.ui.Draggable; dropTarget?: JQuery; + target?: Element; } interface DropTargetAreaDragleaveEvent extends DropTargetAreaEvent { - draggable?: JQuery; + draggable?: kendo.ui.Draggable; dropTarget?: JQuery; + target?: Element; } interface DropTargetAreaDropEvent extends DropTargetAreaEvent { draggable?: kendo.ui.Draggable; dropTarget?: JQuery; + target?: Element; } interface DraggableOptions { axis?: string; + autoScroll?: boolean; container?: JQuery; cursorOffset?: any; distance?: number; filter?: string; group?: string; - hint?: Function; + hint?: Function|JQuery; + holdToDrag?: boolean; ignore?: string; + cancelHold(): void; drag?(e: DraggableEvent): void; dragcancel?(e: DraggableEvent): void; dragend?(e: DraggableEvent): void; dragstart?(e: DraggableEvent): void; + hold?(e: DraggableEvent): void; } interface GridColumnEditorOptions { @@ -1475,6 +1489,7 @@ declare namespace kendo.mobile { statusBarStyle?: string; transition?: string; useNativeScrolling?: boolean; + init?(e: ApplicationEvent): void; } interface ApplicationEvent { @@ -1523,270 +1538,6081 @@ declare namespace kendo.drawing.pdf { proxyUrl?: string, callback?: Function): void; } -declare namespace kendo.geometry { - class Arc extends Observable { +declare namespace kendo.ui { + class AgendaView implements kendo.ui.SchedulerView { + static fn: AgendaView; + + startDate(): Date; + endDate(): Date; + + static extend(proto: Object): AgendaView; + } + + class Alert extends kendo.ui.Dialog { + + static fn: Alert; + + options: AlertOptions; - options: ArcOptions; + element: JQuery; + wrapper: JQuery; - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; + static extend(proto: Object): Alert; + + constructor(element: Element, options?: AlertOptions); - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - } - interface ArcOptions { + interface AlertMessages { + okText?: string; + } + + interface AlertOptions { name?: string; + messages?: AlertMessages; } - interface ArcEvent { - sender: Arc; + interface AlertEvent { + sender: Alert; preventDefault: Function; isDefaultPrevented(): boolean; } - class Circle extends Observable { + class AutoComplete extends kendo.ui.Widget { + + static fn: AutoComplete; + + options: AutoCompleteOptions; + + dataSource: kendo.data.DataSource; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): AutoComplete; + + constructor(element: Element, options?: AutoCompleteOptions); - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; + close(): void; + dataItem(index: number): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(item: string): void; + select(item: Element): void; + select(item: JQuery): void; + setDataSource(dataSource: kendo.data.DataSource): void; + suggest(value: string): void; + value(): string; + value(value: string): void; } - interface CircleOptions { + interface AutoCompleteAnimationClose { + duration?: number; + effects?: string; + } + + interface AutoCompleteAnimationOpen { + duration?: number; + effects?: string; + } + + interface AutoCompleteAnimation { + close?: AutoCompleteAnimationClose; + open?: AutoCompleteAnimationOpen; + } + + interface AutoCompleteVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface AutoCompleteOptions { name?: string; + animation?: boolean|AutoCompleteAnimation; + dataSource?: any|any|kendo.data.DataSource; + clearButton?: boolean; + dataTextField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + minLength?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: any; + separator?: string|any; + suggest?: boolean; + headerTemplate?: string|Function; + template?: string|Function; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean|AutoCompleteVirtual; + change?(e: AutoCompleteChangeEvent): void; + close?(e: AutoCompleteCloseEvent): void; + dataBound?(e: AutoCompleteDataBoundEvent): void; + filtering?(e: AutoCompleteFilteringEvent): void; + open?(e: AutoCompleteOpenEvent): void; + select?(e: AutoCompleteSelectEvent): void; } - interface CircleEvent { - sender: Circle; + interface AutoCompleteEvent { + sender: AutoComplete; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface AutoCompleteChangeEvent extends AutoCompleteEvent { + } + + interface AutoCompleteCloseEvent extends AutoCompleteEvent { + } + + interface AutoCompleteDataBoundEvent extends AutoCompleteEvent { + } + + interface AutoCompleteFilteringEvent extends AutoCompleteEvent { + filter?: any; + } + + interface AutoCompleteOpenEvent extends AutoCompleteEvent { + } + + interface AutoCompleteSelectEvent extends AutoCompleteEvent { + dataItem?: any; + item?: JQuery; + } + + + class Button extends kendo.ui.Widget { + + static fn: Button; + + options: ButtonOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Button; + + constructor(element: Element, options?: ButtonOptions); + + + enable(toggle: boolean): void; + + } + + interface ButtonOptions { + name?: string; + enable?: boolean; + icon?: string; + imageUrl?: string; + spriteCssClass?: string; + click?(e: ButtonClickEvent): void; + } + interface ButtonEvent { + sender: Button; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ButtonClickEvent extends ButtonEvent { + event?: any; + } + + + class Calendar extends kendo.ui.Widget { + + static fn: Calendar; + + options: CalendarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Calendar; + + constructor(element: Element, options?: CalendarOptions); + + + current(): Date; + destroy(): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + navigate(value: Date, view: string): void; + navigateDown(value: Date): void; + navigateToFuture(): void; + navigateToPast(): void; + navigateUp(): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + view(): any; + + } + + interface CalendarMonth { + content?: string; + empty?: string; + } + + interface CalendarOptions { + name?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string|Function; + format?: string; + max?: Date; + min?: Date; + month?: CalendarMonth; + start?: string; + value?: Date; + change?(e: CalendarEvent): void; + navigate?(e: CalendarEvent): void; + } + interface CalendarEvent { + sender: Calendar; preventDefault: Function; isDefaultPrevented(): boolean; } - class Matrix extends Observable { + class ColorPalette extends kendo.ui.Widget { + + static fn: ColorPalette; + + options: ColorPaletteOptions; - options: MatrixOptions; + element: JQuery; + wrapper: JQuery; - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; + static extend(proto: Object): ColorPalette; + + constructor(element: Element, options?: ColorPaletteOptions); - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; + value(): string; + value(color?: string): void; + color(): kendo.Color; + color(color?: kendo.Color): void; + enable(enable?: boolean): void; } - interface MatrixOptions { + interface ColorPaletteTileSize { + width?: number; + height?: number; + } + + interface ColorPaletteOptions { name?: string; + palette?: string|any; + columns?: number; + tileSize?: ColorPaletteTileSize; + value?: string; + change?(e: ColorPaletteEvent): void; } - interface MatrixEvent { - sender: Matrix; + interface ColorPaletteEvent { + sender: ColorPalette; preventDefault: Function; isDefaultPrevented(): boolean; } - class Point extends Observable { + class ColorPicker extends kendo.ui.Widget { + + static fn: ColorPicker; + + options: ColorPickerOptions; - options: PointOptions; + element: JQuery; + wrapper: JQuery; - x: number; - y: number; + static extend(proto: Object): ColorPicker; - constructor(x: number, y: number); + constructor(element: Element, options?: ColorPickerOptions); - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; + close(): void; + open(): void; + toggle(): void; + value(): string; + value(color?: string): void; + color(): kendo.Color; + color(color?: kendo.Color): void; + enable(enable?: boolean): void; } - interface PointOptions { + interface ColorPickerMessages { + apply?: string; + cancel?: string; + } + + interface ColorPickerTileSize { + width?: number; + height?: number; + } + + interface ColorPickerOptions { name?: string; + buttons?: boolean; + columns?: number; + tileSize?: ColorPickerTileSize; + messages?: ColorPickerMessages; + palette?: string|any; + opacity?: boolean; + preview?: boolean; + toolIcon?: string; + value?: string; + change?(e: ColorPickerChangeEvent): void; + select?(e: ColorPickerSelectEvent): void; + open?(e: ColorPickerEvent): void; + close?(e: ColorPickerEvent): void; } - interface PointEvent { - sender: Point; + interface ColorPickerEvent { + sender: ColorPicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ColorPickerChangeEvent extends ColorPickerEvent { + value?: string; + } + + interface ColorPickerSelectEvent extends ColorPickerEvent { + value?: string; + } + + + class ComboBox extends kendo.ui.Widget { + + static fn: ComboBox; + + options: ComboBoxOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ComboBox; + + constructor(element: Element, options?: ComboBoxOptions); + + + close(): void; + dataItem(index?: number): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(): number; + select(li: JQuery): void; + select(li: number): void; + select(li: Function): void; + setDataSource(dataSource: kendo.data.DataSource): void; + suggest(value: string): void; + text(): string; + text(text: string): void; + toggle(toggle: boolean): void; + value(): string; + value(value: string): void; + + } + + interface ComboBoxAnimationClose { + effects?: string; + duration?: number; + } + + interface ComboBoxAnimationOpen { + effects?: string; + duration?: number; + } + + interface ComboBoxAnimation { + close?: ComboBoxAnimationClose; + open?: ComboBoxAnimationOpen; + } + + interface ComboBoxPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface ComboBoxVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface ComboBoxOptions { + name?: string; + animation?: ComboBoxAnimation; + autoBind?: boolean; + cascadeFrom?: string; + cascadeFromField?: string; + clearButton?: boolean; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + index?: number; + minLength?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: ComboBoxPopup; + suggest?: boolean; + headerTemplate?: string|Function; + template?: string|Function; + text?: string; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean|ComboBoxVirtual; + change?(e: ComboBoxChangeEvent): void; + close?(e: ComboBoxCloseEvent): void; + dataBound?(e: ComboBoxDataBoundEvent): void; + filtering?(e: ComboBoxFilteringEvent): void; + open?(e: ComboBoxOpenEvent): void; + select?(e: ComboBoxSelectEvent): void; + cascade?(e: ComboBoxCascadeEvent): void; + } + interface ComboBoxEvent { + sender: ComboBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ComboBoxChangeEvent extends ComboBoxEvent { + } + + interface ComboBoxCloseEvent extends ComboBoxEvent { + } + + interface ComboBoxDataBoundEvent extends ComboBoxEvent { + } + + interface ComboBoxFilteringEvent extends ComboBoxEvent { + filter?: any; + } + + interface ComboBoxOpenEvent extends ComboBoxEvent { + } + + interface ComboBoxSelectEvent extends ComboBoxEvent { + dataItem?: any; + item?: JQuery; + } + + interface ComboBoxCascadeEvent extends ComboBoxEvent { + } + + + class Confirm extends kendo.ui.Dialog { + + static fn: Confirm; + + options: ConfirmOptions; + + result: JQueryPromise; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Confirm; + + constructor(element: Element, options?: ConfirmOptions); + + + + } + + interface ConfirmMessages { + okText?: string; + cancel?: string; + } + + interface ConfirmOptions { + name?: string; + messages?: ConfirmMessages; + } + interface ConfirmEvent { + sender: Confirm; preventDefault: Function; isDefaultPrevented(): boolean; } - class Rect extends Observable { + class ContextMenu extends kendo.ui.Widget { + + static fn: ContextMenu; + + options: ContextMenuOptions; - options: RectOptions; + element: JQuery; + wrapper: JQuery; - origin: kendo.geometry.Point; - size: kendo.geometry.Size; + static extend(proto: Object): ContextMenu; - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + constructor(element: Element, options?: ContextMenuOptions); - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; + append(item: any, referenceItem?: string): kendo.ui.ContextMenu; + append(item: any, referenceItem?: JQuery): kendo.ui.ContextMenu; + close(element: Element): kendo.ui.ContextMenu; + close(element: JQuery): kendo.ui.ContextMenu; + destroy(): void; + enable(element: string, enable: boolean): kendo.ui.ContextMenu; + enable(element: Element, enable: boolean): kendo.ui.ContextMenu; + enable(element: JQuery, enable: boolean): kendo.ui.ContextMenu; + insertAfter(item: any, referenceItem: string): kendo.ui.ContextMenu; + insertAfter(item: any, referenceItem: Element): kendo.ui.ContextMenu; + insertAfter(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; + insertBefore(item: any, referenceItem: string): kendo.ui.ContextMenu; + insertBefore(item: any, referenceItem: Element): kendo.ui.ContextMenu; + insertBefore(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; + open(x: number, y?: number): kendo.ui.ContextMenu; + open(x: Element, y?: number): kendo.ui.ContextMenu; + open(x: JQuery, y?: number): kendo.ui.ContextMenu; + remove(element: string): kendo.ui.ContextMenu; + remove(element: Element): kendo.ui.ContextMenu; + remove(element: JQuery): kendo.ui.ContextMenu; } - interface RectOptions { + interface ContextMenuAnimationClose { + effects?: string; + duration?: number; + } + + interface ContextMenuAnimationOpen { + effects?: string; + duration?: number; + } + + interface ContextMenuAnimation { + close?: ContextMenuAnimationClose; + open?: ContextMenuAnimationOpen; + } + + interface ContextMenuOptions { name?: string; + alignToAnchor?: boolean; + animation?: boolean|ContextMenuAnimation; + closeOnClick?: boolean; + dataSource?: any|any; + direction?: string; + filter?: string; + hoverDelay?: number; + orientation?: string; + popupCollision?: string; + showOn?: string; + target?: string|JQuery; + close?(e: ContextMenuCloseEvent): void; + open?(e: ContextMenuOpenEvent): void; + activate?(e: ContextMenuActivateEvent): void; + deactivate?(e: ContextMenuDeactivateEvent): void; + select?(e: ContextMenuSelectEvent): void; } - interface RectEvent { - sender: Rect; + interface ContextMenuEvent { + sender: ContextMenu; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ContextMenuCloseEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + event?: JQueryEventObject; + } + + interface ContextMenuOpenEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + event?: JQueryEventObject; + } + + interface ContextMenuActivateEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + } + + interface ContextMenuDeactivateEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + } + + interface ContextMenuSelectEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + } + + + class DatePicker extends kendo.ui.Widget { + + static fn: DatePicker; + + options: DatePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DatePicker; + + constructor(element: Element, options?: DatePickerOptions); + + + close(): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(): void; + setOptions(options: any): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + + } + + interface DatePickerAnimationClose { + effects?: string; + duration?: number; + } + + interface DatePickerAnimationOpen { + effects?: string; + duration?: number; + } + + interface DatePickerAnimation { + close?: DatePickerAnimationClose; + open?: DatePickerAnimationOpen; + } + + interface DatePickerMonth { + content?: string; + empty?: string; + } + + interface DatePickerOptions { + name?: string; + animation?: boolean|DatePickerAnimation; + ARIATemplate?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string|Function; + format?: string; + max?: Date; + min?: Date; + month?: DatePickerMonth; + parseFormats?: any; + start?: string; + value?: Date; + change?(e: DatePickerChangeEvent): void; + close?(e: DatePickerCloseEvent): void; + open?(e: DatePickerOpenEvent): void; + } + interface DatePickerEvent { + sender: DatePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DatePickerChangeEvent extends DatePickerEvent { + } + + interface DatePickerCloseEvent extends DatePickerEvent { + } + + interface DatePickerOpenEvent extends DatePickerEvent { + } + + + class DateTimePicker extends kendo.ui.Widget { + + static fn: DateTimePicker; + + options: DateTimePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DateTimePicker; + + constructor(element: Element, options?: DateTimePickerOptions); + + + close(view: string): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(view: string): void; + setOptions(options: any): void; + toggle(view: string): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + + } + + interface DateTimePickerAnimationClose { + effects?: string; + duration?: number; + } + + interface DateTimePickerAnimationOpen { + effects?: string; + duration?: number; + } + + interface DateTimePickerAnimation { + close?: DateTimePickerAnimationClose; + open?: DateTimePickerAnimationOpen; + } + + interface DateTimePickerMonth { + content?: string; + empty?: string; + } + + interface DateTimePickerOptions { + name?: string; + animation?: boolean|DateTimePickerAnimation; + ARIATemplate?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string; + format?: string; + interval?: number; + max?: Date; + min?: Date; + month?: DateTimePickerMonth; + parseFormats?: any; + start?: string; + timeFormat?: string; + value?: Date; + change?(e: DateTimePickerChangeEvent): void; + close?(e: DateTimePickerCloseEvent): void; + open?(e: DateTimePickerOpenEvent): void; + } + interface DateTimePickerEvent { + sender: DateTimePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DateTimePickerChangeEvent extends DateTimePickerEvent { + } + + interface DateTimePickerCloseEvent extends DateTimePickerEvent { + view?: string; + } + + interface DateTimePickerOpenEvent extends DateTimePickerEvent { + view?: string; + } + + + class Dialog extends kendo.ui.Widget { + + static fn: Dialog; + + options: DialogOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Dialog; + + constructor(element: Element, options?: DialogOptions); + + + close(): kendo.ui.Dialog; + content(): string; + content(content?: string): kendo.ui.Dialog; + content(content?: JQuery): kendo.ui.Dialog; + destroy(): void; + open(): kendo.ui.Dialog; + title(): string; + title(text?: string): kendo.ui.Dialog; + toFront(): kendo.ui.Dialog; + + } + + interface DialogAction { + text?: string; + action?: Function; + primary?: boolean; + } + + interface DialogAnimationClose { + effects?: string; + duration?: number; + } + + interface DialogAnimationOpen { + effects?: string; + duration?: number; + } + + interface DialogAnimation { + close?: DialogAnimationClose; + open?: DialogAnimationOpen; + } + + interface DialogMessages { + close?: string; + } + + interface DialogOptions { + name?: string; + actions?: DialogAction[]; + animation?: boolean|DialogAnimation; + buttonLayout?: string; + closable?: boolean; + content?: string; + height?: number|string; + maxHeight?: number; + maxWidth?: number; + messages?: DialogMessages; + minHeight?: number; + minWidth?: number; + modal?: boolean; + title?: string|boolean; + visible?: boolean; + width?: number|string; + close?(e: DialogCloseEvent): void; + hide?(e: DialogEvent): void; + initOpen?(e: DialogEvent): void; + open?(e: DialogEvent): void; + show?(e: DialogEvent): void; + } + interface DialogEvent { + sender: Dialog; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DialogCloseEvent extends DialogEvent { + userTriggered?: boolean; + } + + + class DropDownList extends kendo.ui.Widget { + + static fn: DropDownList; + + options: DropDownListOptions; + popup: kendo.ui.Popup; + + dataSource: kendo.data.DataSource; + span: JQuery; + filterInput: JQuery; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DropDownList; + + constructor(element: Element, options?: DropDownListOptions); + + + close(): void; + dataItem(index?: JQuery): any; + dataItem(index?: number): any; + destroy(): void; + focus(): void; + items(): any; + enable(enable: boolean): void; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(): number; + select(li: JQuery): void; + select(li: number): void; + select(li: Function): void; + setDataSource(dataSource: kendo.data.DataSource): void; + text(): string; + text(text: string): void; + toggle(toggle: boolean): void; + value(): string; + value(value: string): void; + + } + + interface DropDownListAnimationClose { + effects?: string; + duration?: number; + } + + interface DropDownListAnimationOpen { + effects?: string; + duration?: number; + } + + interface DropDownListAnimation { + close?: DropDownListAnimationClose; + open?: DropDownListAnimationOpen; + } + + interface DropDownListPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface DropDownListVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface DropDownListOptions { + name?: string; + animation?: boolean|DropDownListAnimation; + autoBind?: boolean; + cascadeFrom?: string; + cascadeFromField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + ignoreCase?: boolean; + index?: number; + minLength?: number; + noDataTemplate?: string|Function; + popup?: DropDownListPopup; + optionLabel?: string|any; + optionLabelTemplate?: string|Function; + headerTemplate?: string|Function; + template?: string|Function; + valueTemplate?: string|Function; + text?: string; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean|DropDownListVirtual; + change?(e: DropDownListChangeEvent): void; + close?(e: DropDownListCloseEvent): void; + dataBound?(e: DropDownListDataBoundEvent): void; + filtering?(e: DropDownListFilteringEvent): void; + open?(e: DropDownListOpenEvent): void; + select?(e: DropDownListSelectEvent): void; + cascade?(e: DropDownListCascadeEvent): void; + } + interface DropDownListEvent { + sender: DropDownList; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DropDownListChangeEvent extends DropDownListEvent { + } + + interface DropDownListCloseEvent extends DropDownListEvent { + } + + interface DropDownListDataBoundEvent extends DropDownListEvent { + } + + interface DropDownListFilteringEvent extends DropDownListEvent { + filter?: any; + } + + interface DropDownListOpenEvent extends DropDownListEvent { + } + + interface DropDownListSelectEvent extends DropDownListEvent { + dataItem?: any; + item?: JQuery; + } + + interface DropDownListCascadeEvent extends DropDownListEvent { + } + + + class Editor extends kendo.ui.Widget { + + static fn: Editor; + + options: EditorOptions; + + body: Element; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Editor; + + constructor(element: Element, options?: EditorOptions); + + + createRange(document?: Document): Range; + destroy(): void; + encodedValue(): void; + exec(name: string, params: any): void; + focus(): void; + getRange(): Range; + getSelection(): Selection; + paste(html: string, options: any): void; + selectedHtml(): string; + refresh(): void; + saveAsPDF(): JQueryPromise; + selectRange(range: Range): void; + update(): void; + state(toolName: string): boolean; + value(): string; + value(value: string): void; + + } + + interface EditorDeserialization { + custom?: Function; + } + + interface EditorFileBrowserMessages { + uploadFile?: string; + orderBy?: string; + orderByName?: string; + orderBySize?: string; + directoryNotFound?: string; + emptyFolder?: string; + deleteFile?: string; + invalidFileType?: string; + overwriteFile?: string; + search?: string; + } + + interface EditorFileBrowserSchemaModelFieldsName { + field?: string; + parse?: Function; + } + + interface EditorFileBrowserSchemaModelFieldsSize { + field?: string; + parse?: Function; + } + + interface EditorFileBrowserSchemaModelFieldsType { + parse?: Function; + field?: string; + } + + interface EditorFileBrowserSchemaModelFields { + name?: EditorFileBrowserSchemaModelFieldsName; + type?: EditorFileBrowserSchemaModelFieldsType; + size?: EditorFileBrowserSchemaModelFieldsSize; + } + + interface EditorFileBrowserSchemaModel { + id?: string; + fields?: EditorFileBrowserSchemaModelFields; + } + + interface EditorFileBrowserSchema { + } + + interface EditorFileBrowserTransportCreate { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorFileBrowserTransportDestroy { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorFileBrowserTransportRead { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorFileBrowserTransport { + read?: EditorFileBrowserTransportRead; + uploadUrl?: string; + fileUrl?: string|Function; + destroy?: EditorFileBrowserTransportDestroy; + create?: EditorFileBrowserTransportCreate; + } + + interface EditorFileBrowser { + fileTypes?: string; + path?: string; + transport?: EditorFileBrowserTransport; + schema?: EditorFileBrowserSchema; + messages?: EditorFileBrowserMessages; + } + + interface EditorImageBrowserMessages { + uploadFile?: string; + orderBy?: string; + orderByName?: string; + orderBySize?: string; + directoryNotFound?: string; + emptyFolder?: string; + deleteFile?: string; + invalidFileType?: string; + overwriteFile?: string; + search?: string; + } + + interface EditorImageBrowserSchemaModelFieldsName { + field?: string; + parse?: Function; + } + + interface EditorImageBrowserSchemaModelFieldsSize { + field?: string; + parse?: Function; + } + + interface EditorImageBrowserSchemaModelFieldsType { + parse?: Function; + field?: string; + } + + interface EditorImageBrowserSchemaModelFields { + name?: EditorImageBrowserSchemaModelFieldsName; + type?: EditorImageBrowserSchemaModelFieldsType; + size?: EditorImageBrowserSchemaModelFieldsSize; + } + + interface EditorImageBrowserSchemaModel { + id?: string; + fields?: EditorImageBrowserSchemaModelFields; + } + + interface EditorImageBrowserSchema { + } + + interface EditorImageBrowserTransportCreate { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorImageBrowserTransportDestroy { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorImageBrowserTransportRead { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorImageBrowserTransport { + read?: EditorImageBrowserTransportRead; + thumbnailUrl?: string|Function; + uploadUrl?: string; + imageUrl?: string|Function; + destroy?: EditorImageBrowserTransportDestroy; + create?: EditorImageBrowserTransportCreate; + } + + interface EditorImageBrowser { + fileTypes?: string; + path?: string; + transport?: EditorImageBrowserTransport; + schema?: EditorImageBrowserSchema; + messages?: EditorImageBrowserMessages; + } + + interface EditorImmutables { + deserialization?: Function; + serialization?: string|Function; + } + + interface EditorMessages { + accessibilityTab?: string; + addColumnLeft?: string; + addColumnRight?: string; + addRowAbove?: string; + addRowBelow?: string; + alignCenter?: string; + alignCenterBottom?: string; + alignCenterMiddle?: string; + alignCenterTop?: string; + alignLeft?: string; + alignLeftBottom?: string; + alignLeftMiddle?: string; + alignLeftTop?: string; + alignRemove?: string; + alignRight?: string; + alignRightBottom?: string; + alignRightMiddle?: string; + alignRightTop?: string; + alignment?: string; + associateCellsWithHeaders?: string; + backColor?: string; + background?: string; + bold?: string; + border?: string; + style?: string; + caption?: string; + cellMargin?: string; + cellPadding?: string; + cellSpacing?: string; + cellTab?: string; + cleanFormatting?: string; + collapseBorders?: string; + columns?: string; + createLink?: string; + createTable?: string; + createTableHint?: string; + cssClass?: string; + deleteColumn?: string; + deleteRow?: string; + dialogCancel?: string; + dialogInsert?: string; + dialogOk?: string; + dialogUpdate?: string; + editAreaTitle?: string; + fileTitle?: string; + fileWebAddress?: string; + fontName?: string; + fontNameInherit?: string; + fontSize?: string; + fontSizeInherit?: string; + foreColor?: string; + formatBlock?: string; + formatting?: string; + height?: string; + id?: string; + imageAltText?: string; + imageHeight?: string; + imageWebAddress?: string; + imageWidth?: string; + indent?: string; + insertFile?: string; + insertHtml?: string; + insertImage?: string; + insertOrderedList?: string; + insertUnorderedList?: string; + italic?: string; + justifyCenter?: string; + justifyFull?: string; + justifyLeft?: string; + justifyRight?: string; + linkOpenInNewWindow?: string; + linkText?: string; + linkToolTip?: string; + linkWebAddress?: string; + outdent?: string; + print?: string; + rows?: string; + selectAllCells?: string; + strikethrough?: string; + subscript?: string; + summary?: string; + superscript?: string; + tableTab?: string; + tableWizard?: string; + underline?: string; + unlink?: string; + viewHtml?: string; + width?: string; + wrapText?: string; + } + + interface EditorPasteCleanup { + all?: boolean; + css?: boolean; + custom?: Function; + keepNewLines?: boolean; + msAllFormatting?: boolean; + msConvertLists?: boolean; + msTags?: boolean; + none?: boolean; + span?: boolean; + } + + interface EditorPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface EditorPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: EditorPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface EditorResizable { + content?: boolean; + min?: number; + max?: number; + toolbar?: boolean; + } + + interface EditorSerialization { + custom?: Function; + entities?: boolean; + scripts?: boolean; + semantic?: boolean; + } + + interface EditorToolItem { + text?: string; + value?: string; + context?: string; + } + + interface EditorTool { + name?: string; + tooltip?: string; + exec?: Function; + items?: EditorToolItem[]; + template?: string; + } + + interface EditorExecParams { + value?: any; + } + + interface EditorPasteOptions { + split?: boolean; + } + + interface EditorOptions { + name?: string; + deserialization?: EditorDeserialization; + domain?: string; + encoded?: boolean; + immutables?: boolean|EditorImmutables; + messages?: EditorMessages; + pasteCleanup?: EditorPasteCleanup; + pdf?: EditorPdf; + resizable?: boolean|EditorResizable; + serialization?: EditorSerialization; + stylesheets?: any; + tools?: EditorTool[]; + imageBrowser?: EditorImageBrowser; + fileBrowser?: EditorFileBrowser; + change?(e: EditorEvent): void; + execute?(e: EditorExecuteEvent): void; + keydown?(e: EditorEvent): void; + keyup?(e: EditorEvent): void; + paste?(e: EditorPasteEvent): void; + pdfExport?(e: EditorPdfExportEvent): void; + select?(e: EditorEvent): void; + } + interface EditorEvent { + sender: Editor; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface EditorExecuteEvent extends EditorEvent { + name?: string; + command?: any; + } + + interface EditorPasteEvent extends EditorEvent { + html?: any; + } + + interface EditorPdfExportEvent extends EditorEvent { + promise?: JQueryPromise; + } + + + class FilterMenu extends kendo.ui.Widget { + + static fn: FilterMenu; + + options: FilterMenuOptions; + + field: string; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): FilterMenu; + + constructor(element: Element, options?: FilterMenuOptions); + + + clear(): void; + + } + + interface FilterMenuMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + selectValue?: string; + } + + interface FilterMenuOperatorsDate { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsEnums { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + } + + interface FilterMenuOperatorsNumber { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsString { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + isempty?: string; + isnotempty?: string; + startswith?: string; + contains?: string; + doesnotcontain?: string; + endswith?: string; + } + + interface FilterMenuOperators { + string?: FilterMenuOperatorsString; + number?: FilterMenuOperatorsNumber; + date?: FilterMenuOperatorsDate; + enums?: FilterMenuOperatorsEnums; + } + + interface FilterMenuOptions { + name?: string; + dataSource?: any|any|kendo.data.DataSource; + extra?: boolean; + field?: string; + messages?: FilterMenuMessages; + operators?: FilterMenuOperators; + } + interface FilterMenuEvent { + sender: FilterMenu; preventDefault: Function; isDefaultPrevented(): boolean; } - class Size extends Observable { + class FlatColorPicker extends kendo.ui.Widget { + + static fn: FlatColorPicker; + + options: FlatColorPickerOptions; - options: SizeOptions; + element: JQuery; + wrapper: JQuery; - width: number; - height: number; + static extend(proto: Object): FlatColorPicker; + + constructor(element: Element, options?: FlatColorPickerOptions); - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; + focus(): void; + value(): string; + value(color?: string): void; + color(): kendo.Color; + color(color?: kendo.Color): void; + enable(enable?: boolean): void; } - interface SizeOptions { + interface FlatColorPickerMessages { + apply?: string; + cancel?: string; + } + + interface FlatColorPickerOptions { name?: string; + opacity?: boolean; + buttons?: boolean; + value?: string; + preview?: boolean; + autoupdate?: boolean; + messages?: FlatColorPickerMessages; + change?(e: FlatColorPickerChangeEvent): void; } - interface SizeEvent { - sender: Size; + interface FlatColorPickerEvent { + sender: FlatColorPicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface FlatColorPickerChangeEvent extends FlatColorPickerEvent { + value?: string; + } + + + class Gantt extends kendo.ui.Widget { + + static fn: Gantt; + + options: GanttOptions; + + dataSource: kendo.data.DataSource; + dependencies: kendo.data.GanttDependencyDataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Gantt; + + constructor(element: Element, options?: GanttOptions); + + + clearSelection(): void; + dataItem(row: string): kendo.data.GanttTask; + dataItem(row: Element): kendo.data.GanttTask; + dataItem(row: JQuery): kendo.data.GanttTask; + date(date?: Date): Date; + destroy(): void; + range(range?: any): any; + refresh(): void; + refreshDependencies(): void; + removeDependency(dependency: string): void; + removeDependency(dependency: kendo.data.GanttDependency): void; + removeTask(task: string): void; + removeTask(task: kendo.data.GanttTask): void; + saveAsPDF(): JQueryPromise; + select(): JQuery; + select(row: string): void; + select(row: Element): void; + select(row: JQuery): void; + setDataSource(dataSource: kendo.data.GanttDataSource): void; + setDependenciesDataSource(dataSource: kendo.data.GanttDependencyDataSource): void; + view(): kendo.ui.GanttView; + view(type?: string): void; + + } + + interface GanttAssignments { + dataSource?: any|any|kendo.data.DataSource; + dataResourceIdField?: string; + dataTaskIdField?: string; + dataValueField?: string; + } + + interface GanttColumn { + field?: string; + title?: string; + format?: string; + width?: string|number; + editable?: boolean; + sortable?: boolean; + } + + interface GanttCurrentTimeMarker { + updateInterval?: number; + } + + interface GanttEditable { + confirmation?: boolean; + create?: boolean; + dependencyCreate?: boolean; + dependencyDestroy?: boolean; + dragPercentComplete?: boolean; + destroy?: boolean; + move?: boolean; + reorder?: boolean; + resize?: boolean; + template?: string|Function; + update?: boolean; + } + + interface GanttMessagesActions { + addChild?: string; + append?: string; + insertAfter?: string; + insertBefore?: string; + pdf?: string; + } + + interface GanttMessagesEditor { + assignButton?: string; + editorTitle?: string; + end?: string; + percentComplete?: string; + resources?: string; + resourcesEditorTitle?: string; + resourcesHeader?: string; + start?: string; + title?: string; + unitsHeader?: string; + } + + interface GanttMessagesViews { + day?: string; + end?: string; + month?: string; + start?: string; + week?: string; + year?: string; + } + + interface GanttMessages { + actions?: GanttMessagesActions; + cancel?: string; + deleteDependencyConfirmation?: string; + deleteDependencyWindowTitle?: string; + deleteTaskConfirmation?: string; + deleteTaskWindowTitle?: string; + destroy?: string; + editor?: GanttMessagesEditor; + save?: string; + views?: GanttMessagesViews; + } + + interface GanttPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface GanttPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: GanttPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface GanttRange { + start?: Date; + end?: Date; + } + + interface GanttResources { + dataFormatField?: string; + dataColorField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + field?: string; + } + + interface GanttToolbarItem { + name?: string; + template?: string|Function; + text?: string; + } + + interface GanttTooltip { + template?: string|Function; + visible?: boolean; + } + + interface GanttViewRange { + start?: Date; + end?: Date; + } + + interface GanttView { + date?: Date; + range?: GanttViewRange; + type?: string; + selected?: boolean; + slotSize?: number|string; + timeHeaderTemplate?: string|Function; + dayHeaderTemplate?: string|Function; + weekHeaderTemplate?: string|Function; + monthHeaderTemplate?: string|Function; + yearHeaderTemplate?: string|Function; + resizeTooltipFormat?: string; + } + + interface GanttOptions { + name?: string; + assignments?: GanttAssignments; + autoBind?: boolean; + columnResizeHandleWidth?: number; + columns?: GanttColumn[]; + currentTimeMarker?: boolean|GanttCurrentTimeMarker; + dataSource?: any|any|kendo.data.GanttDataSource; + date?: Date; + dependencies?: any|any|kendo.data.GanttDependencyDataSource; + editable?: boolean|GanttEditable; + navigatable?: boolean; + workDayStart?: Date; + workDayEnd?: Date; + workWeekStart?: number; + workWeekEnd?: number; + hourSpan?: number; + snap?: boolean; + height?: number|string; + listWidth?: string|number; + messages?: GanttMessages; + pdf?: GanttPdf; + range?: GanttRange; + resizable?: boolean; + selectable?: boolean; + showWorkDays?: boolean; + showWorkHours?: boolean; + taskTemplate?: string|Function; + toolbar?: GanttToolbarItem[]; + tooltip?: GanttTooltip; + views?: GanttView[]; + resources?: GanttResources; + rowHeight?: number|string; + dataBinding?(e: GanttDataBindingEvent): void; + dataBound?(e: GanttDataBoundEvent): void; + add?(e: GanttAddEvent): void; + edit?(e: GanttEditEvent): void; + remove?(e: GanttRemoveEvent): void; + cancel?(e: GanttCancelEvent): void; + save?(e: GanttSaveEvent): void; + change?(e: GanttChangeEvent): void; + columnResize?(e: GanttColumnResizeEvent): void; + navigate?(e: GanttNavigateEvent): void; + moveStart?(e: GanttMoveStartEvent): void; + move?(e: GanttMoveEvent): void; + moveEnd?(e: GanttMoveEndEvent): void; + pdfExport?(e: GanttPdfExportEvent): void; + resizeStart?(e: GanttResizeStartEvent): void; + resize?(e: GanttResizeEvent): void; + resizeEnd?(e: GanttResizeEndEvent): void; + } + interface GanttEvent { + sender: Gantt; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface GanttDataBindingEvent extends GanttEvent { + } + + interface GanttDataBoundEvent extends GanttEvent { + } + + interface GanttAddEvent extends GanttEvent { + task?: kendo.data.GanttTask; + dependency?: kendo.data.GanttDependency; + } + + interface GanttEditEvent extends GanttEvent { + container?: JQuery; + task?: kendo.data.GanttTask; + } + + interface GanttRemoveEvent extends GanttEvent { + task?: kendo.data.GanttTask; + dependencies?: any; + } + + interface GanttCancelEvent extends GanttEvent { + container?: JQuery; + task?: kendo.data.GanttTask; + } + + interface GanttSaveEvent extends GanttEvent { + task?: kendo.data.GanttTask; + values?: any; + } + + interface GanttChangeEvent extends GanttEvent { + } + + interface GanttColumnResizeEvent extends GanttEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + + interface GanttNavigateEvent extends GanttEvent { + view?: string; + } + + interface GanttMoveStartEvent extends GanttEvent { + task?: kendo.data.GanttTask; + } + + interface GanttMoveEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + interface GanttMoveEndEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + interface GanttPdfExportEvent extends GanttEvent { + promise?: JQueryPromise; + } + + interface GanttResizeStartEvent extends GanttEvent { + task?: kendo.data.GanttTask; + } + + interface GanttResizeEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + interface GanttResizeEndEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + + class Grid extends kendo.ui.Widget { + + static fn: Grid; + + options: GridOptions; + + dataSource: kendo.data.DataSource; + columns: GridColumn[]; + footer: JQuery; + pager: kendo.ui.Pager; + table: JQuery; + tbody: JQuery; + thead: JQuery; + content: JQuery; + lockedHeader: JQuery; + lockedTable: JQuery; + lockedContent: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Grid; + + constructor(element: Element, options?: GridOptions); + + + addRow(): void; + autoFitColumn(column: number): void; + autoFitColumn(column: string): void; + autoFitColumn(column: any): void; + cancelChanges(): void; + cancelRow(): void; + cellIndex(cell: string): number; + cellIndex(cell: Element): number; + cellIndex(cell: JQuery): number; + clearSelection(): void; + closeCell(isCancel?: boolean): void; + collapseGroup(row: string): void; + collapseGroup(row: Element): void; + collapseGroup(row: JQuery): void; + collapseRow(row: string): void; + collapseRow(row: Element): void; + collapseRow(row: JQuery): void; + current(): JQuery; + current(cell: JQuery): void; + dataItem(row: string): kendo.data.ObservableObject; + dataItem(row: Element): kendo.data.ObservableObject; + dataItem(row: JQuery): kendo.data.ObservableObject; + destroy(): void; + editCell(cell: JQuery): void; + editRow(row: JQuery): void; + expandGroup(row: string): void; + expandGroup(row: Element): void; + expandGroup(row: JQuery): void; + expandRow(row: string): void; + expandRow(row: Element): void; + expandRow(row: JQuery): void; + getOptions(): GridOptions; + hideColumn(column: number): void; + hideColumn(column: string): void; + hideColumn(column: any): void; + items(): any; + lockColumn(column: number): void; + lockColumn(column: string): void; + refresh(): void; + removeRow(row: string): void; + removeRow(row: Element): void; + removeRow(row: JQuery): void; + reorderColumn(destIndex: number, column: any): void; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + saveChanges(): void; + saveRow(): void; + select(): JQuery; + select(rows: string): void; + select(rows: Element): void; + select(rows: JQuery): void; + setDataSource(dataSource: kendo.data.DataSource): void; + setOptions(options: any): void; + showColumn(column: number): void; + showColumn(column: string): void; + showColumn(column: any): void; + unlockColumn(column: number): void; + unlockColumn(column: string): void; + + } + + interface GridAllowCopy { + delimeter?: string|any; + } + + interface GridColumnMenuMessages { + columns?: string; + filter?: string; + sortAscending?: string; + sortDescending?: string; + settings?: string; + done?: string; + lock?: string; + unlock?: string; + } + + interface GridColumnMenu { + columns?: boolean; + filterable?: boolean; + sortable?: boolean; + messages?: GridColumnMenuMessages; + } + + interface GridColumnCommandItemText { + edit?: string; + cancel?: string; + update?: string; + } + + interface GridColumnCommandItem { + name?: string; + text?: GridColumnCommandItemText; + className?: string; + click?: Function; + template?: string; + } + + interface GridColumnFilterableCell { + dataSource?: any|kendo.data.DataSource; + dataTextField?: string; + delay?: number; + inputWidth?: number; + suggestionOperator?: string; + minLength?: number; + enabled?: boolean; + operator?: string; + showOperators?: boolean; + template?: Function; + } + + interface GridColumnFilterable { + cell?: GridColumnFilterableCell; + multi?: boolean; + dataSource?: any|any|kendo.data.DataSource; + checkAll?: boolean; + itemTemplate?: Function; + operators?: any; + search?: boolean; + ignoreCase?: boolean; + ui?: string|Function; + } + + interface GridColumnSortable { + compare?: Function; + } + + interface GridColumn { + aggregates?: any; + attributes?: any; + columns?: any; + command?: GridColumnCommandItem[]; + encoded?: boolean; + field?: string; + filterable?: boolean|GridColumnFilterable; + footerAttributes?: any; + footerTemplate?: string|Function; + format?: string; + groupable?: boolean; + groupHeaderTemplate?: string|Function; + groupFooterTemplate?: string|Function; + headerAttributes?: any; + headerTemplate?: string|Function; + hidden?: boolean; + locked?: boolean; + lockable?: boolean; + minScreenWidth?: number; + sortable?: boolean|GridColumnSortable; + template?: string|Function; + title?: string; + width?: string|number; + values?: any; + menu?: boolean; + type?: any; + } + + interface GridEditable { + confirmation?: boolean|string|Function; + cancelDelete?: string; + confirmDelete?: string; + createAt?: string; + destroy?: boolean; + mode?: string; + template?: string|Function; + update?: boolean; + window?: any; + } + + interface GridExcel { + allPages?: boolean; + fileName?: string; + filterable?: boolean; + forceProxy?: boolean; + proxyURL?: string; + } + + interface GridFilterableMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + search?: string; + selectValue?: string; + cancel?: string; + selectedItemsFormat?: string; + operator?: string; + value?: string; + checkAll?: string; + } + + interface GridFilterableOperatorsDate { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface GridFilterableOperatorsEnums { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + } + + interface GridFilterableOperatorsNumber { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface GridFilterableOperatorsString { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + isempty?: string; + isnotempty?: string; + startswith?: string; + contains?: string; + doesnotcontain?: string; + endswith?: string; + } + + interface GridFilterableOperators { + string?: GridFilterableOperatorsString; + number?: GridFilterableOperatorsNumber; + date?: GridFilterableOperatorsDate; + enums?: GridFilterableOperatorsEnums; + } + + interface GridFilterable { + extra?: boolean; + messages?: GridFilterableMessages; + operators?: GridFilterableOperators; + mode?: string; + } + + interface GridGroupableMessages { + empty?: string; + } + + interface GridGroupable { + enabled?: boolean; + showFooter?: boolean; + messages?: GridGroupableMessages; + } + + interface GridMessagesCommands { + cancel?: string; + canceledit?: string; + create?: string; + destroy?: string; + edit?: string; + excel?: string; + save?: string; + update?: string; + } + + interface GridMessages { + commands?: GridMessagesCommands; + noRecords?: string; + } + + interface GridNoRecords { + template?: string|Function; + } + + interface GridPageableMessages { + display?: string; + empty?: string; + page?: string; + of?: string; + itemsPerPage?: string; + first?: string; + last?: string; + next?: string; + previous?: string; + refresh?: string; + morePages?: string; + } + + interface GridPageable { + pageSize?: number; + previousNext?: boolean; + numeric?: boolean; + buttonCount?: number; + input?: boolean; + pageSizes?: boolean|any; + refresh?: boolean; + info?: boolean; + messages?: GridPageableMessages; + } + + interface GridPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface GridPdf { + allPages?: boolean; + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: GridPdfMargin; + paperSize?: string|any; + template?: string; + repeatHeaders?: boolean; + scale?: number; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface GridScrollable { + virtual?: boolean; + } + + interface GridSortable { + allowUnsort?: boolean; + mode?: string; + } + + interface GridToolbarItem { + name?: string; + template?: string|Function; + text?: string; + } + + interface GridOptions { + name?: string; + allowCopy?: boolean|GridAllowCopy; + altRowTemplate?: string|Function; + autoBind?: boolean; + columnResizeHandleWidth?: number; + columns?: GridColumn[]; + columnMenu?: boolean|GridColumnMenu; + dataSource?: any|any|kendo.data.DataSource; + detailTemplate?: string|Function; + editable?: boolean|GridEditable; + excel?: GridExcel; + filterable?: boolean|GridFilterable; + groupable?: boolean|GridGroupable; + height?: number|string; + messages?: GridMessages; + mobile?: boolean|string; + navigatable?: boolean; + noRecords?: boolean|GridNoRecords; + pageable?: boolean|GridPageable; + pdf?: GridPdf; + reorderable?: boolean; + resizable?: boolean; + rowTemplate?: string|Function; + scrollable?: boolean|GridScrollable; + selectable?: boolean|string; + sortable?: boolean|GridSortable; + toolbar?: GridToolbarItem[] | any; + cancel?(e: GridCancelEvent): void; + change?(e: GridChangeEvent): void; + columnHide?(e: GridColumnHideEvent): void; + columnMenuInit?(e: GridColumnMenuInitEvent): void; + columnReorder?(e: GridColumnReorderEvent): void; + columnResize?(e: GridColumnResizeEvent): void; + columnShow?(e: GridColumnShowEvent): void; + dataBinding?(e: GridDataBindingEvent): void; + dataBound?(e: GridDataBoundEvent): void; + detailCollapse?(e: GridDetailCollapseEvent): void; + detailExpand?(e: GridDetailExpandEvent): void; + detailInit?(e: GridDetailInitEvent): void; + edit?(e: GridEditEvent): void; + excelExport?(e: GridExcelExportEvent): void; + filter?(e: GridFilterEvent): void; + group?(e: GridGroupEvent): void; + page?(e: GridPageEvent): void; + pdfExport?(e: GridPdfExportEvent): void; + filterMenuInit?(e: GridFilterMenuInitEvent): void; + remove?(e: GridRemoveEvent): void; + save?(e: GridSaveEvent): void; + saveChanges?(e: GridSaveChangesEvent): void; + sort?(e: GridSortEvent): void; + columnLock?(e: GridColumnLockEvent): void; + columnUnlock?(e: GridColumnUnlockEvent): void; + navigate?(e: GridNavigateEvent): void; + } + interface GridEvent { + sender: Grid; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface GridCancelEvent extends GridEvent { + container?: JQuery; + model?: kendo.data.Model; + } + + interface GridChangeEvent extends GridEvent { + } + + interface GridColumnHideEvent extends GridEvent { + column?: any; + } + + interface GridColumnMenuInitEvent extends GridEvent { + container?: JQuery; + field?: string; + } + + interface GridColumnReorderEvent extends GridEvent { + column?: any; + newIndex?: number; + oldIndex?: number; + } + + interface GridColumnResizeEvent extends GridEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + + interface GridColumnShowEvent extends GridEvent { + column?: any; + } + + interface GridDataBindingEvent extends GridEvent { + action?: string; + index?: number; + items?: any; + } + + interface GridDataBoundEvent extends GridEvent { + } + + interface GridDetailCollapseEvent extends GridEvent { + detailRow?: JQuery; + masterRow?: JQuery; + } + + interface GridDetailExpandEvent extends GridEvent { + detailRow?: JQuery; + masterRow?: JQuery; + } + + interface GridDetailInitEvent extends GridEvent { + data?: kendo.data.ObservableObject; + detailCell?: JQuery; + detailRow?: JQuery; + masterRow?: JQuery; + } + + interface GridEditEvent extends GridEvent { + container?: JQuery; + model?: kendo.data.Model; + } + + interface GridExcelExportEvent extends GridEvent { + data?: any; + workbook?: kendo.ooxml.Workbook; + } + + interface GridFilterEvent extends GridEvent { + filter?: any; + field?: string; + } + + interface GridGroupEvent extends GridEvent { + groups?: any; + } + + interface GridPageEvent extends GridEvent { + page?: number; + } + + interface GridPdfExportEvent extends GridEvent { + promise?: JQueryPromise; + } + + interface GridFilterMenuInitEvent extends GridEvent { + container?: JQuery; + field?: string; + } + + interface GridRemoveEvent extends GridEvent { + model?: kendo.data.Model; + row?: JQuery; + } + + interface GridSaveEvent extends GridEvent { + model?: kendo.data.Model; + container?: JQuery; + values?: any; + } + + interface GridSaveChangesEvent extends GridEvent { + } + + interface GridSortEvent extends GridEvent { + sort?: any; + } + + interface GridColumnLockEvent extends GridEvent { + column?: any; + } + + interface GridColumnUnlockEvent extends GridEvent { + column?: any; + } + + interface GridNavigateEvent extends GridEvent { + element?: JQuery; + } + + + class ListView extends kendo.ui.Widget { + + static fn: ListView; + + options: ListViewOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ListView; + + constructor(element: Element, options?: ListViewOptions); + + + add(): void; + cancel(): void; + clearSelection(): void; + dataItem(row: string): kendo.data.ObservableObject; + dataItem(row: Element): kendo.data.ObservableObject; + dataItem(row: JQuery): kendo.data.ObservableObject; + dataItems(): void; + destroy(): void; + edit(item: JQuery): void; + items(): any; + refresh(): void; + remove(item: any): void; + save(): void; + select(): JQuery; + select(items: JQuery): void; + select(items: any): void; + setDataSource(dataSource: kendo.data.DataSource): void; + + } + + interface ListViewOptions { + name?: string; + autoBind?: boolean; + dataSource?: any|any|kendo.data.DataSource; + editTemplate?: Function; + navigatable?: boolean; + selectable?: boolean|string; + template?: Function; + altTemplate?: Function; + cancel?(e: ListViewCancelEvent): void; + change?(e: ListViewEvent): void; + dataBound?(e: ListViewEvent): void; + dataBinding?(e: ListViewEvent): void; + edit?(e: ListViewEditEvent): void; + remove?(e: ListViewRemoveEvent): void; + save?(e: ListViewSaveEvent): void; + } + interface ListViewEvent { + sender: ListView; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ListViewCancelEvent extends ListViewEvent { + container?: JQuery; + model?: kendo.data.Model; + } + + interface ListViewEditEvent extends ListViewEvent { + item?: JQuery; + model?: kendo.data.Model; + } + + interface ListViewRemoveEvent extends ListViewEvent { + item?: JQuery; + model?: kendo.data.Model; + } + + interface ListViewSaveEvent extends ListViewEvent { + model?: kendo.data.Model; + item?: JQuery; + } + + + class MaskedTextBox extends kendo.ui.Widget { + + static fn: MaskedTextBox; + + options: MaskedTextBoxOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MaskedTextBox; + + constructor(element: Element, options?: MaskedTextBoxOptions); + + + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + raw(): string; + value(): string; + value(value: string): void; + + } + + interface MaskedTextBoxOptions { + name?: string; + clearPromptChar?: boolean; + culture?: string; + mask?: string; + promptChar?: string; + rules?: any; + unmaskOnPost?: boolean; + value?: string; + change?(e: MaskedTextBoxChangeEvent): void; + } + interface MaskedTextBoxEvent { + sender: MaskedTextBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface MaskedTextBoxChangeEvent extends MaskedTextBoxEvent { + } + + + class MediaPlayer extends kendo.ui.Widget { + + static fn: MediaPlayer; + + options: MediaPlayerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MediaPlayer; + + constructor(element: Element, options?: MediaPlayerOptions); + + + fullScreen(): void; + fullScreen(value: boolean): void; + volume(): void; + volume(value: number): void; + mute(value: boolean): void; + isEnded(): void; + isPaused(): void; + isPlaying(): void; + pause(): void; + play(): void; + seek(milliseconds: number): void; + stop(): void; + titlebar(): void; + toolbar(): void; + + } + + interface MediaPlayerMedia { + source?: string; + title?: string; + } + + interface MediaPlayerMessages { + pause?: string; + play?: string; + mute?: string; + unmute?: string; + quality?: string; + fullscreen?: string; + } + + interface MediaPlayerOptions { + name?: string; + autoPlay?: boolean; + autoRepeat?: boolean; + forwardSeek?: boolean; + fullScreen?: boolean; + media?: MediaPlayerMedia; + messages?: MediaPlayerMessages; + mute?: boolean; + navigatable?: boolean; + volume?: number; + end?(e: MediaPlayerEvent): void; + pause?(e: MediaPlayerEvent): void; + play?(e: MediaPlayerEvent): void; + ready?(e: MediaPlayerEvent): void; + timeChange?(e: MediaPlayerEvent): void; + volumeChange?(e: MediaPlayerEvent): void; + } + interface MediaPlayerEvent { + sender: MediaPlayer; preventDefault: Function; isDefaultPrevented(): boolean; } - class Transformation extends Observable { + class Menu extends kendo.ui.Widget { + + static fn: Menu; + + options: MenuOptions; - options: TransformationOptions; + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Menu; + + constructor(element: Element, options?: MenuOptions); - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; + append(item: any, referenceItem?: string): kendo.ui.Menu; + append(item: any, referenceItem?: JQuery): kendo.ui.Menu; + close(element: string): kendo.ui.Menu; + close(element: Element): kendo.ui.Menu; + close(element: JQuery): kendo.ui.Menu; + destroy(): void; + enable(element: string, enable: boolean): kendo.ui.Menu; + enable(element: Element, enable: boolean): kendo.ui.Menu; + enable(element: JQuery, enable: boolean): kendo.ui.Menu; + insertAfter(item: any, referenceItem: string): kendo.ui.Menu; + insertAfter(item: any, referenceItem: Element): kendo.ui.Menu; + insertAfter(item: any, referenceItem: JQuery): kendo.ui.Menu; + insertBefore(item: any, referenceItem: string): kendo.ui.Menu; + insertBefore(item: any, referenceItem: Element): kendo.ui.Menu; + insertBefore(item: any, referenceItem: JQuery): kendo.ui.Menu; + open(element: string): kendo.ui.Menu; + open(element: Element): kendo.ui.Menu; + open(element: JQuery): kendo.ui.Menu; + remove(element: string): kendo.ui.Menu; + remove(element: Element): kendo.ui.Menu; + remove(element: JQuery): kendo.ui.Menu; } - interface TransformationOptions { + interface MenuAnimationClose { + effects?: string; + duration?: number; + } + + interface MenuAnimationOpen { + effects?: string; + duration?: number; + } + + interface MenuAnimation { + close?: MenuAnimationClose; + open?: MenuAnimationOpen; + } + + interface MenuOptions { name?: string; + animation?: boolean|MenuAnimation; + closeOnClick?: boolean; + dataSource?: any|any; + direction?: string; + hoverDelay?: number; + openOnClick?: boolean; + orientation?: string; + popupCollision?: string; + close?(e: MenuCloseEvent): void; + open?(e: MenuOpenEvent): void; + activate?(e: MenuActivateEvent): void; + deactivate?(e: MenuDeactivateEvent): void; + select?(e: MenuSelectEvent): void; } - interface TransformationEvent { - sender: Transformation; + interface MenuEvent { + sender: Menu; preventDefault: Function; isDefaultPrevented(): boolean; } + interface MenuCloseEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuOpenEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuActivateEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuDeactivateEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuSelectEvent extends MenuEvent { + item?: HTMLElement; + } + + + class MultiSelect extends kendo.ui.Widget { + + static fn: MultiSelect; + + options: MultiSelectOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; + tagList: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MultiSelect; + + constructor(element: Element, options?: MultiSelectOptions); + + + close(): void; + dataItems(): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + setDataSource(dataSource: kendo.data.DataSource): void; + toggle(toggle?: boolean): void; + value(): any; + value(value: any): void; + value(value: string): void; + + } + + interface MultiSelectAnimationClose { + effects?: string; + duration?: number; + } + + interface MultiSelectAnimationOpen { + effects?: string; + duration?: number; + } + + interface MultiSelectAnimation { + close?: MultiSelectAnimationClose; + open?: MultiSelectAnimationOpen; + } + + interface MultiSelectPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface MultiSelectVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface MultiSelectOptions { + name?: string; + animation?: boolean|MultiSelectAnimation; + autoBind?: boolean; + autoClose?: boolean; + clearButton?: boolean; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + minLength?: number; + maxSelectedItems?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: MultiSelectPopup; + headerTemplate?: string|Function; + itemTemplate?: string|Function; + tagTemplate?: string; + tagMode?: string; + value?: any; + valuePrimitive?: boolean; + virtual?: boolean|MultiSelectVirtual; + change?(e: MultiSelectChangeEvent): void; + close?(e: MultiSelectCloseEvent): void; + dataBound?(e: MultiSelectDataBoundEvent): void; + filtering?(e: MultiSelectFilteringEvent): void; + open?(e: MultiSelectOpenEvent): void; + select?(e: MultiSelectSelectEvent): void; + deselect?(e: MultiSelectDeselectEvent): void; + } + interface MultiSelectEvent { + sender: MultiSelect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface MultiSelectChangeEvent extends MultiSelectEvent { + } + + interface MultiSelectCloseEvent extends MultiSelectEvent { + } + + interface MultiSelectDataBoundEvent extends MultiSelectEvent { + } + + interface MultiSelectFilteringEvent extends MultiSelectEvent { + filter?: any; + } + + interface MultiSelectOpenEvent extends MultiSelectEvent { + } + + interface MultiSelectSelectEvent extends MultiSelectEvent { + dataItem?: any; + item?: JQuery; + } + + interface MultiSelectDeselectEvent extends MultiSelectEvent { + dataItem?: any; + item?: JQuery; + } + + + class Notification extends kendo.ui.Widget { + + static fn: Notification; + + options: NotificationOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Notification; + + constructor(element: Element, options?: NotificationOptions); + + + error(data: any): void; + error(data: string): void; + error(data: Function): void; + getNotifications(): JQuery; + hide(): void; + info(data: any): void; + info(data: string): void; + info(data: Function): void; + show(data: any, type: string): void; + show(data: string, type: string): void; + show(data: Function, type: string): void; + showText(data: any, type: string): void; + showText(data: string, type: string): void; + showText(data: Function, type: string): void; + success(data: any): void; + success(data: string): void; + success(data: Function): void; + warning(data: any): void; + warning(data: string): void; + warning(data: Function): void; + + } + + interface NotificationPosition { + bottom?: number; + left?: number; + pinned?: boolean; + right?: number; + top?: number; + } + + interface NotificationTemplate { + type?: string; + template?: string; + } + + interface NotificationOptions { + name?: string; + allowHideAfter?: number; + animation?: any|boolean; + appendTo?: string|JQuery; + autoHideAfter?: number; + button?: boolean; + height?: number|string; + hideOnClick?: boolean; + position?: NotificationPosition; + stacking?: string; + templates?: NotificationTemplate[]; + width?: number|string; + hide?(e: NotificationHideEvent): void; + show?(e: NotificationShowEvent): void; + } + interface NotificationEvent { + sender: Notification; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface NotificationHideEvent extends NotificationEvent { + element?: JQuery; + } + + interface NotificationShowEvent extends NotificationEvent { + element?: JQuery; + } + + + class NumericTextBox extends kendo.ui.Widget { + + static fn: NumericTextBox; + + options: NumericTextBoxOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): NumericTextBox; + + constructor(element: Element, options?: NumericTextBoxOptions); + + + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + focus(): void; + max(): number; + max(value: number): void; + max(value: string): void; + min(): number; + min(value: number): void; + min(value: string): void; + step(): number; + step(value: number): void; + step(value: string): void; + value(): number; + value(value: number): void; + value(value: string): void; + + } + + interface NumericTextBoxOptions { + name?: string; + culture?: string; + decimals?: number; + downArrowText?: string; + format?: string; + max?: number; + min?: number; + placeholder?: string; + restrictDecimals?: boolean; + round?: boolean; + spinners?: boolean; + step?: number; + upArrowText?: string; + value?: number; + change?(e: NumericTextBoxChangeEvent): void; + spin?(e: NumericTextBoxSpinEvent): void; + } + interface NumericTextBoxEvent { + sender: NumericTextBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface NumericTextBoxChangeEvent extends NumericTextBoxEvent { + } + + interface NumericTextBoxSpinEvent extends NumericTextBoxEvent { + } + + + class Pager extends kendo.ui.Widget { + + static fn: Pager; + + options: PagerOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Pager; + + constructor(element: Element, options?: PagerOptions); + + + totalPages(): number; + pageSize(): number; + page(): number; + page(page: number): void; + refresh(): void; + destroy(): void; + + } + + interface PagerMessages { + display?: string; + empty?: string; + allPages?: string; + page?: string; + of?: string; + itemsPerPage?: string; + first?: string; + previous?: string; + next?: string; + last?: string; + refresh?: string; + } + + interface PagerOptions { + name?: string; + autoBind?: boolean; + buttonCount?: number; + dataSource?: any|kendo.data.DataSource; + selectTemplate?: string; + linkTemplate?: string; + info?: boolean; + input?: boolean; + numeric?: boolean; + pageSizes?: boolean|any; + previousNext?: boolean; + refresh?: boolean; + messages?: PagerMessages; + change?(e: PagerChangeEvent): void; + } + interface PagerEvent { + sender: Pager; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PagerChangeEvent extends PagerEvent { + } + + + class PanelBar extends kendo.ui.Widget { + + static fn: PanelBar; + + options: PanelBarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): PanelBar; + + constructor(element: Element, options?: PanelBarOptions); + + + append(item: string, referenceItem: string): kendo.ui.PanelBar; + append(item: string, referenceItem: Element): kendo.ui.PanelBar; + append(item: string, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: Element, referenceItem: string): kendo.ui.PanelBar; + append(item: Element, referenceItem: Element): kendo.ui.PanelBar; + append(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: JQuery, referenceItem: string): kendo.ui.PanelBar; + append(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; + append(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: any, referenceItem: string): kendo.ui.PanelBar; + append(item: any, referenceItem: Element): kendo.ui.PanelBar; + append(item: any, referenceItem: JQuery): kendo.ui.PanelBar; + clearSelection(): void; + collapse(element: string, useAnimation: boolean): kendo.ui.PanelBar; + collapse(element: Element, useAnimation: boolean): kendo.ui.PanelBar; + collapse(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; + destroy(): void; + enable(element: string, enable: boolean): void; + enable(element: Element, enable: boolean): void; + enable(element: JQuery, enable: boolean): void; + expand(element: string, useAnimation: boolean): kendo.ui.PanelBar; + expand(element: Element, useAnimation: boolean): kendo.ui.PanelBar; + expand(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; + insertAfter(item: string, referenceItem: string): void; + insertAfter(item: string, referenceItem: Element): void; + insertAfter(item: string, referenceItem: JQuery): void; + insertAfter(item: Element, referenceItem: string): void; + insertAfter(item: Element, referenceItem: Element): void; + insertAfter(item: Element, referenceItem: JQuery): void; + insertAfter(item: JQuery, referenceItem: string): void; + insertAfter(item: JQuery, referenceItem: Element): void; + insertAfter(item: JQuery, referenceItem: JQuery): void; + insertAfter(item: any, referenceItem: string): void; + insertAfter(item: any, referenceItem: Element): void; + insertAfter(item: any, referenceItem: JQuery): void; + insertBefore(item: string, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: string, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: string, referenceItem: JQuery): kendo.ui.PanelBar; + insertBefore(item: Element, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: Element, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; + insertBefore(item: JQuery, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; + insertBefore(item: any, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: any, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: any, referenceItem: JQuery): kendo.ui.PanelBar; + reload(element: string): void; + reload(element: Element): void; + reload(element: JQuery): void; + remove(element: string): void; + remove(element: Element): void; + remove(element: JQuery): void; + select(): JQuery; + select(element?: string): void; + select(element?: Element): void; + select(element?: JQuery): void; + + } + + interface PanelBarAnimationCollapse { + duration?: number; + effects?: string; + } + + interface PanelBarAnimationExpand { + duration?: number; + effects?: string; + } + + interface PanelBarAnimation { + collapse?: PanelBarAnimationCollapse; + expand?: PanelBarAnimationExpand; + } + + interface PanelBarOptions { + name?: string; + animation?: boolean|PanelBarAnimation; + contentUrls?: any; + dataSource?: any|any; + expandMode?: string; + activate?(e: PanelBarActivateEvent): void; + collapse?(e: PanelBarCollapseEvent): void; + contentLoad?(e: PanelBarContentLoadEvent): void; + error?(e: PanelBarErrorEvent): void; + expand?(e: PanelBarExpandEvent): void; + select?(e: PanelBarSelectEvent): void; + } + interface PanelBarEvent { + sender: PanelBar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PanelBarActivateEvent extends PanelBarEvent { + item?: Element; + } + + interface PanelBarCollapseEvent extends PanelBarEvent { + item?: Element; + } + + interface PanelBarContentLoadEvent extends PanelBarEvent { + item?: Element; + contentElement?: Element; + } + + interface PanelBarErrorEvent extends PanelBarEvent { + xhr?: JQueryXHR; + status?: string; + } + + interface PanelBarExpandEvent extends PanelBarEvent { + item?: Element; + } + + interface PanelBarSelectEvent extends PanelBarEvent { + item?: Element; + } + + + class PivotConfigurator extends kendo.ui.Widget { + + static fn: PivotConfigurator; + + options: PivotConfiguratorOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): PivotConfigurator; + + constructor(element: Element, options?: PivotConfiguratorOptions); + + + destroy(): void; + refresh(): void; + setDataSource(dataSource: kendo.data.PivotDataSource): void; + + } + + interface PivotConfiguratorMessagesFieldMenuOperators { + contains?: string; + doesnotcontain?: string; + startswith?: string; + endswith?: string; + eq?: string; + neq?: string; + } + + interface PivotConfiguratorMessagesFieldMenu { + info?: string; + sortAscending?: string; + sortDescending?: string; + filterFields?: string; + filter?: string; + include?: string; + title?: string; + clear?: string; + ok?: string; + cancel?: string; + operators?: PivotConfiguratorMessagesFieldMenuOperators; + } + + interface PivotConfiguratorMessages { + measures?: string; + columns?: string; + rows?: string; + measuresLabel?: string; + rowsLabel?: string; + columnsLabel?: string; + fieldsLabel?: string; + fieldMenu?: PivotConfiguratorMessagesFieldMenu; + } + + interface PivotConfiguratorSortable { + allowUnsort?: boolean; + } + + interface PivotConfiguratorOptions { + name?: string; + dataSource?: any|kendo.data.PivotDataSource; + filterable?: boolean; + sortable?: boolean|PivotConfiguratorSortable; + height?: number|string; + messages?: PivotConfiguratorMessages; + } + interface PivotConfiguratorEvent { + sender: PivotConfigurator; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class PivotGrid extends kendo.ui.Widget { + + static fn: PivotGrid; + + options: PivotGridOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): PivotGrid; + + constructor(element: Element, options?: PivotGridOptions); + + + cellInfo(columnIndex: number, rowIndex: number): any; + cellInfoByElement(cell: string): any; + cellInfoByElement(cell: Element): any; + cellInfoByElement(cell: JQuery): any; + destroy(): void; + refresh(): void; + setDataSource(dataSource: kendo.data.PivotDataSource): void; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + + } + + interface PivotGridExcel { + fileName?: string; + filterable?: boolean; + forceProxy?: boolean; + proxyURL?: string; + } + + interface PivotGridMessagesFieldMenuOperators { + contains?: string; + doesnotcontain?: string; + startswith?: string; + endswith?: string; + eq?: string; + neq?: string; + } + + interface PivotGridMessagesFieldMenu { + info?: string; + sortAscending?: string; + sortDescending?: string; + filterFields?: string; + filter?: string; + include?: string; + title?: string; + clear?: string; + ok?: string; + cancel?: string; + operators?: PivotGridMessagesFieldMenuOperators; + } + + interface PivotGridMessages { + measureFields?: string; + columnFields?: string; + rowFields?: string; + fieldMenu?: PivotGridMessagesFieldMenu; + } + + interface PivotGridPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface PivotGridPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: PivotGridPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface PivotGridSortable { + allowUnsort?: boolean; + } + + interface PivotGridOptions { + name?: string; + dataSource?: any|kendo.data.PivotDataSource; + autoBind?: boolean; + reorderable?: boolean; + excel?: PivotGridExcel; + pdf?: PivotGridPdf; + filterable?: boolean; + sortable?: boolean|PivotGridSortable; + columnWidth?: number; + height?: number|string; + columnHeaderTemplate?: string|Function; + dataCellTemplate?: string|Function; + kpiStatusTemplate?: string|Function; + kpiTrendTemplate?: string|Function; + rowHeaderTemplate?: string|Function; + messages?: PivotGridMessages; + dataBinding?(e: PivotGridDataBindingEvent): void; + dataBound?(e: PivotGridDataBoundEvent): void; + expandMember?(e: PivotGridExpandMemberEvent): void; + collapseMember?(e: PivotGridCollapseMemberEvent): void; + excelExport?(e: PivotGridExcelExportEvent): void; + pdfExport?(e: PivotGridPdfExportEvent): void; + } + interface PivotGridEvent { + sender: PivotGrid; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PivotGridDataBindingEvent extends PivotGridEvent { + } + + interface PivotGridDataBoundEvent extends PivotGridEvent { + } + + interface PivotGridExpandMemberEvent extends PivotGridEvent { + axis?: string; + path?: string; + } + + interface PivotGridCollapseMemberEvent extends PivotGridEvent { + axis?: string; + path?: string; + } + + interface PivotGridExcelExportEvent extends PivotGridEvent { + data?: any; + workbook?: any; + } + + interface PivotGridPdfExportEvent extends PivotGridEvent { + promise?: JQueryPromise; + } + + + class Popup extends kendo.ui.Widget { + + static fn: Popup; + + options: PopupOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Popup; + + constructor(element: Element, options?: PopupOptions); + + + close(): void; + open(): void; + position(): void; + setOptions(options: any): void; + visible(): boolean; + + } + + interface PopupAnimationClose { + effects?: string; + duration?: number; + } + + interface PopupAnimationOpen { + effects?: string; + duration?: number; + } + + interface PopupAnimation { + close?: PopupAnimationClose; + open?: PopupAnimationOpen; + } + + interface PopupOptions { + name?: string; + adjustSize?: any; + animation?: boolean|PopupAnimation; + anchor?: string|JQuery; + appendTo?: string|JQuery; + collision?: string; + origin?: string; + position?: string; + activate?(e: PopupActivateEvent): void; + close?(e: PopupCloseEvent): void; + deactivate?(e: PopupDeactivateEvent): void; + open?(e: PopupOpenEvent): void; + } + interface PopupEvent { + sender: Popup; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PopupActivateEvent extends PopupEvent { + } + + interface PopupCloseEvent extends PopupEvent { + } + + interface PopupDeactivateEvent extends PopupEvent { + } + + interface PopupOpenEvent extends PopupEvent { + } + + + class ProgressBar extends kendo.ui.Widget { + + static fn: ProgressBar; + + options: ProgressBarOptions; + + progressStatus: JQuery; + progressWrapper: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ProgressBar; + + constructor(element: Element, options?: ProgressBarOptions); + + + enable(enable: boolean): void; + value(): number; + value(value: number): void; + + } + + interface ProgressBarAnimation { + duration?: number; + } + + interface ProgressBarOptions { + name?: string; + animation?: ProgressBarAnimation; + chunkCount?: number; + enable?: boolean; + max?: number; + min?: number; + orientation?: string; + reverse?: boolean; + showStatus?: boolean; + type?: string; + value?: number; + change?(e: ProgressBarChangeEvent): void; + complete?(e: ProgressBarCompleteEvent): void; + } + interface ProgressBarEvent { + sender: ProgressBar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ProgressBarChangeEvent extends ProgressBarEvent { + value?: number; + } + + interface ProgressBarCompleteEvent extends ProgressBarEvent { + value?: number; + } + + + class Prompt extends kendo.ui.Dialog { + + static fn: Prompt; + + options: PromptOptions; + + result: JQueryPromise; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Prompt; + + constructor(element: Element, options?: PromptOptions); + + + + } + + interface PromptMessages { + okText?: string; + cancel?: string; + } + + interface PromptOptions { + name?: string; + messages?: PromptMessages; + } + interface PromptEvent { + sender: Prompt; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class RangeSlider extends kendo.ui.Widget { + + static fn: RangeSlider; + + options: RangeSliderOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): RangeSlider; + + constructor(element: Element, options?: RangeSliderOptions); + + + destroy(): void; + enable(enable: boolean): void; + value(): any; + value(selectionStart: number, selectionEnd: number): void; + values(): any; + resize(): void; + + } + + interface RangeSliderTooltip { + enabled?: boolean; + format?: string; + template?: string; + } + + interface RangeSliderOptions { + name?: string; + largeStep?: number; + leftDragHandleTitle?: string; + max?: number; + min?: number; + orientation?: string; + rightDragHandleTitle?: string; + selectionEnd?: number; + selectionStart?: number; + smallStep?: number; + tickPlacement?: string; + tooltip?: RangeSliderTooltip; + change?(e: RangeSliderChangeEvent): void; + slide?(e: RangeSliderSlideEvent): void; + } + interface RangeSliderEvent { + sender: RangeSlider; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface RangeSliderChangeEvent extends RangeSliderEvent { + value?: any; + } + + interface RangeSliderSlideEvent extends RangeSliderEvent { + value?: any; + } + + + class ResponsivePanel extends kendo.ui.Widget { + + static fn: ResponsivePanel; + + options: ResponsivePanelOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ResponsivePanel; + + constructor(element: Element, options?: ResponsivePanelOptions); + + + close(): void; + destroy(): void; + open(): void; + + } + + interface ResponsivePanelOptions { + name?: string; + autoClose?: boolean; + breakpoint?: number; + orientation?: string; + toggleButton?: string; + close?(e: ResponsivePanelEvent): void; + open?(e: ResponsivePanelEvent): void; + } + interface ResponsivePanelEvent { + sender: ResponsivePanel; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Scheduler extends kendo.ui.Widget { + + static fn: Scheduler; + + options: SchedulerOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Scheduler; + + constructor(element: Element, options?: SchedulerOptions); + + + addEvent(data: any): void; + cancelEvent(): void; + data(): void; + date(): Date; + date(value?: Date): void; + destroy(): void; + editEvent(event: string): void; + editEvent(event: kendo.data.SchedulerEvent): void; + items(): any; + occurrenceByUid(uid: string): kendo.data.SchedulerEvent; + occurrencesInRange(start: Date, end: Date): any; + refresh(): void; + removeEvent(event: string): void; + removeEvent(event: kendo.data.SchedulerEvent): void; + resourcesBySlot(slot: any): any; + saveAsPDF(): JQueryPromise; + saveEvent(): void; + select(): void; + select(events: any, options: any): void; + setDataSource(dataSource: kendo.data.SchedulerDataSource): void; + slotByPosition(xPosition: number, yPosition: number): any; + slotByElement(element: Element): any; + slotByElement(element: JQuery): any; + view(type?: string): void; + viewName(): string; + + } + + interface SchedulerCurrentTimeMarker { + updateInterval?: number; + useLocalTimezone?: boolean; + } + + interface SchedulerEditable { + confirmation?: boolean|string; + create?: boolean; + destroy?: boolean; + editRecurringMode?: string; + move?: boolean; + resize?: boolean; + template?: string|Function; + update?: boolean; + window?: any; + } + + interface SchedulerFooter { + command?: string|boolean; + } + + interface SchedulerGroup { + date?: boolean; + resources?: any; + orientation?: string; + } + + interface SchedulerMessagesEditable { + confirmation?: string; + } + + interface SchedulerMessagesEditor { + allDayEvent?: string; + description?: string; + editorTitle?: string; + end?: string; + endTimezone?: string; + repeat?: string; + separateTimezones?: string; + start?: string; + startTimezone?: string; + timezone?: string; + timezoneEditorButton?: string; + timezoneEditorTitle?: string; + title?: string; + } + + interface SchedulerMessagesRecurrenceEditorDaily { + interval?: string; + repeatEvery?: string; + } + + interface SchedulerMessagesRecurrenceEditorEnd { + after?: string; + occurrence?: string; + label?: string; + never?: string; + mobileLabel?: string; + on?: string; + } + + interface SchedulerMessagesRecurrenceEditorFrequencies { + daily?: string; + monthly?: string; + never?: string; + weekly?: string; + yearly?: string; + } + + interface SchedulerMessagesRecurrenceEditorMonthly { + day?: string; + interval?: string; + repeatEvery?: string; + repeatOn?: string; + } + + interface SchedulerMessagesRecurrenceEditorOffsetPositions { + first?: string; + second?: string; + third?: string; + fourth?: string; + last?: string; + } + + interface SchedulerMessagesRecurrenceEditorWeekdays { + day?: string; + weekday?: string; + weekend?: string; + } + + interface SchedulerMessagesRecurrenceEditorWeekly { + interval?: string; + repeatEvery?: string; + repeatOn?: string; + } + + interface SchedulerMessagesRecurrenceEditorYearly { + of?: string; + repeatEvery?: string; + repeatOn?: string; + interval?: string; + } + + interface SchedulerMessagesRecurrenceEditor { + daily?: SchedulerMessagesRecurrenceEditorDaily; + end?: SchedulerMessagesRecurrenceEditorEnd; + frequencies?: SchedulerMessagesRecurrenceEditorFrequencies; + monthly?: SchedulerMessagesRecurrenceEditorMonthly; + offsetPositions?: SchedulerMessagesRecurrenceEditorOffsetPositions; + weekly?: SchedulerMessagesRecurrenceEditorWeekly; + weekdays?: SchedulerMessagesRecurrenceEditorWeekdays; + yearly?: SchedulerMessagesRecurrenceEditorYearly; + } + + interface SchedulerMessagesRecurrenceMessages { + deleteRecurring?: string; + deleteWindowOccurrence?: string; + deleteWindowSeries?: string; + deleteWindowTitle?: string; + editRecurring?: string; + editWindowOccurrence?: string; + editWindowSeries?: string; + editWindowTitle?: string; + } + + interface SchedulerMessagesViews { + day?: string; + week?: string; + month?: string; + agenda?: string; + } + + interface SchedulerMessages { + allDay?: string; + ariaEventLabel?: string; + ariaSlotLabel?: string; + cancel?: string; + date?: string; + deleteWindowTitle?: string; + destroy?: string; + event?: string; + defaultRowText?: string; + pdf?: string; + save?: string; + showFullDay?: string; + showWorkDay?: string; + time?: string; + today?: string; + editable?: SchedulerMessagesEditable; + editor?: SchedulerMessagesEditor; + recurrenceEditor?: SchedulerMessagesRecurrenceEditor; + recurrenceMessages?: SchedulerMessagesRecurrenceMessages; + views?: SchedulerMessagesViews; + } + + interface SchedulerPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface SchedulerPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: SchedulerPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface SchedulerResource { + dataColorField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + field?: string; + multiple?: boolean; + name?: string; + title?: string; + valuePrimitive?: boolean; + } + + interface SchedulerToolbarItem { + name?: string; + } + + interface SchedulerViewEditable { + create?: boolean; + destroy?: boolean; + update?: boolean; + } + + interface SchedulerViewGroup { + date?: boolean; + orientation?: string; + } + + interface SchedulerView { + allDayEventTemplate?: string|Function; + allDaySlot?: boolean; + allDaySlotTemplate?: string|Function; + columnWidth?: number; + dateHeaderTemplate?: string|Function; + dayTemplate?: string|Function; + editable?: boolean|SchedulerViewEditable; + endTime?: Date; + eventHeight?: number; + eventTemplate?: string|Function; + eventTimeTemplate?: string|Function; + group?: SchedulerViewGroup; + majorTick?: number; + majorTimeHeaderTemplate?: string|Function; + minorTickCount?: number; + minorTimeHeaderTemplate?: string|Function; + selected?: boolean; + selectedDateFormat?: string; + selectedShortDateFormat?: string; + showWorkHours?: boolean; + slotTemplate?: string|Function; + startTime?: Date; + title?: string; + type?: string; + workWeekStart?: number; + workWeekEnd?: number; + } + + interface SchedulerSelectOptions { + events?: any; + resources?: any; + start?: Date; + end?: Date; + isAllDay?: boolean; + } + + interface SchedulerOptions { + name?: string; + allDayEventTemplate?: string|Function; + allDaySlot?: boolean; + autoBind?: boolean; + currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; + dataSource?: any|any|kendo.data.SchedulerDataSource; + date?: Date; + dateHeaderTemplate?: string|Function; + editable?: boolean|SchedulerEditable; + endTime?: Date; + eventTemplate?: string|Function; + footer?: boolean|SchedulerFooter; + group?: SchedulerGroup; + height?: number|string; + majorTick?: number; + majorTimeHeaderTemplate?: string|Function; + max?: Date; + messages?: SchedulerMessages; + min?: Date; + minorTickCount?: number; + minorTimeHeaderTemplate?: string|Function; + mobile?: boolean|string; + pdf?: SchedulerPdf; + resources?: SchedulerResource[]; + selectable?: boolean; + showWorkHours?: boolean; + snap?: boolean; + startTime?: Date; + timezone?: string; + toolbar?: SchedulerToolbarItem[]; + views?: SchedulerView[]; + groupHeaderTemplate?: string|Function; + width?: number|string; + workDayStart?: Date; + workDayEnd?: Date; + workWeekStart?: number; + workWeekEnd?: number; + add?(e: SchedulerAddEvent): void; + cancel?(e: SchedulerCancelEvent): void; + change?(e: SchedulerChangeEvent): void; + dataBinding?(e: SchedulerDataBindingEvent): void; + dataBound?(e: SchedulerDataBoundEvent): void; + edit?(e: SchedulerEditEvent): void; + moveStart?(e: SchedulerMoveStartEvent): void; + move?(e: SchedulerMoveEvent): void; + moveEnd?(e: SchedulerMoveEndEvent): void; + navigate?(e: SchedulerNavigateEvent): void; + pdfExport?(e: SchedulerPdfExportEvent): void; + remove?(e: SchedulerRemoveEvent): void; + resizeStart?(e: SchedulerResizeStartEvent): void; + resize?(e: SchedulerResizeEvent): void; + resizeEnd?(e: SchedulerResizeEndEvent): void; + save?(e: SchedulerSaveEvent): void; + } + interface SchedulerEvent { + sender: Scheduler; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SchedulerAddEvent extends SchedulerEvent { + event?: any; + } + + interface SchedulerCancelEvent extends SchedulerEvent { + container?: JQuery; + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerChangeEvent extends SchedulerEvent { + start?: Date; + end?: Date; + events?: any; + slots?: any; + resources?: any; + } + + interface SchedulerDataBindingEvent extends SchedulerEvent { + } + + interface SchedulerDataBoundEvent extends SchedulerEvent { + } + + interface SchedulerEditEvent extends SchedulerEvent { + container?: JQuery; + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerMoveStartEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerMoveEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + slot?: any; + } + + interface SchedulerMoveEndEvent extends SchedulerEvent { + start?: Date; + end?: Date; + event?: kendo.data.SchedulerEvent; + slot?: any; + resources?: any; + } + + interface SchedulerNavigateEvent extends SchedulerEvent { + action?: string; + date?: Date; + view?: string; + } + + interface SchedulerPdfExportEvent extends SchedulerEvent { + promise?: JQueryPromise; + } + + interface SchedulerRemoveEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerResizeStartEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerResizeEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + slot?: any; + } + + interface SchedulerResizeEndEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + slot?: any; + } + + interface SchedulerSaveEvent extends SchedulerEvent { + container?: JQuery; + event?: kendo.data.SchedulerEvent; + } + + + class Slider extends kendo.ui.Widget { + + static fn: Slider; + + options: SliderOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Slider; + + constructor(element: Element, options?: SliderOptions); + + + destroy(): void; + enable(enable: boolean): void; + value(): number; + value(value: number): void; + resize(): void; + + } + + interface SliderTooltip { + enabled?: boolean; + format?: string; + template?: string; + } + + interface SliderOptions { + name?: string; + decreaseButtonTitle?: string; + dragHandleTitle?: string; + increaseButtonTitle?: string; + largeStep?: number; + max?: number; + min?: number; + orientation?: string; + showButtons?: boolean; + smallStep?: number; + tickPlacement?: string; + tooltip?: SliderTooltip; + value?: number; + change?(e: SliderChangeEvent): void; + slide?(e: SliderSlideEvent): void; + } + interface SliderEvent { + sender: Slider; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SliderChangeEvent extends SliderEvent { + value?: number; + } + + interface SliderSlideEvent extends SliderEvent { + value?: number; + } + + + class Sortable extends kendo.ui.Widget { + + static fn: Sortable; + + options: SortableOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Sortable; + + constructor(element: Element, options?: SortableOptions); + + + indexOf(element: JQuery): number; + items(): JQuery; + + } + + interface SortableCursorOffset { + left?: number; + top?: number; + } + + interface SortableOptions { + name?: string; + axis?: string; + autoScroll?: boolean; + container?: string|JQuery; + connectWith?: string; + cursor?: string; + cursorOffset?: SortableCursorOffset; + disabled?: string; + filter?: string; + handler?: string; + hint?: Function|string|JQuery; + holdToDrag?: boolean; + ignore?: string; + placeholder?: Function|string|JQuery; + start?(e: SortableStartEvent): void; + move?(e: SortableMoveEvent): void; + end?(e: SortableEndEvent): void; + change?(e: SortableChangeEvent): void; + cancel?(e: SortableCancelEvent): void; + } + interface SortableEvent { + sender: Sortable; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SortableStartEvent extends SortableEvent { + draggableEvent?: any; + item?: JQuery; + } + + interface SortableMoveEvent extends SortableEvent { + item?: JQuery; + target?: JQuery; + list?: kendo.ui.Sortable; + draggableEvent?: any; + } + + interface SortableEndEvent extends SortableEvent { + action?: string; + item?: JQuery; + oldIndex?: number; + newIndex?: number; + draggableEvent?: any; + } + + interface SortableChangeEvent extends SortableEvent { + action?: string; + item?: JQuery; + oldIndex?: number; + newIndex?: number; + draggableEvent?: any; + } + + interface SortableCancelEvent extends SortableEvent { + item?: JQuery; + } + + + class Splitter extends kendo.ui.Widget { + + static fn: Splitter; + + options: SplitterOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Splitter; + + constructor(element: Element, options?: SplitterOptions); + + + ajaxRequest(pane: string, url: string, data: any): void; + ajaxRequest(pane: string, url: string, data: string): void; + ajaxRequest(pane: Element, url: string, data: any): void; + ajaxRequest(pane: Element, url: string, data: string): void; + ajaxRequest(pane: JQuery, url: string, data: any): void; + ajaxRequest(pane: JQuery, url: string, data: string): void; + append(config?: any): JQuery; + collapse(pane: string): void; + collapse(pane: Element): void; + collapse(pane: JQuery): void; + destroy(): void; + expand(pane: string): void; + expand(pane: Element): void; + expand(pane: JQuery): void; + insertAfter(config: any, referencePane: string): JQuery; + insertAfter(config: any, referencePane: Element): JQuery; + insertAfter(config: any, referencePane: JQuery): JQuery; + insertBefore(config: any, referencePane: string): JQuery; + insertBefore(config: any, referencePane: Element): JQuery; + insertBefore(config: any, referencePane: JQuery): JQuery; + max(pane: string, value: string): void; + max(pane: Element, value: string): void; + max(pane: JQuery, value: string): void; + min(pane: string, value: string): void; + min(pane: Element, value: string): void; + min(pane: JQuery, value: string): void; + remove(pane: string): void; + remove(pane: Element): void; + remove(pane: JQuery): void; + size(pane: string): any; + size(pane: Element): any; + size(pane: JQuery): any; + size(pane: string, value?: string): void; + size(pane: Element, value?: string): void; + size(pane: JQuery, value?: string): void; + toggle(pane: string, expand?: boolean): void; + toggle(pane: Element, expand?: boolean): void; + toggle(pane: JQuery, expand?: boolean): void; + + } + + interface SplitterPane { + collapsed?: boolean; + collapsedSize?: string; + collapsible?: boolean; + contentUrl?: string; + max?: string; + min?: string; + resizable?: boolean; + scrollable?: boolean; + size?: string; + } + + interface SplitterOptions { + name?: string; + orientation?: string; + panes?: SplitterPane[]; + collapse?(e: SplitterCollapseEvent): void; + contentLoad?(e: SplitterContentLoadEvent): void; + error?(e: SplitterErrorEvent): void; + expand?(e: SplitterExpandEvent): void; + layoutChange?(e: SplitterEvent): void; + resize?(e: SplitterEvent): void; + } + interface SplitterEvent { + sender: Splitter; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SplitterCollapseEvent extends SplitterEvent { + pane?: Element; + } + + interface SplitterContentLoadEvent extends SplitterEvent { + pane?: Element; + } + + interface SplitterErrorEvent extends SplitterEvent { + xhr?: JQueryXHR; + status?: string; + } + + interface SplitterExpandEvent extends SplitterEvent { + pane?: Element; + } + + + class Spreadsheet extends kendo.ui.Widget { + + static fn: Spreadsheet; + + options: SpreadsheetOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Spreadsheet; + + constructor(element: Element, options?: SpreadsheetOptions); + + + activeSheet(): kendo.spreadsheet.Sheet; + activeSheet(sheet?: kendo.spreadsheet.Sheet): void; + sheets(): any; + fromFile(blob: Blob): JQueryPromise; + fromFile(blob: File): JQueryPromise; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + sheetByName(name: string): kendo.spreadsheet.Sheet; + sheetIndex(sheet: kendo.spreadsheet.Sheet): number; + sheetByIndex(index: number): kendo.spreadsheet.Sheet; + insertSheet(options: any): kendo.spreadsheet.Sheet; + moveSheetToIndex(sheet: kendo.spreadsheet.Sheet, index: number): void; + removeSheet(sheet: kendo.spreadsheet.Sheet): void; + renameSheet(sheet: kendo.spreadsheet.Sheet, newSheetName: string): kendo.spreadsheet.Sheet; + toJSON(): any; + fromJSON(data: any): void; + defineName(name: string, value: string, hidden: boolean): void; + undefineName(name: string): void; + + } + + interface SpreadsheetExcel { + fileName?: string; + forceProxy?: boolean; + proxyURL?: string; + } + + interface SpreadsheetPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface SpreadsheetPdf { + area?: string; + author?: string; + creator?: string; + date?: Date; + fileName?: string; + fitWidth?: boolean; + forceProxy?: boolean; + guidelines?: boolean; + hCenter?: boolean; + keywords?: string; + landscape?: boolean; + margin?: SpreadsheetPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + vCenter?: boolean; + } + + interface SpreadsheetSheetColumn { + index?: number; + width?: number; + } + + interface SpreadsheetSheetFilterColumnCriteriaItem { + operator?: string; + value?: string; + } + + interface SpreadsheetSheetFilterColumn { + criteria?: SpreadsheetSheetFilterColumnCriteriaItem[]; + filter?: string; + index?: number; + logic?: string; + type?: string; + value?: number|string|Date; + values?: any; + } + + interface SpreadsheetSheetFilter { + columns?: SpreadsheetSheetFilterColumn[]; + ref?: string; + } + + interface SpreadsheetSheetRowCellBorderBottom { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderLeft { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderRight { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderTop { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellValidation { + type?: string; + comparerType?: string; + dataType?: string; + from?: string; + showButton?: boolean; + to?: string; + allowNulls?: boolean; + messageTemplate?: string; + titleTemplate?: string; + } + + interface SpreadsheetSheetRowCell { + background?: string; + borderBottom?: SpreadsheetSheetRowCellBorderBottom; + borderLeft?: SpreadsheetSheetRowCellBorderLeft; + borderTop?: SpreadsheetSheetRowCellBorderTop; + borderRight?: SpreadsheetSheetRowCellBorderRight; + color?: string; + fontFamily?: string; + fontSize?: number; + italic?: boolean; + bold?: boolean; + enable?: boolean; + format?: string; + formula?: string; + index?: number; + link?: string; + textAlign?: string; + underline?: boolean; + value?: number|string|boolean|Date; + validation?: SpreadsheetSheetRowCellValidation; + verticalAlign?: string; + wrap?: boolean; + } + + interface SpreadsheetSheetRow { + cells?: SpreadsheetSheetRowCell[]; + height?: number; + index?: number; + type?: string; + } + + interface SpreadsheetSheetSortColumn { + ascending?: boolean; + index?: number; + } + + interface SpreadsheetSheetSort { + columns?: SpreadsheetSheetSortColumn[]; + ref?: string; + } + + interface SpreadsheetSheet { + activeCell?: string; + name?: string; + columns?: SpreadsheetSheetColumn[]; + dataSource?: kendo.data.DataSource; + filter?: SpreadsheetSheetFilter; + frozenColumns?: number; + frozenRows?: number; + mergedCells?: any; + rows?: SpreadsheetSheetRow[]; + selection?: string; + showGridLines?: boolean; + sort?: SpreadsheetSheetSort; + } + + interface SpreadsheetToolbar { + home?: boolean|any; + insert?: boolean|any; + data?: boolean|any; + } + + interface SpreadsheetInsertSheetOptions { + rows?: number; + columns?: number; + rowHeight?: number; + columnWidth?: number; + headerHeight?: number; + headerWidth?: number; + dataSource?: kendo.data.DataSource; + data?: any; + } + + interface SpreadsheetOptions { + name?: string; + activeSheet?: string; + columnWidth?: number; + columns?: number; + headerHeight?: number; + headerWidth?: number; + excel?: SpreadsheetExcel; + pdf?: SpreadsheetPdf; + rowHeight?: number; + rows?: number; + sheets?: SpreadsheetSheet[]; + sheetsbar?: boolean; + toolbar?: boolean|SpreadsheetToolbar; + change?(e: SpreadsheetChangeEvent): void; + render?(e: SpreadsheetRenderEvent): void; + excelExport?(e: SpreadsheetExcelExportEvent): void; + excelImport?(e: SpreadsheetExcelImportEvent): void; + pdfExport?(e: SpreadsheetPdfExportEvent): void; + } + interface SpreadsheetEvent { + sender: Spreadsheet; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SpreadsheetChangeEvent extends SpreadsheetEvent { + range?: kendo.spreadsheet.Range; + } + + interface SpreadsheetRenderEvent extends SpreadsheetEvent { + } + + interface SpreadsheetExcelExportEvent extends SpreadsheetEvent { + data?: any; + workbook?: kendo.ooxml.Workbook; + } + + interface SpreadsheetExcelImportEvent extends SpreadsheetEvent { + file?: Blob|File; + progress?: JQueryPromise; + } + + interface SpreadsheetPdfExportEvent extends SpreadsheetEvent { + promise?: JQueryPromise; + } + + + class TabStrip extends kendo.ui.Widget { + + static fn: TabStrip; + + options: TabStripOptions; + + dataSource: kendo.data.DataSource; + tabGroup: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TabStrip; + + constructor(element: Element, options?: TabStripOptions); + + + activateTab(item: JQuery): void; + append(tab: any): kendo.ui.TabStrip; + contentElement(itemIndex: number): Element; + contentHolder(itemIndex: number): Element; + deactivateTab(item: JQuery): void; + destroy(): void; + disable(element: string): kendo.ui.TabStrip; + disable(element: Element): kendo.ui.TabStrip; + disable(element: JQuery): kendo.ui.TabStrip; + enable(element: string, enable?: boolean): kendo.ui.TabStrip; + enable(element: Element, enable?: boolean): kendo.ui.TabStrip; + enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip; + insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip; + insertAfter(item: Element, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: Element, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; + insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: Element, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: Element, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: JQuery, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; + items(): HTMLCollection; + reload(element: string): kendo.ui.TabStrip; + reload(element: Element): kendo.ui.TabStrip; + reload(element: JQuery): kendo.ui.TabStrip; + remove(element: string): kendo.ui.TabStrip; + remove(element: number): kendo.ui.TabStrip; + remove(element: JQuery): kendo.ui.TabStrip; + select(): JQuery; + select(element: string): void; + select(element: Element): void; + select(element: JQuery): void; + select(element: number): void; + setDataSource(dataSource: any): void; + setDataSource(dataSource: kendo.data.DataSource): void; + + } + + interface TabStripAnimationClose { + duration?: number; + effects?: string; + } + + interface TabStripAnimationOpen { + duration?: number; + effects?: string; + } + + interface TabStripAnimation { + close?: TabStripAnimationClose; + open?: TabStripAnimationOpen; + } + + interface TabStripScrollable { + distance?: number; + } + + interface TabStripOptions { + name?: string; + animation?: boolean|TabStripAnimation; + collapsible?: boolean; + contentUrls?: any; + dataContentField?: string; + dataContentUrlField?: string; + dataImageUrlField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataSpriteCssClass?: string; + dataTextField?: string; + dataUrlField?: string; + navigatable?: boolean; + scrollable?: boolean|TabStripScrollable; + tabPosition?: string; + value?: string; + activate?(e: TabStripActivateEvent): void; + contentLoad?(e: TabStripContentLoadEvent): void; + error?(e: TabStripErrorEvent): void; + select?(e: TabStripSelectEvent): void; + show?(e: TabStripShowEvent): void; + } + interface TabStripEvent { + sender: TabStrip; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TabStripActivateEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + interface TabStripContentLoadEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + interface TabStripErrorEvent extends TabStripEvent { + xhr?: JQueryXHR; + status?: string; + } + + interface TabStripSelectEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + interface TabStripShowEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + + class TimePicker extends kendo.ui.Widget { + + static fn: TimePicker; + + options: TimePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TimePicker; + + constructor(element: Element, options?: TimePickerOptions); + + + close(): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(): void; + setOptions(options: any): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + + } + + interface TimePickerAnimationClose { + effects?: string; + duration?: number; + } + + interface TimePickerAnimationOpen { + effects?: string; + duration?: number; + } + + interface TimePickerAnimation { + close?: TimePickerAnimationClose; + open?: TimePickerAnimationOpen; + } + + interface TimePickerOptions { + name?: string; + animation?: boolean|TimePickerAnimation; + culture?: string; + dates?: any; + format?: string; + interval?: number; + max?: Date; + min?: Date; + parseFormats?: any; + value?: Date; + change?(e: TimePickerChangeEvent): void; + close?(e: TimePickerCloseEvent): void; + open?(e: TimePickerOpenEvent): void; + } + interface TimePickerEvent { + sender: TimePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TimePickerChangeEvent extends TimePickerEvent { + } + + interface TimePickerCloseEvent extends TimePickerEvent { + } + + interface TimePickerOpenEvent extends TimePickerEvent { + } + + + class ToolBar extends kendo.ui.Widget { + + static fn: ToolBar; + + options: ToolBarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ToolBar; + + constructor(element: Element, options?: ToolBarOptions); + + + add(command: any): void; + destroy(): void; + enable(command: string, enable: boolean): void; + enable(command: Element, enable: boolean): void; + enable(command: JQuery, enable: boolean): void; + getSelectedFromGroup(groupName: string): void; + hide(command: string): void; + hide(command: Element): void; + hide(command: JQuery): void; + remove(command: string): void; + remove(command: Element): void; + remove(command: JQuery): void; + show(command: string): void; + show(command: Element): void; + show(command: JQuery): void; + toggle(command: string, state: boolean): void; + toggle(command: Element, state: boolean): void; + toggle(command: JQuery, state: boolean): void; + + } + + interface ToolBarItemButton { + attributes?: any; + click?: Function; + enable?: boolean; + group?: string; + hidden?: boolean; + icon?: string; + id?: string; + imageUrl?: string; + selected?: boolean; + showIcon?: string; + showText?: string; + spriteCssClass?: string; + toggle?: Function; + togglable?: boolean; + text?: string; + url?: string; + } + + interface ToolBarItemMenuButton { + attributes?: any; + enable?: boolean; + hidden?: boolean; + icon?: string; + id?: string; + imageUrl?: string; + spriteCssClass?: string; + text?: string; + url?: string; + } + + interface ToolBarItem { + attributes?: any; + buttons?: ToolBarItemButton[]; + click?: Function; + enable?: boolean; + group?: string; + hidden?: boolean; + icon?: string; + id?: string; + imageUrl?: string; + menuButtons?: ToolBarItemMenuButton[]; + overflow?: string; + overflowTemplate?: string|Function; + primary?: boolean; + selected?: boolean; + showIcon?: string; + showText?: string; + spriteCssClass?: string; + template?: string|Function; + text?: string; + togglable?: boolean; + toggle?: Function; + type?: string; + url?: string; + } + + interface ToolBarOptions { + name?: string; + resizable?: boolean; + items?: ToolBarItem[]; + click?(e: ToolBarClickEvent): void; + close?(e: ToolBarCloseEvent): void; + open?(e: ToolBarOpenEvent): void; + toggle?(e: ToolBarToggleEvent): void; + overflowClose?(e: ToolBarOverflowCloseEvent): void; + overflowOpen?(e: ToolBarOverflowOpenEvent): void; + } + interface ToolBarEvent { + sender: ToolBar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ToolBarClickEvent extends ToolBarEvent { + target?: JQuery; + id?: string; + } + + interface ToolBarCloseEvent extends ToolBarEvent { + SplitButton?: JQuery; + } + + interface ToolBarOpenEvent extends ToolBarEvent { + SplitButton?: JQuery; + } + + interface ToolBarToggleEvent extends ToolBarEvent { + target?: JQuery; + checked?: boolean; + id?: string; + } + + interface ToolBarOverflowCloseEvent extends ToolBarEvent { + } + + interface ToolBarOverflowOpenEvent extends ToolBarEvent { + } + + + class Tooltip extends kendo.ui.Widget { + + static fn: Tooltip; + + options: TooltipOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Tooltip; + + constructor(element: Element, options?: TooltipOptions); + + + show(element: JQuery): void; + hide(): void; + refresh(): void; + target(): JQuery; + + } + + interface TooltipAnimationClose { + effects?: string; + duration?: number; + } + + interface TooltipAnimationOpen { + effects?: string; + duration?: number; + } + + interface TooltipAnimation { + close?: TooltipAnimationClose; + open?: TooltipAnimationOpen; + } + + interface TooltipContent { + url?: string; + } + + interface TooltipOptions { + name?: string; + autoHide?: boolean; + animation?: boolean|TooltipAnimation; + content?: TooltipContent; + callout?: boolean; + filter?: string; + iframe?: boolean; + height?: number; + width?: number; + position?: string; + showAfter?: number; + showOn?: string; + contentLoad?(e: TooltipEvent): void; + show?(e: TooltipEvent): void; + hide?(e: TooltipEvent): void; + requestStart?(e: TooltipRequestStartEvent): void; + error?(e: TooltipErrorEvent): void; + } + interface TooltipEvent { + sender: Tooltip; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TooltipRequestStartEvent extends TooltipEvent { + target?: JQuery; + options?: any; + } + + interface TooltipErrorEvent extends TooltipEvent { + xhr?: JQueryXHR; + status?: string; + } + + + class Touch extends kendo.ui.Widget { + + static fn: Touch; + + options: TouchOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Touch; + + constructor(element: Element, options?: TouchOptions); + + + cancel(): void; + destroy(): void; + + } + + interface TouchOptions { + name?: string; + filter?: string; + surface?: JQuery; + multiTouch?: boolean; + enableSwipe?: boolean; + minXDelta?: number; + maxYDelta?: number; + maxDuration?: number; + minHold?: number; + doubleTapTimeout?: number; + touchstart?(e: TouchTouchstartEvent): void; + dragstart?(e: TouchDragstartEvent): void; + drag?(e: TouchDragEvent): void; + dragend?(e: TouchDragendEvent): void; + tap?(e: TouchTapEvent): void; + doubletap?(e: TouchDoubletapEvent): void; + hold?(e: TouchHoldEvent): void; + swipe?(e: TouchSwipeEvent): void; + gesturestart?(e: TouchGesturestartEvent): void; + gesturechange?(e: TouchGesturechangeEvent): void; + gestureend?(e: TouchGestureendEvent): void; + } + interface TouchEvent { + sender: Touch; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TouchTouchstartEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDragstartEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDragEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDragendEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchTapEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDoubletapEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchHoldEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchSwipeEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchGesturestartEvent extends TouchEvent { + touches?: any; + event?: JQueryEventObject; + distance?: number; + center?: kendo.mobile.ui.Point; + } + + interface TouchGesturechangeEvent extends TouchEvent { + touches?: any; + event?: JQueryEventObject; + distance?: number; + center?: kendo.mobile.ui.Point; + } + + interface TouchGestureendEvent extends TouchEvent { + touches?: any; + event?: JQueryEventObject; + distance?: number; + center?: kendo.mobile.ui.Point; + } + + + class TreeList extends kendo.ui.Widget { + + static fn: TreeList; + + options: TreeListOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TreeList; + + constructor(element: Element, options?: TreeListOptions); + + + addRow(parentRow: string): void; + addRow(parentRow: Element): void; + addRow(parentRow: JQuery): void; + autoFitColumn(column: number): void; + autoFitColumn(column: string): void; + autoFitColumn(column: any): void; + cancelRow(): void; + clearSelection(): void; + collapse(): void; + dataItem(row: string): kendo.data.TreeListModel; + dataItem(row: Element): kendo.data.TreeListModel; + dataItem(row: JQuery): kendo.data.TreeListModel; + destroy(): void; + editRow(row: JQuery): void; + expand(row: string): JQueryPromise; + expand(row: Element): JQueryPromise; + expand(row: JQuery): JQueryPromise; + itemFor(model: kendo.data.TreeListModel): JQuery; + itemFor(model: any): JQuery; + items(): any; + refresh(): void; + removeRow(row: string): void; + removeRow(row: Element): void; + removeRow(row: JQuery): void; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + saveRow(): void; + select(): JQuery; + select(rows: Element): void; + select(rows: JQuery): void; + setDataSource(dataSource: kendo.data.TreeListDataSource): void; + showColumn(column: number): void; + showColumn(column: string): void; + hideColumn(column: number): void; + hideColumn(column: string): void; + lockColumn(column: number): void; + lockColumn(column: string): void; + unlockColumn(column: number): void; + unlockColumn(column: string): void; + reorderColumn(destIndex: number, column: any): void; + + } + + interface TreeListColumnMenuMessages { + columns?: string; + filter?: string; + sortAscending?: string; + sortDescending?: string; + } + + interface TreeListColumnMenu { + columns?: boolean; + filterable?: boolean; + sortable?: boolean; + messages?: TreeListColumnMenuMessages; + } + + interface TreeListColumnCommandItem { + className?: string; + click?: Function; + name?: string; + text?: string; + } + + interface TreeListColumnFilterable { + ui?: string|Function; + } + + interface TreeListColumnSortable { + compare?: Function; + } + + interface TreeListColumn { + attributes?: any; + command?: TreeListColumnCommandItem[]; + encoded?: boolean; + expandable?: boolean; + field?: string; + filterable?: boolean|TreeListColumnFilterable; + footerTemplate?: string|Function; + format?: string; + headerAttributes?: any; + headerTemplate?: string|Function; + minScreenWidth?: number; + sortable?: boolean|TreeListColumnSortable; + template?: string|Function; + title?: string; + width?: string|number; + hidden?: boolean; + menu?: boolean; + locked?: boolean; + lockable?: boolean; + } + + interface TreeListEditable { + mode?: string; + move?: boolean; + template?: string|Function; + window?: any; + } + + interface TreeListExcel { + fileName?: string; + filterable?: boolean; + forceProxy?: boolean; + proxyURL?: string; + } + + interface TreeListFilterableMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + selectValue?: string; + cancel?: string; + operator?: string; + } + + interface TreeListFilterable { + extra?: boolean; + messages?: TreeListFilterableMessages; + } + + interface TreeListMessagesCommands { + canceledit?: string; + create?: string; + createchild?: string; + destroy?: string; + edit?: string; + excel?: string; + pdf?: string; + update?: string; + } + + interface TreeListMessages { + commands?: TreeListMessagesCommands; + loading?: string; + noRows?: string; + requestFailed?: string; + retry?: string; + } + + interface TreeListPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface TreeListPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: TreeListPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface TreeListSortable { + allowUnsort?: boolean; + mode?: string; + } + + interface TreeListToolbarItem { + click?: Function; + name?: string; + text?: string; + } + + interface TreeListOptions { + name?: string; + autoBind?: boolean; + columns?: TreeListColumn[]; + resizable?: boolean; + reorderable?: boolean; + columnMenu?: boolean|TreeListColumnMenu; + dataSource?: any|any|kendo.data.TreeListDataSource; + editable?: boolean|TreeListEditable; + excel?: TreeListExcel; + filterable?: boolean|TreeListFilterable; + height?: number|string; + messages?: TreeListMessages; + pdf?: TreeListPdf; + scrollable?: boolean|any; + selectable?: boolean|string; + sortable?: boolean|TreeListSortable; + toolbar?: TreeListToolbarItem[] | any; + cancel?(e: TreeListCancelEvent): void; + change?(e: TreeListChangeEvent): void; + collapse?(e: TreeListCollapseEvent): void; + dataBinding?(e: TreeListDataBindingEvent): void; + dataBound?(e: TreeListDataBoundEvent): void; + dragstart?(e: TreeListDragstartEvent): void; + drag?(e: TreeListDragEvent): void; + dragend?(e: TreeListDragendEvent): void; + drop?(e: TreeListDropEvent): void; + edit?(e: TreeListEditEvent): void; + excelExport?(e: TreeListExcelExportEvent): void; + expand?(e: TreeListExpandEvent): void; + filterMenuInit?(e: TreeListFilterMenuInitEvent): void; + pdfExport?(e: TreeListPdfExportEvent): void; + remove?(e: TreeListRemoveEvent): void; + save?(e: TreeListSaveEvent): void; + columnShow?(e: TreeListColumnShowEvent): void; + columnHide?(e: TreeListColumnHideEvent): void; + columnReorder?(e: TreeListColumnReorderEvent): void; + columnResize?(e: TreeListColumnResizeEvent): void; + columnMenuInit?(e: TreeListColumnMenuInitEvent): void; + columnLock?(e: TreeListColumnLockEvent): void; + columnUnlock?(e: TreeListColumnUnlockEvent): void; + } + interface TreeListEvent { + sender: TreeList; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TreeListCancelEvent extends TreeListEvent { + container?: JQuery; + model?: kendo.data.TreeListModel; + } + + interface TreeListChangeEvent extends TreeListEvent { + } + + interface TreeListCollapseEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + } + + interface TreeListDataBindingEvent extends TreeListEvent { + } + + interface TreeListDataBoundEvent extends TreeListEvent { + } + + interface TreeListDragstartEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + } + + interface TreeListDragEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + target?: JQuery; + } + + interface TreeListDragendEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + destination?: kendo.data.TreeListModel; + } + + interface TreeListDropEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + destination?: kendo.data.TreeListModel; + dropTarget?: Element; + valid?: boolean; + setValid?: boolean; + } + + interface TreeListEditEvent extends TreeListEvent { + container?: JQuery; + model?: kendo.data.TreeListModel; + } + + interface TreeListExcelExportEvent extends TreeListEvent { + data?: any; + workbook?: any; + } + + interface TreeListExpandEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + } + + interface TreeListFilterMenuInitEvent extends TreeListEvent { + container?: JQuery; + field?: string; + } + + interface TreeListPdfExportEvent extends TreeListEvent { + promise?: JQueryPromise; + } + + interface TreeListRemoveEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + row?: JQuery; + } + + interface TreeListSaveEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + container?: JQuery; + } + + interface TreeListColumnShowEvent extends TreeListEvent { + column?: any; + } + + interface TreeListColumnHideEvent extends TreeListEvent { + column?: any; + } + + interface TreeListColumnReorderEvent extends TreeListEvent { + column?: any; + newIndex?: number; + oldIndex?: number; + } + + interface TreeListColumnResizeEvent extends TreeListEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + + interface TreeListColumnMenuInitEvent extends TreeListEvent { + container?: JQuery; + field?: string; + } + + interface TreeListColumnLockEvent extends TreeListEvent { + column?: any; + } + + interface TreeListColumnUnlockEvent extends TreeListEvent { + column?: any; + } + + + class TreeView extends kendo.ui.Widget { + + static fn: TreeView; + + options: TreeViewOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TreeView; + + constructor(element: Element, options?: TreeViewOptions); + + + append(nodeData: any, parentNode?: JQuery, success?: Function): JQuery; + append(nodeData: JQuery, parentNode?: JQuery, success?: Function): JQuery; + collapse(nodes: JQuery): void; + collapse(nodes: Element): void; + collapse(nodes: string): void; + dataItem(node: JQuery): kendo.data.Node; + dataItem(node: Element): kendo.data.Node; + dataItem(node: string): kendo.data.Node; + destroy(): void; + detach(node: JQuery): JQuery; + detach(node: Element): JQuery; + detach(node: string): JQuery; + enable(nodes: JQuery, enable?: boolean): void; + enable(nodes: Element, enable?: boolean): void; + enable(nodes: string, enable?: boolean): void; + expand(nodes: JQuery): void; + expand(nodes: Element): void; + expand(nodes: string): void; + expandPath(path: any, complete: Function): void; + expandTo(targetNode: kendo.data.Node): void; + expandTo(targetNode: any): void; + findByText(text: string): JQuery; + findByUid(text: string): JQuery; + insertAfter(nodeData: any, referenceNode: JQuery): void; + insertBefore(nodeData: any, referenceNode: JQuery): void; + items(): any; + parent(node: JQuery): JQuery; + parent(node: Element): JQuery; + parent(node: string): JQuery; + remove(node: JQuery): void; + remove(node: Element): void; + remove(node: string): void; + select(): JQuery; + select(node?: JQuery): void; + select(node?: Element): void; + select(node?: string): void; + setDataSource(dataSource: kendo.data.HierarchicalDataSource): void; + text(node: JQuery): string; + text(node: Element): string; + text(node: string): string; + text(node: JQuery, newText: string): void; + text(node: Element, newText: string): void; + text(node: string, newText: string): void; + toggle(node: JQuery): void; + toggle(node: Element): void; + toggle(node: string): void; + updateIndeterminate(node: JQuery): void; + + } + + interface TreeViewAnimationCollapse { + duration?: number; + effects?: string; + } + + interface TreeViewAnimationExpand { + duration?: number; + effects?: string; + } + + interface TreeViewAnimation { + collapse?: boolean|TreeViewAnimationCollapse; + expand?: boolean|TreeViewAnimationExpand; + } + + interface TreeViewCheckboxes { + checkChildren?: boolean; + name?: string; + template?: string|Function; + } + + interface TreeViewMessages { + loading?: string; + requestFailed?: string; + retry?: string; + } + + interface TreeViewOptions { + name?: string; + animation?: boolean|TreeViewAnimation; + autoBind?: boolean; + autoScroll?: boolean; + checkboxes?: boolean|TreeViewCheckboxes; + dataImageUrlField?: string; + dataSource?: any|any|kendo.data.HierarchicalDataSource; + dataSpriteCssClassField?: string; + dataTextField?: string|any; + dataUrlField?: string; + dragAndDrop?: boolean; + loadOnDemand?: boolean; + messages?: TreeViewMessages; + template?: string|Function; + change?(e: TreeViewEvent): void; + check?(e: TreeViewCheckEvent): void; + collapse?(e: TreeViewCollapseEvent): void; + dataBound?(e: TreeViewDataBoundEvent): void; + drag?(e: TreeViewDragEvent): void; + dragend?(e: TreeViewDragendEvent): void; + dragstart?(e: TreeViewDragstartEvent): void; + drop?(e: TreeViewDropEvent): void; + expand?(e: TreeViewExpandEvent): void; + navigate?(e: TreeViewNavigateEvent): void; + select?(e: TreeViewSelectEvent): void; + } + interface TreeViewEvent { + sender: TreeView; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TreeViewCheckEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewCollapseEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewDataBoundEvent extends TreeViewEvent { + node?: JQuery; + } + + interface TreeViewDragEvent extends TreeViewEvent { + sourceNode?: Element; + dropTarget?: Element; + pageX?: number; + pageY?: number; + statusClass?: string; + setStatusClass?: Function; + } + + interface TreeViewDragendEvent extends TreeViewEvent { + sourceNode?: Element; + destinationNode?: Element; + dropPosition?: string; + } + + interface TreeViewDragstartEvent extends TreeViewEvent { + sourceNode?: Element; + } + + interface TreeViewDropEvent extends TreeViewEvent { + sourceNode?: Element; + destinationNode?: Element; + valid?: boolean; + setValid?: Function; + dropTarget?: Element; + dropPosition?: string; + } + + interface TreeViewExpandEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewNavigateEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewSelectEvent extends TreeViewEvent { + node?: Element; + } + + + class Upload extends kendo.ui.Widget { + + static fn: Upload; + + options: UploadOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Upload; + + constructor(element: Element, options?: UploadOptions); + + + clearAllFiles(): void; + clearFile(): void; + clearFileByUid(): void; + destroy(): void; + disable(): void; + enable(enable?: boolean): void; + getFiles(): any; + removeAllFiles(): void; + removeFile(): void; + removeFileByUid(): void; + toggle(enable: boolean): void; + upload(): void; + + } + + interface UploadAsync { + autoUpload?: boolean; + batch?: boolean; + removeField?: string; + removeUrl?: string; + removeVerb?: string; + saveField?: string; + saveUrl?: string; + withCredentials?: boolean; + } + + interface UploadFile { + extension?: string; + name?: string; + size?: number; + } + + interface UploadLocalization { + cancel?: string; + clearSelectedFiles?: string; + dropFilesHere?: string; + headerStatusUploaded?: string; + headerStatusUploading?: string; + invalidFileExtension?: string; + invalidMaxFileSize?: string; + invalidMinFileSize?: string; + remove?: string; + retry?: string; + select?: string; + statusFailed?: string; + statusUploaded?: string; + statusUploading?: string; + uploadSelectedFiles?: string; + } + + interface UploadValidation { + allowedExtensions?: any; + maxFileSize?: number; + minFileSize?: number; + } + + interface UploadOptions { + name?: string; + async?: UploadAsync; + dropZone?: string; + enabled?: boolean; + files?: UploadFile[]; + localization?: UploadLocalization; + multiple?: boolean; + showFileList?: boolean; + template?: string|Function; + validation?: UploadValidation; + cancel?(e: UploadCancelEvent): void; + complete?(e: UploadEvent): void; + error?(e: UploadErrorEvent): void; + progress?(e: UploadProgressEvent): void; + remove?(e: UploadRemoveEvent): void; + select?(e: UploadSelectEvent): void; + success?(e: UploadSuccessEvent): void; + upload?(e: UploadUploadEvent): void; + } + interface UploadEvent { + sender: Upload; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface UploadCancelEvent extends UploadEvent { + files?: UploadFile[]; + } + + interface UploadErrorEvent extends UploadEvent { + files?: UploadFile[]; + operation?: string; + XMLHttpRequest?: any; + } + + interface UploadProgressEvent extends UploadEvent { + files?: UploadFile[]; + percentComplete?: number; + } + + interface UploadRemoveEvent extends UploadEvent { + files?: UploadFile[]; + data?: any; + } + + interface UploadSelectEvent extends UploadEvent { + e?: any; + files?: UploadFile[]; + } + + interface UploadSuccessEvent extends UploadEvent { + files?: UploadFile[]; + operation?: string; + response?: any; + XMLHttpRequest?: any; + } + + interface UploadUploadEvent extends UploadEvent { + files?: UploadFile[]; + data?: any; + formData?: any; + XMLHttpRequest?: any; + } + + + class Validator extends kendo.ui.Widget { + + static fn: Validator; + + options: ValidatorOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Validator; + + constructor(element: Element, options?: ValidatorOptions); + + + errors(): any; + hideMessages(): void; + validate(): boolean; + validateInput(input: Element): boolean; + validateInput(input: JQuery): boolean; + + } + + interface ValidatorOptions { + name?: string; + errorTemplate?: string; + messages?: any; + rules?: any; + validateOnBlur?: boolean; + validate?(e: ValidatorValidateEvent): void; + } + interface ValidatorEvent { + sender: Validator; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ValidatorValidateEvent extends ValidatorEvent { + valid?: boolean; + } + + + class Window extends kendo.ui.Widget { + + static fn: Window; + + options: WindowOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Window; + + constructor(element: Element, options?: WindowOptions); + + + center(): kendo.ui.Window; + close(): kendo.ui.Window; + content(): string; + content(content?: string): kendo.ui.Window; + content(content?: JQuery): kendo.ui.Window; + destroy(): void; + isMaximized(): boolean; + isMinimized(): boolean; + maximize(): kendo.ui.Window; + minimize(): kendo.ui.Window; + open(): kendo.ui.Window; + pin(): void; + refresh(options: any): kendo.ui.Window; + restore(): kendo.ui.Window; + setOptions(options: any): void; + title(): string; + title(text?: string): kendo.ui.Window; + toFront(): kendo.ui.Window; + toggleMaximization(): kendo.ui.Window; + unpin(): void; + + } + + interface WindowAnimationClose { + effects?: string; + duration?: number; + } + + interface WindowAnimationOpen { + effects?: string; + duration?: number; + } + + interface WindowAnimation { + close?: WindowAnimationClose; + open?: WindowAnimationOpen; + } + + interface WindowContent { + template?: string; + } + + interface WindowPosition { + top?: number|string; + left?: number|string; + } + + interface WindowRefreshOptions { + url?: string; + cache?: boolean; + data?: any; + type?: string; + template?: string; + iframe?: boolean; + } + + interface WindowOptions { + name?: string; + actions?: any; + animation?: boolean|WindowAnimation; + appendTo?: any|string; + autoFocus?: boolean; + content?: WindowContent; + draggable?: boolean; + iframe?: boolean; + height?: number|string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + pinned?: boolean; + position?: WindowPosition; + resizable?: boolean; + scrollable?: boolean; + title?: string|boolean; + visible?: boolean; + width?: number|string; + activate?(e: WindowEvent): void; + close?(e: WindowCloseEvent): void; + deactivate?(e: WindowEvent): void; + dragend?(e: WindowEvent): void; + dragstart?(e: WindowEvent): void; + error?(e: WindowErrorEvent): void; + maximize?(e: WindowEvent): void; + minimize?(e: WindowEvent): void; + open?(e: WindowEvent): void; + refresh?(e: WindowEvent): void; + resize?(e: WindowEvent): void; + } + interface WindowEvent { + sender: Window; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface WindowCloseEvent extends WindowEvent { + userTriggered?: boolean; + } + + interface WindowErrorEvent extends WindowEvent { + xhr?: JQueryXHR; + status?: string; + } + } declare namespace kendo.drawing { @@ -2579,5662 +8405,272 @@ declare namespace kendo.drawing { } -declare namespace kendo.ui { - class AutoComplete extends kendo.ui.Widget { - - static fn: AutoComplete; - - options: AutoCompleteOptions; - - dataSource: kendo.data.DataSource; - list: JQuery; - ul: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): AutoComplete; - - constructor(element: Element, options?: AutoCompleteOptions); +declare namespace kendo.geometry { + class Arc extends Observable { - close(): void; - dataItem(index: number): any; - destroy(): void; - enable(enable: boolean): void; - focus(): void; - items(): any; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - select(item: string): void; - select(item: Element): void; - select(item: JQuery): void; - setDataSource(dataSource: kendo.data.DataSource): void; - suggest(value: string): void; - value(): string; - value(value: string): void; + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; } - interface AutoCompleteAnimationClose { - duration?: number; - effects?: string; - } - - interface AutoCompleteAnimationOpen { - duration?: number; - effects?: string; - } - - interface AutoCompleteAnimation { - close?: AutoCompleteAnimationClose; - open?: AutoCompleteAnimationOpen; - } - - interface AutoCompleteVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface AutoCompleteOptions { + interface ArcOptions { name?: string; - animation?: boolean|AutoCompleteAnimation; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - highlightFirst?: boolean; - ignoreCase?: boolean; - minLength?: number; - placeholder?: string; - popup?: any; - separator?: string; - suggest?: boolean; - headerTemplate?: string|Function; - template?: string | Function; - valuePrimitive?: boolean; - virtual?: boolean|AutoCompleteVirtual; - change?(e: AutoCompleteChangeEvent): void; - close?(e: AutoCompleteCloseEvent): void; - dataBound?(e: AutoCompleteDataBoundEvent): void; - filtering?(e: AutoCompleteFilteringEvent): void; - open?(e: AutoCompleteOpenEvent): void; - select?(e: AutoCompleteSelectEvent): void; } - interface AutoCompleteEvent { - sender: AutoComplete; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface AutoCompleteChangeEvent extends AutoCompleteEvent { - } - - interface AutoCompleteCloseEvent extends AutoCompleteEvent { - } - - interface AutoCompleteDataBoundEvent extends AutoCompleteEvent { - } - - interface AutoCompleteFilteringEvent extends AutoCompleteEvent { - filter?: any; - } - - interface AutoCompleteOpenEvent extends AutoCompleteEvent { - } - - interface AutoCompleteSelectEvent extends AutoCompleteEvent { - item?: JQuery; - } - - - class Button extends kendo.ui.Widget { - - static fn: Button; - - options: ButtonOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Button; - - constructor(element: Element, options?: ButtonOptions); - - - enable(toggle: boolean): void; - - } - - interface ButtonOptions { - name?: string; - enable?: boolean; - icon?: string; - imageUrl?: string; - spriteCssClass?: string; - click?(e: ButtonClickEvent): void; - } - interface ButtonEvent { - sender: Button; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ButtonClickEvent extends ButtonEvent { - event?: any; - } - - - class Calendar extends kendo.ui.Widget { - - static fn: Calendar; - - options: CalendarOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Calendar; - - constructor(element: Element, options?: CalendarOptions); - - - current(): Date; - destroy(): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - navigate(value: Date, view: string): void; - navigateDown(value: Date): void; - navigateToFuture(): void; - navigateToPast(): void; - navigateUp(): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - view(): any; - - } - - interface CalendarMonth { - content?: string; - empty?: string; - } - - interface CalendarOptions { - name?: string; - culture?: string; - dates?: any; - depth?: string; - disableDates?: any|Function; - footer?: string|Function; - format?: string; - max?: Date; - min?: Date; - month?: CalendarMonth; - start?: string; - value?: Date; - change?(e: CalendarEvent): void; - navigate?(e: CalendarEvent): void; - } - interface CalendarEvent { - sender: Calendar; + interface ArcEvent { + sender: Arc; preventDefault: Function; isDefaultPrevented(): boolean; } - class ColorPalette extends kendo.ui.Widget { - - static fn: ColorPalette; - - options: ColorPaletteOptions; + class Circle extends Observable { - element: JQuery; - wrapper: JQuery; + options: CircleOptions; - static extend(proto: Object): ColorPalette; + center: kendo.geometry.Point; + radius: number; - constructor(element: Element, options?: ColorPaletteOptions); + constructor(center: any|kendo.geometry.Point, radius: number); - value(): string; - value(color?: string): void; - color(): kendo.Color; - color(color?: kendo.Color): void; - enable(enable?: boolean): void; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; } - interface ColorPaletteTileSize { - width?: number; - height?: number; - } - - interface ColorPaletteOptions { + interface CircleOptions { name?: string; - palette?: string|any; - columns?: number; - tileSize?: ColorPaletteTileSize; - value?: string; - change?(e: ColorPaletteEvent): void; } - interface ColorPaletteEvent { - sender: ColorPalette; + interface CircleEvent { + sender: Circle; preventDefault: Function; isDefaultPrevented(): boolean; } - class ColorPicker extends kendo.ui.Widget { - - static fn: ColorPicker; - - options: ColorPickerOptions; + class Matrix extends Observable { - element: JQuery; - wrapper: JQuery; + options: MatrixOptions; - static extend(proto: Object): ColorPicker; - - constructor(element: Element, options?: ColorPickerOptions); + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; - close(): void; - open(): void; - toggle(): void; - value(): string; - value(color?: string): void; - color(): kendo.Color; - color(color?: kendo.Color): void; - enable(enable?: boolean): void; + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; } - interface ColorPickerMessages { - apply?: string; - cancel?: string; - } - - interface ColorPickerTileSize { - width?: number; - height?: number; - } - - interface ColorPickerOptions { + interface MatrixOptions { name?: string; - buttons?: boolean; - columns?: number; - tileSize?: ColorPickerTileSize; - messages?: ColorPickerMessages; - palette?: string|any; - opacity?: boolean; - preview?: boolean; - toolIcon?: string; - value?: string; - change?(e: ColorPickerChangeEvent): void; - select?(e: ColorPickerSelectEvent): void; - open?(e: ColorPickerEvent): void; - close?(e: ColorPickerEvent): void; } - interface ColorPickerEvent { - sender: ColorPicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ColorPickerChangeEvent extends ColorPickerEvent { - value?: string; - } - - interface ColorPickerSelectEvent extends ColorPickerEvent { - value?: string; - } - - - class ComboBox extends kendo.ui.Widget { - - static fn: ComboBox; - - options: ComboBoxOptions; - - dataSource: kendo.data.DataSource; - input: JQuery; - list: JQuery; - ul: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ComboBox; - - constructor(element: Element, options?: ComboBoxOptions); - - - close(): void; - dataItem(index?: number): any; - destroy(): void; - enable(enable: boolean): void; - focus(): void; - items(): any; - open(): void; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - select(): number; - select(li: JQuery): void; - select(li: number): void; - select(li: Function): void; - setDataSource(dataSource: kendo.data.DataSource): void; - suggest(value: string): void; - text(): string; - text(text: string): void; - toggle(toggle: boolean): void; - value(): string; - value(value: string): void; - - } - - interface ComboBoxAnimationClose { - effects?: string; - duration?: number; - } - - interface ComboBoxAnimationOpen { - effects?: string; - duration?: number; - } - - interface ComboBoxAnimation { - close?: ComboBoxAnimationClose; - open?: ComboBoxAnimationOpen; - } - - interface ComboBoxPopup { - appendTo?: string; - origin?: string; - position?: string; - } - - interface ComboBoxVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface ComboBoxOptions { - name?: string; - animation?: ComboBoxAnimation; - autoBind?: boolean; - cascadeFrom?: string; - cascadeFromField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - highlightFirst?: boolean; - ignoreCase?: boolean; - index?: number; - minLength?: number; - placeholder?: string; - popup?: ComboBoxPopup; - suggest?: boolean; - headerTemplate?: string|Function; - template?: string|Function; - text?: string; - value?: string; - valuePrimitive?: boolean; - virtual?: boolean|ComboBoxVirtual; - change?(e: ComboBoxChangeEvent): void; - close?(e: ComboBoxCloseEvent): void; - dataBound?(e: ComboBoxDataBoundEvent): void; - filtering?(e: ComboBoxFilteringEvent): void; - open?(e: ComboBoxOpenEvent): void; - select?(e: ComboBoxSelectEvent): void; - cascade?(e: ComboBoxCascadeEvent): void; - } - interface ComboBoxEvent { - sender: ComboBox; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ComboBoxChangeEvent extends ComboBoxEvent { - } - - interface ComboBoxCloseEvent extends ComboBoxEvent { - } - - interface ComboBoxDataBoundEvent extends ComboBoxEvent { - } - - interface ComboBoxFilteringEvent extends ComboBoxEvent { - filter?: any; - } - - interface ComboBoxOpenEvent extends ComboBoxEvent { - } - - interface ComboBoxSelectEvent extends ComboBoxEvent { - item?: JQuery; - } - - interface ComboBoxCascadeEvent extends ComboBoxEvent { - } - - - class ContextMenu extends kendo.ui.Widget { - - static fn: ContextMenu; - - options: ContextMenuOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ContextMenu; - - constructor(element: Element, options?: ContextMenuOptions); - - - append(item: any, referenceItem: string): kendo.ui.ContextMenu; - append(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; - close(element: Element): kendo.ui.ContextMenu; - close(element: JQuery): kendo.ui.ContextMenu; - destroy(): void; - enable(element: string, enable: boolean): kendo.ui.ContextMenu; - enable(element: Element, enable: boolean): kendo.ui.ContextMenu; - enable(element: JQuery, enable: boolean): kendo.ui.ContextMenu; - insertAfter(item: any, referenceItem: string): kendo.ui.ContextMenu; - insertAfter(item: any, referenceItem: Element): kendo.ui.ContextMenu; - insertAfter(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; - insertBefore(item: any, referenceItem: string): kendo.ui.ContextMenu; - insertBefore(item: any, referenceItem: Element): kendo.ui.ContextMenu; - insertBefore(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; - open(x: number, y?: number): kendo.ui.ContextMenu; - open(x: Element, y?: number): kendo.ui.ContextMenu; - open(x: JQuery, y?: number): kendo.ui.ContextMenu; - remove(element: string): kendo.ui.ContextMenu; - remove(element: Element): kendo.ui.ContextMenu; - remove(element: JQuery): kendo.ui.ContextMenu; - - } - - interface ContextMenuAnimationClose { - effects?: string; - duration?: number; - } - - interface ContextMenuAnimationOpen { - effects?: string; - duration?: number; - } - - interface ContextMenuAnimation { - close?: ContextMenuAnimationClose; - open?: ContextMenuAnimationOpen; - } - - interface ContextMenuOptions { - name?: string; - alignToAnchor?: boolean; - animation?: boolean|ContextMenuAnimation; - closeOnClick?: boolean; - dataSource?: any|any; - direction?: string; - filter?: string; - hoverDelay?: number; - orientation?: string; - popupCollision?: string; - showOn?: string; - target?: string|JQuery; - close?(e: ContextMenuCloseEvent): void; - open?(e: ContextMenuOpenEvent): void; - activate?(e: ContextMenuActivateEvent): void; - deactivate?(e: ContextMenuDeactivateEvent): void; - select?(e: ContextMenuSelectEvent): void; - } - interface ContextMenuEvent { - sender: ContextMenu; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ContextMenuCloseEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - event?: JQueryEventObject; - } - - interface ContextMenuOpenEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - event?: JQueryEventObject; - } - - interface ContextMenuActivateEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - } - - interface ContextMenuDeactivateEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - } - - interface ContextMenuSelectEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - } - - - class DatePicker extends kendo.ui.Widget { - - static fn: DatePicker; - - options: DatePickerOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): DatePicker; - - constructor(element: Element, options?: DatePickerOptions); - - - close(): void; - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - open(): void; - setOptions(options: any): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - - } - - interface DatePickerAnimationClose { - effects?: string; - duration?: number; - } - - interface DatePickerAnimationOpen { - effects?: string; - duration?: number; - } - - interface DatePickerAnimation { - close?: DatePickerAnimationClose; - open?: DatePickerAnimationOpen; - } - - interface DatePickerMonth { - content?: string; - empty?: string; - } - - interface DatePickerOptions { - name?: string; - animation?: boolean|DatePickerAnimation; - ARIATemplate?: string; - culture?: string; - dates?: any; - depth?: string; - disableDates?: any|Function; - footer?: string|Function; - format?: string; - max?: Date; - min?: Date; - month?: DatePickerMonth; - parseFormats?: any; - start?: string; - value?: Date; - change?(e: DatePickerChangeEvent): void; - close?(e: DatePickerCloseEvent): void; - open?(e: DatePickerOpenEvent): void; - } - interface DatePickerEvent { - sender: DatePicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface DatePickerChangeEvent extends DatePickerEvent { - } - - interface DatePickerCloseEvent extends DatePickerEvent { - } - - interface DatePickerOpenEvent extends DatePickerEvent { - } - - - class DateTimePicker extends kendo.ui.Widget { - - static fn: DateTimePicker; - - options: DateTimePickerOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): DateTimePicker; - - constructor(element: Element, options?: DateTimePickerOptions); - - - close(view: string): void; - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - open(view: string): void; - setOptions(options: any): void; - toggle(view: string): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - - } - - interface DateTimePickerAnimationClose { - effects?: string; - duration?: number; - } - - interface DateTimePickerAnimationOpen { - effects?: string; - duration?: number; - } - - interface DateTimePickerAnimation { - close?: DateTimePickerAnimationClose; - open?: DateTimePickerAnimationOpen; - } - - interface DateTimePickerMonth { - content?: string; - empty?: string; - } - - interface DateTimePickerOptions { - name?: string; - animation?: boolean|DateTimePickerAnimation; - ARIATemplate?: string; - culture?: string; - dates?: any; - depth?: string; - disableDates?: any|Function; - footer?: string; - format?: string; - interval?: number; - max?: Date; - min?: Date; - month?: DateTimePickerMonth; - parseFormats?: any; - start?: string; - timeFormat?: string; - value?: Date; - change?(e: DateTimePickerChangeEvent): void; - close?(e: DateTimePickerCloseEvent): void; - open?(e: DateTimePickerOpenEvent): void; - } - interface DateTimePickerEvent { - sender: DateTimePicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface DateTimePickerChangeEvent extends DateTimePickerEvent { - } - - interface DateTimePickerCloseEvent extends DateTimePickerEvent { - view?: string; - } - - interface DateTimePickerOpenEvent extends DateTimePickerEvent { - view?: string; - } - - - class DropDownList extends kendo.ui.Widget { - - static fn: DropDownList; - - options: DropDownListOptions; - popup: kendo.ui.Popup; - - dataSource: kendo.data.DataSource; - span: JQuery; - filterInput: JQuery; - list: JQuery; - ul: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): DropDownList; - - constructor(element: Element, options?: DropDownListOptions); - - - close(): void; - dataItem(index?: JQuery): any; - dataItem(index?: number): any; - destroy(): void; - focus(): void; - items(): any; - enable(enable: boolean): void; - open(): void; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - select(): number; - select(li: JQuery): void; - select(li: number): void; - select(li: Function): void; - setDataSource(dataSource: kendo.data.DataSource): void; - text(): string; - text(text: string): void; - toggle(toggle: boolean): void; - value(): string; - value(value: string): void; - - } - - interface DropDownListAnimationClose { - effects?: string; - duration?: number; - } - - interface DropDownListAnimationOpen { - effects?: string; - duration?: number; - } - - interface DropDownListAnimation { - close?: DropDownListAnimationClose; - open?: DropDownListAnimationOpen; - } - - interface DropDownListPopup { - appendTo?: string; - origin?: string; - position?: string; - } - - interface DropDownListVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface DropDownListOptions { - name?: string; - animation?: boolean|DropDownListAnimation; - autoBind?: boolean; - cascadeFrom?: string; - cascadeFromField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - ignoreCase?: boolean; - index?: number; - minLength?: number; - popup?: DropDownListPopup; - optionLabel?: string|any; - optionLabelTemplate?: string|Function; - headerTemplate?: string|Function; - template?: string|Function; - valueTemplate?: string|Function; - text?: string; - value?: string; - valuePrimitive?: boolean; - virtual?: boolean|DropDownListVirtual; - change?(e: DropDownListChangeEvent): void; - close?(e: DropDownListCloseEvent): void; - dataBound?(e: DropDownListDataBoundEvent): void; - filtering?(e: DropDownListFilteringEvent): void; - open?(e: DropDownListOpenEvent): void; - select?(e: DropDownListSelectEvent): void; - cascade?(e: DropDownListCascadeEvent): void; - } - interface DropDownListEvent { - sender: DropDownList; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface DropDownListChangeEvent extends DropDownListEvent { - } - - interface DropDownListCloseEvent extends DropDownListEvent { - } - - interface DropDownListDataBoundEvent extends DropDownListEvent { - } - - interface DropDownListFilteringEvent extends DropDownListEvent { - filter?: any; - } - - interface DropDownListOpenEvent extends DropDownListEvent { - } - - interface DropDownListSelectEvent extends DropDownListEvent { - item?: JQuery; - } - - interface DropDownListCascadeEvent extends DropDownListEvent { - } - - - class Editor extends kendo.ui.Widget { - - static fn: Editor; - - options: EditorOptions; - - body: Element; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Editor; - - constructor(element: Element, options?: EditorOptions); - - - createRange(document?: Document): Range; - destroy(): void; - encodedValue(): void; - exec(name: string, params: any): void; - focus(): void; - getRange(): Range; - getSelection(): Selection; - paste(html: string, options: any): void; - selectedHtml(): string; - refresh(): void; - saveAsPDF(): JQueryPromise; - selectRange(range: Range): void; - update(): void; - state(toolName: string): boolean; - value(): string; - value(value: string): void; - - } - - interface EditorDeserialization { - custom?: Function; - } - - interface EditorFileBrowserMessages { - uploadFile?: string; - orderBy?: string; - orderByName?: string; - orderBySize?: string; - directoryNotFound?: string; - emptyFolder?: string; - deleteFile?: string; - invalidFileType?: string; - overwriteFile?: string; - search?: string; - } - - interface EditorFileBrowserSchemaModelFieldsName { - field?: string; - parse?: Function; - } - - interface EditorFileBrowserSchemaModelFieldsSize { - field?: string; - parse?: Function; - } - - interface EditorFileBrowserSchemaModelFieldsType { - parse?: Function; - field?: string; - } - - interface EditorFileBrowserSchemaModelFields { - name?: EditorFileBrowserSchemaModelFieldsName; - type?: EditorFileBrowserSchemaModelFieldsType; - size?: EditorFileBrowserSchemaModelFieldsSize; - } - - interface EditorFileBrowserSchemaModel { - id?: string; - fields?: EditorFileBrowserSchemaModelFields; - } - - interface EditorFileBrowserSchema { - } - - interface EditorFileBrowserTransportCreate { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorFileBrowserTransportDestroy { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorFileBrowserTransportRead { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorFileBrowserTransport { - read?: EditorFileBrowserTransportRead; - uploadUrl?: string; - fileUrl?: string|Function; - destroy?: EditorFileBrowserTransportDestroy; - create?: EditorFileBrowserTransportCreate; - } - - interface EditorFileBrowser { - fileTypes?: string; - path?: string; - transport?: EditorFileBrowserTransport; - schema?: EditorFileBrowserSchema; - messages?: EditorFileBrowserMessages; - } - - interface EditorImageBrowserMessages { - uploadFile?: string; - orderBy?: string; - orderByName?: string; - orderBySize?: string; - directoryNotFound?: string; - emptyFolder?: string; - deleteFile?: string; - invalidFileType?: string; - overwriteFile?: string; - search?: string; - } - - interface EditorImageBrowserSchemaModelFieldsName { - field?: string; - parse?: Function; - } - - interface EditorImageBrowserSchemaModelFieldsSize { - field?: string; - parse?: Function; - } - - interface EditorImageBrowserSchemaModelFieldsType { - parse?: Function; - field?: string; - } - - interface EditorImageBrowserSchemaModelFields { - name?: EditorImageBrowserSchemaModelFieldsName; - type?: EditorImageBrowserSchemaModelFieldsType; - size?: EditorImageBrowserSchemaModelFieldsSize; - } - - interface EditorImageBrowserSchemaModel { - id?: string; - fields?: EditorImageBrowserSchemaModelFields; - } - - interface EditorImageBrowserSchema { - } - - interface EditorImageBrowserTransportCreate { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorImageBrowserTransportDestroy { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorImageBrowserTransportRead { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorImageBrowserTransport { - read?: EditorImageBrowserTransportRead; - thumbnailUrl?: string|Function; - uploadUrl?: string; - imageUrl?: string|Function; - destroy?: EditorImageBrowserTransportDestroy; - create?: EditorImageBrowserTransportCreate; - } - - interface EditorImageBrowser { - fileTypes?: string; - path?: string; - transport?: EditorImageBrowserTransport; - schema?: EditorImageBrowserSchema; - messages?: EditorImageBrowserMessages; - } - - interface EditorMessages { - bold?: string; - italic?: string; - underline?: string; - strikethrough?: string; - superscript?: string; - subscript?: string; - justifyCenter?: string; - justifyLeft?: string; - justifyRight?: string; - justifyFull?: string; - insertUnorderedList?: string; - insertOrderedList?: string; - indent?: string; - outdent?: string; - createLink?: string; - unlink?: string; - insertImage?: string; - insertFile?: string; - insertHtml?: string; - viewHtml?: string; - fontName?: string; - fontNameInherit?: string; - fontSize?: string; - fontSizeInherit?: string; - formatBlock?: string; - formatting?: string; - foreColor?: string; - backColor?: string; - style?: string; - emptyFolder?: string; - uploadFile?: string; - editAreaTitle?: string; - orderBy?: string; - orderBySize?: string; - orderByName?: string; - invalidFileType?: string; - deleteFile?: string; - overwriteFile?: string; - directoryNotFound?: string; - imageWebAddress?: string; - imageAltText?: string; - imageWidth?: string; - imageHeight?: string; - fileWebAddress?: string; - fileTitle?: string; - linkWebAddress?: string; - linkText?: string; - linkToolTip?: string; - linkOpenInNewWindow?: string; - dialogUpdate?: string; - dialogInsert?: string; - dialogCancel?: string; - createTable?: string; - createTableHint?: string; - addColumnLeft?: string; - addColumnRight?: string; - addRowAbove?: string; - addRowBelow?: string; - deleteRow?: string; - deleteColumn?: string; - } - - interface EditorPasteCleanup { - all?: boolean; - css?: boolean; - custom?: Function; - keepNewLines?: boolean; - msAllFormatting?: boolean; - msConvertLists?: boolean; - msTags?: boolean; - none?: boolean; - span?: boolean; - } - - interface EditorPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface EditorPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: EditorPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface EditorResizable { - content?: boolean; - min?: number; - max?: number; - toolbar?: boolean; - } - - interface EditorSerialization { - custom?: Function; - entities?: boolean; - scripts?: boolean; - semantic?: boolean; - } - - interface EditorToolItem { - text?: string; - value?: string; - context?: string; - } - - interface EditorTool { - name?: string; - tooltip?: string; - exec?: Function; - items?: EditorToolItem[]; - template?: string; - } - - interface EditorExecParams { - value?: any; - } - - interface EditorPasteOptions { - split?: boolean; - } - - interface EditorOptions { - name?: string; - deserialization?: EditorDeserialization; - domain?: string; - encoded?: boolean; - messages?: EditorMessages; - pasteCleanup?: EditorPasteCleanup; - pdf?: EditorPdf; - resizable?: boolean|EditorResizable; - serialization?: EditorSerialization; - stylesheets?: any; - tools?: EditorTool[]; - imageBrowser?: EditorImageBrowser; - fileBrowser?: EditorFileBrowser; - change?(e: EditorEvent): void; - execute?(e: EditorExecuteEvent): void; - keydown?(e: EditorEvent): void; - keyup?(e: EditorEvent): void; - paste?(e: EditorPasteEvent): void; - pdfExport?(e: EditorPdfExportEvent): void; - select?(e: EditorEvent): void; - } - interface EditorEvent { - sender: Editor; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface EditorExecuteEvent extends EditorEvent { - name?: string; - command?: any; - } - - interface EditorPasteEvent extends EditorEvent { - html?: any; - } - - interface EditorPdfExportEvent extends EditorEvent { - promise?: JQueryPromise; - } - - - class FilterMenu extends kendo.ui.Widget { - - static fn: FilterMenu; - - options: FilterMenuOptions; - - field: string; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): FilterMenu; - - constructor(element: Element, options?: FilterMenuOptions); - - - clear(): void; - - } - - interface FilterMenuMessages { - and?: string; - clear?: string; - filter?: string; - info?: string; - isFalse?: string; - isTrue?: string; - or?: string; - selectValue?: string; - } - - interface FilterMenuOperatorsDate { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface FilterMenuOperatorsEnums { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - } - - interface FilterMenuOperatorsNumber { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface FilterMenuOperatorsString { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - isempty?: string; - isnotempty?: string; - startswith?: string; - contains?: string; - doesnotcontain?: string; - endswith?: string; - } - - interface FilterMenuOperators { - string?: FilterMenuOperatorsString; - number?: FilterMenuOperatorsNumber; - date?: FilterMenuOperatorsDate; - enums?: FilterMenuOperatorsEnums; - } - - interface FilterMenuOptions { - name?: string; - dataSource?: any|any|kendo.data.DataSource; - extra?: boolean; - field?: string; - messages?: FilterMenuMessages; - operators?: FilterMenuOperators; - } - interface FilterMenuEvent { - sender: FilterMenu; + interface MatrixEvent { + sender: Matrix; preventDefault: Function; isDefaultPrevented(): boolean; } - class FlatColorPicker extends kendo.ui.Widget { - - static fn: FlatColorPicker; - - options: FlatColorPickerOptions; + class Point extends Observable { - element: JQuery; - wrapper: JQuery; + options: PointOptions; - static extend(proto: Object): FlatColorPicker; + x: number; + y: number; - constructor(element: Element, options?: FlatColorPickerOptions); + constructor(x: number, y: number); + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; - focus(): void; - value(): string; - value(color?: string): void; - color(): kendo.Color; - color(color?: kendo.Color): void; - enable(enable?: boolean): void; + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; } - interface FlatColorPickerMessages { - apply?: string; - cancel?: string; - } - - interface FlatColorPickerOptions { + interface PointOptions { name?: string; - opacity?: boolean; - buttons?: boolean; - value?: string; - preview?: boolean; - autoupdate?: boolean; - messages?: FlatColorPickerMessages; - change?(e: FlatColorPickerChangeEvent): void; } - interface FlatColorPickerEvent { - sender: FlatColorPicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface FlatColorPickerChangeEvent extends FlatColorPickerEvent { - value?: string; - } - - - class Gantt extends kendo.ui.Widget { - - static fn: Gantt; - - options: GanttOptions; - - dataSource: kendo.data.DataSource; - dependencies: kendo.data.GanttDependencyDataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Gantt; - - constructor(element: Element, options?: GanttOptions); - - - clearSelection(): void; - dataItem(row: string): kendo.data.GanttTask; - dataItem(row: Element): kendo.data.GanttTask; - dataItem(row: JQuery): kendo.data.GanttTask; - destroy(): void; - refresh(): void; - refreshDependencies(): void; - removeDependency(dependency: string): void; - removeDependency(dependency: kendo.data.GanttDependency): void; - removeTask(task: string): void; - removeTask(task: kendo.data.GanttTask): void; - saveAsPDF(): JQueryPromise; - select(): JQuery; - select(row: string): void; - select(row: Element): void; - select(row: JQuery): void; - setDataSource(dataSource: kendo.data.GanttDataSource): void; - setDependenciesDataSource(dataSource: kendo.data.GanttDependencyDataSource): void; - view(): kendo.ui.GanttView; - view(type?: string): void; - - } - - interface GanttAssignments { - dataSource?: any|any|kendo.data.DataSource; - dataResourceIdField?: string; - dataTaskIdField?: string; - dataValueField?: string; - } - - interface GanttColumn { - field?: string; - title?: string; - format?: string; - width?: string|number; - editable?: boolean; - sortable?: boolean; - } - - interface GanttCurrentTimeMarker { - updateInterval?: number; - } - - interface GanttEditable { - confirmation?: boolean; - template?: string|Function; - } - - interface GanttMessagesActions { - addChild?: string; - append?: string; - insertAfter?: string; - insertBefore?: string; - pdf?: string; - } - - interface GanttMessagesEditor { - assignButton?: string; - editorTitle?: string; - end?: string; - percentComplete?: string; - resources?: string; - resourcesEditorTitle?: string; - resourcesHeader?: string; - start?: string; - title?: string; - unitsHeader?: string; - } - - interface GanttMessagesViews { - day?: string; - end?: string; - month?: string; - start?: string; - week?: string; - year?: string; - } - - interface GanttMessages { - actions?: GanttMessagesActions; - cancel?: string; - deleteDependencyConfirmation?: string; - deleteDependencyWindowTitle?: string; - deleteTaskConfirmation?: string; - deleteTaskWindowTitle?: string; - destroy?: string; - editor?: GanttMessagesEditor; - save?: string; - views?: GanttMessagesViews; - } - - interface GanttPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface GanttPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: GanttPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface GanttResources { - dataFormatField?: string; - dataColorField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - field?: string; - } - - interface GanttToolbarItem { - name?: string; - template?: string|Function; - text?: string; - } - - interface GanttTooltip { - template?: string|Function; - visible?: boolean; - } - - interface GanttView { - type?: string; - selected?: boolean; - slotSize?: number|string; - timeHeaderTemplate?: string|Function; - dayHeaderTemplate?: string|Function; - weekHeaderTemplate?: string|Function; - monthHeaderTemplate?: string|Function; - yearHeaderTemplate?: string|Function; - resizeTooltipFormat?: string; - } - - interface GanttOptions { - name?: string; - assignments?: GanttAssignments; - autoBind?: boolean; - columnResizeHandleWidth?: number; - columns?: GanttColumn[]; - currentTimeMarker?: boolean|GanttCurrentTimeMarker; - dataSource?: any|any|kendo.data.GanttDataSource; - dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: boolean|GanttEditable; - navigatable?: boolean; - workDayStart?: Date; - workDayEnd?: Date; - workWeekStart?: number; - workWeekEnd?: number; - hourSpan?: number; - snap?: boolean; - height?: number|string; - listWidth?: string|number; - messages?: GanttMessages; - pdf?: GanttPdf; - resizable?: boolean; - selectable?: boolean; - showWorkDays?: boolean; - showWorkHours?: boolean; - taskTemplate?: string|Function; - toolbar?: GanttToolbarItem[]; - tooltip?: GanttTooltip; - views?: GanttView[]; - resources?: GanttResources; - rowHeight?: number|string; - dataBinding?(e: GanttDataBindingEvent): void; - dataBound?(e: GanttDataBoundEvent): void; - add?(e: GanttAddEvent): void; - edit?(e: GanttEditEvent): void; - remove?(e: GanttRemoveEvent): void; - cancel?(e: GanttCancelEvent): void; - save?(e: GanttSaveEvent): void; - change?(e: GanttChangeEvent): void; - columnResize?(e: GanttColumnResizeEvent): void; - navigate?(e: GanttNavigateEvent): void; - moveStart?(e: GanttMoveStartEvent): void; - move?(e: GanttMoveEvent): void; - moveEnd?(e: GanttMoveEndEvent): void; - pdfExport?(e: GanttPdfExportEvent): void; - resizeStart?(e: GanttResizeStartEvent): void; - resize?(e: GanttResizeEvent): void; - resizeEnd?(e: GanttResizeEndEvent): void; - } - interface GanttEvent { - sender: Gantt; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface GanttDataBindingEvent extends GanttEvent { - } - - interface GanttDataBoundEvent extends GanttEvent { - } - - interface GanttAddEvent extends GanttEvent { - task?: kendo.data.GanttTask; - dependency?: kendo.data.GanttDependency; - } - - interface GanttEditEvent extends GanttEvent { - container?: JQuery; - task?: kendo.data.GanttTask; - } - - interface GanttRemoveEvent extends GanttEvent { - task?: kendo.data.GanttTask; - dependencies?: any; - } - - interface GanttCancelEvent extends GanttEvent { - container?: JQuery; - task?: kendo.data.GanttTask; - } - - interface GanttSaveEvent extends GanttEvent { - task?: kendo.data.GanttTask; - values?: any; - } - - interface GanttChangeEvent extends GanttEvent { - } - - interface GanttColumnResizeEvent extends GanttEvent { - column?: any; - newWidth?: number; - oldWidth?: number; - } - - interface GanttNavigateEvent extends GanttEvent { - view?: string; - } - - interface GanttMoveStartEvent extends GanttEvent { - task?: kendo.data.GanttTask; - } - - interface GanttMoveEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - interface GanttMoveEndEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - interface GanttPdfExportEvent extends GanttEvent { - promise?: JQueryPromise; - } - - interface GanttResizeStartEvent extends GanttEvent { - task?: kendo.data.GanttTask; - } - - interface GanttResizeEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - interface GanttResizeEndEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - - class Grid extends kendo.ui.Widget { - - static fn: Grid; - - options: GridOptions; - - dataSource: kendo.data.DataSource; - columns: GridColumn[]; - footer: JQuery; - pager: kendo.ui.Pager; - table: JQuery; - tbody: JQuery; - thead: JQuery; - content: JQuery; - lockedHeader: JQuery; - lockedTable: JQuery; - lockedContent: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Grid; - - constructor(element: Element, options?: GridOptions); - - - addRow(): void; - autoFitColumn(column: number): void; - autoFitColumn(column: string): void; - autoFitColumn(column: any): void; - cancelChanges(): void; - cancelRow(): void; - cellIndex(cell: string): number; - cellIndex(cell: Element): number; - cellIndex(cell: JQuery): number; - clearSelection(): void; - closeCell(isCancel?: boolean): void; - collapseGroup(row: string): void; - collapseGroup(row: Element): void; - collapseGroup(row: JQuery): void; - collapseRow(row: string): void; - collapseRow(row: Element): void; - collapseRow(row: JQuery): void; - current(): JQuery; - current(cell: JQuery): void; - dataItem(row: string): kendo.data.ObservableObject; - dataItem(row: Element): kendo.data.ObservableObject; - dataItem(row: JQuery): kendo.data.ObservableObject; - destroy(): void; - editCell(cell: JQuery): void; - editRow(row: JQuery): void; - expandGroup(row: string): void; - expandGroup(row: Element): void; - expandGroup(row: JQuery): void; - expandRow(row: string): void; - expandRow(row: Element): void; - expandRow(row: JQuery): void; - getOptions(): GridOptions; - hideColumn(column: number): void; - hideColumn(column: string): void; - hideColumn(column: any): void; - items(): any; - lockColumn(column: number): void; - lockColumn(column: string): void; - refresh(): void; - removeRow(row: string): void; - removeRow(row: Element): void; - removeRow(row: JQuery): void; - reorderColumn(destIndex: number, column: any): void; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; - saveChanges(): void; - saveRow(): void; - select(): JQuery; - select(rows: string): void; - select(rows: Element): void; - select(rows: JQuery): void; - setDataSource(dataSource: kendo.data.DataSource): void; - setOptions(options: any): void; - showColumn(column: number): void; - showColumn(column: string): void; - showColumn(column: any): void; - unlockColumn(column: number): void; - unlockColumn(column: string): void; - - } - - interface GridAllowCopy { - delimeter?: string|any; - } - - interface GridColumnMenuMessages { - columns?: string; - filter?: string; - sortAscending?: string; - sortDescending?: string; - settings?: string; - done?: string; - lock?: string; - unlock?: string; - } - - interface GridColumnMenu { - columns?: boolean; - filterable?: boolean; - sortable?: boolean; - messages?: GridColumnMenuMessages; - } - - interface GridColumnCommandItemText { - edit?: string; - cancel?: string; - update?: string; - } - - interface GridColumnCommandItem { - name?: string; - text?: GridColumnCommandItemText; - className?: string; - template?: string; - imageClass?: string; - click?: Function; - } - - interface GridColumnFilterableCell { - dataSource?: any|kendo.data.DataSource; - dataTextField?: string; - delay?: number; - inputWidth?: number; - suggestionOperator?: string; - minLength?: number; - enabled?: boolean; - operator?: string; - showOperators?: boolean; - template?: Function; - } - - interface GridColumnFilterable { - cell?: GridColumnFilterableCell; - multi?: boolean; - dataSource?: any|any|kendo.data.DataSource; - checkAll?: boolean; - itemTemplate?: Function; - operators?: any; - search?: boolean; - ignoreCase?: boolean; - ui?: string|Function; - } - - interface GridColumnSortable { - compare?: Function; - } - - interface GridColumn { - aggregates?: any; - attributes?: any; - columns?: any; - command?: GridColumnCommandItem[]; - encoded?: boolean; - field?: string; - filterable?: boolean|GridColumnFilterable; - footerAttributes?: any; - footerTemplate?: string|Function; - format?: string; - groupable?: boolean; - groupHeaderTemplate?: string|Function; - groupFooterTemplate?: string|Function; - headerAttributes?: any; - headerTemplate?: string|Function; - hidden?: boolean; - locked?: boolean; - lockable?: boolean; - minScreenWidth?: number; - sortable?: boolean|GridColumnSortable; - template?: string|Function; - title?: string; - width?: string|number; - values?: any; - menu?: boolean; - type?: any; - } - - interface GridEditable { - confirmation?: boolean|string|Function; - cancelDelete?: string; - confirmDelete?: string; - createAt?: string; - destroy?: boolean; - mode?: string; - template?: string|Function; - update?: boolean; - window?: any; - } - - interface GridExcel { - allPages?: boolean; - fileName?: string; - filterable?: boolean; - forceProxy?: boolean; - proxyURL?: string; - } - - interface GridFilterableMessages { - and?: string; - clear?: string; - filter?: string; - info?: string; - isFalse?: string; - isTrue?: string; - or?: string; - search?: string; - selectValue?: string; - cancel?: string; - selectedItemsFormat?: string; - operator?: string; - value?: string; - checkAll?: string; - } - - interface GridFilterableOperatorsDate { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface GridFilterableOperatorsEnums { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - } - - interface GridFilterableOperatorsNumber { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface GridFilterableOperatorsString { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - isempty?: string; - isnotempty?: string; - startswith?: string; - contains?: string; - doesnotcontain?: string; - endswith?: string; - } - - interface GridFilterableOperators { - string?: GridFilterableOperatorsString; - number?: GridFilterableOperatorsNumber; - date?: GridFilterableOperatorsDate; - enums?: GridFilterableOperatorsEnums; - } - - interface GridFilterable { - extra?: boolean; - messages?: GridFilterableMessages; - operators?: GridFilterableOperators; - mode?: string; - } - - interface GridGroupableMessages { - empty?: string; - } - - interface GridGroupable { - enabled?: boolean; - showFooter?: boolean; - messages?: GridGroupableMessages; - } - - interface GridMessagesCommands { - cancel?: string; - canceledit?: string; - create?: string; - destroy?: string; - edit?: string; - excel?: string; - save?: string; - update?: string; - } - - interface GridMessages { - commands?: GridMessagesCommands; - noRecords?: string; - } - - interface GridNoRecords { - template?: string|Function; - } - - interface GridPageableMessages { - display?: string; - empty?: string; - page?: string; - of?: string; - itemsPerPage?: string; - first?: string; - last?: string; - next?: string; - previous?: string; - refresh?: string; - morePages?: string; - } - - interface GridPageable { - pageSize?: number; - previousNext?: boolean; - numeric?: boolean; - buttonCount?: number; - input?: boolean; - pageSizes?: boolean|any; - refresh?: boolean; - info?: boolean; - messages?: GridPageableMessages; - } - - interface GridPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface GridPdf { - allPages?: boolean; - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: GridPdfMargin; - paperSize?: string|any; - template?: string; - repeatHeaders?: boolean; - scale?: number; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface GridScrollable { - virtual?: boolean; - } - - interface GridSortable { - allowUnsort?: boolean; - mode?: string; - } - - interface GridToolbarItem { - name?: string; - template?: string|Function; - text?: string; - } - - interface GridOptions { - name?: string; - allowCopy?: boolean|GridAllowCopy; - altRowTemplate?: string|Function; - autoBind?: boolean; - columnResizeHandleWidth?: number; - columns?: GridColumn[]; - columnMenu?: boolean|GridColumnMenu; - dataSource?: any|any|kendo.data.DataSource; - detailTemplate?: string|Function; - editable?: boolean|GridEditable; - excel?: GridExcel; - filterable?: boolean|GridFilterable; - groupable?: boolean|GridGroupable; - height?: number|string; - messages?: GridMessages; - mobile?: boolean|string; - navigatable?: boolean; - noRecords?: boolean|GridNoRecords; - pageable?: boolean|GridPageable; - pdf?: GridPdf; - reorderable?: boolean; - resizable?: boolean; - rowTemplate?: string|Function; - scrollable?: boolean|GridScrollable; - selectable?: boolean|string; - sortable?: boolean|GridSortable; - toolbar?: string | ((...args:any[]) => string) | GridToolbarItem[]; - cancel?(e: GridCancelEvent): void; - change?(e: GridChangeEvent): void; - columnHide?(e: GridColumnHideEvent): void; - columnMenuInit?(e: GridColumnMenuInitEvent): void; - columnReorder?(e: GridColumnReorderEvent): void; - columnResize?(e: GridColumnResizeEvent): void; - columnShow?(e: GridColumnShowEvent): void; - dataBinding?(e: GridDataBindingEvent): void; - dataBound?(e: GridDataBoundEvent): void; - detailCollapse?(e: GridDetailCollapseEvent): void; - detailExpand?(e: GridDetailExpandEvent): void; - detailInit?(e: GridDetailInitEvent): void; - edit?(e: GridEditEvent): void; - excelExport?(e: GridExcelExportEvent): void; - pdfExport?(e: GridPdfExportEvent): void; - filterMenuInit?(e: GridFilterMenuInitEvent): void; - remove?(e: GridRemoveEvent): void; - save?(e: GridSaveEvent): void; - saveChanges?(e: GridSaveChangesEvent): void; - columnLock?(e: GridColumnLockEvent): void; - columnUnlock?(e: GridColumnUnlockEvent): void; - navigate?(e: GridNavigateEvent): void; - } - interface GridEvent { - sender: Grid; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface GridCancelEvent extends GridEvent { - container?: JQuery; - model?: kendo.data.Model; - } - - interface GridChangeEvent extends GridEvent { - } - - interface GridColumnHideEvent extends GridEvent { - column?: any; - } - - interface GridColumnMenuInitEvent extends GridEvent { - container?: JQuery; - field?: string; - } - - interface GridColumnReorderEvent extends GridEvent { - column?: any; - newIndex?: number; - oldIndex?: number; - } - - interface GridColumnResizeEvent extends GridEvent { - column?: any; - newWidth?: number; - oldWidth?: number; - } - - interface GridColumnShowEvent extends GridEvent { - column?: any; - } - - interface GridDataBindingEvent extends GridEvent { - action?: string; - index?: number; - items?: any; - } - - interface GridDataBoundEvent extends GridEvent { - } - - interface GridDetailCollapseEvent extends GridEvent { - detailRow?: JQuery; - masterRow?: JQuery; - } - - interface GridDetailExpandEvent extends GridEvent { - detailRow?: JQuery; - masterRow?: JQuery; - } - - interface GridDetailInitEvent extends GridEvent { - data?: kendo.data.ObservableObject; - detailCell?: JQuery; - detailRow?: JQuery; - masterRow?: JQuery; - } - - interface GridEditEvent extends GridEvent { - container?: JQuery; - model?: kendo.data.Model; - } - - interface GridExcelExportEvent extends GridEvent { - data?: any; - workbook?: kendo.ooxml.Workbook; - } - - interface GridPdfExportEvent extends GridEvent { - promise?: JQueryPromise; - } - - interface GridFilterMenuInitEvent extends GridEvent { - container?: JQuery; - field?: string; - } - - interface GridRemoveEvent extends GridEvent { - model?: kendo.data.Model; - row?: JQuery; - } - - interface GridSaveEvent extends GridEvent { - model?: kendo.data.Model; - container?: JQuery; - values?: any; - } - - interface GridSaveChangesEvent extends GridEvent { - } - - interface GridColumnLockEvent extends GridEvent { - column?: any; - } - - interface GridColumnUnlockEvent extends GridEvent { - column?: any; - } - - interface GridNavigateEvent extends GridEvent { - element?: JQuery; - } - - - class ListView extends kendo.ui.Widget { - - static fn: ListView; - - options: ListViewOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ListView; - - constructor(element: Element, options?: ListViewOptions); - - - add(): void; - cancel(): void; - clearSelection(): void; - dataItem(row: string): kendo.data.ObservableObject; - dataItem(row: Element): kendo.data.ObservableObject; - dataItem(row: JQuery): kendo.data.ObservableObject; - dataItems(): void; - destroy(): void; - edit(item: JQuery): void; - items(): any; - refresh(): void; - remove(item: any): void; - save(): void; - select(): JQuery; - select(items: JQuery): void; - select(items: any): void; - setDataSource(dataSource: kendo.data.DataSource): void; - - } - - interface ListViewOptions { - name?: string; - autoBind?: boolean; - dataSource?: any|any|kendo.data.DataSource; - editTemplate?: Function; - navigatable?: boolean; - selectable?: boolean|string; - template?: Function; - altTemplate?: Function; - cancel?(e: ListViewCancelEvent): void; - change?(e: ListViewEvent): void; - dataBound?(e: ListViewEvent): void; - dataBinding?(e: ListViewEvent): void; - edit?(e: ListViewEditEvent): void; - remove?(e: ListViewRemoveEvent): void; - save?(e: ListViewSaveEvent): void; - } - interface ListViewEvent { - sender: ListView; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ListViewCancelEvent extends ListViewEvent { - container?: JQuery; - model?: kendo.data.Model; - } - - interface ListViewEditEvent extends ListViewEvent { - item?: JQuery; - model?: kendo.data.Model; - } - - interface ListViewRemoveEvent extends ListViewEvent { - item?: JQuery; - model?: kendo.data.Model; - } - - interface ListViewSaveEvent extends ListViewEvent { - model?: kendo.data.Model; - item?: JQuery; - } - - - class MaskedTextBox extends kendo.ui.Widget { - - static fn: MaskedTextBox; - - options: MaskedTextBoxOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): MaskedTextBox; - - constructor(element: Element, options?: MaskedTextBoxOptions); - - - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - raw(): string; - value(): string; - value(value: string): void; - - } - - interface MaskedTextBoxOptions { - name?: string; - clearPromptChar?: boolean; - culture?: string; - mask?: string; - promptChar?: string; - rules?: any; - unmaskOnPost?: boolean; - value?: string; - change?(e: MaskedTextBoxChangeEvent): void; - } - interface MaskedTextBoxEvent { - sender: MaskedTextBox; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface MaskedTextBoxChangeEvent extends MaskedTextBoxEvent { - } - - - class Menu extends kendo.ui.Widget { - - static fn: Menu; - - options: MenuOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Menu; - - constructor(element: Element, options?: MenuOptions); - - - append(item: any, referenceItem: string): kendo.ui.Menu; - append(item: any, referenceItem: JQuery): kendo.ui.Menu; - close(element: string): kendo.ui.Menu; - close(element: Element): kendo.ui.Menu; - close(element: JQuery): kendo.ui.Menu; - destroy(): void; - enable(element: string, enable: boolean): kendo.ui.Menu; - enable(element: Element, enable: boolean): kendo.ui.Menu; - enable(element: JQuery, enable: boolean): kendo.ui.Menu; - insertAfter(item: any, referenceItem: string): kendo.ui.Menu; - insertAfter(item: any, referenceItem: Element): kendo.ui.Menu; - insertAfter(item: any, referenceItem: JQuery): kendo.ui.Menu; - insertBefore(item: any, referenceItem: string): kendo.ui.Menu; - insertBefore(item: any, referenceItem: Element): kendo.ui.Menu; - insertBefore(item: any, referenceItem: JQuery): kendo.ui.Menu; - open(element: string): kendo.ui.Menu; - open(element: Element): kendo.ui.Menu; - open(element: JQuery): kendo.ui.Menu; - remove(element: string): kendo.ui.Menu; - remove(element: Element): kendo.ui.Menu; - remove(element: JQuery): kendo.ui.Menu; - - } - - interface MenuAnimationClose { - effects?: string; - duration?: number; - } - - interface MenuAnimationOpen { - effects?: string; - duration?: number; - } - - interface MenuAnimation { - close?: MenuAnimationClose; - open?: MenuAnimationOpen; - } - - interface MenuOptions { - name?: string; - animation?: boolean|MenuAnimation; - closeOnClick?: boolean; - dataSource?: any|any; - direction?: string; - hoverDelay?: number; - openOnClick?: boolean; - orientation?: string; - popupCollision?: string; - close?(e: MenuCloseEvent): void; - open?(e: MenuOpenEvent): void; - activate?(e: MenuActivateEvent): void; - deactivate?(e: MenuDeactivateEvent): void; - select?(e: MenuSelectEvent): void; - } - interface MenuEvent { - sender: Menu; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface MenuCloseEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuOpenEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuActivateEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuDeactivateEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuSelectEvent extends MenuEvent { - item?: HTMLElement; - } - - - class MultiSelect extends kendo.ui.Widget { - - static fn: MultiSelect; - - options: MultiSelectOptions; - - dataSource: kendo.data.DataSource; - input: JQuery; - list: JQuery; - ul: JQuery; - tagList: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): MultiSelect; - - constructor(element: Element, options?: MultiSelectOptions); - - - close(): void; - dataItems(): any; - destroy(): void; - enable(enable: boolean): void; - focus(): void; - items(): any; - open(): void; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - setDataSource(dataSource: kendo.data.DataSource): void; - toggle(toggle: boolean): void; - value(): any; - value(value: any): void; - value(value: string): void; - - } - - interface MultiSelectAnimationClose { - effects?: string; - duration?: number; - } - - interface MultiSelectAnimationOpen { - effects?: string; - duration?: number; - } - - interface MultiSelectAnimation { - close?: MultiSelectAnimationClose; - open?: MultiSelectAnimationOpen; - } - - interface MultiSelectPopup { - appendTo?: string; - origin?: string; - position?: string; - } - - interface MultiSelectVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface MultiSelectOptions { - name?: string; - animation?: boolean|MultiSelectAnimation; - autoBind?: boolean; - autoClose?: boolean; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - highlightFirst?: boolean; - ignoreCase?: boolean; - minLength?: number; - maxSelectedItems?: number; - placeholder?: string; - popup?: MultiSelectPopup; - headerTemplate?: string|Function; - itemTemplate?: string|Function; - tagTemplate?: string; - tagMode?: string; - value?: any; - valuePrimitive?: boolean; - virtual?: boolean|MultiSelectVirtual; - change?(e: MultiSelectChangeEvent): void; - close?(e: MultiSelectCloseEvent): void; - dataBound?(e: MultiSelectDataBoundEvent): void; - filtering?(e: MultiSelectFilteringEvent): void; - open?(e: MultiSelectOpenEvent): void; - select?(e: MultiSelectSelectEvent): void; - } - interface MultiSelectEvent { - sender: MultiSelect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface MultiSelectChangeEvent extends MultiSelectEvent { - } - - interface MultiSelectCloseEvent extends MultiSelectEvent { - } - - interface MultiSelectDataBoundEvent extends MultiSelectEvent { - } - - interface MultiSelectFilteringEvent extends MultiSelectEvent { - filter?: any; - } - - interface MultiSelectOpenEvent extends MultiSelectEvent { - } - - interface MultiSelectSelectEvent extends MultiSelectEvent { - item?: JQuery; - } - - - class Notification extends kendo.ui.Widget { - - static fn: Notification; - - options: NotificationOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Notification; - - constructor(element: Element, options?: NotificationOptions); - - - error(data: any): void; - error(data: string): void; - error(data: Function): void; - getNotifications(): JQuery; - hide(): void; - info(data: any): void; - info(data: string): void; - info(data: Function): void; - show(data: any, type: string): void; - show(data: string, type: string): void; - show(data: Function, type: string): void; - showText(data: any, type: string): void; - showText(data: string, type: string): void; - showText(data: Function, type: string): void; - success(data: any): void; - success(data: string): void; - success(data: Function): void; - warning(data: any): void; - warning(data: string): void; - warning(data: Function): void; - - } - - interface NotificationPosition { - bottom?: number; - left?: number; - pinned?: boolean; - right?: number; - top?: number; - } - - interface NotificationTemplate { - type?: string; - template?: string; - } - - interface NotificationOptions { - name?: string; - allowHideAfter?: number; - animation?: any|boolean; - appendTo?: string|JQuery; - autoHideAfter?: number; - button?: boolean; - height?: number|string; - hideOnClick?: boolean; - position?: NotificationPosition; - stacking?: string; - templates?: NotificationTemplate[]; - width?: number|string; - hide?(e: NotificationHideEvent): void; - show?(e: NotificationShowEvent): void; - } - interface NotificationEvent { - sender: Notification; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface NotificationHideEvent extends NotificationEvent { - element?: JQuery; - } - - interface NotificationShowEvent extends NotificationEvent { - element?: JQuery; - } - - - class NumericTextBox extends kendo.ui.Widget { - - static fn: NumericTextBox; - - options: NumericTextBoxOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): NumericTextBox; - - constructor(element: Element, options?: NumericTextBoxOptions); - - - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - focus(): void; - max(): number; - max(value: number): void; - max(value: string): void; - min(): number; - min(value: number): void; - min(value: string): void; - step(): number; - step(value: number): void; - step(value: string): void; - value(): number; - value(value: number): void; - value(value: string): void; - - } - - interface NumericTextBoxOptions { - name?: string; - culture?: string; - decimals?: number; - downArrowText?: string; - format?: string; - max?: number; - min?: number; - placeholder?: string; - spinners?: boolean; - step?: number; - upArrowText?: string; - value?: number; - change?(e: NumericTextBoxChangeEvent): void; - spin?(e: NumericTextBoxSpinEvent): void; - } - interface NumericTextBoxEvent { - sender: NumericTextBox; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface NumericTextBoxChangeEvent extends NumericTextBoxEvent { - } - - interface NumericTextBoxSpinEvent extends NumericTextBoxEvent { - } - - - class Pager extends kendo.ui.Widget { - - static fn: Pager; - - options: PagerOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Pager; - - constructor(element: Element, options?: PagerOptions); - - - totalPages(): number; - pageSize(): number; - page(): number; - page(page: number): void; - refresh(): void; - destroy(): void; - - } - - interface PagerMessages { - display?: string; - empty?: string; - allPages?: string; - page?: string; - of?: string; - itemsPerPage?: string; - first?: string; - previous?: string; - next?: string; - last?: string; - refresh?: string; - } - - interface PagerOptions { - name?: string; - autoBind?: boolean; - buttonCount?: number; - dataSource?: any|kendo.data.DataSource; - selectTemplate?: string; - linkTemplate?: string; - info?: boolean; - input?: boolean; - numeric?: boolean; - pageSizes?: boolean|any; - previousNext?: boolean; - refresh?: boolean; - messages?: PagerMessages; - change?(e: PagerChangeEvent): void; - } - interface PagerEvent { - sender: Pager; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PagerChangeEvent extends PagerEvent { - } - - - class PanelBar extends kendo.ui.Widget { - - static fn: PanelBar; - - options: PanelBarOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): PanelBar; - - constructor(element: Element, options?: PanelBarOptions); - - - append(item: string, referenceItem: string): kendo.ui.PanelBar; - append(item: string, referenceItem: Element): kendo.ui.PanelBar; - append(item: string, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: Element, referenceItem: string): kendo.ui.PanelBar; - append(item: Element, referenceItem: Element): kendo.ui.PanelBar; - append(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: string): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: any, referenceItem: string): kendo.ui.PanelBar; - append(item: any, referenceItem: Element): kendo.ui.PanelBar; - append(item: any, referenceItem: JQuery): kendo.ui.PanelBar; - clearSelection(): void; - collapse(element: string, useAnimation: boolean): kendo.ui.PanelBar; - collapse(element: Element, useAnimation: boolean): kendo.ui.PanelBar; - collapse(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; - destroy(): void; - enable(element: string, enable: boolean): void; - enable(element: Element, enable: boolean): void; - enable(element: JQuery, enable: boolean): void; - expand(element: string, useAnimation: boolean): kendo.ui.PanelBar; - expand(element: Element, useAnimation: boolean): kendo.ui.PanelBar; - expand(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; - insertAfter(item: string, referenceItem: string): void; - insertAfter(item: string, referenceItem: Element): void; - insertAfter(item: string, referenceItem: JQuery): void; - insertAfter(item: Element, referenceItem: string): void; - insertAfter(item: Element, referenceItem: Element): void; - insertAfter(item: Element, referenceItem: JQuery): void; - insertAfter(item: JQuery, referenceItem: string): void; - insertAfter(item: JQuery, referenceItem: Element): void; - insertAfter(item: JQuery, referenceItem: JQuery): void; - insertAfter(item: any, referenceItem: string): void; - insertAfter(item: any, referenceItem: Element): void; - insertAfter(item: any, referenceItem: JQuery): void; - insertBefore(item: string, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: string, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: string, referenceItem: JQuery): kendo.ui.PanelBar; - insertBefore(item: Element, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: Element, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; - insertBefore(item: JQuery, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; - insertBefore(item: any, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: any, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: any, referenceItem: JQuery): kendo.ui.PanelBar; - reload(element: string): void; - reload(element: Element): void; - reload(element: JQuery): void; - remove(element: string): void; - remove(element: Element): void; - remove(element: JQuery): void; - select(): JQuery; - select(element?: string): void; - select(element?: Element): void; - select(element?: JQuery): void; - - } - - interface PanelBarAnimationCollapse { - duration?: number; - effects?: string; - } - - interface PanelBarAnimationExpand { - duration?: number; - effects?: string; - } - - interface PanelBarAnimation { - collapse?: PanelBarAnimationCollapse; - expand?: PanelBarAnimationExpand; - } - - interface PanelBarOptions { - name?: string; - animation?: boolean|PanelBarAnimation; - contentUrls?: any; - dataSource?: any|any; - expandMode?: string; - activate?(e: PanelBarActivateEvent): void; - collapse?(e: PanelBarCollapseEvent): void; - contentLoad?(e: PanelBarContentLoadEvent): void; - error?(e: PanelBarErrorEvent): void; - expand?(e: PanelBarExpandEvent): void; - select?(e: PanelBarSelectEvent): void; - } - interface PanelBarEvent { - sender: PanelBar; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PanelBarActivateEvent extends PanelBarEvent { - item?: Element; - } - - interface PanelBarCollapseEvent extends PanelBarEvent { - item?: Element; - } - - interface PanelBarContentLoadEvent extends PanelBarEvent { - item?: Element; - contentElement?: Element; - } - - interface PanelBarErrorEvent extends PanelBarEvent { - xhr?: JQueryXHR; - status?: string; - } - - interface PanelBarExpandEvent extends PanelBarEvent { - item?: Element; - } - - interface PanelBarSelectEvent extends PanelBarEvent { - item?: Element; - } - - - class PivotConfigurator extends kendo.ui.Widget { - - static fn: PivotConfigurator; - - options: PivotConfiguratorOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): PivotConfigurator; - - constructor(element: Element, options?: PivotConfiguratorOptions); - - - destroy(): void; - refresh(): void; - setDataSource(dataSource: kendo.data.PivotDataSource): void; - - } - - interface PivotConfiguratorMessagesFieldMenuOperators { - contains?: string; - doesnotcontain?: string; - startswith?: string; - endswith?: string; - eq?: string; - neq?: string; - } - - interface PivotConfiguratorMessagesFieldMenu { - info?: string; - sortAscending?: string; - sortDescending?: string; - filterFields?: string; - filter?: string; - include?: string; - title?: string; - clear?: string; - ok?: string; - cancel?: string; - operators?: PivotConfiguratorMessagesFieldMenuOperators; - } - - interface PivotConfiguratorMessages { - measures?: string; - columns?: string; - rows?: string; - measuresLabel?: string; - rowsLabel?: string; - columnsLabel?: string; - fieldsLabel?: string; - fieldMenu?: PivotConfiguratorMessagesFieldMenu; - } - - interface PivotConfiguratorSortable { - allowUnsort?: boolean; - } - - interface PivotConfiguratorOptions { - name?: string; - dataSource?: any|kendo.data.PivotDataSource; - filterable?: boolean; - sortable?: boolean|PivotConfiguratorSortable; - height?: number|string; - messages?: PivotConfiguratorMessages; - } - interface PivotConfiguratorEvent { - sender: PivotConfigurator; + interface PointEvent { + sender: Point; preventDefault: Function; isDefaultPrevented(): boolean; } - class PivotGrid extends kendo.ui.Widget { - - static fn: PivotGrid; - - options: PivotGridOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): PivotGrid; - - constructor(element: Element, options?: PivotGridOptions); + class Rect extends Observable { - cellInfo(columnIndex: number, rowIndex: number): any; - cellInfoByElement(cell: string): any; - cellInfoByElement(cell: Element): any; - cellInfoByElement(cell: JQuery): any; - destroy(): void; - refresh(): void; - setDataSource(dataSource: kendo.data.PivotDataSource): void; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; } - interface PivotGridExcel { - fileName?: string; - filterable?: boolean; - forceProxy?: boolean; - proxyURL?: string; - } - - interface PivotGridMessagesFieldMenuOperators { - contains?: string; - doesnotcontain?: string; - startswith?: string; - endswith?: string; - eq?: string; - neq?: string; - } - - interface PivotGridMessagesFieldMenu { - info?: string; - sortAscending?: string; - sortDescending?: string; - filterFields?: string; - filter?: string; - include?: string; - title?: string; - clear?: string; - ok?: string; - cancel?: string; - operators?: PivotGridMessagesFieldMenuOperators; - } - - interface PivotGridMessages { - measureFields?: string; - columnFields?: string; - rowFields?: string; - fieldMenu?: PivotGridMessagesFieldMenu; - } - - interface PivotGridPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface PivotGridPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: PivotGridPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface PivotGridSortable { - allowUnsort?: boolean; - } - - interface PivotGridOptions { + interface RectOptions { name?: string; - dataSource?: any|kendo.data.PivotDataSource; - autoBind?: boolean; - reorderable?: boolean; - excel?: PivotGridExcel; - pdf?: PivotGridPdf; - filterable?: boolean; - sortable?: boolean|PivotGridSortable; - columnWidth?: number; - height?: number|string; - columnHeaderTemplate?: string|Function; - dataCellTemplate?: string|Function; - kpiStatusTemplate?: string|Function; - kpiTrendTemplate?: string|Function; - rowHeaderTemplate?: string|Function; - messages?: PivotGridMessages; - dataBinding?(e: PivotGridDataBindingEvent): void; - dataBound?(e: PivotGridDataBoundEvent): void; - expandMember?(e: PivotGridExpandMemberEvent): void; - collapseMember?(e: PivotGridCollapseMemberEvent): void; - excelExport?(e: PivotGridExcelExportEvent): void; - pdfExport?(e: PivotGridPdfExportEvent): void; } - interface PivotGridEvent { - sender: PivotGrid; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PivotGridDataBindingEvent extends PivotGridEvent { - } - - interface PivotGridDataBoundEvent extends PivotGridEvent { - } - - interface PivotGridExpandMemberEvent extends PivotGridEvent { - axis?: string; - path?: string; - } - - interface PivotGridCollapseMemberEvent extends PivotGridEvent { - axis?: string; - path?: string; - } - - interface PivotGridExcelExportEvent extends PivotGridEvent { - data?: any; - workbook?: any; - } - - interface PivotGridPdfExportEvent extends PivotGridEvent { - promise?: JQueryPromise; - } - - - class Popup extends kendo.ui.Widget { - - static fn: Popup; - - options: PopupOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Popup; - - constructor(element: Element, options?: PopupOptions); - - - close(): void; - open(): void; - position(): void; - setOptions(options: any): void; - visible(): boolean; - - } - - interface PopupAnimationClose { - effects?: string; - duration?: number; - } - - interface PopupAnimationOpen { - effects?: string; - duration?: number; - } - - interface PopupAnimation { - close?: PopupAnimationClose; - open?: PopupAnimationOpen; - } - - interface PopupOptions { - name?: string; - adjustSize?: any; - animation?: boolean|PopupAnimation; - anchor?: string|JQuery; - appendTo?: string|JQuery; - collision?: string; - origin?: string; - position?: string; - activate?(e: PopupActivateEvent): void; - close?(e: PopupCloseEvent): void; - deactivate?(e: PopupDeactivateEvent): void; - open?(e: PopupOpenEvent): void; - } - interface PopupEvent { - sender: Popup; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PopupActivateEvent extends PopupEvent { - } - - interface PopupCloseEvent extends PopupEvent { - } - - interface PopupDeactivateEvent extends PopupEvent { - } - - interface PopupOpenEvent extends PopupEvent { - } - - - class ProgressBar extends kendo.ui.Widget { - - static fn: ProgressBar; - - options: ProgressBarOptions; - - progressStatus: JQuery; - progressWrapper: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ProgressBar; - - constructor(element: Element, options?: ProgressBarOptions); - - - enable(enable: boolean): void; - value(): number; - value(value: number): void; - - } - - interface ProgressBarAnimation { - duration?: number; - } - - interface ProgressBarOptions { - name?: string; - animation?: ProgressBarAnimation; - chunkCount?: number; - enable?: boolean; - max?: number; - min?: number; - orientation?: string; - reverse?: boolean; - showStatus?: boolean; - type?: string; - value?: number; - change?(e: ProgressBarChangeEvent): void; - complete?(e: ProgressBarCompleteEvent): void; - } - interface ProgressBarEvent { - sender: ProgressBar; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ProgressBarChangeEvent extends ProgressBarEvent { - value?: number; - } - - interface ProgressBarCompleteEvent extends ProgressBarEvent { - value?: number; - } - - - class RangeSlider extends kendo.ui.Widget { - - static fn: RangeSlider; - - options: RangeSliderOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): RangeSlider; - - constructor(element: Element, options?: RangeSliderOptions); - - - destroy(): void; - enable(enable: boolean): void; - value(): any; - values(): any; - value(selectionStart: number, selectionEnd: number): void; - resize(): void; - - } - - interface RangeSliderTooltip { - enabled?: boolean; - format?: string; - template?: string; - } - - interface RangeSliderOptions { - name?: string; - largeStep?: number; - max?: number; - min?: number; - orientation?: string; - selectionEnd?: number; - selectionStart?: number; - smallStep?: number; - tickPlacement?: string; - tooltip?: RangeSliderTooltip; - change?(e: RangeSliderChangeEvent): void; - slide?(e: RangeSliderSlideEvent): void; - } - interface RangeSliderEvent { - sender: RangeSlider; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface RangeSliderChangeEvent extends RangeSliderEvent { - value?: any; - } - - interface RangeSliderSlideEvent extends RangeSliderEvent { - value?: any; - } - - - class ResponsivePanel extends kendo.ui.Widget { - - static fn: ResponsivePanel; - - options: ResponsivePanelOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ResponsivePanel; - - constructor(element: Element, options?: ResponsivePanelOptions); - - - close(): void; - destroy(): void; - open(): void; - - } - - interface ResponsivePanelOptions { - name?: string; - autoClose?: boolean; - breakpoint?: number; - orientation?: string; - toggleButton?: string; - close?(e: ResponsivePanelEvent): void; - open?(e: ResponsivePanelEvent): void; - } - interface ResponsivePanelEvent { - sender: ResponsivePanel; + interface RectEvent { + sender: Rect; preventDefault: Function; isDefaultPrevented(): boolean; } - class Scheduler extends kendo.ui.Widget { - - static fn: Scheduler; - - options: SchedulerOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Scheduler; - - constructor(element: Element, options?: SchedulerOptions); + class Size extends Observable { - addEvent(data: any): void; - cancelEvent(): void; - data(): void; - date(): Date; - date(value?: Date): void; - destroy(): void; - editEvent(event: string): void; - editEvent(event: kendo.data.SchedulerEvent): void; - items(): any; - occurrenceByUid(uid: string): kendo.data.SchedulerEvent; - occurrencesInRange(start: Date, end: Date): any; - refresh(): void; - removeEvent(event: string): void; - removeEvent(event: kendo.data.SchedulerEvent): void; - resourcesBySlot(slot: any): any; - saveAsPDF(): JQueryPromise; - saveEvent(): void; - select(): void; - select(events: any, options: any): void; - setDataSource(dataSource: kendo.data.SchedulerDataSource): void; - slotByPosition(xPosition: number, yPosition: number): any; - slotByElement(element: Element): any; - slotByElement(element: JQuery): any; - view(): kendo.ui.SchedulerView; - view(type?: string): void; - viewName(): string; + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; } - interface SchedulerCurrentTimeMarker { - updateInterval?: number; - useLocalTimezone?: boolean; - } - - interface SchedulerEditable { - confirmation?: boolean|string; - create?: boolean; - destroy?: boolean; - editRecurringMode?: string; - move?: boolean; - resize?: boolean; - template?: string|Function; - update?: boolean; - window?: any; - } - - interface SchedulerFooter { - command?: string|boolean; - } - - interface SchedulerGroup { - resources?: any; - orientation?: string; - } - - interface SchedulerMessagesEditable { - confirmation?: string; - } - - interface SchedulerMessagesEditor { - allDayEvent?: string; - description?: string; - editorTitle?: string; - end?: string; - endTimezone?: string; - repeat?: string; - separateTimezones?: string; - start?: string; - startTimezone?: string; - timezone?: string; - timezoneEditorButton?: string; - timezoneEditorTitle?: string; - title?: string; - } - - interface SchedulerMessagesRecurrenceEditorDaily { - interval?: string; - repeatEvery?: string; - } - - interface SchedulerMessagesRecurrenceEditorEnd { - after?: string; - occurrence?: string; - label?: string; - never?: string; - mobileLabel?: string; - on?: string; - } - - interface SchedulerMessagesRecurrenceEditorFrequencies { - daily?: string; - monthly?: string; - never?: string; - weekly?: string; - yearly?: string; - } - - interface SchedulerMessagesRecurrenceEditorMonthly { - day?: string; - interval?: string; - repeatEvery?: string; - repeatOn?: string; - } - - interface SchedulerMessagesRecurrenceEditorOffsetPositions { - first?: string; - second?: string; - third?: string; - fourth?: string; - last?: string; - } - - interface SchedulerMessagesRecurrenceEditorWeekdays { - day?: string; - weekday?: string; - weekend?: string; - } - - interface SchedulerMessagesRecurrenceEditorWeekly { - interval?: string; - repeatEvery?: string; - repeatOn?: string; - } - - interface SchedulerMessagesRecurrenceEditorYearly { - of?: string; - repeatEvery?: string; - repeatOn?: string; - interval?: string; - } - - interface SchedulerMessagesRecurrenceEditor { - daily?: SchedulerMessagesRecurrenceEditorDaily; - end?: SchedulerMessagesRecurrenceEditorEnd; - frequencies?: SchedulerMessagesRecurrenceEditorFrequencies; - monthly?: SchedulerMessagesRecurrenceEditorMonthly; - offsetPositions?: SchedulerMessagesRecurrenceEditorOffsetPositions; - weekly?: SchedulerMessagesRecurrenceEditorWeekly; - weekdays?: SchedulerMessagesRecurrenceEditorWeekdays; - yearly?: SchedulerMessagesRecurrenceEditorYearly; - } - - interface SchedulerMessagesRecurrenceMessages { - deleteRecurring?: string; - deleteWindowOccurrence?: string; - deleteWindowSeries?: string; - deleteWindowTitle?: string; - editRecurring?: string; - editWindowOccurrence?: string; - editWindowSeries?: string; - editWindowTitle?: string; - } - - interface SchedulerMessagesViews { - day?: string; - week?: string; - month?: string; - agenda?: string; - } - - interface SchedulerMessages { - allDay?: string; - ariaEventLabel?: string; - ariaSlotLabel?: string; - cancel?: string; - date?: string; - deleteWindowTitle?: string; - destroy?: string; - event?: string; - defaultRowText?: string; - pdf?: string; - save?: string; - showFullDay?: string; - showWorkDay?: string; - time?: string; - today?: string; - editable?: SchedulerMessagesEditable; - editor?: SchedulerMessagesEditor; - recurrenceEditor?: SchedulerMessagesRecurrenceEditor; - recurrenceMessages?: SchedulerMessagesRecurrenceMessages; - views?: SchedulerMessagesViews; - } - - interface SchedulerPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface SchedulerPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: SchedulerPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface SchedulerResource { - dataColorField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - field?: string; - multiple?: boolean; - name?: string; - title?: string; - valuePrimitive?: boolean; - } - - interface SchedulerToolbarItem { + interface SizeOptions { name?: string; } - - interface SchedulerViewEditable { - create?: boolean; - destroy?: boolean; - update?: boolean; - } - - interface SchedulerViewGroup { - orientation?: string; - } - - interface SchedulerView { - allDayEventTemplate?: string|Function; - allDaySlot?: boolean; - allDaySlotTemplate?: string|Function; - columnWidth?: number; - dateHeaderTemplate?: string|Function; - dayTemplate?: string|Function; - editable?: boolean|SchedulerViewEditable; - endTime?: Date; - eventHeight?: number; - eventTemplate?: string|Function; - eventTimeTemplate?: string|Function; - group?: SchedulerViewGroup; - majorTick?: number; - majorTimeHeaderTemplate?: string|Function; - minorTickCount?: number; - minorTimeHeaderTemplate?: string|Function; - selected?: boolean; - selectedDateFormat?: string; - showWorkHours?: boolean; - slotTemplate?: string|Function; - startTime?: Date; - title?: string; - type?: string; - workWeekStart?: number; - workWeekEnd?: number; - } - - interface SchedulerSelectOptions { - events?: any; - resources?: any; - start?: Date; - end?: Date; - isAllDay?: boolean; - } - - interface SchedulerOptions { - name?: string; - allDayEventTemplate?: string|Function; - allDaySlot?: boolean; - autoBind?: boolean; - currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; - dataSource?: any|any|kendo.data.SchedulerDataSource; - date?: Date; - dateHeaderTemplate?: string|Function; - editable?: boolean|SchedulerEditable; - endTime?: Date; - eventTemplate?: string|Function; - footer?: boolean|SchedulerFooter; - group?: SchedulerGroup; - height?: number|string; - majorTick?: number; - majorTimeHeaderTemplate?: string|Function; - max?: Date; - messages?: SchedulerMessages; - min?: Date; - minorTickCount?: number; - minorTimeHeaderTemplate?: string|Function; - mobile?: boolean|string; - pdf?: SchedulerPdf; - resources?: SchedulerResource[]; - selectable?: boolean; - showWorkHours?: boolean; - snap?: boolean; - startTime?: Date; - timezone?: string; - toolbar?: SchedulerToolbarItem[]; - views?: SchedulerView[]; - groupHeaderTemplate?: string|Function; - width?: number|string; - workDayStart?: Date; - workDayEnd?: Date; - workWeekStart?: number; - workWeekEnd?: number; - add?(e: SchedulerAddEvent): void; - cancel?(e: SchedulerCancelEvent): void; - change?(e: SchedulerChangeEvent): void; - dataBinding?(e: SchedulerDataBindingEvent): void; - dataBound?(e: SchedulerDataBoundEvent): void; - edit?(e: SchedulerEditEvent): void; - moveStart?(e: SchedulerMoveStartEvent): void; - move?(e: SchedulerMoveEvent): void; - moveEnd?(e: SchedulerMoveEndEvent): void; - navigate?(e: SchedulerNavigateEvent): void; - pdfExport?(e: SchedulerPdfExportEvent): void; - remove?(e: SchedulerRemoveEvent): void; - resizeStart?(e: SchedulerResizeStartEvent): void; - resize?(e: SchedulerResizeEvent): void; - resizeEnd?(e: SchedulerResizeEndEvent): void; - save?(e: SchedulerSaveEvent): void; - } - interface SchedulerEvent { - sender: Scheduler; + interface SizeEvent { + sender: Size; preventDefault: Function; isDefaultPrevented(): boolean; } - interface SchedulerAddEvent extends SchedulerEvent { - event?: any; - } - interface SchedulerCancelEvent extends SchedulerEvent { - container?: JQuery; - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerChangeEvent extends SchedulerEvent { - start?: Date; - end?: Date; - events?: any; - slots?: any; - resources?: any; - } - - interface SchedulerDataBindingEvent extends SchedulerEvent { - } - - interface SchedulerDataBoundEvent extends SchedulerEvent { - } - - interface SchedulerEditEvent extends SchedulerEvent { - container?: JQuery; - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerMoveStartEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerMoveEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - slot?: any; - } - - interface SchedulerMoveEndEvent extends SchedulerEvent { - start?: Date; - end?: Date; - event?: kendo.data.SchedulerEvent; - slot?: any; - resources?: any; - } - - interface SchedulerNavigateEvent extends SchedulerEvent { - action?: string; - date?: Date; - view?: string; - } - - interface SchedulerPdfExportEvent extends SchedulerEvent { - promise?: JQueryPromise; - } - - interface SchedulerRemoveEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerResizeStartEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerResizeEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - slot?: any; - } - - interface SchedulerResizeEndEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - slot?: any; - } - - interface SchedulerSaveEvent extends SchedulerEvent { - container?: JQuery; - event?: kendo.data.SchedulerEvent; - } + class Transformation extends Observable { - class Slider extends kendo.ui.Widget { - - static fn: Slider; - - options: SliderOptions; + options: TransformationOptions; - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Slider; - - constructor(element: Element, options?: SliderOptions); - destroy(): void; - enable(enable: boolean): void; - value(): number; - value(value: number): void; - resize(): void; + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; } - interface SliderTooltip { - enabled?: boolean; - format?: string; - template?: string; - } - - interface SliderOptions { + interface TransformationOptions { name?: string; - decreaseButtonTitle?: string; - increaseButtonTitle?: string; - largeStep?: number; - max?: number; - min?: number; - orientation?: string; - showButtons?: boolean; - smallStep?: number; - tickPlacement?: string; - tooltip?: SliderTooltip; - value?: number; - change?(e: SliderChangeEvent): void; - slide?(e: SliderSlideEvent): void; } - interface SliderEvent { - sender: Slider; + interface TransformationEvent { + sender: Transformation; preventDefault: Function; isDefaultPrevented(): boolean; } - interface SliderChangeEvent extends SliderEvent { - value?: number; - } - - interface SliderSlideEvent extends SliderEvent { - value?: number; - } - - - class Sortable extends kendo.ui.Widget { - - static fn: Sortable; - - options: SortableOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Sortable; - - constructor(element: Element, options?: SortableOptions); - - - indexOf(element: JQuery): number; - items(): JQuery; - - } - - interface SortableCursorOffset { - left?: number; - top?: number; - } - - interface SortableOptions { - name?: string; - axis?: string; - autoScroll?: boolean; - container?: string|JQuery; - connectWith?: string; - cursor?: string; - cursorOffset?: SortableCursorOffset; - disabled?: string; - filter?: string; - handler?: string; - hint?: Function|string|JQuery; - holdToDrag?: boolean; - ignore?: string; - placeholder?: Function|string|JQuery; - start?(e: SortableStartEvent): void; - move?(e: SortableMoveEvent): void; - end?(e: SortableEndEvent): void; - change?(e: SortableChangeEvent): void; - cancel?(e: SortableCancelEvent): void; - } - interface SortableEvent { - sender: Sortable; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface SortableStartEvent extends SortableEvent { - draggableEvent?: any; - item?: JQuery; - } - - interface SortableMoveEvent extends SortableEvent { - item?: JQuery; - target?: JQuery; - list?: kendo.ui.Sortable; - draggableEvent?: any; - } - - interface SortableEndEvent extends SortableEvent { - action?: string; - item?: JQuery; - oldIndex?: number; - newIndex?: number; - draggableEvent?: any; - } - - interface SortableChangeEvent extends SortableEvent { - action?: string; - item?: JQuery; - oldIndex?: number; - newIndex?: number; - draggableEvent?: any; - } - - interface SortableCancelEvent extends SortableEvent { - item?: JQuery; - } - - - class Splitter extends kendo.ui.Widget { - - static fn: Splitter; - - options: SplitterOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Splitter; - - constructor(element: Element, options?: SplitterOptions); - - - ajaxRequest(pane: string, url: string, data: any): void; - ajaxRequest(pane: string, url: string, data: string): void; - ajaxRequest(pane: Element, url: string, data: any): void; - ajaxRequest(pane: Element, url: string, data: string): void; - ajaxRequest(pane: JQuery, url: string, data: any): void; - ajaxRequest(pane: JQuery, url: string, data: string): void; - append(config?: any): JQuery; - collapse(pane: string): void; - collapse(pane: Element): void; - collapse(pane: JQuery): void; - destroy(): void; - expand(pane: string): void; - expand(pane: Element): void; - expand(pane: JQuery): void; - insertAfter(config: any, referencePane: string): JQuery; - insertAfter(config: any, referencePane: Element): JQuery; - insertAfter(config: any, referencePane: JQuery): JQuery; - insertBefore(config: any, referencePane: string): JQuery; - insertBefore(config: any, referencePane: Element): JQuery; - insertBefore(config: any, referencePane: JQuery): JQuery; - max(pane: string, value: string): void; - max(pane: Element, value: string): void; - max(pane: JQuery, value: string): void; - min(pane: string, value: string): void; - min(pane: Element, value: string): void; - min(pane: JQuery, value: string): void; - remove(pane: string): void; - remove(pane: Element): void; - remove(pane: JQuery): void; - size(pane: string, value: string): void; - size(pane: Element, value: string): void; - size(pane: JQuery, value: string): void; - toggle(pane: string, expand?: boolean): void; - toggle(pane: Element, expand?: boolean): void; - toggle(pane: JQuery, expand?: boolean): void; - - } - - interface SplitterPane { - collapsed?: boolean; - collapsedSize?: string; - collapsible?: boolean; - contentUrl?: string; - max?: string; - min?: string; - resizable?: boolean; - scrollable?: boolean; - size?: string; - } - - interface SplitterOptions { - name?: string; - orientation?: string; - panes?: SplitterPane[]; - collapse?(e: SplitterCollapseEvent): void; - contentLoad?(e: SplitterContentLoadEvent): void; - error?(e: SplitterErrorEvent): void; - expand?(e: SplitterExpandEvent): void; - layoutChange?(e: SplitterEvent): void; - resize?(e: SplitterEvent): void; - } - interface SplitterEvent { - sender: Splitter; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface SplitterCollapseEvent extends SplitterEvent { - pane?: Element; - } - - interface SplitterContentLoadEvent extends SplitterEvent { - pane?: Element; - } - - interface SplitterErrorEvent extends SplitterEvent { - xhr?: JQueryXHR; - status?: string; - } - - interface SplitterExpandEvent extends SplitterEvent { - pane?: Element; - } - - - class Spreadsheet extends kendo.ui.Widget { - - static fn: Spreadsheet; - - options: SpreadsheetOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Spreadsheet; - - constructor(element: Element, options?: SpreadsheetOptions); - - - activeSheet(): kendo.spreadsheet.Sheet; - activeSheet(sheet?: kendo.spreadsheet.Sheet): void; - sheets(): any; - fromFile(blob: Blob): JQueryPromise; - fromFile(blob: File): JQueryPromise; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; - sheetByName(name: string): kendo.spreadsheet.Sheet; - sheetIndex(sheet: kendo.spreadsheet.Sheet): number; - sheetByIndex(index: number): kendo.spreadsheet.Sheet; - insertSheet(options: any): kendo.spreadsheet.Sheet; - moveSheetToIndex(sheet: kendo.spreadsheet.Sheet, index: number): void; - removeSheet(sheet: kendo.spreadsheet.Sheet): void; - renameSheet(sheet: kendo.spreadsheet.Sheet, newSheetName: string): kendo.spreadsheet.Sheet; - toJSON(): any; - fromJSON(data: any): void; - - } - - interface SpreadsheetExcel { - fileName?: string; - forceProxy?: boolean; - proxyURL?: string; - } - - interface SpreadsheetPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface SpreadsheetPdf { - area?: string; - author?: string; - creator?: string; - date?: Date; - fileName?: string; - fitWidth?: boolean; - forceProxy?: boolean; - guidelines?: boolean; - hCenter?: boolean; - keywords?: string; - landscape?: boolean; - margin?: SpreadsheetPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - vCenter?: boolean; - } - - interface SpreadsheetSheetColumn { - index?: number; - width?: number; - } - - interface SpreadsheetSheetFilterColumnCriteriaItem { - operator?: string; - value?: string; - } - - interface SpreadsheetSheetFilterColumn { - criteria?: SpreadsheetSheetFilterColumnCriteriaItem[]; - filter?: string; - index?: number; - logic?: string; - type?: string; - value?: number|string|Date; - values?: any; - } - - interface SpreadsheetSheetFilter { - columns?: SpreadsheetSheetFilterColumn[]; - ref?: string; - } - - interface SpreadsheetSheetRowCellBorderBottom { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellBorderLeft { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellBorderRight { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellBorderTop { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellValidation { - type?: string; - comparerType?: string; - dataType?: string; - from?: string; - to?: string; - allowNulls?: boolean; - messageTemplate?: string; - titleTemplate?: string; - } - - interface SpreadsheetSheetRowCell { - background?: string; - borderBottom?: SpreadsheetSheetRowCellBorderBottom; - borderLeft?: SpreadsheetSheetRowCellBorderLeft; - borderTop?: SpreadsheetSheetRowCellBorderTop; - borderRight?: SpreadsheetSheetRowCellBorderRight; - color?: string; - fontFamily?: string; - fontSize?: number; - italic?: boolean; - bold?: boolean; - enable?: boolean; - format?: string; - formula?: string; - index?: number; - link?: string; - textAlign?: string; - underline?: boolean; - value?: number|string|boolean|Date; - validation?: SpreadsheetSheetRowCellValidation; - verticalAlign?: string; - wrap?: boolean; - } - - interface SpreadsheetSheetRow { - cells?: SpreadsheetSheetRowCell[]; - height?: number; - index?: number; - } - - interface SpreadsheetSheetSortColumn { - ascending?: boolean; - index?: number; - } - - interface SpreadsheetSheetSort { - columns?: SpreadsheetSheetSortColumn[]; - ref?: string; - } - - interface SpreadsheetSheet { - activeCell?: string; - name?: string; - columns?: SpreadsheetSheetColumn[]; - dataSource?: kendo.data.DataSource; - filter?: SpreadsheetSheetFilter; - frozenColumns?: number; - frozenRows?: number; - mergedCells?: any; - rows?: SpreadsheetSheetRow[]; - selection?: string; - showGridLines?: boolean; - sort?: SpreadsheetSheetSort; - } - - interface SpreadsheetToolbar { - home?: boolean|any; - insert?: boolean|any; - data?: boolean|any; - } - - interface SpreadsheetInsertSheetOptions { - rows?: number; - columns?: number; - rowHeight?: number; - columnWidth?: number; - headerHeight?: number; - headerWidth?: number; - dataSource?: kendo.data.DataSource; - data?: any; - } - - interface SpreadsheetOptions { - name?: string; - activeSheet?: string; - columnWidth?: number; - columns?: number; - headerHeight?: number; - headerWidth?: number; - excel?: SpreadsheetExcel; - pdf?: SpreadsheetPdf; - rowHeight?: number; - rows?: number; - sheets?: SpreadsheetSheet[]; - sheetsbar?: boolean; - toolbar?: boolean|SpreadsheetToolbar; - change?(e: SpreadsheetChangeEvent): void; - render?(e: SpreadsheetRenderEvent): void; - excelExport?(e: SpreadsheetExcelExportEvent): void; - excelImport?(e: SpreadsheetExcelImportEvent): void; - pdfExport?(e: SpreadsheetPdfExportEvent): void; - } - interface SpreadsheetEvent { - sender: Spreadsheet; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface SpreadsheetChangeEvent extends SpreadsheetEvent { - range?: kendo.spreadsheet.Range; - } - - interface SpreadsheetRenderEvent extends SpreadsheetEvent { - } - - interface SpreadsheetExcelExportEvent extends SpreadsheetEvent { - data?: any; - workbook?: kendo.ooxml.Workbook; - } - - interface SpreadsheetExcelImportEvent extends SpreadsheetEvent { - file?: Blob|File; - progress?: JQueryPromise; - } - - interface SpreadsheetPdfExportEvent extends SpreadsheetEvent { - promise?: JQueryPromise; - } - - - class TabStrip extends kendo.ui.Widget { - - static fn: TabStrip; - - options: TabStripOptions; - - dataSource: kendo.data.DataSource; - tabGroup: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TabStrip; - - constructor(element: Element, options?: TabStripOptions); - - - activateTab(item: JQuery): void; - append(tab: any): kendo.ui.TabStrip; - contentElement(itemIndex: number): Element; - contentHolder(itemIndex: number): Element; - deactivateTab(item: JQuery): void; - destroy(): void; - disable(element: string): kendo.ui.TabStrip; - disable(element: Element): kendo.ui.TabStrip; - disable(element: JQuery): kendo.ui.TabStrip; - enable(element: string, enable?: boolean): kendo.ui.TabStrip; - enable(element: Element, enable?: boolean): kendo.ui.TabStrip; - enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip; - insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip; - insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip; - insertAfter(item: Element, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: Element, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; - insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: Element, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: Element, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: JQuery, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; - items(): HTMLCollection; - reload(element: string): kendo.ui.TabStrip; - reload(element: Element): kendo.ui.TabStrip; - reload(element: JQuery): kendo.ui.TabStrip; - remove(element: string): kendo.ui.TabStrip; - remove(element: number): kendo.ui.TabStrip; - remove(element: JQuery): kendo.ui.TabStrip; - select(): JQuery; - select(element: string): void; - select(element: Element): void; - select(element: JQuery): void; - select(element: number): void; - setDataSource(dataSource: any): void; - setDataSource(dataSource: kendo.data.DataSource): void; - - } - - interface TabStripAnimationClose { - duration?: number; - effects?: string; - } - - interface TabStripAnimationOpen { - duration?: number; - effects?: string; - } - - interface TabStripAnimation { - close?: TabStripAnimationClose; - open?: TabStripAnimationOpen; - } - - interface TabStripScrollable { - distance?: number; - } - - interface TabStripOptions { - name?: string; - animation?: boolean|TabStripAnimation; - collapsible?: boolean; - contentUrls?: any; - dataContentField?: string; - dataContentUrlField?: string; - dataImageUrlField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataSpriteCssClass?: string; - dataTextField?: string; - dataUrlField?: string; - navigatable?: boolean; - scrollable?: boolean|TabStripScrollable; - tabPosition?: string; - value?: string; - activate?(e: TabStripActivateEvent): void; - contentLoad?(e: TabStripContentLoadEvent): void; - error?(e: TabStripErrorEvent): void; - select?(e: TabStripSelectEvent): void; - show?(e: TabStripShowEvent): void; - } - interface TabStripEvent { - sender: TabStrip; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TabStripActivateEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - interface TabStripContentLoadEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - interface TabStripErrorEvent extends TabStripEvent { - xhr?: JQueryXHR; - status?: string; - } - - interface TabStripSelectEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - interface TabStripShowEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - - class TimePicker extends kendo.ui.Widget { - - static fn: TimePicker; - - options: TimePickerOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TimePicker; - - constructor(element: Element, options?: TimePickerOptions); - - - close(): void; - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - open(): void; - setOptions(options: any): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - - } - - interface TimePickerAnimationClose { - effects?: string; - duration?: number; - } - - interface TimePickerAnimationOpen { - effects?: string; - duration?: number; - } - - interface TimePickerAnimation { - close?: TimePickerAnimationClose; - open?: TimePickerAnimationOpen; - } - - interface TimePickerOptions { - name?: string; - animation?: boolean|TimePickerAnimation; - culture?: string; - dates?: any; - format?: string; - interval?: number; - max?: Date; - min?: Date; - parseFormats?: any; - value?: Date; - change?(e: TimePickerChangeEvent): void; - close?(e: TimePickerCloseEvent): void; - open?(e: TimePickerOpenEvent): void; - } - interface TimePickerEvent { - sender: TimePicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TimePickerChangeEvent extends TimePickerEvent { - } - - interface TimePickerCloseEvent extends TimePickerEvent { - } - - interface TimePickerOpenEvent extends TimePickerEvent { - } - - - class ToolBar extends kendo.ui.Widget { - - static fn: ToolBar; - - options: ToolBarOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ToolBar; - - constructor(element: Element, options?: ToolBarOptions); - - - add(command: any): void; - destroy(): void; - enable(command: string, enable: boolean): void; - enable(command: Element, enable: boolean): void; - enable(command: JQuery, enable: boolean): void; - getSelectedFromGroup(groupName: string): void; - hide(command: string): void; - hide(command: Element): void; - hide(command: JQuery): void; - remove(command: string): void; - remove(command: Element): void; - remove(command: JQuery): void; - show(command: string): void; - show(command: Element): void; - show(command: JQuery): void; - toggle(): void; - - } - - interface ToolBarItemButton { - attributes?: any; - click?: Function; - enable?: boolean; - group?: string; - hidden?: boolean; - icon?: string; - id?: string; - imageUrl?: string; - selected?: boolean; - showIcon?: string; - showText?: string; - spriteCssClass?: string; - toggle?: Function; - togglable?: boolean; - text?: string; - url?: string; - } - - interface ToolBarItemMenuButton { - attributes?: any; - enable?: boolean; - hidden?: boolean; - icon?: string; - id?: string; - imageUrl?: string; - spriteCssClass?: string; - text?: string; - url?: string; - } - - interface ToolBarItem { - attributes?: any; - buttons?: ToolBarItemButton[]; - click?: Function; - enable?: boolean; - group?: string; - hidden?: boolean; - icon?: string; - id?: string; - imageUrl?: string; - menuButtons?: ToolBarItemMenuButton[]; - overflow?: string; - overflowTemplate?: string|Function; - primary?: boolean; - selected?: boolean; - showIcon?: string; - showText?: string; - spriteCssClass?: string; - template?: string|Function; - text?: string; - togglable?: boolean; - toggle?: Function; - type?: string; - url?: string; - } - - interface ToolBarOptions { - name?: string; - resizable?: boolean; - items?: ToolBarItem[]; - click?(e: ToolBarClickEvent): void; - close?(e: ToolBarCloseEvent): void; - open?(e: ToolBarOpenEvent): void; - toggle?(e: ToolBarToggleEvent): void; - overflowClose?(e: ToolBarOverflowCloseEvent): void; - overflowOpen?(e: ToolBarOverflowOpenEvent): void; - } - interface ToolBarEvent { - sender: ToolBar; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ToolBarClickEvent extends ToolBarEvent { - target?: JQuery; - id?: string; - } - - interface ToolBarCloseEvent extends ToolBarEvent { - SplitButton?: JQuery; - } - - interface ToolBarOpenEvent extends ToolBarEvent { - SplitButton?: JQuery; - } - - interface ToolBarToggleEvent extends ToolBarEvent { - target?: JQuery; - checked?: boolean; - id?: string; - } - - interface ToolBarOverflowCloseEvent extends ToolBarEvent { - } - - interface ToolBarOverflowOpenEvent extends ToolBarEvent { - } - - - class Tooltip extends kendo.ui.Widget { - - static fn: Tooltip; - - options: TooltipOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Tooltip; - - constructor(element: Element, options?: TooltipOptions); - - - show(element: JQuery): void; - hide(): void; - refresh(): void; - target(): JQuery; - - } - - interface TooltipAnimationClose { - effects?: string; - duration?: number; - } - - interface TooltipAnimationOpen { - effects?: string; - duration?: number; - } - - interface TooltipAnimation { - close?: TooltipAnimationClose; - open?: TooltipAnimationOpen; - } - - interface TooltipContent { - url?: string; - } - - interface TooltipOptions { - name?: string; - autoHide?: boolean; - animation?: boolean|TooltipAnimation; - content?: TooltipContent; - callout?: boolean; - filter?: string; - iframe?: boolean; - height?: number; - width?: number; - position?: string; - showAfter?: number; - showOn?: string; - contentLoad?(e: TooltipEvent): void; - show?(e: TooltipEvent): void; - hide?(e: TooltipEvent): void; - requestStart?(e: TooltipRequestStartEvent): void; - error?(e: TooltipErrorEvent): void; - } - interface TooltipEvent { - sender: Tooltip; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TooltipRequestStartEvent extends TooltipEvent { - target?: JQuery; - options?: any; - } - - interface TooltipErrorEvent extends TooltipEvent { - xhr?: JQueryXHR; - status?: string; - } - - - class Touch extends kendo.ui.Widget { - - static fn: Touch; - - options: TouchOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Touch; - - constructor(element: Element, options?: TouchOptions); - - - cancel(): void; - destroy(): void; - - } - - interface TouchOptions { - name?: string; - filter?: string; - surface?: JQuery; - multiTouch?: boolean; - enableSwipe?: boolean; - minXDelta?: number; - maxYDelta?: number; - maxDuration?: number; - minHold?: number; - doubleTapTimeout?: number; - touchstart?(e: TouchTouchstartEvent): void; - dragstart?(e: TouchDragstartEvent): void; - drag?(e: TouchDragEvent): void; - dragend?(e: TouchDragendEvent): void; - tap?(e: TouchTapEvent): void; - doubletap?(e: TouchDoubletapEvent): void; - hold?(e: TouchHoldEvent): void; - swipe?(e: TouchSwipeEvent): void; - gesturestart?(e: TouchGesturestartEvent): void; - gesturechange?(e: TouchGesturechangeEvent): void; - gestureend?(e: TouchGestureendEvent): void; - } - interface TouchEvent { - sender: Touch; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TouchTouchstartEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDragstartEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDragEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDragendEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchTapEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDoubletapEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchHoldEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchSwipeEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchGesturestartEvent extends TouchEvent { - touches?: any; - event?: JQueryEventObject; - distance?: number; - center?: kendo.mobile.ui.Point; - } - - interface TouchGesturechangeEvent extends TouchEvent { - touches?: any; - event?: JQueryEventObject; - distance?: number; - center?: kendo.mobile.ui.Point; - } - - interface TouchGestureendEvent extends TouchEvent { - touches?: any; - event?: JQueryEventObject; - distance?: number; - center?: kendo.mobile.ui.Point; - } - - - class TreeList extends kendo.ui.Widget { - - static fn: TreeList; - - options: TreeListOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TreeList; - - constructor(element: Element, options?: TreeListOptions); - - - addRow(parentRow: string): void; - addRow(parentRow: Element): void; - addRow(parentRow: JQuery): void; - autoFitColumn(column: number): void; - autoFitColumn(column: string): void; - autoFitColumn(column: any): void; - cancelRow(): void; - clearSelection(): void; - collapse(): void; - dataItem(row: string): kendo.data.TreeListModel; - dataItem(row: Element): kendo.data.TreeListModel; - dataItem(row: JQuery): kendo.data.TreeListModel; - destroy(): void; - editRow(row: JQuery): void; - expand(row: string): void; - expand(row: Element): void; - expand(row: JQuery): void; - itemFor(model: kendo.data.TreeListModel): JQuery; - itemFor(model: any): JQuery; - items(): any; - refresh(): void; - removeRow(row: string): void; - removeRow(row: Element): void; - removeRow(row: JQuery): void; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; - saveRow(): void; - select(): JQuery; - select(rows: Element): void; - select(rows: JQuery): void; - setDataSource(dataSource: kendo.data.TreeListDataSource): void; - showColumn(column: number): void; - showColumn(column: string): void; - hideColumn(column: number): void; - hideColumn(column: string): void; - lockColumn(column: number): void; - lockColumn(column: string): void; - unlockColumn(column: number): void; - unlockColumn(column: string): void; - reorderColumn(destIndex: number, column: any): void; - - } - - interface TreeListColumnMenuMessages { - columns?: string; - filter?: string; - sortAscending?: string; - sortDescending?: string; - } - - interface TreeListColumnMenu { - columns?: boolean; - filterable?: boolean; - sortable?: boolean; - messages?: TreeListColumnMenuMessages; - } - - interface TreeListColumnCommandItem { - className?: string; - click?: Function; - name?: string; - text?: string; - } - - interface TreeListColumnFilterable { - ui?: string|Function; - } - - interface TreeListColumnSortable { - compare?: Function; - } - - interface TreeListColumn { - attributes?: any; - command?: TreeListColumnCommandItem[]; - encoded?: boolean; - expandable?: boolean; - field?: string; - filterable?: boolean|TreeListColumnFilterable; - footerTemplate?: string|Function; - format?: string; - headerAttributes?: any; - headerTemplate?: string|Function; - minScreenWidth?: number; - sortable?: boolean|TreeListColumnSortable; - template?: string|Function; - title?: string; - width?: string|number; - hidden?: boolean; - menu?: boolean; - locked?: boolean; - lockable?: boolean; - } - - interface TreeListEditable { - mode?: string; - move?: boolean; - template?: string|Function; - window?: any; - } - - interface TreeListExcel { - fileName?: string; - filterable?: boolean; - forceProxy?: boolean; - proxyURL?: string; - } - - interface TreeListFilterableMessages { - and?: string; - clear?: string; - filter?: string; - info?: string; - isFalse?: string; - isTrue?: string; - or?: string; - selectValue?: string; - cancel?: string; - operator?: string; - } - - interface TreeListFilterable { - extra?: boolean; - messages?: TreeListFilterableMessages; - } - - interface TreeListMessagesCommands { - canceledit?: string; - create?: string; - createchild?: string; - destroy?: string; - edit?: string; - excel?: string; - pdf?: string; - update?: string; - } - - interface TreeListMessages { - commands?: TreeListMessagesCommands; - loading?: string; - noRows?: string; - requestFailed?: string; - retry?: string; - } - - interface TreeListPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface TreeListPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: TreeListPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface TreeListSortable { - allowUnsort?: boolean; - mode?: string; - } - - interface TreeListToolbarItem { - name?: string; - text?: string; - } - - interface TreeListOptions { - name?: string; - autoBind?: boolean; - columns?: TreeListColumn[]; - resizable?: boolean; - reorderable?: boolean; - columnMenu?: boolean|TreeListColumnMenu; - dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: boolean|TreeListEditable; - excel?: TreeListExcel; - filterable?: boolean|TreeListFilterable; - height?: number|string; - messages?: TreeListMessages; - pdf?: TreeListPdf; - scrollable?: boolean|any; - selectable?: boolean|string; - sortable?: boolean|TreeListSortable; - toolbar?: TreeListToolbarItem[]; - cancel?(e: TreeListCancelEvent): void; - change?(e: TreeListChangeEvent): void; - collapse?(e: TreeListCollapseEvent): void; - dataBinding?(e: TreeListDataBindingEvent): void; - dataBound?(e: TreeListDataBoundEvent): void; - dragstart?(e: TreeListDragstartEvent): void; - drag?(e: TreeListDragEvent): void; - dragend?(e: TreeListDragendEvent): void; - drop?(e: TreeListDropEvent): void; - edit?(e: TreeListEditEvent): void; - excelExport?(e: TreeListExcelExportEvent): void; - expand?(e: TreeListExpandEvent): void; - filterMenuInit?(e: TreeListFilterMenuInitEvent): void; - pdfExport?(e: TreeListPdfExportEvent): void; - remove?(e: TreeListRemoveEvent): void; - save?(e: TreeListSaveEvent): void; - columnShow?(e: TreeListColumnShowEvent): void; - columnHide?(e: TreeListColumnHideEvent): void; - columnReorder?(e: TreeListColumnReorderEvent): void; - columnResize?(e: TreeListColumnResizeEvent): void; - columnMenuInit?(e: TreeListColumnMenuInitEvent): void; - columnLock?(e: TreeListColumnLockEvent): void; - columnUnlock?(e: TreeListColumnUnlockEvent): void; - } - interface TreeListEvent { - sender: TreeList; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TreeListCancelEvent extends TreeListEvent { - container?: JQuery; - model?: kendo.data.TreeListModel; - } - - interface TreeListChangeEvent extends TreeListEvent { - } - - interface TreeListCollapseEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - } - - interface TreeListDataBindingEvent extends TreeListEvent { - } - - interface TreeListDataBoundEvent extends TreeListEvent { - } - - interface TreeListDragstartEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - } - - interface TreeListDragEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - target?: JQuery; - } - - interface TreeListDragendEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - destination?: kendo.data.TreeListModel; - } - - interface TreeListDropEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - destination?: kendo.data.TreeListModel; - valid?: boolean; - setValid?: boolean; - } - - interface TreeListEditEvent extends TreeListEvent { - container?: JQuery; - model?: kendo.data.TreeListModel; - } - - interface TreeListExcelExportEvent extends TreeListEvent { - data?: any; - workbook?: any; - } - - interface TreeListExpandEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - } - - interface TreeListFilterMenuInitEvent extends TreeListEvent { - container?: JQuery; - field?: string; - } - - interface TreeListPdfExportEvent extends TreeListEvent { - promise?: JQueryPromise; - } - - interface TreeListRemoveEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - row?: JQuery; - } - - interface TreeListSaveEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - container?: JQuery; - } - - interface TreeListColumnShowEvent extends TreeListEvent { - column?: any; - } - - interface TreeListColumnHideEvent extends TreeListEvent { - column?: any; - } - - interface TreeListColumnReorderEvent extends TreeListEvent { - column?: any; - newIndex?: number; - oldIndex?: number; - } - - interface TreeListColumnResizeEvent extends TreeListEvent { - column?: any; - newWidth?: number; - oldWidth?: number; - } - - interface TreeListColumnMenuInitEvent extends TreeListEvent { - container?: JQuery; - field?: string; - } - - interface TreeListColumnLockEvent extends TreeListEvent { - column?: any; - } - - interface TreeListColumnUnlockEvent extends TreeListEvent { - column?: any; - } - - - class TreeView extends kendo.ui.Widget { - - static fn: TreeView; - - options: TreeViewOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TreeView; - - constructor(element: Element, options?: TreeViewOptions); - - - append(nodeData: any, parentNode?: JQuery, success?: Function): JQuery; - append(nodeData: JQuery, parentNode?: JQuery, success?: Function): JQuery; - collapse(nodes: JQuery): void; - collapse(nodes: Element): void; - collapse(nodes: string): void; - dataItem(node: JQuery): kendo.data.Node; - dataItem(node: Element): kendo.data.Node; - dataItem(node: string): kendo.data.Node; - destroy(): void; - detach(node: JQuery): JQuery; - detach(node: Element): JQuery; - detach(node: string): JQuery; - enable(nodes: JQuery, enable?: boolean): void; - enable(nodes: Element, enable?: boolean): void; - enable(nodes: string, enable?: boolean): void; - expand(nodes: JQuery): void; - expand(nodes: Element): void; - expand(nodes: string): void; - expandPath(path: any, complete: Function): void; - expandTo(targetNode: kendo.data.Node): void; - expandTo(targetNode: any): void; - findByText(text: string): JQuery; - findByUid(text: string): JQuery; - insertAfter(nodeData: any, referenceNode: JQuery): void; - insertBefore(nodeData: any, referenceNode: JQuery): void; - items(): any; - parent(node: JQuery): JQuery; - parent(node: Element): JQuery; - parent(node: string): JQuery; - remove(node: JQuery): void; - remove(node: Element): void; - remove(node: string): void; - select(): JQuery; - select(node?: JQuery): void; - select(node?: Element): void; - select(node?: string): void; - setDataSource(dataSource: kendo.data.HierarchicalDataSource): void; - text(node: JQuery): string; - text(node: Element): string; - text(node: string): string; - text(node: JQuery, newText: string): void; - text(node: Element, newText: string): void; - text(node: string, newText: string): void; - toggle(node: JQuery): void; - toggle(node: Element): void; - toggle(node: string): void; - updateIndeterminate(node: JQuery): void; - - } - - interface TreeViewAnimationCollapse { - duration?: number; - effects?: string; - } - - interface TreeViewAnimationExpand { - duration?: number; - effects?: string; - } - - interface TreeViewAnimation { - collapse?: boolean|TreeViewAnimationCollapse; - expand?: boolean|TreeViewAnimationExpand; - } - - interface TreeViewCheckboxes { - checkChildren?: boolean; - name?: string; - template?: string|Function; - } - - interface TreeViewMessages { - loading?: string; - requestFailed?: string; - retry?: string; - } - - interface TreeViewOptions { - name?: string; - animation?: boolean|TreeViewAnimation; - autoBind?: boolean; - autoScroll?: boolean; - checkboxes?: boolean|TreeViewCheckboxes; - dataImageUrlField?: string; - dataSource?: any|any|kendo.data.HierarchicalDataSource; - dataSpriteCssClassField?: string; - dataTextField?: string|any; - dataUrlField?: string; - dragAndDrop?: boolean; - loadOnDemand?: boolean; - messages?: TreeViewMessages; - template?: string|Function; - change?(e: TreeViewEvent): void; - check?(e: TreeViewCheckEvent): void; - collapse?(e: TreeViewCollapseEvent): void; - dataBound?(e: TreeViewDataBoundEvent): void; - drag?(e: TreeViewDragEvent): void; - dragend?(e: TreeViewDragendEvent): void; - dragstart?(e: TreeViewDragstartEvent): void; - drop?(e: TreeViewDropEvent): void; - expand?(e: TreeViewExpandEvent): void; - navigate?(e: TreeViewNavigateEvent): void; - select?(e: TreeViewSelectEvent): void; - } - interface TreeViewEvent { - sender: TreeView; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TreeViewCheckEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewCollapseEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewDataBoundEvent extends TreeViewEvent { - node?: JQuery; - } - - interface TreeViewDragEvent extends TreeViewEvent { - sourceNode?: Element; - dropTarget?: Element; - pageX?: number; - pageY?: number; - statusClass?: string; - setStatusClass?: Function; - } - - interface TreeViewDragendEvent extends TreeViewEvent { - sourceNode?: Element; - destinationNode?: Element; - dropPosition?: string; - } - - interface TreeViewDragstartEvent extends TreeViewEvent { - sourceNode?: Element; - } - - interface TreeViewDropEvent extends TreeViewEvent { - sourceNode?: Element; - destinationNode?: Element; - valid?: boolean; - setValid?: Function; - dropTarget?: Element; - dropPosition?: string; - } - - interface TreeViewExpandEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewNavigateEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewSelectEvent extends TreeViewEvent { - node?: Element; - } - - - class Upload extends kendo.ui.Widget { - - static fn: Upload; - - options: UploadOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Upload; - - constructor(element: Element, options?: UploadOptions); - - - destroy(): void; - disable(): void; - enable(enable?: boolean): void; - toggle(enable: boolean): void; - - } - - interface UploadAsync { - autoUpload?: boolean; - batch?: boolean; - removeField?: string; - removeUrl?: string; - removeVerb?: string; - saveField?: string; - saveUrl?: string; - withCredentials?: boolean; - } - - interface UploadFile { - extension?: string; - name?: string; - size?: number; - } - - interface UploadLocalization { - cancel?: string; - dropFilesHere?: string; - headerStatusUploaded?: string; - headerStatusUploading?: string; - remove?: string; - retry?: string; - select?: string; - statusFailed?: string; - statusUploaded?: string; - statusUploading?: string; - uploadSelectedFiles?: string; - } - - interface UploadOptions { - name?: string; - async?: UploadAsync; - enabled?: boolean; - files?: UploadFile[]; - localization?: UploadLocalization; - multiple?: boolean; - showFileList?: boolean; - template?: string|Function; - cancel?(e: UploadCancelEvent): void; - complete?(e: UploadEvent): void; - error?(e: UploadErrorEvent): void; - progress?(e: UploadProgressEvent): void; - remove?(e: UploadRemoveEvent): void; - select?(e: UploadSelectEvent): void; - success?(e: UploadSuccessEvent): void; - upload?(e: UploadUploadEvent): void; - } - interface UploadEvent { - sender: Upload; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface UploadCancelEvent extends UploadEvent { - files?: UploadFile[]; - } - - interface UploadErrorEvent extends UploadEvent { - files?: UploadFile[]; - operation?: string; - XMLHttpRequest?: any; - } - - interface UploadProgressEvent extends UploadEvent { - files?: UploadFile[]; - percentComplete?: number; - } - - interface UploadRemoveEvent extends UploadEvent { - files?: UploadFile[]; - data?: any; - } - - interface UploadSelectEvent extends UploadEvent { - e?: any; - files?: UploadFile[]; - } - - interface UploadSuccessEvent extends UploadEvent { - files?: UploadFile[]; - operation?: string; - response?: any; - XMLHttpRequest?: any; - } - - interface UploadUploadEvent extends UploadEvent { - files?: UploadFile[]; - data?: any; - formData?: any; - XMLHttpRequest?: any; - } - - - class Validator extends kendo.ui.Widget { - - static fn: Validator; - - options: ValidatorOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Validator; - - constructor(element: Element, options?: ValidatorOptions); - - - errors(): any; - hideMessages(): void; - validate(): boolean; - validateInput(input: Element): boolean; - validateInput(input: JQuery): boolean; - - } - - interface ValidatorOptions { - name?: string; - errorTemplate?: string; - messages?: any; - rules?: any; - validateOnBlur?: boolean; - validate?(e: ValidatorValidateEvent): void; - } - interface ValidatorEvent { - sender: Validator; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ValidatorValidateEvent extends ValidatorEvent { - valid?: boolean; - } - - - class Window extends kendo.ui.Widget { - - static fn: Window; - - options: WindowOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Window; - - constructor(element: Element, options?: WindowOptions); - - - center(): kendo.ui.Window; - close(): kendo.ui.Window; - content(): string; - content(content?: string): kendo.ui.Window; - content(content?: JQuery): kendo.ui.Window; - destroy(): void; - maximize(): kendo.ui.Window; - minimize(): kendo.ui.Window; - open(): kendo.ui.Window; - pin(): void; - refresh(options: any): kendo.ui.Window; - restore(): kendo.ui.Window; - setOptions(options: any): void; - title(): string; - title(text?: string): kendo.ui.Window; - toFront(): kendo.ui.Window; - toggleMaximization(): kendo.ui.Window; - unpin(): void; - - } - - interface WindowAnimationClose { - effects?: string; - duration?: number; - } - - interface WindowAnimationOpen { - effects?: string; - duration?: number; - } - - interface WindowAnimation { - close?: WindowAnimationClose; - open?: WindowAnimationOpen; - } - - interface WindowContent { - template?: string; - } - - interface WindowPosition { - top?: number|string; - left?: number|string; - } - - interface WindowRefreshOptions { - url?: string; - cache?: boolean; - data?: any; - type?: string; - template?: string; - iframe?: boolean; - } - - interface WindowOptions { - name?: string; - actions?: any; - animation?: boolean|WindowAnimation; - appendTo?: any|string; - autoFocus?: boolean; - content?: WindowContent; - draggable?: boolean; - iframe?: boolean; - height?: number|string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - pinned?: boolean; - position?: WindowPosition; - resizable?: boolean; - scrollable?: boolean; - title?: string|boolean; - visible?: boolean; - width?: number|string; - activate?(e: WindowEvent): void; - close?(e: WindowCloseEvent): void; - deactivate?(e: WindowEvent): void; - dragend?(e: WindowEvent): void; - dragstart?(e: WindowEvent): void; - error?(e: WindowErrorEvent): void; - maximize?(e: WindowEvent): void; - minimize?(e: WindowEvent): void; - open?(e: WindowEvent): void; - refresh?(e: WindowEvent): void; - resize?(e: WindowEvent): void; - } - interface WindowEvent { - sender: Window; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface WindowCloseEvent extends WindowEvent { - userTriggered?: boolean; - } - - interface WindowErrorEvent extends WindowEvent { - xhr?: JQueryXHR; - status?: string; - } - } declare namespace kendo.dataviz.ui { @@ -8344,13 +8780,25 @@ declare namespace kendo.dataviz.ui { exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; exportSVG(options: any): JQueryPromise; + findAxisByName(name: string): kendo.dataviz.ChartAxis; + findPaneByIndex(index: number): kendo.dataviz.ChartPane; + findPaneByName(name: string): kendo.dataviz.ChartPane; + findSeries(callback: Function): kendo.dataviz.ChartSeries; + findSeriesByIndex(index: number): kendo.dataviz.ChartSeries; + findSeriesByName(name: string): kendo.dataviz.ChartSeries; getAxis(name: string): kendo.dataviz.ChartAxis; + hideTooltip(): void; + plotArea(): void; redraw(): void; refresh(): void; resize(force?: boolean): void; saveAsPDF(): void; setDataSource(dataSource: kendo.data.DataSource): void; setOptions(options: any): void; + showTooltip(filter: Function): void; + showTooltip(filter: number): void; + showTooltip(filter: Date): void; + showTooltip(filter: string): void; svg(): string; imageDataURL(): string; toggleHighlight(show: boolean, options: any): void; @@ -8383,6 +8831,7 @@ declare namespace kendo.dataviz.ui { interface ChartAxisDefaultsCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartAxisDefaultsCrosshairTooltip; visible?: boolean; @@ -8526,6 +8975,7 @@ declare namespace kendo.dataviz.ui { } interface ChartCategoryAxisItemAutoBaseUnitSteps { + milliseconds?: any; seconds?: any; minutes?: any; hours?: any; @@ -8561,6 +9011,7 @@ declare namespace kendo.dataviz.ui { interface ChartCategoryAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartCategoryAxisItemCrosshairTooltip; visible?: boolean; @@ -8740,6 +9191,7 @@ declare namespace kendo.dataviz.ui { } interface ChartCategoryAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -9061,7 +9513,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemConnectors { - color?: string; + color?: string|Function; padding?: number; width?: number; } @@ -9101,6 +9553,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemHighlightLine { + dashType?: string; color?: string; opacity?: number; width?: number; @@ -9286,6 +9739,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -9579,6 +10033,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesDefaultsNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -9903,6 +10358,7 @@ declare namespace kendo.dataviz.ui { } interface ChartValueAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -10189,6 +10645,7 @@ declare namespace kendo.dataviz.ui { } interface ChartXAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -10477,6 +10934,7 @@ declare namespace kendo.dataviz.ui { } interface ChartYAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -10605,7 +11063,6 @@ declare namespace kendo.dataviz.ui { autoBind?: boolean; axisDefaults?: ChartAxisDefaults; categoryAxis?: ChartCategoryAxisItem[]; - valueAxis?: ChartValueAxisItem[]; chartArea?: ChartChartArea; dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; @@ -10621,21 +11078,22 @@ declare namespace kendo.dataviz.ui { title?: ChartTitle; tooltip?: ChartTooltip; transitions?: boolean; + valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; zoomable?: boolean|ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; - legendItemClick?(e: ChartLegendItemClickEvent): void; - legendItemHover?(e: ChartLegendItemHoverEvent): void; dataBound?(e: ChartDataBoundEvent): void; drag?(e: ChartDragEvent): void; dragEnd?(e: ChartDragEndEvent): void; dragStart?(e: ChartDragStartEvent): void; + legendItemClick?(e: ChartLegendItemClickEvent): void; + legendItemHover?(e: ChartLegendItemHoverEvent): void; noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; plotAreaHover?(e: ChartPlotAreaHoverEvent): void; - render?(e: ChartEvent): void; + render?(e: ChartRenderEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; selectStart?(e: ChartSelectStartEvent): void; @@ -10660,22 +11118,6 @@ declare namespace kendo.dataviz.ui { value?: any; } - interface ChartLegendItemClickEvent extends ChartEvent { - text?: string; - series?: any; - seriesIndex?: number; - pointIndex?: number; - element?: any; - } - - interface ChartLegendItemHoverEvent extends ChartEvent { - text?: string; - series?: any; - seriesIndex?: number; - pointIndex?: number; - element?: any; - } - interface ChartDataBoundEvent extends ChartEvent { } @@ -10694,21 +11136,37 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } + interface ChartLegendItemClickEvent extends ChartEvent { + pointIndex?: number; + series?: any; + seriesIndex?: number; + text?: string; + element?: any; + } + + interface ChartLegendItemHoverEvent extends ChartEvent { + element?: any; + pointIndex?: number; + series?: any; + seriesIndex?: number; + text?: string; + } + interface ChartNoteClickEvent extends ChartEvent { category?: any; - element?: any; - value?: any; - series?: any; dataItem?: any; + element?: any; + series?: any; + value?: any; visual?: any; } interface ChartNoteHoverEvent extends ChartEvent { category?: any; - element?: any; - value?: any; - series?: any; dataItem?: any; + element?: any; + series?: any; + value?: any; visual?: any; } @@ -10730,6 +11188,9 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface ChartRenderEvent extends ChartEvent { + } + interface ChartSelectEvent extends ChartEvent { axis?: any; from?: any; @@ -10750,23 +11211,25 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesClickEvent extends ChartEvent { category?: any; + dataItem?: any; element?: any; originalEvent?: any; - series?: ChartSeriesClickEventSeries; - dataItem?: any; - value?: any; percentage?: any; + series?: ChartSeriesClickEventSeries; + stackValue?: any; + value?: any; } interface ChartSeriesHoverEvent extends ChartEvent { category?: any; categoryPoints?: any; + dataItem?: any; element?: any; originalEvent?: any; - series?: ChartSeriesHoverEventSeries; - dataItem?: any; - value?: any; percentage?: any; + series?: ChartSeriesHoverEventSeries; + stackValue?: any; + value?: any; } interface ChartZoomEvent extends ChartEvent { @@ -11219,6 +11682,7 @@ declare namespace kendo.dataviz.ui { interface DiagramSelectable { key?: string; + multiple?: boolean; stroke?: DiagramSelectableStroke; } @@ -12401,7 +12865,7 @@ declare namespace kendo.dataviz.ui { constructor(element: Element, options?: RadialGaugeOptions); - allValues(values: any): any; + allValues(values?: any): any; destroy(): void; exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; @@ -13467,6 +13931,7 @@ declare namespace kendo.dataviz.ui { options: StockChartOptions; dataSource: kendo.data.DataSource; + navigator: kendo.dataviz.Navigator; element: JQuery; wrapper: JQuery; @@ -13484,6 +13949,7 @@ declare namespace kendo.dataviz.ui { refresh(): void; resize(force?: boolean): void; setDataSource(dataSource: kendo.data.DataSource): void; + setOptions(options: any): void; svg(): string; imageDataURL(): string; @@ -13694,8 +14160,8 @@ declare namespace kendo.dataviz.ui { } interface StockChartCategoryAxisItemSelect { - from?: any; - to?: any; + from?: string|Date; + to?: string|Date; min?: any; max?: any; mousewheel?: StockChartCategoryAxisItemSelectMousewheel; @@ -14165,8 +14631,14 @@ declare namespace kendo.dataviz.ui { title?: StockChartNavigatorPaneTitle; } + interface StockChartNavigatorSelectMousewheel { + reverse?: boolean; + zoom?: string; + } + interface StockChartNavigatorSelect { from?: Date; + mousewheel?: boolean|StockChartNavigatorSelectMousewheel; to?: Date; } @@ -14940,25 +15412,25 @@ declare namespace kendo.dataviz.ui { transitions?: boolean; valueAxis?: StockChartValueAxisItem[]; axisLabelClick?(e: StockChartAxisLabelClickEvent): void; - legendItemClick?(e: StockChartLegendItemClickEvent): void; - legendItemHover?(e: StockChartLegendItemHoverEvent): void; dataBound?(e: StockChartEvent): void; dragStart?(e: StockChartDragStartEvent): void; drag?(e: StockChartDragEvent): void; dragEnd?(e: StockChartDragEndEvent): void; + legendItemClick?(e: StockChartLegendItemClickEvent): void; + legendItemHover?(e: StockChartLegendItemHoverEvent): void; noteClick?(e: StockChartNoteClickEvent): void; noteHover?(e: StockChartNoteHoverEvent): void; plotAreaClick?(e: StockChartPlotAreaClickEvent): void; plotAreaHover?(e: StockChartPlotAreaHoverEvent): void; - render?(e: StockChartEvent): void; + render?(e: StockChartRenderEvent): void; + select?(e: StockChartSelectEvent): void; + selectEnd?(e: StockChartSelectEndEvent): void; + selectStart?(e: StockChartSelectStartEvent): void; seriesClick?(e: StockChartSeriesClickEvent): void; seriesHover?(e: StockChartSeriesHoverEvent): void; zoomStart?(e: StockChartZoomStartEvent): void; zoom?(e: StockChartZoomEvent): void; zoomEnd?(e: StockChartZoomEndEvent): void; - selectStart?(e: StockChartSelectStartEvent): void; - select?(e: StockChartSelectEvent): void; - selectEnd?(e: StockChartSelectEndEvent): void; } interface StockChartEvent { sender: StockChart; @@ -14975,6 +15447,21 @@ declare namespace kendo.dataviz.ui { element?: any; } + interface StockChartDragStartEvent extends StockChartEvent { + axisRanges?: any; + originalEvent?: any; + } + + interface StockChartDragEvent extends StockChartEvent { + axisRanges?: any; + originalEvent?: any; + } + + interface StockChartDragEndEvent extends StockChartEvent { + axisRanges?: any; + originalEvent?: any; + } + interface StockChartLegendItemClickEvent extends StockChartEvent { text?: string; series?: any; @@ -14991,21 +15478,6 @@ declare namespace kendo.dataviz.ui { element?: any; } - interface StockChartDragStartEvent extends StockChartEvent { - axisRanges?: any; - originalEvent?: any; - } - - interface StockChartDragEvent extends StockChartEvent { - axisRanges?: any; - originalEvent?: any; - } - - interface StockChartDragEndEvent extends StockChartEvent { - axisRanges?: any; - originalEvent?: any; - } - interface StockChartNoteClickEvent extends StockChartEvent { category?: any; element?: any; @@ -15039,6 +15511,27 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface StockChartRenderEvent extends StockChartEvent { + } + + interface StockChartSelectEvent extends StockChartEvent { + axis?: any; + from?: Date; + to?: Date; + } + + interface StockChartSelectEndEvent extends StockChartEvent { + axis?: any; + from?: Date; + to?: Date; + } + + interface StockChartSelectStartEvent extends StockChartEvent { + axis?: any; + from?: Date; + to?: Date; + } + interface StockChartSeriesClickEvent extends StockChartEvent { value?: any; category?: any; @@ -15073,24 +15566,6 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } - interface StockChartSelectStartEvent extends StockChartEvent { - axis?: any; - from?: any; - to?: any; - } - - interface StockChartSelectEvent extends StockChartEvent { - axis?: any; - from?: any; - to?: any; - } - - interface StockChartSelectEndEvent extends StockChartEvent { - axis?: any; - from?: any; - to?: any; - } - class TreeMap extends kendo.ui.Widget { @@ -15433,6 +15908,8 @@ declare namespace kendo.dataviz { slot(from: Date, to?: string, limit?: boolean): kendo.geometry.Rect; slot(from: Date, to?: number, limit?: boolean): kendo.geometry.Rect; slot(from: Date, to?: Date, limit?: boolean): kendo.geometry.Rect; + value(point: kendo.geometry.Point): void; + valueRange(): void; } @@ -15446,6 +15923,133 @@ declare namespace kendo.dataviz { } + class ChartPane extends Observable { + + + options: ChartPaneOptions; + + chartsVisual: kendo.drawing.Group; + visual: kendo.drawing.Group; + + + + series(): any; + + } + + interface ChartPaneOptions { + name?: string; + } + interface ChartPaneEvent { + sender: ChartPane; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ChartPlotArea extends Observable { + + + options: ChartPlotAreaOptions; + + backgroundVisual: kendo.drawing.MultiPath; + visual: kendo.drawing.Group; + + + + + } + + interface ChartPlotAreaOptions { + name?: string; + } + interface ChartPlotAreaEvent { + sender: ChartPlotArea; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ChartPoint extends Observable { + + + options: ChartPointOptions; + + category: string|Date|number; + dataItem: any; + percentage: number; + runningTotal: number; + total: number; + value: number; + visual: kendo.drawing.Element; + + + + + } + + interface ChartPointOptions { + name?: string; + } + interface ChartPointEvent { + sender: ChartPoint; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ChartSeries extends Observable { + + + options: ChartSeriesOptions; + + + + + data(): any; + data(data: any): void; + findPoint(callback: Function): kendo.dataviz.ChartPoint; + points(): any; + points(filter: Function): void; + toggleHighlight(show: boolean, filter: Function): void; + toggleHighlight(show: boolean, filter: any): void; + toggleVisibility(show: boolean, filter: Function): void; + + } + + interface ChartSeriesOptions { + name?: string; + } + interface ChartSeriesEvent { + sender: ChartSeries; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Navigator extends kendo.Observable { + + + options: NavigatorOptions; + + + + + select(): any; + select(): void; + + } + + interface NavigatorOptions { + name?: string; + } + interface NavigatorEvent { + sender: Navigator; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } declare namespace kendo.dataviz.diagram { class Circle extends Observable { @@ -16361,6 +16965,7 @@ declare namespace kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } + function alert(text: string): void; function antiForgeryTokens(): any; function bind(element: string, viewModel: any, namespace?: any): void; function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; @@ -16369,6 +16974,7 @@ declare namespace kendo { function bind(element: Element, viewModel: any, namespace?: any): void; function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; function observableHierarchy(array: any): void; + function confirm(text: string): JQueryPromise; function culture(culture: string): void; function destroy(element: string): void; function destroy(element: JQuery): void; @@ -16379,6 +16985,7 @@ declare namespace kendo { function parseFloat(value: string, culture?: string): number; function parseInt(value: string, culture?: string): number; function parseColor(color: string, noerror: boolean): kendo.Color; + function prompt(text: string, defaultValue: string): JQueryPromise; function proxyModelSetters(): void; function proxyModelSetters(data: kendo.data.Model): void; function resize(element: string, force: boolean): void; @@ -16386,7 +16993,7 @@ declare namespace kendo { function resize(element: Element, force: boolean): void; function saveAs(options: any): void; function stringify(value: any): string; - function throttle(fn: Function, timeout: number): void; + function throttle(fn: Function, timeout: number): Function; function touchScroller(element: string): void; function touchScroller(element: JQuery): void; function touchScroller(element: Element): void; @@ -16471,6 +17078,8 @@ declare namespace kendo.spreadsheet { clear(options?: any): void; clearFilter(indices: any): void; clearFilter(indices: number): void; + editor(): string; + editor(value?: string): void; enable(): boolean; enable(value?: boolean): void; fillFrom(srcRange: Range, direction?: number): void; @@ -16557,7 +17166,7 @@ declare namespace kendo.spreadsheet { selection(): kendo.spreadsheet.Range; setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; showGridLines(): boolean; - showGridLines(showGridLiens?: boolean): void; + showGridLines(showGridLines?: boolean): void; toJSON(): void; unhideColumn(index: number): void; unhideRow(index: number): void; @@ -17712,272 +18321,6 @@ declare namespace kendo.ooxml { } -declare namespace kendo.dataviz.geometry { - class Arc extends Observable { - - - options: ArcOptions; - - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Circle extends Observable { - - - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Matrix extends Observable { - - - options: MatrixOptions; - - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - - - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Point extends Observable { - - - options: PointOptions; - - x: number; - y: number; - - constructor(x: number, y: number); - - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Rect extends Observable { - - - options: RectOptions; - - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); - - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Size extends Observable { - - - options: SizeOptions; - - width: number; - height: number; - - - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Transformation extends Observable { - - - options: TransformationOptions; - - - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - -} declare namespace kendo.dataviz.drawing { class Arc extends kendo.drawing.Element { @@ -18767,12 +19110,283 @@ declare namespace kendo.dataviz.drawing { +} +declare namespace kendo.dataviz.geometry { + class Arc extends Observable { + + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends Observable { + + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + constructor(center: any|kendo.geometry.Point, radius: number); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Matrix extends Observable { + + + options: MatrixOptions; + + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Point extends Observable { + + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends Observable { + + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Size extends Observable { + + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Transformation extends Observable { + + + options: TransformationOptions; + + + + + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } interface HTMLElement { kendoBindingTarget: kendo.data.BindingTarget; } +interface JQueryAjaxSettings { +} + interface JQueryXHR { } @@ -18795,6 +19409,10 @@ interface JQuery { data(key: any): any; + kendoAlert(): JQuery; + kendoAlert(options: kendo.ui.AlertOptions): JQuery; + data(key: "kendoAlert"): kendo.ui.Alert; + kendoAutoComplete(): JQuery; kendoAutoComplete(options: kendo.ui.AutoCompleteOptions): JQuery; data(key: "kendoAutoComplete"): kendo.ui.AutoComplete; @@ -18827,6 +19445,10 @@ interface JQuery { kendoComboBox(options: kendo.ui.ComboBoxOptions): JQuery; data(key: "kendoComboBox"): kendo.ui.ComboBox; + kendoConfirm(): JQuery; + kendoConfirm(options: kendo.ui.ConfirmOptions): JQuery; + data(key: "kendoConfirm"): kendo.ui.Confirm; + kendoContextMenu(): JQuery; kendoContextMenu(options: kendo.ui.ContextMenuOptions): JQuery; data(key: "kendoContextMenu"): kendo.ui.ContextMenu; @@ -18843,6 +19465,10 @@ interface JQuery { kendoDiagram(options: kendo.dataviz.ui.DiagramOptions): JQuery; data(key: "kendoDiagram"): kendo.dataviz.ui.Diagram; + kendoDialog(): JQuery; + kendoDialog(options: kendo.ui.DialogOptions): JQuery; + data(key: "kendoDialog"): kendo.ui.Dialog; + kendoDropDownList(): JQuery; kendoDropDownList(options: kendo.ui.DropDownListOptions): JQuery; data(key: "kendoDropDownList"): kendo.ui.DropDownList; @@ -18883,6 +19509,10 @@ interface JQuery { kendoMaskedTextBox(options: kendo.ui.MaskedTextBoxOptions): JQuery; data(key: "kendoMaskedTextBox"): kendo.ui.MaskedTextBox; + kendoMediaPlayer(): JQuery; + kendoMediaPlayer(options: kendo.ui.MediaPlayerOptions): JQuery; + data(key: "kendoMediaPlayer"): kendo.ui.MediaPlayer; + kendoMenu(): JQuery; kendoMenu(options: kendo.ui.MenuOptions): JQuery; data(key: "kendoMenu"): kendo.ui.Menu; @@ -19003,6 +19633,10 @@ interface JQuery { kendoProgressBar(options: kendo.ui.ProgressBarOptions): JQuery; data(key: "kendoProgressBar"): kendo.ui.ProgressBar; + kendoPrompt(): JQuery; + kendoPrompt(options: kendo.ui.PromptOptions): JQuery; + data(key: "kendoPrompt"): kendo.ui.Prompt; + kendoQRCode(): JQuery; kendoQRCode(options: kendo.dataviz.ui.QRCodeOptions): JQuery; data(key: "kendoQRCode"): kendo.dataviz.ui.QRCode; diff --git a/klaw/klaw-tests.ts b/klaw/klaw-tests.ts new file mode 100644 index 0000000000..5e7ecdebf7 --- /dev/null +++ b/klaw/klaw-tests.ts @@ -0,0 +1,46 @@ +/// +/// + +import * as klaw from "klaw"; +const path = require('path'); + +// README.md: Streams 1 (push) example: + +let items: klaw.Item[] = [] // files, directories, symlinks, etc + +klaw('/some/dir') + .on('data', function(item: klaw.Item) { + items.push(item) + }) + .on('end', function() { + console.dir(items) // => [ ... array of files] + }) + +// README.md: Streams 2 & 3 (pull) with error handling + +klaw('/some/dir') + .on('readable', function() { + let item: klaw.Item; + while (item = this.read()) { + items.push(item) + } + }) + .on('error', function(err: Error, item: klaw.Item) { + console.log(err.message) + console.log(item.path) // the file the error occurred on + }) + .on('end', function() { + console.log(items) // => [ ... array of files] + }) + +// README.md: Example (ignore hidden directories): + +var filterFunc = function(item: klaw.Item): boolean { + var basename = path.basename(item.path) + return basename === '.' || basename[0] !== '.' +} + +klaw('/some/dir', { filter: filterFunc }) + .on('data', function(item: klaw.Item) { + // only items of none hidden folders will reach here + }) diff --git a/klaw/klaw.d.ts b/klaw/klaw.d.ts new file mode 100644 index 0000000000..e2b641f546 --- /dev/null +++ b/klaw/klaw.d.ts @@ -0,0 +1,44 @@ +// Type definitions for klaw v1.3.0 +// Project: https://github.com/jprichardson/node-klaw +// Definitions by: Matthew McEachen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "klaw" { + + import * as fs from "fs" + import { Readable, ReadableOptions } from 'stream' + + function K(root: string, options?: K.Options): K.Walker + + namespace K { + interface Item { + path: string + stats: fs.Stats + } + + type QueueMethod = "shift" | "pop" + + interface Options extends ReadableOptions { + queueMethod?: QueueMethod + pathSorter?: (a: Array) => Array + fs?: any // fs or mock-fs + filter?: (a: Item) => boolean + } + + type Event = "close" | "data" | "end" | "readable" | "error" + + interface Walker { + on(event: Event, listener: Function): this + on(event: "close", listener: () => void): this + on(event: "data", listener: (item: Item) => void): this + on(event: "end", listener: () => void): this + on(event: "readable", listener: () => void): this + on(event: "error", listener: (err: Error) => void): this + read(): Item + } + } + + export = K +} diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index e811e417cd..b103562b83 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -414,11 +414,14 @@ knex.transaction(function(trx) { console.error(error); }); +knex.schema.withSchema("public").hasTable("table") as Promise; + knex.schema.createTable('users', function (table) { table.increments(); table.string('name'); table.enu('favorite_color', ['red', 'blue', 'green']); table.timestamps(); + table.timestamp('created_at').defaultTo(knex.fn.now()); }); knex.schema.renameTable('users', 'old_users'); @@ -453,6 +456,10 @@ knex.schema.raw("SET sql_mode='TRADITIONAL'") table.dropColumn('name'); table.string('first_name'); table.string('last_name'); + table.dropUnique(["name1", "name2"], "index_name"); + table.dropUnique(["name1", "name2"]); + table.dropPrimary(); + table.dropPrimary("constraint_name"); }); knex('users') diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 67dbfb17d7..c1cf4f6cba 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -12,7 +12,7 @@ declare module "knex" { type Callback = Function; type Client = Function; - type Value = string|number|boolean|Date|Array|Array|Array|Array|Buffer; + type Value = string|number|boolean|Date|Array|Array|Array|Array|Buffer|Knex.Raw; type ColumnName = string|Knex.Raw|Knex.QueryBuilder; type TableName = string|Knex.Raw|Knex.QueryBuilder; @@ -31,7 +31,7 @@ declare module "knex" { client: any; migrate: Knex.Migrator; seed: any; - fn: any; + fn: Knex.FunctionHelper; on(eventName: string, callback: Function): Knex.QueryBuilder; } @@ -347,6 +347,7 @@ declare module "knex" { table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise; dropTableIfExists(tableName: string): Promise; raw(statement: string): SchemaBuilder; + withSchema(schemaName: string): SchemaBuilder; } interface TableBuilder { @@ -381,6 +382,8 @@ declare module "knex" { foreign(column: string): ForeignConstraintBuilder; foreign(columns: string[]): MultikeyForeignConstraintBuilder; dropForeign(columnNames: string[], foreignKeyName?: string): TableBuilder; + dropUnique(columnNames: string[], indexName?: string): TableBuilder; + dropPrimary(constraintName?: string): TableBuilder; } interface CreateTableBuilder extends TableBuilder { @@ -545,6 +548,10 @@ declare module "knex" { status(config?: MigratorConfig):Promise; currentVersion(config?: MigratorConfig):Promise; } + + interface FunctionHelper { + now(): Raw; + } } export = Knex; diff --git a/knockout.es5/knockout.es5.d.ts b/knockout.es5/knockout.es5.d.ts index 10e0054bf6..2f0576868d 100644 --- a/knockout.es5/knockout.es5.d.ts +++ b/knockout.es5/knockout.es5.d.ts @@ -12,6 +12,13 @@ interface KnockoutStatic { defineProperty(obj: T, propertyName: string, options: KnockoutDefinePropertyOptions): T; getObservable(obj: any, propertyName: string): KnockoutObservable; valueHasMutated(obj: any, propertyName: string): void; + es5: KnockoutEs5; +} + +interface KnockoutEs5 { + getAllObservablesForObject(obj: T, createIfNotDefined?: boolean): T; + notifyWhenPresentOrFutureArrayValuesMutate(ko: KnockoutStatic, observable: KnockoutObservable): void; + isTracked(obj: T, propertyName: string): boolean; } interface KnockoutDefinePropertyOptions { diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index f0e9fe023f..a7b4cd6411 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -332,7 +332,7 @@ interface KnockoutUtils { } interface KnockoutArrayChange { - status: "added" | "deleted"; + status: "added" | "deleted" | "retained"; value: T; index: number; moved?: number; diff --git a/koa-bodyparser/koa-bodyparser.d.ts b/koa-bodyparser/koa-bodyparser.d.ts index f8e1b25aae..0daf7cdb2a 100644 --- a/koa-bodyparser/koa-bodyparser.d.ts +++ b/koa-bodyparser/koa-bodyparser.d.ts @@ -18,6 +18,11 @@ declare module "koa-bodyparser" { import * as Koa from "koa"; + module "koa" { + interface Request { + body: any; + } + } function bodyParser(opts?: { /** diff --git a/koa-passport/koa-passport-tests.ts b/koa-passport/koa-passport-tests.ts new file mode 100644 index 0000000000..cdfe4938f4 --- /dev/null +++ b/koa-passport/koa-passport-tests.ts @@ -0,0 +1,41 @@ +/// +/// + +import * as Koa from 'koa'; +import * as passport from 'koa-passport'; + +const app = new Koa(); +let ctx: Koa.Context; + + +app.use(passport.initialize()); +app.use(passport.session()); + +app.use(async (ctx: Koa.Context): Promise => { + ctx.isAuthenticated(); + ctx.isUnauthenticated(); + ctx.login({}); + ctx.logout(); + ctx.state.user; +}); + + +app.use(async (ctx: Koa.Context, next: () => Promise) => { + return passport.authenticate('local', (user: any, info: any, status: any) => { + if (user === false) { + ctx.status = 401; + ctx.body = { success: false }; + } else { + ctx.body = { success: true }; + return ctx.login(user); + } + })(ctx, next); +}); + +app.use( + passport.authenticate('local', { + successRedirect: '/app', + failureRedirect: '/' + }) +); + diff --git a/koa-passport/koa-passport.d.ts b/koa-passport/koa-passport.d.ts new file mode 100644 index 0000000000..f89d534ee2 --- /dev/null +++ b/koa-passport/koa-passport.d.ts @@ -0,0 +1,68 @@ +// Type definitions for koa-passport 2.x +// Project: https://github.com/rkusa/koa-passport +// Definitions by: horiuchi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* =================== USAGE =================== + + import * as passport from 'koa-passport'; + app.use(passport.initialize()); + app.use(passport.session()); + + =============================================== */ +/// +/// + +declare module "koa-passport" { + + import * as Koa from "koa"; + module "koa" { + interface Request { + authInfo?: any; + user?: any; + + login(user: any): Promise; + login(user: any, options: Object): Promise; + logIn(user: any): Promise; + logIn(user: any, options: Object): Promise; + + logout(): void; + logOut(): void; + + isAuthenticated(): boolean; + isUnauthenticated(): boolean; + } + } + + import * as passport from "passport"; + + interface Middleware { (ctx: Koa.Context, next: () => Promise): any; } + interface KoaPassport { + use(strategy: passport.Strategy): this; + use(name: string, strategy: passport.Strategy): this; + unuse(name: string): this; + framework(fw: passport.Framework): this; + initialize(options?: { userProperty: string; }): Middleware; + session(options?: { pauseStream: boolean; }): Middleware; + + authenticate(strategy: string, callback?: Function): Middleware; + authenticate(strategy: string, options: Object, callback?: Function): Middleware; + authenticate(strategies: string[], callback?: Function): Middleware; + authenticate(strategies: string[], options: Object, callback?: Function): Middleware; + authorize(strategy: string, callback?: Function): Middleware; + authorize(strategy: string, options: Object, callback?: Function): Middleware; + authorize(strategies: string[], callback?: Function): Middleware; + authorize(strategies: string[], options: Object, callback?: Function): Middleware; + serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void; + deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void; + transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; + } + const koaPassport: KoaPassport; + + namespace KoaPassport { + interface Profile extends passport.Profile { } + interface Framework extends passport.Framework { } + } + + export = koaPassport; +} diff --git a/koa-send/koa-send-tests.ts b/koa-send/koa-send-tests.ts new file mode 100644 index 0000000000..630bdcbddb --- /dev/null +++ b/koa-send/koa-send-tests.ts @@ -0,0 +1,23 @@ +/// +/// + +import * as Koa from "koa"; +import * as send from "koa-send"; + +const app = new Koa(); + +app.use(async (ctx: Koa.Context) => { + const path: string = await send(ctx, 'stimpy.html'); +}); + +app.use(async (ctx: Koa.Context) => { + await send(ctx, 'stimpy.html', { + root: '../static-files', + index: 'index.html', + maxAge: 10, + hidden: true, + format: true, + gzip: true, + setHeaders: () => {}, + }); +}); diff --git a/koa-send/koa-send.d.ts b/koa-send/koa-send.d.ts new file mode 100644 index 0000000000..9ed8805412 --- /dev/null +++ b/koa-send/koa-send.d.ts @@ -0,0 +1,27 @@ +// Type definitions for koa-send v3.x +// Project: https://github.com/koajs/send +// Definitions by: Peter Safranek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "koa-send" { + + import * as Koa from "koa"; + + interface ISendOptions { + root?: string; + index?: string; + maxAge?: number; + hidden?: boolean; + format?: boolean; + gzip?: boolean; + setHeaders?: Function; + } + + function send(ctx: Koa.Context, path: string, opts?: ISendOptions): Promise; + + namespace send {} + + export = send; +} diff --git a/koa-session-minimal/koa-session-minimal-tests.ts b/koa-session-minimal/koa-session-minimal-tests.ts new file mode 100644 index 0000000000..7ee723d3aa --- /dev/null +++ b/koa-session-minimal/koa-session-minimal-tests.ts @@ -0,0 +1,31 @@ +/// +/// + +import * as Koa from "koa"; +import * as session from "koa-session-minimal"; + +const app = new Koa(); + +const ONE_DAY = 24 * 3600 * 1000; + +app.use(session({ + key: 'SESSID', + cookie: { + maxAge: ONE_DAY, + httpOnly: false, + } +})); + +app.use((ctx) => { + if (ctx.path === '/favicon.ico') return // ignore favicon + + if (!('count' in ctx.session)) ctx.session.count = 0 // init counter + + ctx.session.count += 1 + ctx.body = ctx.session.count + + ctx.sessionHandler.regenerateId() // change session id +}); + +app.listen(80) + diff --git a/koa-session-minimal/koa-session-minimal.d.ts b/koa-session-minimal/koa-session-minimal.d.ts new file mode 100644 index 0000000000..e0369fcc1b --- /dev/null +++ b/koa-session-minimal/koa-session-minimal.d.ts @@ -0,0 +1,50 @@ +// Type definitions for koa-session-minimal v3.x +// Project: https://github.com/longztian/koa-session-minimal +// Definitions by: Longzhang Tian +// Definitions: https://github.com/hellopao/DefinitelyTyped + +/* =================== USAGE =================== + + import * as Koa from "koa"; + import session = require("koa-session-minimal"); + + const app = new Koa(); + app.use(session()); + + =============================================== */ + +/// +/// + +declare module "koa-session-minimal" { + + import * as Koa from "koa"; + import * as cookies from "cookies"; + + module "koa" { + interface Request { + session: any; + sessionHandler: { regenerateId: () => void }; + } + } + + function session(opts?: { + /** + * session cookie name and store key prefix. Default is 'koa:sess' + */ + key?: string; + + /** + * cookie options + */ + cookie?: cookies.IOptions | { (ctx?: Koa.Context): cookies.IOptions }; + + /** + * session store + */ + store?: any; + }): { (ctx: Koa.Context, next?: () => any): any }; + + namespace session {} + export = session; +} diff --git a/koa/koa-tests.ts b/koa/koa-tests.ts index 71814fe4fc..ac42c1f1de 100644 --- a/koa/koa-tests.ts +++ b/koa/koa-tests.ts @@ -19,3 +19,5 @@ app.use(ctx => { }); app.listen(3000); + +const server = app.listen(); diff --git a/koa/koa.d.ts b/koa/koa.d.ts index 1356ffdb0e..1e45997f9f 100644 --- a/koa/koa.d.ts +++ b/koa/koa.d.ts @@ -159,6 +159,7 @@ declare module "koa" { constructor(); // From node.d.ts + listen(): http.Server; listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): http.Server; listen(port: number, hostname?: string, listeningListener?: Function): http.Server; listen(port: number, backlog?: number, listeningListener?: Function): http.Server; diff --git a/kue/kue.d.ts b/kue/kue.d.ts index 653f3992aa..ee3571db0d 100644 --- a/kue/kue.d.ts +++ b/kue/kue.d.ts @@ -10,7 +10,7 @@ declare module "kue" { import events = require('events'); import express = require('express'); - import redis = require('redis'); + import redisClientFactory = require('redis'); export class Queue extends events.EventEmitter { name: string; @@ -18,7 +18,7 @@ declare module "kue" { promoter: any; workers: Worker[]; shuttingDown: boolean; - client: redis.RedisClient; + client: redisClientFactory.RedisClient; testMode: TestMode; static singleton: Queue; @@ -63,7 +63,7 @@ declare module "kue" { public id: number; public type: string; public data: any; - public client: redis.RedisClient; + public client: redisClientFactory.RedisClient; private _max_attempts; static priorities: Priorities; @@ -86,7 +86,7 @@ declare module "kue" { delay(ms:number|Date): Job; removeOnComplete(param: any): void; backoff(param: any): void; - ttl(param: any): void; + ttl(param: any): Job; private _getBackoffImpl(): void; priority(level: string|number): Job; attempt(fn: Function): Job; @@ -109,7 +109,7 @@ declare module "kue" { class Worker extends events.EventEmitter { queue: Queue; type: string; - client: redis.RedisClient; + client: redisClientFactory.RedisClient; job: Job; constructor(queue: Queue, type: string); @@ -127,10 +127,10 @@ declare module "kue" { interface Redis { configureFactory(options: Object, queue: Queue): void; - createClient(): redis.RedisClient; - createClientFactory(options: Object): redis.RedisClient; - client(): redis.RedisClient; - pubsubClient(): redis.RedisClient; + createClient(): redisClientFactory.RedisClient; + createClientFactory(options: Object): redisClientFactory.RedisClient; + client(): redisClientFactory.RedisClient; + pubsubClient(): redisClientFactory.RedisClient; reset(): void; } @@ -146,4 +146,4 @@ declare module "kue" { export var workers: Worker[]; export function createQueue(options?: Object): Queue; -} \ No newline at end of file +} diff --git a/ldclient-js/ldclient-js-tests.ts b/ldclient-js/ldclient-js-tests.ts new file mode 100644 index 0000000000..cf4ec2b2b6 --- /dev/null +++ b/ldclient-js/ldclient-js-tests.ts @@ -0,0 +1,32 @@ +/// + +// Implicitly calls LDClient#identify +const ldClient = LDClient.initialize( + 'ENV KEY', + { + key: 'USER KEY', + name: 'USER NAME', + custom: { + 'CUSTOM ATTRIBUTE': ['CUSTOM VALUE'], + }, + }, + { + hash: 'SECURE USER HASH', + } +); + +ldClient.on('ready', () => { + const defaultValue = false; + ldClient.variation('FLAG-KEY', defaultValue); + console.log('All flag values:', ldClient.allFlags()); +}); + +function changeCallback(changes: LaunchDarkly.LDFlagChangeset) { + console.log('Flags changed:', changes); +} + +ldClient.on('change', changeCallback); + +document.getElementById('disable-change-tracking').addEventListener('click', () => { + ldClient.off('change', changeCallback); +}); diff --git a/ldclient-js/ldclient-js.d.ts b/ldclient-js/ldclient-js.d.ts new file mode 100644 index 0000000000..47792db29a --- /dev/null +++ b/ldclient-js/ldclient-js.d.ts @@ -0,0 +1,238 @@ +// Type definitions for ldclient-js v1.1.2 +// Project: https://github.com/launchdarkly/js-client +// Definitions by: Isaac Sukin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * The LaunchDarkly JavaScript client interfaces. + * + * Documentation: http://docs.launchdarkly.com/docs/js-sdk-reference + */ +declare namespace LaunchDarkly { + /** + * The names of events to which users of the client can subscribe. + */ + export type LDEventName = 'ready' | 'change'; + + /** + * The types of values a feature flag can have. + * + * Flags can have any JSON-serializable value. + */ + export type LDFlagValue = any; + + /** + * A map of feature flags from their keys to their values. + */ + export type LDFlagSet = { + [key: string]: LDFlagValue, + }; + + /** + * A map of feature flag keys to objects holding changes in their values. + */ + export type LDFlagChangeset = { + [key: string]: { + current: LDFlagValue, + previous: LDFlagValue, + }, + }; + + /** + * The parameters required to (un)subscribe to/from LaunchDarkly events. + * + * See LDClient#on and LDClient#off. + */ + type LDEventSignature = ( + key: LDEventName, + callback: (current?: LDFlagValue | LDFlagChangeset, previous?: LDFlagValue) => void, + context?: any + ) => void; + + /** + * LaunchDarkly initialization options. + */ + export interface LDOptions { + /** + * The signed user key for Secure Mode. + * + * @see http://docs.launchdarkly.com/docs/js-sdk-reference#secure-mode + */ + hash: string; + + /** + * The initial set of flags to use until the remote set is retrieved. + * + * If "localStorage" is specified, the flags will be saved locally and + * retrieved from storage. Alternatively an LDFlagSet can be specified + * which will be used as the initial source of flag values. + */ + bootstrap?: 'localStorage' | LDFlagSet; + } + + /** + * A LaunchDarkly user object. + */ + export interface LDUser { + /** + * A unique string identifying a user. + */ + key: string; + + /** + * The user's name. + * + * You can search for users on the User page by name. + */ + name?: string; + + /** + * The user's first name. + */ + firstName?: string; + + /** + * The user's last name. + */ + lastName?: string; + + /** + * The user's email address. + * + * If an `avatar` URL is not provided, LaunchDarkly will use Gravatar + * to try to display an avatar for the user on the Users page. + */ + email?: string; + + /** + * An absolute URL to an avatar image for the user. + */ + avatar?: string; + + /** + * The user's IP address. + * + * If you provide an IP, LaunchDarkly will use a geolocation service to + * automatically infer a `country` for the user, unless you've already + * specified one. + */ + ip?: string; + + /** + * The country associated with the user. + */ + country?: string; + + /** + * Whether to show the user on the Users page in LaunchDarkly. + */ + anonymous?: boolean; + + /** + * Any additional attributes associated with the user. + */ + custom?: { + [key: string]: string | boolean | number | Array, + }; + } + + /** + * The LaunchDarkly client's instance interface. + * + * @see http://docs.launchdarkly.com/docs/js-sdk-reference + */ + export interface LDClient { + /** + * Identifies a user to LaunchDarkly. + * + * This only needs to be called if the user changes identities because + * normally the user's identity is set during client initialization. + * + * @param user + * A map of user options. Must contain at least the `key` property + * which identifies the user. + * @param hash + * The signed user key for Secure Mode; see + * http://docs.launchdarkly.com/docs/js-sdk-reference#secure-mode + * @param onDone + * A callback to invoke after the user is identified. + */ + identify: (user: LDUser, hash?: string, onDone?: () => void) => void; + + /** + * Retrieves a flag's value. + * + * @param key + * The key of the flag for which to retrieve the corresponding value. + * @param defaultValue + * The value to use if the flag is not available (for example, if the + * user is offline or a flag is requested that does not exist). + * + * @returns + * The flag's value. + */ + variation: (key: string, defaultValue?: LDFlagValue) => LDFlagValue; + + /** + * Registers an event listener. + * + * @param key + * The name of the event for which to listen. This can be "ready", + * "change", or "change:FLAG-KEY". + * @param callback + * The function to execute when the event fires. For the "change" + * event, the callback receives one parameter: an LDFlagChangeset + * describing the changes. For "change:FLAG-KEY" events, the callback + * receives two parameters: the current (new) value and the previous + * value of the relevant flag. + * @param context + * The "this" context to use for the callback. + */ + on: LDEventSignature; + + /** + * Deregisters an event listener. + * + * @param key + * The name of the event for which to stop listening. This can be + * "ready", "change", or "change:FLAG-KEY". + * @param callback + * The function to deregister. + * @param context + * The "this" context for the callback. + */ + off: LDEventSignature; + + /** + * Track page events to use in goals or A/B tests. + * + * LaunchDarkly automatically tracks pageviews and clicks that are + * specified in the Goals section of their dashboard. This can be used + * to track custom goals or other events that do not currently have + * goals. + * + * @param key + * The event to record. + * @param data + * Additional information to associate with the event. + */ + track: (key: string, data?: any) => void; + + /** + * Returns a map of all available flags to the current user's values. + */ + allFlags: () => LDFlagSet; + } + +} + +/** + * The LaunchDarkly static global. + */ +declare var LDClient: { + initialize: ( + key: string, + user: LaunchDarkly.LDUser, + options?: LaunchDarkly.LDOptions + ) => LaunchDarkly.LDClient; +}; diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index 9b07b8fd03..80d6c35e41 100644 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -166,11 +166,72 @@ mapPixelBounds = map.getPixelBounds(); mapPixelBounds = map.getPixelWorldBounds(); mapPixelBounds = map.getPixelWorldBounds(12); +let tileLayerOptions: L.TileLayerOptions = {}; +tileLayerOptions = { + minZoom: 0, + maxZoom: 18, + maxNativeZoom: 2, + errorTileUrl: '', + zoomOffset: 0, + tms: true, + zoomReverse: true, + detectRetina: true, + crossOrigin: false, + opacity: 1, + updateWhenIdle: true, + updateWhenZooming: true, + updateInterval: 500, + attribution: '', + zIndex: 1, + noWrap: true, + pane: '', + className: '', + keepBuffer: 1, + foo: 'bar', + bar: () => 'foo', + abc: (data: any) => 'foobar' +}; + +tileLayerOptions.subdomains = 'a'; +tileLayerOptions.subdomains = ['a', 'b']; + +tileLayerOptions.tileSize = 256; +tileLayerOptions.tileSize = point; +//tileLayerOptions.tileSize = pointTuple; investigate if this is valid + +tileLayerOptions.bounds = latLngBounds; +tileLayerOptions.bounds = latLngBoundsLiteral; + +let tileLayer: L.TileLayer; +tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png'); +tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', tileLayerOptions); +tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''}); + +let eventHandler = () => {}; +let domEvent: Event = {} as Event; +L.DomEvent + .on(htmlElement, 'click', eventHandler) + .addListener(htmlElement, 'click', eventHandler) + .off(htmlElement, 'click', eventHandler) + .removeListener(htmlElement, 'click', eventHandler) + .on(htmlElement, {'click': eventHandler}) + .addListener(htmlElement, {'click': eventHandler}) + .off(htmlElement, {'click': eventHandler}, eventHandler) + .removeListener(htmlElement, {'click': eventHandler}, eventHandler) + .stopPropagation(domEvent) + .disableScrollPropagation(htmlElement) + .disableClickPropagation(htmlElement) + .preventDefault(domEvent) + .stop(domEvent); +point = L.DomEvent.getMousePosition(domEvent); +point = L.DomEvent.getMousePosition(domEvent, htmlElement); +const wheelDelta: number = L.DomEvent.getWheelDelta(domEvent); + map = map // addControl // removeControl - .addLayer(L.tileLayer('')) - .removeLayer(L.tileLayer('')) // use a different type of layer + .addLayer(tileLayer) + .removeLayer(tileLayer) // use a different type of layer .eachLayer((currentLayer) => { layer = currentLayer; }) @@ -237,8 +298,8 @@ map = map .panTo(latLngTuple, panOptions) .panBy(point) .panBy(pointTuple) - .setMaxBounds(bounds) // investigate if this really receives Bounds instead of LatLngBounds - .setMaxBounds(boundsLiteral) + .setMaxBounds(latLngBounds) + .setMaxBounds(latLngBoundsLiteral) .setMinZoom(5) .setMaxZoom(10) .panInsideBounds(latLngBounds) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 87f33576e6..b67134a8b6 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -1,9 +1,47 @@ -// Type definitions for Leaflet.js 1.0.0-rc3 +// Type definitions for Leaflet.js 1.0.0 // Project: https://github.com/Leaflet/Leaflet // Definitions by: Alejandro Sánchez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +type NativeMouseEvent = MouseEvent; + declare namespace L { + export class Class { + static extend(props:any):any/* how to return constructor of self extended type ? */; + static include(props:any):any /* how to return self extended type ? */; + static mergeOptions(props:any): any /* how to return self extended type ? */; + static addInitHook(initHookFn: ()=> void): any/* how to return self extended type ? */; + } + + export class DomUtil { + static get(id: string): HTMLElement; + static get(id: HTMLElement): HTMLElement; + static getStyle(el: HTMLElement, styleAttrib: string): string; + static create(tagName: String, className?: String, container?: HTMLElement): HTMLElement; + static remove(el: HTMLElement):void; + static empty(el: HTMLElement):void; + static toFront(el: HTMLElement):void; + static toBack(el: HTMLElement):void; + static hasClass(el: HTMLElement, name: String): Boolean; + static addClass(el: HTMLElement, name: String):void; + static removeClass(el: HTMLElement, name: String):void; + static setClass(el: HTMLElement, name: String):void; + static getClass(el: HTMLElement): String; + static setOpacity(el: HTMLElement, opacity: Number):void; + static testProp(props: String[]): String|boolean/*=false*/; + static setTransform(el: HTMLElement, offset: Point, scale?: Number):void; + static setPosition(el: HTMLElement, position: Point):void; + static getPosition(el: HTMLElement): Point + static disableTextSelection(): void + static enableTextSelection(): void + static disableImageDrag(): void + static enableImageDrag(): void + static preventOutline(el: HTMLElement): void + static restoreOutline(): void + } + export interface CRS { latLngToPoint(latlng: LatLng, zoom: number): Point; latLngToPoint(latlng: LatLngLiteral, zoom: number): Point; @@ -199,8 +237,150 @@ declare namespace L { export function bounds(points: BoundsLiteral): Bounds; - export interface Evented { + export type EventHandlerFn = (event: Event) => void; + export type EventHandlerFnMap = {[type: string]: EventHandlerFn}; + + /** + * A set of methods shared between event-powered classes (like Map and Marker). + * Generally, events allow you to execute some function when something happens + * with an object (e.g. the user clicks on the map, causing the map to fire + * 'click' event). + */ + export interface Evented extends Class { + /** + * Adds a listener function (fn) to a particular event type of the object. + * You can optionally specify the context of the listener (object the this + * keyword will point to). You can also pass several space-separated types + * (e.g. 'click dblclick'). + */ + on(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} + */ + on(eventMap: EventHandlerFnMap): this; + + /** + * Removes a previously added listener function. If no function is specified, + * it will remove all the listeners of that particular event from the object. + * Note that if you passed a custom context to on, you must pass the same context + * to off in order to remove the listener. + */ + off(type: string, fn?: EventHandlerFn, context?: Object): this; + + /** + * Removes a set of type/listener pairs. + */ + off(eventMap: EventHandlerFnMap): this; + + /** + * Removes all listeners to all events on the object. + */ + off(): this; + + /** + * Fires an event of the specified type. You can optionally provide a data + * object — the first argument of the listener function will contain its properties. + * The event might can optionally be propagated to event parents. + */ + fire(type: string, data?: Object, propagate?: boolean): this; + + /** + * Returns true if a particular event type has any listeners attached to it. + */ + listens(type: string): boolean; + + /** + * Behaves as on(...), except the listener will only get fired once and then removed. + */ + once(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Behaves as on(...), except the listener will only get fired once and then removed. + */ + once(eventMap: EventHandlerFnMap): this; + + /** + * Adds an event parent - an Evented that will receive propagated events + */ + addEventParent(obj: Evented): this; + + /** + * Removes an event parent, so it will stop receiving propagated events + */ + removeEventParent(obj: Evented): this; + + /** + * Alias for on(...) + * + * Adds a listener function (fn) to a particular event type of the object. + * You can optionally specify the context of the listener (object the this + * keyword will point to). You can also pass several space-separated types + * (e.g. 'click dblclick'). + */ + addEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Alias for on(...) + * + * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} + */ + addEventListener(eventMap: EventHandlerFnMap): this; + + /** + * Alias for off(...) + * + * Removes a previously added listener function. If no function is specified, + * it will remove all the listeners of that particular event from the object. + * Note that if you passed a custom context to on, you must pass the same context + * to off in order to remove the listener. + */ + removeEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Alias for off(...) + * + * Removes a set of type/listener pairs. + */ + removeEventListener(eventMap: EventHandlerFnMap): this; + + /** + * Alias for off() + * + * Removes all listeners to all events on the object. + */ + clearAllEventListeners(): this; + + /** + * Alias for once(...) + * + * Behaves as on(...), except the listener will only get fired once and then removed. + */ + addOneTimeEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Alias for once(...) + * + * Behaves as on(...), except the listener will only get fired once and then removed. + */ + addOneTimeEventListener(eventMap: EventHandlerFnMap): this; + + /** + * Alias for fire(...) + * + * Fires an event of the specified type. You can optionally provide a data + * object — the first argument of the listener function will contain its properties. + * The event might can optionally be propagated to event parents. + */ + fireEvent(type: string, data?: Object, propagate?: boolean): this; + + /** + * Alias for listens(...) + * + * Returns true if a particular event type has any listeners attached to it. + */ + hasEventListeners(type: string): boolean; } interface LayerOptions { @@ -303,6 +483,7 @@ declare namespace L { zoomReverse?: boolean; detectRetina?: boolean; crossOrigin?: boolean; + [name: string]: any; } export interface TileLayer extends GridLayer { @@ -355,7 +536,7 @@ declare namespace L { export interface PathOptions extends InteractiveLayerOptions { stroke?: boolean; color?: string; - wight?: number; + weight?: number; opacity?: number; lineCap?: LineCapShape; lineJoin?: LineJoinShape; @@ -366,7 +547,7 @@ declare namespace L { fillOpacity?: number; fillRule?: FillRule; renderer?: Renderer; - className: string; + className?: string; } export interface Path extends Layer { @@ -381,8 +562,7 @@ declare namespace L { noClip?: boolean; } - export interface Polyline extends Path { - toGeoJSON(): Object; // should import GeoJSON typings + interface InternalPolyline extends Path { getLatLngs(): Array; setLatLngs(latlngs: Array): this; setLatLngs(latlngs: Array): this; @@ -398,6 +578,10 @@ declare namespace L { addLatLng(latlng: Array): this; } + export interface Polyline extends InternalPolyline { + toGeoJSON(): GeoJSON.LineString | GeoJSON.MultiLineString; + } + export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; export function polyline(latlngs: Array, options?: PolylineOptions): Polyline; @@ -410,8 +594,8 @@ declare namespace L { export function polyline(latlngs: Array>, options?: PolylineOptions): Polyline; - export interface Polygon extends Polyline { - toGeoJSON(): Object; // should import GeoJSON typings + export interface Polygon extends InternalPolyline { + toGeoJSON(): GeoJSON.Polygon | GeoJSON.MultiPolygon; } export function polygon(latlngs: Array, options?: PolylineOptions): Polygon; @@ -440,7 +624,7 @@ declare namespace L { } export interface CircleMarker extends Path { - toGeoJSON(): Object; // should import GeoJSON typings + toGeoJSON(): GeoJSON.Point; setLatLng(latLng: LatLng): this; setLatLng(latLng: LatLngLiteral): this; setLatLng(latLng: LatLngTuple): this; @@ -485,6 +669,262 @@ declare namespace L { export interface SVG extends Renderer {} + export namespace SVG { + export function create(name: string): SVGElement; + + export function pointsToPath(rings: Array, close: boolean): string; + + export function pointsToPath(rings: Array, close: boolean): string; + } + + export function svg(options?: RendererOptions): SVG; + + export interface Canvas extends Renderer {} + + export function canvas(options?: RendererOptions): Canvas; + + /** + * Used to group several layers and handle them as one. + * If you add it to the map, any layers added or removed from the group will be + * added/removed on the map as well. Extends Layer. + */ + export interface LayerGroup extends Layer { + /** + * Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection). + */ + toGeoJSON(): GeoJSON.GeometryCollection; + + /** + * Adds the given layer to the group. + */ + addLayer(layer: Layer): this; + + /** + * Removes the given layer from the group. + */ + removeLayer(layer: Layer): this; + + /** + * Removes the layer with the given internal ID from the group. + */ + removeLayer(id: number): this; + + /** + * Returns true if the given layer is currently added to the group. + */ + hasLayer(layer: Layer): boolean; + + /** + * Removes all the layers from the group. + */ + clearLayers(): this; + + /** + * Calls methodName on every layer contained in this group, passing any additional parameters. + * Has no effect if the layers contained do not implement methodName. + */ + invoke(methodName: string, ...params: Array): this; + + /** + * Iterates over the layers of the group, + * optionally specifying context of the iterator function. + */ + eachLayer(fn: (layer: Layer) => void, context?: Object): this; + + /** + * Returns the layer with the given internal ID. + */ + getLayer(id: number): Layer; + + /** + * Returns an array of all the layers added to the group. + */ + getLayers(): Array; + + /** + * Calls setZIndex on every layer contained in this group, passing the z-index. + */ + setZIndex(zIndex: number): this; + + /** + * Returns the internal ID for a layer + */ + getLayerId(layer: Layer): number; + } + + /** + * Create a layer group, optionally given an initial set of layers. + */ + export function layerGroup(layers: Array): LayerGroup; + + /** + * Extended LayerGroup that also has mouse events (propagated from + * members of the group) and a shared bindPopup method. + */ + export interface FeatureGroup extends LayerGroup { + /** + * Sets the given path options to each layer of the group that has a setStyle method. + */ + setStyle(style: PathOptions): this; + + /** + * Brings the layer group to the top of all other layers + */ + bringToFront(): this; + + /** + * Brings the layer group to the top [sic] of all other layers + */ + bringToBack(): this; + + /** + * Returns the LatLngBounds of the Feature Group (created from + * bounds and coordinates of its children). + */ + getBounds(): LatLngBounds; + } + + /** + * Create a feature group, optionally given an initial set of layers. + */ + export function featureGroup(layers?: Array): FeatureGroup; + + type StyleFunction = (feature: GeoJSON.Feature) => PathOptions; + + export interface GeoJSONOptions extends LayerOptions { + /** + * A Function defining how GeoJSON points spawn Leaflet layers. + * It is internally called when data is added, passing the GeoJSON point + * feature and its LatLng. + * + * The default is to spawn a default Marker: + * + * ``` + * function(geoJsonPoint, latlng) { + * return L.marker(latlng); + * } + * ``` + */ + pointToLayer?: (geoJsonPoint: GeoJSON.Point, latlng: LatLng) => Layer; // should import GeoJSON typings + + /** + * A Function defining the Path options for styling GeoJSON lines and polygons, + * called internally when data is added. + * + * The default value is to not override any defaults: + * + * ``` + * function (geoJsonFeature) { + * return {} + * } + * ``` + */ + style?: StyleFunction; + + /** + * A Function that will be called once for each created Feature, after it + * has been created and styled. Useful for attaching events and popups to features. + * + * The default is to do nothing with the newly created layers: + * + * ``` + * function (feature, layer) {} + * ``` + */ + onEachFeature?: (feature: GeoJSON.Feature, layer: Layer) => void; + + /** + * A Function that will be used to decide whether to show a feature or not. + * + * The default is to show all features: + * + * ``` + * function (geoJsonFeature) { + * return true; + * } + * ``` + */ + filter?: (geoJsonFeature: GeoJSON.Feature) => boolean; + + /** + * A Function that will be used for converting GeoJSON coordinates to LatLngs. + * The default is the coordsToLatLng static method. + */ + coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng; // check if LatLng has an altitude property + } + + /** + * Represents a GeoJSON object or an array of GeoJSON objects. + * Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup. + */ + export interface GeoJSON extends FeatureGroup { + /** + * Adds a GeoJSON object to the layer. + */ + addData(data: GeoJSON.GeoJsonObject): Layer; + + /** + * Resets the given vector layer's style to the original GeoJSON style, + * useful for resetting style after hover events. + */ + resetStyle(layer: Layer): Layer; + + /** + * Changes styles of GeoJSON vector layers with the given style function. + */ + setStyle(style: StyleFunction): this; + + /** + * Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer + * and/or coordsToLatLng functions if provided as options. + */ + geometryToLayer(featureData: GeoJSON.Feature, options?: GeoJSONOptions): Layer; + + /** + * Creates a LatLng object from an array of 2 numbers (longitude, latitude) or + * 3 numbers (longitude, latitude, altitude) used in GeoJSON for points. + */ + coordsToLatLng(coords: [number, number]): LatLng; + + coordsToLatLng(coords: [number, number, number]): LatLng; + + /** + * Creates a multidimensional array of LatLngs from a GeoJSON coordinates array. + * levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of + * arrays of points, etc., 0 by default). + * Can use a custom coordsToLatLng function. + */ + coordsToLatLngs(coords: Array, levelsDeep?: number, coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng): LatLng[]; // Not entirely sure how to define arbitrarily nested arrays + + /** + * Reverse of coordsToLatLng + */ + latLngToCoords(latlng: LatLng): [number, number] | [number, number, number]; + + /** + * Reverse of coordsToLatLngs closed determines whether the first point should be + * appended to the end of the array to close the feature, only used when levelsDeep is 0. + * False by default. + */ + latLngsToCoords(latlngs: Array, levelsDeep?: number, closed?: boolean): [number, number] | [number, number, number]; + + /** + * Normalize GeoJSON geometries/features into GeoJSON features. + */ + asFeature(geojson: GeoJSON.GeometryObject): GeoJSON.Feature; + + asFeature(geojson: GeoJSON.Feature): GeoJSON.Feature; + } + + /** + * Creates a GeoJSON layer. + * + * Optionally accepts an object in GeoJSON format to display on the + * map (you can alternatively add it later with addData method) and + * an options object. + */ + export function geoJSON(geojson?: GeoJSON.GeoJsonObject, options?: GeoJSONOptions): GeoJSON; + type Zoom = boolean | 'center'; export interface MapOptions { @@ -544,8 +984,78 @@ declare namespace L { bounceAtZoomLimits?: boolean; } - export interface Control { + export type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; + export interface ControlOptions { + position?: ControlPosition; + } + + export interface Control { + getPosition(): ControlPosition; + setPosition(position: ControlPosition): this; + getContainer(): HTMLElement; + addTo(map: Map): this; + remove(): this; + + // Extension methods + onAdd(map: Map): HTMLElement; + onRemove(map: Map): void; + } + + export namespace Control { + export interface ZoomOptions extends ControlOptions { + zoomInText?: string; + zoomInTitle?: string; + zoomOutText?: string; + zoomOutTitle?: string; + } + + export interface Zoom extends Control {} + + export interface AttributionOptions extends ControlOptions { + prefix?: string | boolean; + } + + export interface Attribution extends Control { + setPrefix(prefix: string): this; + addAttribution(text: string): this; + removeAttribution(text: string): this; + } + + export interface LayersOptions extends ControlOptions { + collapsed?: boolean; + autoZIndex?: boolean; + hideSingleBase?: boolean; + } + + export interface Layers extends Control { + addBaseLayer(layer: Layer, name: string): this; + addOverlay(layer: Layer, name: string): this; + removeLayer(layer: Layer): this; + expand(): this; + collapse(): this; + } + + export interface ScaleOptions extends ControlOptions { + maxWidth?: number; + metric?: boolean; + imperial?: boolean; + updateWhenIdle?: boolean; + } + + export interface Scale extends Control {} + } + + export namespace control { + export function zoom(options: Control.ZoomOptions): Control.Zoom; + + export function attribution(options: Control.AttributionOptions): Control.Attribution; + + type LayersObject = {[name: string]: Layer}; + + export function layers(baseLayers?: LayersObject, overlays?: LayersObject, options?: Control.LayersOptions): Control.Layers; + + export function scale(options?: Control.ScaleOptions): Control.Scale; } interface DivOverlayOptions { @@ -651,7 +1161,7 @@ declare namespace L { latlng: LatLng; layerPoint: Point; containerPoint: Point; - originalEvent: MouseEvent; // how can I reference the global MouseEvent? + originalEvent: NativeMouseEvent; } export interface LocationEvent extends Event { @@ -711,6 +1221,38 @@ declare namespace L { distance: number; } + export namespace DomEvent { + export function on(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: Object): typeof DomEvent; + + export function on(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: Object): typeof DomEvent; + + export function off(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: Object): typeof DomEvent; + + export function off(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: Object): typeof DomEvent; + + export function stopPropagation(ev: Event): typeof DomEvent; + + export function disableScrollPropagation(el: HTMLElement): typeof DomEvent; + + export function disableClickPropagation(el: HTMLElement): typeof DomEvent; + + export function preventDefault(ev: Event): typeof DomEvent; + + export function stop(ev: Event): typeof DomEvent; + + export function getMousePosition(ev: Event, container?: HTMLElement): Point; + + export function getWheelDelta(ev: Event): number; + + export function addListener(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: Object): typeof DomEvent; + + export function addListener(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: Object): typeof DomEvent; + + export function removeListener(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: Object): typeof DomEvent; + + export function removeListener(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: Object): typeof DomEvent; + } + interface DefaultMapPanes { mapPane: HTMLElement; tilePane: HTMLElement; @@ -767,8 +1309,8 @@ declare namespace L { panTo(latlng: LatLngTuple, options?: PanOptions): this; panBy(offset: Point): this; panBy(offset: PointTuple): this; - setMaxBounds(bounds: Bounds): this; // is this really bounds and not lanlngbounds? - setMaxBounds(bounds: BoundsLiteral): this; + setMaxBounds(bounds: LatLngBounds): this; + setMaxBounds(bounds: LatLngBoundsLiteral): this; setMinZoom(zoom: number): this; setMaxZoom(zoom: number): this; panInsideBounds(bounds: LatLngBounds, options?: PanOptions): this; @@ -871,8 +1413,12 @@ declare namespace L { createShadow(oldIcon?: HTMLElement): HTMLElement; } + export interface IconDefault extends Icon { + imagePath: string; + } + export namespace Icon { - export const Default: Icon; + export const Default: IconDefault; } export function icon(options: IconOptions): Icon; @@ -920,6 +1466,36 @@ declare namespace L { export function marker(latlng: LatLngLiteral, options?: MarkerOptions): Marker; export function marker(latlng: LatLngTuple, options?: MarkerOptions): Marker; + + export namespace Browser { + export const ie: boolean; + export const ielt9: boolean; + export const edge: boolean; + export const webkit: boolean; + export const gecko: boolean; + export const android: boolean; + export const android23: boolean; + export const chrome: boolean; + export const safari: boolean; + export const win: boolean; + export const ie3d: boolean; + export const webkit3d: boolean; + export const gecko3d: boolean; + export const opera12: boolean; + export const any3d: boolean; + export const mobile: boolean; + export const mobileWebkit: boolean; + export const mobiWebkit3d: boolean; + export const mobileOpera: boolean; + export const mobileGecko: boolean; + export const touch: boolean; + export const msPointer: boolean; + export const pointer: boolean; + export const retina: boolean; + export const canvas: boolean; + export const vml: boolean; + export const svg: boolean; + } } declare module 'leaflet' { diff --git a/localForage/localForage-tests.ts b/localForage/localForage-tests.ts index 6f162e8c4b..e3e3343095 100644 --- a/localForage/localForage-tests.ts +++ b/localForage/localForage-tests.ts @@ -1,65 +1,108 @@ /// -declare var localForage: LocalForage; +declare let localForage: LocalForage; -() => { +namespace LocalForageTest { localForage.clear((err: any) => { - var newError: any = err; + let newError: any = err; }); localForage.iterate((str: string, key: string, num: number) => { - var newStr: string = str; - var newKey: string = key; - var newNum: number = num; + let newStr: string = str; + let newKey: string = key; + let newNum: number = num; }); localForage.length((err: any, num: number) => { - var newError: any = err; + let newError: any = err; + let newNumber: number = num; + }); + + localForage.length().then((num: number) => { var newNumber: number = num; }); localForage.key(0, (err: any, value: string) => { - var newError: any = err; - var newValue: string = value; + let newError: any = err; + let newValue: string = value; }); localForage.keys((err: any, keys: Array) => { - var newError: any = err; + let newError: any = err; + let newArray: Array = keys; + }); + + localForage.keys().then((keys: Array) => { var newArray: Array = keys; }); localForage.getItem("key",(err: any, str: string) => { - var newError: any = err; - var newStr: string = str + let newError: any = err; + let newStr: string = str }); localForage.getItem("key").then((str: string) => { - var newStr: string = str; + let newStr: string = str; }); - + localForage.setItem("key", "value",(err: any, str: string) => { - var newError: any = err; - var newStr: string = str + let newError: any = err; + let newStr: string = str }); localForage.setItem("key", "value").then((str: string) => { - var newStr: string = str; + let newStr: string = str; }); - + localForage.removeItem("key",(err: any) => { - var newError: any = err; + let newError: any = err; }); localForage.removeItem("key").then(() => { }); - - var config = localForage.config({ - name: "testyo", - driver: localForage.LOCALSTORAGE - }); - - var store = localForage.createInstance({ - name: "da instance", - driver: localForage.LOCALSTORAGE + + localForage.getDriver("CustomDriver").then((result: LocalForageDriver) => { + var driver: LocalForageDriver = result; + // we need to use a variable for proper type guards before TS 2.0 + var _support = driver._support; + if (typeof _support === "function") { + // _support = _support.bind(driver); + _support().then((result: boolean) => { + let doesSupport: boolean = result; + }); + } else if (typeof _support === "boolean") { + let doesSupport: boolean = _support; + } }); + + { + let config: boolean; + + config = localForage.config({ + name: "testyo", + driver: localForage.LOCALSTORAGE + }); + } + + { + let store: LocalForage; + + store = localForage.createInstance({ + name: "da instance", + driver: localForage.LOCALSTORAGE + }); + } + + { + let testSerializer: LocalForageSerializer; + + localForage.getSerializer() + .then((serializer: LocalForageSerializer) => { + testSerializer = serializer; + }); + + localForage.getSerializer((serializer: LocalForageSerializer) => { + testSerializer = serializer; + }); + } } \ No newline at end of file diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index c727d93b3a..e5d42d6d12 100644 --- a/localForage/localForage.d.ts +++ b/localForage/localForage.d.ts @@ -12,56 +12,12 @@ interface LocalForageOptions { storeName?: string; - version?: string; + version?: number; description?: string; } -interface LocalForageDriver { - _driver: string; - - _initStorage(options: LocalForageOptions): void; - - _support: boolean | Promise; - - clear(callback: (err: any) => void): void; - - getItem(key: string, callback: (err: any, value: any) => void): void; - - key(keyIndex: number, callback: (err: any, key: string) => void): void; - - keys(callback: (err: any, keys: string[]) => void): void; - - length(callback: (err: any, numberOfKeys: number) => void): void; - - removeItem(key: string, callback: (err: any) => void): void; - - setItem(key: string, value: any, callback: (err: any, value: any) => void): void; -} - -interface LocalForage { - LOCALSTORAGE: string; - WEBSQL: string; - INDEXEDDB: string; - - /** - * Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded. - * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver() - * @param {ILocalForageConfig} options? - */ - config(options: LocalForageOptions): boolean; - createInstance(options: LocalForageOptions): LocalForage; - - driver(): string; - /** - * Force usage of a particular driver or drivers, if available. - * @param {string} driver - */ - setDriver(driver: string | string[]): Promise; - setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void; - defineDriver(driver: LocalForageDriver): Promise; - defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void; - +interface LocalForageDbMethods { getItem(key: string): Promise; getItem(key: string, callback: (err: any, value: T) => void): void; @@ -86,16 +42,71 @@ interface LocalForage { iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, callback: (err: any, result: any) => void): void; - +} + +interface LocalForageDriverSupportFunc { + (): Promise; +} + +interface LocalForageDriver extends LocalForageDbMethods { + _driver: string; + + _initStorage(options: LocalForageOptions): void; + + _support: boolean | LocalForageDriverSupportFunc; +} + +interface LocalForageSerializer { + serialize(value: T | ArrayBuffer | Blob, callback: (value: string, error: any) => {}): void; + + deserialize(value: string): T | ArrayBuffer | Blob; + + stringToBuffer(serializedString: string): ArrayBuffer; + + bufferToString(buffer: ArrayBuffer): string; +} + +interface LocalForage extends LocalForageDbMethods { + LOCALSTORAGE: string; + WEBSQL: string; + INDEXEDDB: string; + + /** + * Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded. + * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver() + * @param {ILocalForageConfig} options? + */ + config(options: LocalForageOptions): boolean; + /** * Create a new instance of localForage to point to a different store. * All the configuration options used by config are supported. * @param {LocalForageOptions} options */ createInstance(options: LocalForageOptions): LocalForage; + + driver(): string; + /** + * Force usage of a particular driver or drivers, if available. + * @param {string} driver + */ + setDriver(driver: string | string[]): Promise; + setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void; + defineDriver(driver: LocalForageDriver): Promise; + defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void; + /** + * Return a particular driver + * @param {string} driver + */ + getDriver(driver: string): Promise; + + getSerializer(): Promise; + getSerializer(callback: (serializer: LocalForageSerializer) => void): void; + + supports(driverName: string): boolean; } declare module "localforage" { - var localforage: LocalForage; + let localforage: LocalForage; export = localforage; } diff --git a/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts b/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts new file mode 100644 index 0000000000..d6a9ac4ae2 --- /dev/null +++ b/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts @@ -0,0 +1,56 @@ +/// + +declare var cordovaSQLiteDriver: LocalForageDriver; + +() => { + + var driverName: string = cordovaSQLiteDriver._driver; + + var config = { + driver: driverName, + name: 'localforage' + }; + + cordovaSQLiteDriver._initStorage(config); + + cordovaSQLiteDriver.clear((err: any) => { + var newError: any = err; + }); + + cordovaSQLiteDriver.length((err: any, num: number) => { + var newError: any = err; + var newNumber: number = num; + }); + + cordovaSQLiteDriver.key(0, (err: any, value: string) => { + var newError: any = err; + var newValue: string = value; + }); + + cordovaSQLiteDriver.keys((err: any, keys: Array) => { + var newError: any = err; + var newArray: Array = keys; + }); + + cordovaSQLiteDriver.getItem("key",(err: any, str: string) => { + var newError: any = err; + var newStr: string = str + }); + + cordovaSQLiteDriver.setItem("key", "value", (err: any, str: string) => { + var newError: any = err; + var newStr: string = str + }); + + cordovaSQLiteDriver.setItem("key", "value", (str: string) => { + var newStr: string = str; + }); + + cordovaSQLiteDriver.removeItem("key",(err: any) => { + var newError: any = err; + }); + + cordovaSQLiteDriver.removeItem("key", (err: any) => { + var newError: any = err; + }); +} \ No newline at end of file diff --git a/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver.d.ts b/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver.d.ts new file mode 100644 index 0000000000..22327f12b9 --- /dev/null +++ b/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver.d.ts @@ -0,0 +1,11 @@ +// Type definitions for localforage-cordovasqlitedriver module v1.0+ +// Project: https://github.com/thgreasi/localForage-cordovaSQLiteDriver +// Definitions by: Thodoris Greasidis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "localforage-cordovasqlitedriver" { + var cordovaSQLiteDriver: LocalForageDriver; + export = cordovaSQLiteDriver; +} diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 42fce74b8b..3fbb0e6fd3 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -141,6 +141,14 @@ result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).splice(1); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).splice(1, 2, 5, 6); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).unshift(5, 6); +result = <_.LoDashExplicitObjectWrapper>_.chain([1, 2, 3, 4]).pop(); +result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).push(5, 6, 7); +result = <_.LoDashExplicitObjectWrapper>_.chain([1, 2, 3, 4]).shift(); +result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).sort((a, b) => 1); +result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).splice(1); +result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).splice(1, 2, 5, 6); +result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).unshift(5, 6); + /********* * Array * *********/ @@ -673,6 +681,7 @@ namespace TestFindIndex { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index?: number, collection?: _.List) => boolean; + let fromIndex: number; { let result: number; @@ -681,21 +690,25 @@ namespace TestFindIndex { result = _.findIndex(array, predicateFn); result = _.findIndex(array, ''); result = _.findIndex<{a: number}, TResult>(array, {a: 42}); + result = _.findIndex(array, predicateFn, fromIndex); result = _.findIndex(list); result = _.findIndex(list, predicateFn); result = _.findIndex(list, ''); result = _.findIndex<{a: number}, TResult>(list, {a: 42}); + result = _.findIndex(list, predicateFn, fromIndex); result = _(array).findIndex(); result = _(array).findIndex(predicateFn); result = _(array).findIndex(''); result = _(array).findIndex<{a: number}>({a: 42}); + result = _(array).findIndex(predicateFn, fromIndex); result = _(list).findIndex(); result = _(list).findIndex(predicateFn); result = _(list).findIndex(''); result = _(list).findIndex<{a: number}>({a: 42}); + result = _(list).findIndex(predicateFn, fromIndex); } { @@ -705,11 +718,13 @@ namespace TestFindIndex { result = _(array).chain().findIndex(predicateFn); result = _(array).chain().findIndex(''); result = _(array).chain().findIndex<{a: number}>({a: 42}); + result = _(array).chain().findIndex(predicateFn, fromIndex); result = _(list).chain().findIndex(); result = _(list).chain().findIndex(predicateFn); result = _(list).chain().findIndex(''); result = _(list).chain().findIndex<{a: number}>({a: 42}); + result = _(list).chain().findIndex(predicateFn, fromIndex); } } @@ -719,6 +734,7 @@ namespace TestFindLastIndex { let list: _.List; let predicateFn: (value: TResult, index?: number, collection?: _.List) => boolean; + let fromIndex: number; { let result: number; @@ -727,21 +743,25 @@ namespace TestFindLastIndex { result = _.findLastIndex(array, predicateFn); result = _.findLastIndex(array, ''); result = _.findLastIndex<{a: number}, TResult>(array, {a: 42}); + result = _.findLastIndex(array, predicateFn, fromIndex); result = _.findLastIndex(list); result = _.findLastIndex(list, predicateFn); result = _.findLastIndex(list, ''); result = _.findLastIndex<{a: number}, TResult>(list, {a: 42}); + result = _.findLastIndex(list, predicateFn, fromIndex); result = _(array).findLastIndex(); result = _(array).findLastIndex(predicateFn); result = _(array).findLastIndex(''); result = _(array).findLastIndex<{a: number}>({a: 42}); + result = _(array).findLastIndex(predicateFn, fromIndex); result = _(list).findLastIndex(); result = _(list).findLastIndex(predicateFn); result = _(list).findLastIndex(''); result = _(list).findLastIndex<{a: number}>({a: 42}); + result = _(list).findLastIndex(predicateFn, fromIndex); } { @@ -751,11 +771,13 @@ namespace TestFindLastIndex { result = _(array).chain().findLastIndex(predicateFn); result = _(array).chain().findLastIndex(''); result = _(array).chain().findLastIndex<{a: number}>({a: 42}); + result = _(array).chain().findLastIndex(predicateFn, fromIndex); result = _(list).chain().findLastIndex(); result = _(list).chain().findLastIndex(predicateFn); result = _(list).chain().findLastIndex(''); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); + result = _(list).chain().findLastIndex(predicateFn, fromIndex); } } @@ -3727,12 +3749,16 @@ result = _.findLast([1, 2, 3, 4], function (num) { result = _.findLast(foodsCombined, { 'type': 'vegetable' }); result = _.findLast(foodsCombined, 'organic'); +result = _.findLast(foodsCombined, 'organic', 1); + result = _([1, 2, 3, 4]).findLast(function (num) { return num % 2 == 0; }); result = _(foodsCombined).findLast({ 'type': 'vegetable' }); result = _(foodsCombined).findLast('organic'); +result = _(foodsCombined).findLast('organic', 1); + // _.flatMap namespace TestFlatMap { let numArray: (number|number[])[] = [1, [2, 3]]; @@ -5864,12 +5890,18 @@ namespace TestMemoize { result = _(memoizeFn).chain().memoize(memoizeResolverFn); } - _.memoize.Cache = { - delete: key => false, - get: key => undefined, - has: key => false, - set(key, value) { return this; } - }; + interface MemoizeCache { + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): this; + } + interface MemoizeCacheConstructor { + new (): MemoizeCache; + } + let MemoizeCache: MemoizeCacheConstructor + + _.memoize.Cache = MemoizeCache; } // _.overArgs @@ -11095,6 +11127,125 @@ namespace TestConstant { } } +// _.defaultTo +namespace TestDefaultTo { + { + let result: number; + result = _.defaultTo(42, 42); + result = _.defaultTo(undefined, 42); + result = _.defaultTo(null, 42); + result = _.defaultTo(NaN, 42); + } + + { + let result: string; + result = _.defaultTo('a', 'default'); + result = _.defaultTo(undefined, 'default'); + result = _.defaultTo(null, 'default'); + } + + { + let result: boolean; + result = _.defaultTo(true, true); + result = _.defaultTo(undefined, true); + result = _.defaultTo(null, true); + } + + { + let result: string[]; + result = _.defaultTo(['a'], ['default']); + result = _.defaultTo(undefined, ['default']); + result = _.defaultTo(null, ['default']); + } + + { + let result: {a: string}; + result = _.defaultTo<{a: string}>({a: 'a'}, {a: 'a'}); + result = _.defaultTo<{a: string}>(undefined, {a: 'a'}); + result = _.defaultTo<{a: string}>(null, {a: 'a'}); + } + + { + let result: _.LoDashImplicitObjectWrapper; + result = _(42).defaultTo(42); + result = _(undefined).defaultTo(42); + result = _(null).defaultTo(42); + result = _(NaN).defaultTo(42); + } + + { + let result: _.LoDashImplicitObjectWrapper; + result = _('a').defaultTo('default'); + result = _(null).defaultTo('default'); + result = _(NaN).defaultTo('default'); + } + + { + let result: _.LoDashImplicitObjectWrapper; + result = _(true).defaultTo(true); + result = _(undefined).defaultTo(true); + result = _(null).defaultTo(true); + result = _(NaN).defaultTo(true); + } + + { + let result: _.LoDashImplicitObjectWrapper; + result = _(['a']).defaultTo(['default']); + result = _(undefined).defaultTo(['default']); + result = _(null).defaultTo(['default']); + result = _(NaN).defaultTo(['default']); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: string }>; + result = _({ a: 'a' }).defaultTo({a : 'a'}); + result = _(undefined).defaultTo({a : 'a'}); + result = _(null).defaultTo({a : 'a'}); + result = _(NaN).defaultTo({a : 'a'}); + } + + { + let result: _.LoDashExplicitObjectWrapper; + result = _(42).chain().defaultTo(42); + result = _(undefined).chain().defaultTo(42); + result = _(null).chain().defaultTo(42); + result = _(NaN).chain().defaultTo(42); + } + + { + let result: _.LoDashExplicitObjectWrapper; + result = _('a').chain().defaultTo('default'); + result = _(undefined).chain().defaultTo('default'); + result = _(null).chain().defaultTo('default'); + result = _(NaN).chain().defaultTo('default'); + } + + { + let result: _.LoDashExplicitObjectWrapper; + result = _(true).chain().defaultTo(true); + result = _(undefined).chain().defaultTo(true); + result = _(null).chain().defaultTo(true); + result = _(NaN).chain().defaultTo(true); + } + + { + let result: _.LoDashExplicitObjectWrapper; + result = _(['a']).chain().defaultTo(['default']); + result = _(undefined).chain().defaultTo(['default']); + result = _(null).chain().defaultTo(['default']); + result = _(NaN).chain().defaultTo(['default']); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: string }>; + result = _({ a: 'a' }).chain().defaultTo({a : 'a'}); + result = _(undefined).chain().defaultTo({a : 'a'}); + result = _(null).chain().defaultTo({a : 'a'}); + result = _(NaN).chain().defaultTo({a : 'a'}); + } + +} + // _.identity namespace TestIdentity { { @@ -11891,3 +12042,578 @@ result = <_.TemplateSettings>_.templateSettings; res1___ = _.partialRight(func4, "foo", true, 100); res____ = _.partialRight(func4, 42, "foo", true, 100); } + +/*************************** + * method_modules_tests * + ***************************/ + +import afterFunc = require("lodash.after"); +import aryFunc = require("lodash.ary"); +import assignFunc = require("lodash.assign"); +import assignInFunc = require("lodash.assignIn"); +import assignInWithFunc = require("lodash.assignInWith"); +import assignWithFunc = require("lodash.assignWith"); +import atFunc = require("lodash.at"); +import beforeFunc = require("lodash.before"); +import bindFunc = require("lodash.bind"); +import bindAllFunc = require("lodash.bindAll"); +import bindKeyFunc = require("lodash.bindKey"); +import castArrayFunc = require("lodash.castArray"); +import chainFunc = require("lodash.chain"); +import chunkFunc = require("lodash.chunk"); +import compactFunc = require("lodash.compact"); +import concatFunc = require("lodash.concat"); +import constantFunc = require("lodash.constant"); +import countByFunc = require("lodash.countBy"); +import createFunc = require("lodash.create"); +import curryFunc = require("lodash.curry"); +import curryRightFunc = require("lodash.curryRight"); +import debounceFunc = require("lodash.debounce"); +import defaultsFunc = require("lodash.defaults"); +import defaultsDeepFunc = require("lodash.defaultsDeep"); +import deferFunc = require("lodash.defer"); +import delayFunc = require("lodash.delay"); +import differenceFunc = require("lodash.difference"); +import differenceByFunc = require("lodash.differenceBy"); +import differenceWithFunc = require("lodash.differenceWith"); +import dropFunc = require("lodash.drop"); +import dropRightFunc = require("lodash.dropRight"); +import dropRightWhileFunc = require("lodash.dropRightWhile"); +import dropWhileFunc = require("lodash.dropWhile"); +import fillFunc = require("lodash.fill"); +import filterFunc = require("lodash.filter"); +import flatMapFunc = require("lodash.flatMap"); +import flattenFunc = require("lodash.flatten"); +import flattenDeepFunc = require("lodash.flattenDeep"); +import flattenDepthFunc = require("lodash.flattenDepth"); +import flipFunc = require("lodash.flip"); +import flowFunc = require("lodash.flow"); +import flowRightFunc = require("lodash.flowRight"); +import fromPairsFunc = require("lodash.fromPairs"); +import functionsFunc = require("lodash.functions"); +import functionsInFunc = require("lodash.functionsIn"); +import groupByFunc = require("lodash.groupBy"); +import initialFunc = require("lodash.initial"); +import intersectionFunc = require("lodash.intersection"); +import intersectionByFunc = require("lodash.intersectionBy"); +import intersectionWithFunc = require("lodash.intersectionWith"); +import invertFunc = require("lodash.invert"); +import invertByFunc = require("lodash.invertBy"); +import invokeMapFunc = require("lodash.invokeMap"); +import iterateeFunc = require("lodash.iteratee"); +import keyByFunc = require("lodash.keyBy"); +import keysFunc = require("lodash.keys"); +import keysInFunc = require("lodash.keysIn"); +import mapFunc = require("lodash.map"); +import mapKeysFunc = require("lodash.mapKeys"); +import mapValuesFunc = require("lodash.mapValues"); +import matchesFunc = require("lodash.matches"); +import matchesPropertyFunc = require("lodash.matchesProperty"); +import memoizeFunc = require("lodash.memoize"); +import mergeFunc = require("lodash.merge"); +import mergeWithFunc = require("lodash.mergeWith"); +import methodFunc = require("lodash.method"); +import methodOfFunc = require("lodash.methodOf"); +import mixinFunc = require("lodash.mixin"); +import negateFunc = require("lodash.negate"); +import nthArgFunc = require("lodash.nthArg"); +import omitFunc = require("lodash.omit"); +import omitByFunc = require("lodash.omitBy"); +import onceFunc = require("lodash.once"); +import orderByFunc = require("lodash.orderBy"); +import overFunc = require("lodash.over"); +import overArgsFunc = require("lodash.overArgs"); +import overEveryFunc = require("lodash.overEvery"); +import overSomeFunc = require("lodash.overSome"); +import partialFunc = require("lodash.partial"); +import partialRightFunc = require("lodash.partialRight"); +import partitionFunc = require("lodash.partition"); +import pickFunc = require("lodash.pick"); +import pickByFunc = require("lodash.pickBy"); +import propertyFunc = require("lodash.property"); +import propertyOfFunc = require("lodash.propertyOf"); +import pullFunc = require("lodash.pull"); +import pullAllFunc = require("lodash.pullAll"); +import pullAllByFunc = require("lodash.pullAllBy"); +import pullAtFunc = require("lodash.pullAt"); +import rangeFunc = require("lodash.range"); +import rangeRightFunc = require("lodash.rangeRight"); +import reargFunc = require("lodash.rearg"); +import rejectFunc = require("lodash.reject"); +import removeFunc = require("lodash.remove"); +import restFunc = require("lodash.rest"); +import reverseFunc = require("lodash.reverse"); +import sampleSizeFunc = require("lodash.sampleSize"); +import setFunc = require("lodash.set"); +import setWithFunc = require("lodash.setWith"); +import shuffleFunc = require("lodash.shuffle"); +import sliceFunc = require("lodash.slice"); +import sortByFunc = require("lodash.sortBy"); +import sortedUniqFunc = require("lodash.sortedUniq"); +import sortedUniqByFunc = require("lodash.sortedUniqBy"); +import splitFunc = require("lodash.split"); +import spreadFunc = require("lodash.spread"); +import tailFunc = require("lodash.tail"); +import takeFunc = require("lodash.take"); +import takeRightFunc = require("lodash.takeRight"); +import takeRightWhileFunc = require("lodash.takeRightWhile"); +import takeWhileFunc = require("lodash.takeWhile"); +import tapFunc = require("lodash.tap"); +import throttleFunc = require("lodash.throttle"); +import thruFunc = require("lodash.thru"); +import toArrayFunc = require("lodash.toArray"); +import toPairsFunc = require("lodash.toPairs"); +import toPairsInFunc = require("lodash.toPairsIn"); +import toPathFunc = require("lodash.toPath"); +import toPlainObjectFunc = require("lodash.toPlainObject"); +import transformFunc = require("lodash.transform"); +import unaryFunc = require("lodash.unary"); +import unionFunc = require("lodash.union"); +import unionByFunc = require("lodash.unionBy"); +import unionWithFunc = require("lodash.unionWith"); +import uniqFunc = require("lodash.uniq"); +import uniqByFunc = require("lodash.uniqBy"); +import uniqWithFunc = require("lodash.uniqWith"); +import unsetFunc = require("lodash.unset"); +import unzipFunc = require("lodash.unzip"); +import unzipWithFunc = require("lodash.unzipWith"); +import updateFunc = require("lodash.update"); +import valuesFunc = require("lodash.values"); +import valuesInFunc = require("lodash.valuesIn"); +import withoutFunc = require("lodash.without"); +import wordsFunc = require("lodash.words"); +import wrapFunc = require("lodash.wrap"); +import xorFunc = require("lodash.xor"); +import xorByFunc = require("lodash.xorBy"); +import xorWithFunc = require("lodash.xorWith"); +import zipFunc = require("lodash.zip"); +import zipObjectFunc = require("lodash.zipObject"); +import zipWithFunc = require("lodash.zipWith"); +import extendFunc = require("lodash.extend"); +import extendWithFunc = require("lodash.extendWith"); +import addFunc = require("lodash.add"); +import attemptFunc = require("lodash.attempt"); +import camelCaseFunc = require("lodash.camelCase"); +import capitalizeFunc = require("lodash.capitalize"); +import ceilFunc = require("lodash.ceil"); +import clampFunc = require("lodash.clamp"); +import cloneFunc = require("lodash.clone"); +import cloneDeepFunc = require("lodash.cloneDeep"); +import cloneDeepWithFunc = require("lodash.cloneDeepWith"); +import cloneWithFunc = require("lodash.cloneWith"); +import deburrFunc = require("lodash.deburr"); +import endsWithFunc = require("lodash.endsWith"); +import eqFunc = require("lodash.eq"); +import escapeFunc = require("lodash.escape"); +import escapeRegExpFunc = require("lodash.escapeRegExp"); +import everyFunc = require("lodash.every"); +import findFunc = require("lodash.find"); +import findIndexFunc = require("lodash.findIndex"); +import findKeyFunc = require("lodash.findKey"); +import findLastFunc = require("lodash.findLast"); +import findLastIndexFunc = require("lodash.findLastIndex"); +import findLastKeyFunc = require("lodash.findLastKey"); +import floorFunc = require("lodash.floor"); +import forEachFunc = require("lodash.forEach"); +import forEachRightFunc = require("lodash.forEachRight"); +import forInFunc = require("lodash.forIn"); +import forInRightFunc = require("lodash.forInRight"); +import forOwnFunc = require("lodash.forOwn"); +import forOwnRightFunc = require("lodash.forOwnRight"); +import getFunc = require("lodash.get"); +import gtFunc = require("lodash.gt"); +import gteFunc = require("lodash.gte"); +import hasFunc = require("lodash.has"); +import hasInFunc = require("lodash.hasIn"); +import headFunc = require("lodash.head"); +import identityFunc = require("lodash.identity"); +import includesFunc = require("lodash.includes"); +import indexOfFunc = require("lodash.indexOf"); +import inRangeFunc = require("lodash.inRange"); +import invokeFunc = require("lodash.invoke"); +import isArgumentsFunc = require("lodash.isArguments"); +import isArrayFunc = require("lodash.isArray"); +import isArrayBufferFunc = require("lodash.isArrayBuffer"); +import isArrayLikeFunc = require("lodash.isArrayLike"); +import isArrayLikeObjectFunc = require("lodash.isArrayLikeObject"); +import isBooleanFunc = require("lodash.isBoolean"); +import isBufferFunc = require("lodash.isBuffer"); +import isDateFunc = require("lodash.isDate"); +import isElementFunc = require("lodash.isElement"); +import isEmptyFunc = require("lodash.isEmpty"); +import isEqualFunc = require("lodash.isEqual"); +import isEqualWithFunc = require("lodash.isEqualWith"); +import isErrorFunc = require("lodash.isError"); +import isFiniteFunc = require("lodash.isFinite"); +import isFunctionFunc = require("lodash.isFunction"); +import isIntegerFunc = require("lodash.isInteger"); +import isLengthFunc = require("lodash.isLength"); +import isMapFunc = require("lodash.isMap"); +import isMatchFunc = require("lodash.isMatch"); +import isMatchWithFunc = require("lodash.isMatchWith"); +import isNaNFunc = require("lodash.isNaN"); +import isNativeFunc = require("lodash.isNative"); +import isNilFunc = require("lodash.isNil"); +import isNullFunc = require("lodash.isNull"); +import isNumberFunc = require("lodash.isNumber"); +import isObjectFunc = require("lodash.isObject"); +import isObjectLikeFunc = require("lodash.isObjectLike"); +import isPlainObjectFunc = require("lodash.isPlainObject"); +import isRegExpFunc = require("lodash.isRegExp"); +import isSafeIntegerFunc = require("lodash.isSafeInteger"); +import isSetFunc = require("lodash.isSet"); +import isStringFunc = require("lodash.isString"); +import isSymbolFunc = require("lodash.isSymbol"); +import isTypedArrayFunc = require("lodash.isTypedArray"); +import isUndefinedFunc = require("lodash.isUndefined"); +import isWeakMapFunc = require("lodash.isWeakMap"); +import isWeakSetFunc = require("lodash.isWeakSet"); +import joinFunc = require("lodash.join"); +import kebabCaseFunc = require("lodash.kebabCase"); +import lastFunc = require("lodash.last"); +import lastIndexOfFunc = require("lodash.lastIndexOf"); +import lowerCaseFunc = require("lodash.lowerCase"); +import lowerFirstFunc = require("lodash.lowerFirst"); +import ltFunc = require("lodash.lt"); +import lteFunc = require("lodash.lte"); +import maxFunc = require("lodash.max"); +import maxByFunc = require("lodash.maxBy"); +import meanFunc = require("lodash.mean"); +import minFunc = require("lodash.min"); +import minByFunc = require("lodash.minBy"); +import noConflictFunc = require("lodash.noConflict"); +import noopFunc = require("lodash.noop"); +import nowFunc = require("lodash.now"); +import padFunc = require("lodash.pad"); +import padEndFunc = require("lodash.padEnd"); +import padStartFunc = require("lodash.padStart"); +import parseIntFunc = require("lodash.parseInt"); +import randomFunc = require("lodash.random"); +import reduceFunc = require("lodash.reduce"); +import reduceRightFunc = require("lodash.reduceRight"); +import repeatFunc = require("lodash.repeat"); +import replaceFunc = require("lodash.replace"); +import resultFunc = require("lodash.result"); +import roundFunc = require("lodash.round"); +import runInContextFunc = require("lodash.runInContext"); +import sampleFunc = require("lodash.sample"); +import sizeFunc = require("lodash.size"); +import snakeCaseFunc = require("lodash.snakeCase"); +import someFunc = require("lodash.some"); +import sortedIndexFunc = require("lodash.sortedIndex"); +import sortedIndexByFunc = require("lodash.sortedIndexBy"); +import sortedIndexOfFunc = require("lodash.sortedIndexOf"); +import sortedLastIndexFunc = require("lodash.sortedLastIndex"); +import sortedLastIndexByFunc = require("lodash.sortedLastIndexBy"); +import sortedLastIndexOfFunc = require("lodash.sortedLastIndexOf"); +import startCaseFunc = require("lodash.startCase"); +import startsWithFunc = require("lodash.startsWith"); +import subtractFunc = require("lodash.subtract"); +import sumFunc = require("lodash.sum"); +import sumByFunc = require("lodash.sumBy"); +import templateFunc = require("lodash.template"); +import timesFunc = require("lodash.times"); +import toIntegerFunc = require("lodash.toInteger"); +import toLengthFunc = require("lodash.toLength"); +import toLowerFunc = require("lodash.toLower"); +import toNumberFunc = require("lodash.toNumber"); +import toSafeIntegerFunc = require("lodash.toSafeInteger"); +import toStringFunc = require("lodash.toString"); +import toUpperFunc = require("lodash.toUpper"); +import trimFunc = require("lodash.trim"); +import trimEndFunc = require("lodash.trimEnd"); +import trimStartFunc = require("lodash.trimStart"); +import truncateFunc = require("lodash.truncate"); +import unescapeFunc = require("lodash.unescape"); +import uniqueIdFunc = require("lodash.uniqueId"); +import upperCaseFunc = require("lodash.upperCase"); +import upperFirstFunc = require("lodash.upperFirst"); +import eachFunc = require("lodash.each"); +import eachRightFunc = require("lodash.eachRight"); +import firstFunc = require("lodash.first"); +namespace method_modules_tests { + _.after = afterFunc; + _.ary = aryFunc; + _.assign = assignFunc; + _.assignIn = assignInFunc; + _.assignInWith = assignInWithFunc; + _.assignWith = assignWithFunc; + _.at = atFunc; + _.before = beforeFunc; + _.bind = bindFunc; + _.bindAll = bindAllFunc; + _.bindKey = bindKeyFunc; + _.castArray = castArrayFunc; + _.chain = chainFunc; + _.chunk = chunkFunc; + _.compact = compactFunc; + _.concat = concatFunc; + _.constant = constantFunc; + _.countBy = countByFunc; + _.create = createFunc; + _.curry = curryFunc; + _.curryRight = curryRightFunc; + _.debounce = debounceFunc; + _.defaults = defaultsFunc; + _.defaultsDeep = defaultsDeepFunc; + _.defer = deferFunc; + _.delay = delayFunc; + _.difference = differenceFunc; + _.differenceBy = differenceByFunc; + _.differenceWith = differenceWithFunc; + _.drop = dropFunc; + _.dropRight = dropRightFunc; + _.dropRightWhile = dropRightWhileFunc; + _.dropWhile = dropWhileFunc; + _.fill = fillFunc; + _.filter = filterFunc; + _.flatMap = flatMapFunc; + _.flatten = flattenFunc; + _.flattenDeep = flattenDeepFunc; + _.flattenDepth = flattenDepthFunc; + _.flip = flipFunc; + _.flow = flowFunc; + _.flowRight = flowRightFunc; + _.fromPairs = fromPairsFunc; + _.functions = functionsFunc; + _.functionsIn = functionsInFunc; + _.groupBy = groupByFunc; + _.initial = initialFunc; + _.intersection = intersectionFunc; + _.intersectionBy = intersectionByFunc; + _.intersectionWith = intersectionWithFunc; + _.invert = invertFunc; + _.invertBy = invertByFunc; + _.invokeMap = invokeMapFunc; + _.iteratee = iterateeFunc; + _.keyBy = keyByFunc; + _.keys = keysFunc; + _.keysIn = keysInFunc; + _.map = mapFunc; + _.mapKeys = mapKeysFunc; + _.mapValues = mapValuesFunc; + _.matches = matchesFunc; + _.matchesProperty = matchesPropertyFunc; + _.memoize = memoizeFunc; + _.merge = mergeFunc; + _.mergeWith = mergeWithFunc; + _.method = methodFunc; + _.methodOf = methodOfFunc; + _.mixin = mixinFunc; + _.negate = negateFunc; + _.nthArg = nthArgFunc; + _.omit = omitFunc; + _.omitBy = omitByFunc; + _.once = onceFunc; + _.orderBy = orderByFunc; + _.over = overFunc; + _.overArgs = overArgsFunc; + _.overEvery = overEveryFunc; + _.overSome = overSomeFunc; + _.partial = partialFunc; + _.partialRight = partialRightFunc; + _.partition = partitionFunc; + _.pick = pickFunc; + _.pickBy = pickByFunc; + _.property = propertyFunc; + _.propertyOf = propertyOfFunc; + _.pull = pullFunc; + _.pullAll = pullAllFunc; + _.pullAllBy = pullAllByFunc; + _.pullAt = pullAtFunc; + _.range = rangeFunc; + _.rangeRight = rangeRightFunc; + _.rearg = reargFunc; + _.reject = rejectFunc; + _.remove = removeFunc; + _.rest = restFunc; + _.reverse = reverseFunc; + _.sampleSize = sampleSizeFunc; + _.set = setFunc; + _.setWith = setWithFunc; + _.shuffle = shuffleFunc; + _.slice = sliceFunc; + _.sortBy = sortByFunc; + _.sortedUniq = sortedUniqFunc; + _.sortedUniqBy = sortedUniqByFunc; + _.split = splitFunc; + _.spread = spreadFunc; + _.tail = tailFunc; + _.take = takeFunc; + _.takeRight = takeRightFunc; + _.takeRightWhile = takeRightWhileFunc; + _.takeWhile = takeWhileFunc; + _.tap = tapFunc; + _.throttle = throttleFunc; + _.thru = thruFunc; + _.toArray = toArrayFunc; + _.toPairs = toPairsFunc; + _.toPairsIn = toPairsInFunc; + _.toPath = toPathFunc; + _.toPlainObject = toPlainObjectFunc; + _.transform = transformFunc; + _.unary = unaryFunc; + _.union = unionFunc; + _.unionBy = unionByFunc; + _.unionWith = unionWithFunc; + _.uniq = uniqFunc; + _.uniqBy = uniqByFunc; + _.uniqWith = uniqWithFunc; + _.unset = unsetFunc; + _.unzip = unzipFunc; + _.unzipWith = unzipWithFunc; + _.update = updateFunc; + _.values = valuesFunc; + _.valuesIn = valuesInFunc; + _.without = withoutFunc; + _.words = wordsFunc; + _.wrap = wrapFunc; + _.xor = xorFunc; + _.xorBy = xorByFunc; + _.xorWith = xorWithFunc; + _.zip = zipFunc; + _.zipObject = zipObjectFunc; + _.zipWith = zipWithFunc; + _.extend = extendFunc; + _.extendWith = extendWithFunc; + _.add = addFunc; + _.attempt = attemptFunc; + _.camelCase = camelCaseFunc; + _.capitalize = capitalizeFunc; + _.ceil = ceilFunc; + _.clamp = clampFunc; + _.clone = cloneFunc; + _.cloneDeep = cloneDeepFunc; + _.cloneDeepWith = cloneDeepWithFunc; + _.cloneWith = cloneWithFunc; + _.deburr = deburrFunc; + _.endsWith = endsWithFunc; + _.eq = eqFunc; + _.escape = escapeFunc; + _.escapeRegExp = escapeRegExpFunc; + _.every = everyFunc; + _.find = findFunc; + _.findIndex = findIndexFunc; + _.findKey = findKeyFunc; + _.findLast = findLastFunc; + _.findLastIndex = findLastIndexFunc; + _.findLastKey = findLastKeyFunc; + _.floor = floorFunc; + _.forEach = forEachFunc; + _.forEachRight = forEachRightFunc; + _.forIn = forInFunc; + _.forInRight = forInRightFunc; + _.forOwn = forOwnFunc; + _.forOwnRight = forOwnRightFunc; + _.get = getFunc; + _.gt = gtFunc; + _.gte = gteFunc; + _.has = hasFunc; + _.hasIn = hasInFunc; + _.head = headFunc; + _.identity = identityFunc; + _.includes = includesFunc; + _.indexOf = indexOfFunc; + _.inRange = inRangeFunc; + _.invoke = invokeFunc; + _.isArguments = isArgumentsFunc; + _.isArray = isArrayFunc; + _.isArrayBuffer = isArrayBufferFunc; + _.isArrayLike = isArrayLikeFunc; + _.isArrayLikeObject = isArrayLikeObjectFunc; + _.isBoolean = isBooleanFunc; + _.isBuffer = isBufferFunc; + _.isDate = isDateFunc; + _.isElement = isElementFunc; + _.isEmpty = isEmptyFunc; + _.isEqual = isEqualFunc; + _.isEqualWith = isEqualWithFunc; + _.isError = isErrorFunc; + _.isFinite = isFiniteFunc; + _.isFunction = isFunctionFunc; + _.isInteger = isIntegerFunc; + _.isLength = isLengthFunc; + _.isMap = isMapFunc; + _.isMatch = isMatchFunc; + _.isMatchWith = isMatchWithFunc; + _.isNaN = isNaNFunc; + _.isNative = isNativeFunc; + _.isNil = isNilFunc; + _.isNull = isNullFunc; + _.isNumber = isNumberFunc; + _.isObject = isObjectFunc; + _.isObjectLike = isObjectLikeFunc; + _.isPlainObject = isPlainObjectFunc; + _.isRegExp = isRegExpFunc; + _.isSafeInteger = isSafeIntegerFunc; + _.isSet = isSetFunc; + _.isString = isStringFunc; + _.isSymbol = isSymbolFunc; + _.isTypedArray = isTypedArrayFunc; + _.isUndefined = isUndefinedFunc; + _.isWeakMap = isWeakMapFunc; + _.isWeakSet = isWeakSetFunc; + _.join = joinFunc; + _.kebabCase = kebabCaseFunc; + _.last = lastFunc; + _.lastIndexOf = lastIndexOfFunc; + _.lowerCase = lowerCaseFunc; + _.lowerFirst = lowerFirstFunc; + _.lt = ltFunc; + _.lte = lteFunc; + _.max = maxFunc; + _.maxBy = maxByFunc; + _.mean = meanFunc; + _.min = minFunc; + _.minBy = minByFunc; + _.noConflict = noConflictFunc; + _.noop = noopFunc; + _.now = nowFunc; + _.pad = padFunc; + _.padEnd = padEndFunc; + _.padStart = padStartFunc; + _.parseInt = parseIntFunc; + _.random = randomFunc; + _.reduce = reduceFunc; + _.reduceRight = reduceRightFunc; + _.repeat = repeatFunc; + _.replace = replaceFunc; + _.result = resultFunc; + _.round = roundFunc; + _.runInContext = runInContextFunc; + _.sample = sampleFunc; + _.size = sizeFunc; + _.snakeCase = snakeCaseFunc; + _.some = someFunc; + _.sortedIndex = sortedIndexFunc; + _.sortedIndexBy = sortedIndexByFunc; + _.sortedIndexOf = sortedIndexOfFunc; + _.sortedLastIndex = sortedLastIndexFunc; + _.sortedLastIndexBy = sortedLastIndexByFunc; + _.sortedLastIndexOf = sortedLastIndexOfFunc; + _.startCase = startCaseFunc; + _.startsWith = startsWithFunc; + _.subtract = subtractFunc; + _.sum = sumFunc; + _.sumBy = sumByFunc; + _.template = templateFunc; + _.times = timesFunc; + _.toInteger = toIntegerFunc; + _.toLength = toLengthFunc; + _.toLower = toLowerFunc; + _.toNumber = toNumberFunc; + _.toSafeInteger = toSafeIntegerFunc; + _.toString = toStringFunc; + _.toUpper = toUpperFunc; + _.trim = trimFunc; + _.trimEnd = trimEndFunc; + _.trimStart = trimStartFunc; + _.truncate = truncateFunc; + _.unescape = unescapeFunc; + _.uniqueId = uniqueIdFunc; + _.upperCase = upperCaseFunc; + _.upperFirst = upperFirstFunc; + _.each = eachFunc; + _.eachRight = eachRightFunc; + _.first = firstFunc; +} diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 3bdd09fab4..ebdc7b5d2a 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -355,6 +355,9 @@ declare module _ { */ set(key: string, value: any): _.Dictionary; } + interface MapCacheConstructor { + new (): MapCache; + } interface LoDashWrapperBase { } @@ -384,7 +387,15 @@ declare module _ { unshift(...items: T[]): LoDashImplicitArrayWrapper; } - interface LoDashExplicitArrayWrapper extends LoDashExplicitWrapperBase> { } + interface LoDashExplicitArrayWrapper extends LoDashExplicitWrapperBase> { + pop(): LoDashExplicitObjectWrapper; + push(...items: T[]): LoDashExplicitArrayWrapper; + shift(): LoDashExplicitObjectWrapper; + sort(compareFn?: (a: T, b: T) => number): LoDashExplicitArrayWrapper; + splice(start: number): LoDashExplicitArrayWrapper; + splice(start: number, deleteCount: number, ...items: any[]): LoDashExplicitArrayWrapper; + unshift(...items: T[]): LoDashExplicitArrayWrapper; + } interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper { } @@ -1579,12 +1590,13 @@ declare module _ { * * @param array The array to search. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. + * @param fromIndex The index to search from. * @return Returns the index of the found element, else -1. */ findIndex( array: List, - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): number; /** @@ -1592,7 +1604,8 @@ declare module _ { */ findIndex( array: List, - predicate?: string + predicate?: string, + fromIndex?: number ): number; /** @@ -1600,7 +1613,8 @@ declare module _ { */ findIndex( array: List, - predicate?: W + predicate?: W, + fromIndex?: number ): number; } @@ -1609,21 +1623,24 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): number; /** * @see _.findIndex */ findIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): number; /** * @see _.findIndex */ findIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): number; } @@ -1632,21 +1649,24 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): number; /** * @see _.findIndex */ findIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): number; /** * @see _.findIndex */ findIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): number; } @@ -1655,21 +1675,24 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): LoDashExplicitWrapper; } @@ -1678,21 +1701,24 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): LoDashExplicitWrapper; } @@ -1712,12 +1738,13 @@ declare module _ { * * @param array The array to search. * @param predicate The function invoked per iteration. - * @param thisArg The function invoked per iteration. + * @param fromIndex The index to search from. * @return Returns the index of the found element, else -1. */ findLastIndex( array: List, - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): number; /** @@ -1725,7 +1752,8 @@ declare module _ { */ findLastIndex( array: List, - predicate?: string + predicate?: string, + fromIndex?: number ): number; /** @@ -1733,7 +1761,8 @@ declare module _ { */ findLastIndex( array: List, - predicate?: W + predicate?: W, + fromIndex?: number ): number; } @@ -1742,21 +1771,24 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): number; } @@ -1765,21 +1797,24 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): number; } @@ -1788,21 +1823,24 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): LoDashExplicitWrapper; } @@ -1811,21 +1849,24 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator + predicate?: ListIterator, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string + predicate?: string, + fromIndex?: number ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: W + predicate?: W, + fromIndex?: number ): LoDashExplicitWrapper; } @@ -6883,26 +6924,32 @@ declare module _ { * right to left. * @param collection Searches for a value in this list. * @param callback The function called per iteration. - * @param thisArg The this binding of callback. + * @param fromIndex The index to search from. * @return The found element, else undefined. **/ findLast( collection: Array, - callback: ListIterator): T; + callback: ListIterator, + fromIndex?: number + ): T; /** * @see _.find **/ findLast( collection: List, - callback: ListIterator): T; + callback: ListIterator, + fromIndex?: number + ): T; /** * @see _.find **/ findLast( collection: Dictionary, - callback: DictionaryIterator): T; + callback: DictionaryIterator, + fromIndex?: number + ): T; /** * @see _.find @@ -6910,7 +6957,9 @@ declare module _ { **/ findLast( collection: Array, - whereValue: W): T; + whereValue: W, + fromIndex?: number + ): T; /** * @see _.find @@ -6918,7 +6967,9 @@ declare module _ { **/ findLast( collection: List, - whereValue: W): T; + whereValue: W, + fromIndex?: number + ): T; /** * @see _.find @@ -6926,7 +6977,9 @@ declare module _ { **/ findLast( collection: Dictionary, - whereValue: W): T; + whereValue: W, + fromIndex?: number + ): T; /** * @see _.find @@ -6934,7 +6987,9 @@ declare module _ { **/ findLast( collection: Array, - pluckValue: string): T; + pluckValue: string, + fromIndex?: number + ): T; /** * @see _.find @@ -6942,7 +6997,9 @@ declare module _ { **/ findLast( collection: List, - pluckValue: string): T; + pluckValue: string, + fromIndex?: number + ): T; /** * @see _.find @@ -6950,7 +7007,9 @@ declare module _ { **/ findLast( collection: Dictionary, - pluckValue: string): T; + pluckValue: string, + fromIndex?: number + ): T; } interface LoDashImplicitArrayWrapper { @@ -6958,20 +7017,26 @@ declare module _ { * @see _.findLast */ findLast( - callback: ListIterator): T; + callback: ListIterator, + fromIndex?: number + ): T; /** * @see _.findLast * @param _.where style callback */ findLast( - whereValue: W): T; + whereValue: W, + fromIndex?: number + ): T; /** * @see _.findLast * @param _.where style callback */ findLast( - pluckValue: string): T; + pluckValue: string, + fromIndex?: number + ): T; } //_.flatMap @@ -10403,7 +10468,7 @@ declare module _ { */ memoize: { (func: T, resolver?: Function): T & MemoizedFunction; - Cache: MapCache; + Cache: MapCacheConstructor; } } @@ -18195,6 +18260,34 @@ declare module _ { constant(): LoDashExplicitObjectWrapper<() => TResult>; } + //_.defaultTo + interface LoDashStatic { + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @param value The value to check. + * @param defaultValue The default value. + * @returns Returns the resolved value. + */ + defaultTo(value: T, defaultValue: T): T; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.defaultTo + */ + defaultTo(value: TResult): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.defaultTo + */ + defaultTo(value: TResult): LoDashExplicitObjectWrapper; + } + //_.identity interface LoDashStatic { /** @@ -21020,6 +21113,1835 @@ declare module "lodash" { export = _; } +/************************************************* + * * + * The lodash method _.XXX exported as a module. * + * * + *************************************************/ + + +declare module "lodash.after" { + const after: typeof _.after; + export = after; +} + + +declare module "lodash.ary" { + const ary: typeof _.ary; + export = ary; +} + + +declare module "lodash.assign" { + const assign: typeof _.assign; + export = assign; +} + + +declare module "lodash.assignIn" { + const assignIn: typeof _.assignIn; + export = assignIn; +} + + +declare module "lodash.assignInWith" { + const assignInWith: typeof _.assignInWith; + export = assignInWith; +} + + +declare module "lodash.assignWith" { + const assignWith: typeof _.assignWith; + export = assignWith; +} + + +declare module "lodash.at" { + const at: typeof _.at; + export = at; +} + + +declare module "lodash.before" { + const before: typeof _.before; + export = before; +} + + +declare module "lodash.bind" { + const bind: typeof _.bind; + export = bind; +} + + +declare module "lodash.bindAll" { + const bindAll: typeof _.bindAll; + export = bindAll; +} + + +declare module "lodash.bindKey" { + const bindKey: typeof _.bindKey; + export = bindKey; +} + + +declare module "lodash.castArray" { + const castArray: typeof _.castArray; + export = castArray; +} + + +declare module "lodash.chain" { + const chain: typeof _.chain; + export = chain; +} + + +declare module "lodash.chunk" { + const chunk: typeof _.chunk; + export = chunk; +} + + +declare module "lodash.compact" { + const compact: typeof _.compact; + export = compact; +} + + +declare module "lodash.concat" { + const concat: typeof _.concat; + export = concat; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.cond" { + const cond: typeof _.cond; + export = cond; +} +*/ + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.conforms" { + const conforms: typeof _.conforms; + export = conforms; +} +*/ + +declare module "lodash.constant" { + const constant: typeof _.constant; + export = constant; +} + + +declare module "lodash.countBy" { + const countBy: typeof _.countBy; + export = countBy; +} + + +declare module "lodash.create" { + const create: typeof _.create; + export = create; +} + + +declare module "lodash.curry" { + const curry: typeof _.curry; + export = curry; +} + + +declare module "lodash.curryRight" { + const curryRight: typeof _.curryRight; + export = curryRight; +} + + +declare module "lodash.debounce" { + const debounce: typeof _.debounce; + export = debounce; +} + + +declare module "lodash.defaults" { + const defaults: typeof _.defaults; + export = defaults; +} + + +declare module "lodash.defaultsDeep" { + const defaultsDeep: typeof _.defaultsDeep; + export = defaultsDeep; +} + + +declare module "lodash.defer" { + const defer: typeof _.defer; + export = defer; +} + + +declare module "lodash.delay" { + const delay: typeof _.delay; + export = delay; +} + + +declare module "lodash.difference" { + const difference: typeof _.difference; + export = difference; +} + + +declare module "lodash.differenceBy" { + const differenceBy: typeof _.differenceBy; + export = differenceBy; +} + + +declare module "lodash.differenceWith" { + const differenceWith: typeof _.differenceWith; + export = differenceWith; +} + + +declare module "lodash.drop" { + const drop: typeof _.drop; + export = drop; +} + + +declare module "lodash.dropRight" { + const dropRight: typeof _.dropRight; + export = dropRight; +} + + +declare module "lodash.dropRightWhile" { + const dropRightWhile: typeof _.dropRightWhile; + export = dropRightWhile; +} + + +declare module "lodash.dropWhile" { + const dropWhile: typeof _.dropWhile; + export = dropWhile; +} + + +declare module "lodash.fill" { + const fill: typeof _.fill; + export = fill; +} + + +declare module "lodash.filter" { + const filter: typeof _.filter; + export = filter; +} + + +declare module "lodash.flatMap" { + const flatMap: typeof _.flatMap; + export = flatMap; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.flatMapDeep" { + const flatMapDeep: typeof _.flatMapDeep; + export = flatMapDeep; +} +*/ +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.flatMapDepth" { + const flatMapDepth: typeof _.flatMapDepth; + export = flatMapDepth; +} +*/ + +declare module "lodash.flatten" { + const flatten: typeof _.flatten; + export = flatten; +} + + +declare module "lodash.flattenDeep" { + const flattenDeep: typeof _.flattenDeep; + export = flattenDeep; +} + +declare module "lodash.flattenDepth" { + const flattenDepth: typeof _.flattenDepth; + export = flattenDepth; +} + +declare module "lodash.flip" { + const flip: typeof _.flip; + export = flip; +} + + +declare module "lodash.flow" { + const flow: typeof _.flow; + export = flow; +} + + +declare module "lodash.flowRight" { + const flowRight: typeof _.flowRight; + export = flowRight; +} + + +declare module "lodash.fromPairs" { + const fromPairs: typeof _.fromPairs; + export = fromPairs; +} + + +declare module "lodash.functions" { + const functions: typeof _.functions; + export = functions; +} + + +declare module "lodash.functionsIn" { + const functionsIn: typeof _.functionsIn; + export = functionsIn; +} + + +declare module "lodash.groupBy" { + const groupBy: typeof _.groupBy; + export = groupBy; +} + + +declare module "lodash.initial" { + const initial: typeof _.initial; + export = initial; +} + + +declare module "lodash.intersection" { + const intersection: typeof _.intersection; + export = intersection; +} + + +declare module "lodash.intersectionBy" { + const intersectionBy: typeof _.intersectionBy; + export = intersectionBy; +} + + +declare module "lodash.intersectionWith" { + const intersectionWith: typeof _.intersectionWith; + export = intersectionWith; +} + + +declare module "lodash.invert" { + const invert: typeof _.invert; + export = invert; +} + + +declare module "lodash.invertBy" { + const invertBy: typeof _.invertBy; + export = invertBy; +} + + +declare module "lodash.invokeMap" { + const invokeMap: typeof _.invokeMap; + export = invokeMap; +} + + +declare module "lodash.iteratee" { + const iteratee: typeof _.iteratee; + export = iteratee; +} + + +declare module "lodash.keyBy" { + const keyBy: typeof _.keyBy; + export = keyBy; +} + + +declare module "lodash.keys" { + const keys: typeof _.keys; + export = keys; +} + + +declare module "lodash.keysIn" { + const keysIn: typeof _.keysIn; + export = keysIn; +} + + +declare module "lodash.map" { + const map: typeof _.map; + export = map; +} + + +declare module "lodash.mapKeys" { + const mapKeys: typeof _.mapKeys; + export = mapKeys; +} + + +declare module "lodash.mapValues" { + const mapValues: typeof _.mapValues; + export = mapValues; +} + + +declare module "lodash.matches" { + const matches: typeof _.matches; + export = matches; +} + + +declare module "lodash.matchesProperty" { + const matchesProperty: typeof _.matchesProperty; + export = matchesProperty; +} + + +declare module "lodash.memoize" { + const memoize: typeof _.memoize; + export = memoize; +} + + +declare module "lodash.merge" { + const merge: typeof _.merge; + export = merge; +} + + +declare module "lodash.mergeWith" { + const mergeWith: typeof _.mergeWith; + export = mergeWith; +} + + +declare module "lodash.method" { + const method: typeof _.method; + export = method; +} + + +declare module "lodash.methodOf" { + const methodOf: typeof _.methodOf; + export = methodOf; +} + + +declare module "lodash.mixin" { + const mixin: typeof _.mixin; + export = mixin; +} + + +declare module "lodash.negate" { + const negate: typeof _.negate; + export = negate; +} + + +declare module "lodash.nthArg" { + const nthArg: typeof _.nthArg; + export = nthArg; +} + + +declare module "lodash.omit" { + const omit: typeof _.omit; + export = omit; +} + + +declare module "lodash.omitBy" { + const omitBy: typeof _.omitBy; + export = omitBy; +} + + +declare module "lodash.once" { + const once: typeof _.once; + export = once; +} + + +declare module "lodash.orderBy" { + const orderBy: typeof _.orderBy; + export = orderBy; +} + + +declare module "lodash.over" { + const over: typeof _.over; + export = over; +} + + +declare module "lodash.overArgs" { + const overArgs: typeof _.overArgs; + export = overArgs; +} + + +declare module "lodash.overEvery" { + const overEvery: typeof _.overEvery; + export = overEvery; +} + + +declare module "lodash.overSome" { + const overSome: typeof _.overSome; + export = overSome; +} + + +declare module "lodash.partial" { + const partial: typeof _.partial; + export = partial; +} + + +declare module "lodash.partialRight" { + const partialRight: typeof _.partialRight; + export = partialRight; +} + + +declare module "lodash.partition" { + const partition: typeof _.partition; + export = partition; +} + + +declare module "lodash.pick" { + const pick: typeof _.pick; + export = pick; +} + + +declare module "lodash.pickBy" { + const pickBy: typeof _.pickBy; + export = pickBy; +} + + +declare module "lodash.property" { + const property: typeof _.property; + export = property; +} + + +declare module "lodash.propertyOf" { + const propertyOf: typeof _.propertyOf; + export = propertyOf; +} + + +declare module "lodash.pull" { + const pull: typeof _.pull; + export = pull; +} + + +declare module "lodash.pullAll" { + const pullAll: typeof _.pullAll; + export = pullAll; +} + + +declare module "lodash.pullAllBy" { + const pullAllBy: typeof _.pullAllBy; + export = pullAllBy; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.pullAllWith" { + const pullAllWith: typeof _.pullAllWith; + export = pullAllWith; +} +*/ + +declare module "lodash.pullAt" { + const pullAt: typeof _.pullAt; + export = pullAt; +} + + +declare module "lodash.range" { + const range: typeof _.range; + export = range; +} + + +declare module "lodash.rangeRight" { + const rangeRight: typeof _.rangeRight; + export = rangeRight; +} + + +declare module "lodash.rearg" { + const rearg: typeof _.rearg; + export = rearg; +} + + +declare module "lodash.reject" { + const reject: typeof _.reject; + export = reject; +} + + +declare module "lodash.remove" { + const remove: typeof _.remove; + export = remove; +} + + +declare module "lodash.rest" { + const rest: typeof _.rest; + export = rest; +} + + +declare module "lodash.reverse" { + const reverse: typeof _.reverse; + export = reverse; +} + + +declare module "lodash.sampleSize" { + const sampleSize: typeof _.sampleSize; + export = sampleSize; +} + + +declare module "lodash.set" { + const set: typeof _.set; + export = set; +} + + +declare module "lodash.setWith" { + const setWith: typeof _.setWith; + export = setWith; +} + + +declare module "lodash.shuffle" { + const shuffle: typeof _.shuffle; + export = shuffle; +} + + +declare module "lodash.slice" { + const slice: typeof _.slice; + export = slice; +} + + +declare module "lodash.sortBy" { + const sortBy: typeof _.sortBy; + export = sortBy; +} + + +declare module "lodash.sortedUniq" { + const sortedUniq: typeof _.sortedUniq; + export = sortedUniq; +} + + +declare module "lodash.sortedUniqBy" { + const sortedUniqBy: typeof _.sortedUniqBy; + export = sortedUniqBy; +} + + +declare module "lodash.split" { + const split: typeof _.split; + export = split; +} + + +declare module "lodash.spread" { + const spread: typeof _.spread; + export = spread; +} + + +declare module "lodash.tail" { + const tail: typeof _.tail; + export = tail; +} + + +declare module "lodash.take" { + const take: typeof _.take; + export = take; +} + + +declare module "lodash.takeRight" { + const takeRight: typeof _.takeRight; + export = takeRight; +} + + +declare module "lodash.takeRightWhile" { + const takeRightWhile: typeof _.takeRightWhile; + export = takeRightWhile; +} + + +declare module "lodash.takeWhile" { + const takeWhile: typeof _.takeWhile; + export = takeWhile; +} + + +declare module "lodash.tap" { + const tap: typeof _.tap; + export = tap; +} + + +declare module "lodash.throttle" { + const throttle: typeof _.throttle; + export = throttle; +} + + +declare module "lodash.thru" { + const thru: typeof _.thru; + export = thru; +} + + +declare module "lodash.toArray" { + const toArray: typeof _.toArray; + export = toArray; +} + + +declare module "lodash.toPairs" { + const toPairs: typeof _.toPairs; + export = toPairs; +} + + +declare module "lodash.toPairsIn" { + const toPairsIn: typeof _.toPairsIn; + export = toPairsIn; +} + + +declare module "lodash.toPath" { + const toPath: typeof _.toPath; + export = toPath; +} + + +declare module "lodash.toPlainObject" { + const toPlainObject: typeof _.toPlainObject; + export = toPlainObject; +} + + +declare module "lodash.transform" { + const transform: typeof _.transform; + export = transform; +} + + +declare module "lodash.unary" { + const unary: typeof _.unary; + export = unary; +} + + +declare module "lodash.union" { + const union: typeof _.union; + export = union; +} + + +declare module "lodash.unionBy" { + const unionBy: typeof _.unionBy; + export = unionBy; +} + + +declare module "lodash.unionWith" { + const unionWith: typeof _.unionWith; + export = unionWith; +} + + +declare module "lodash.uniq" { + const uniq: typeof _.uniq; + export = uniq; +} + + +declare module "lodash.uniqBy" { + const uniqBy: typeof _.uniqBy; + export = uniqBy; +} + + +declare module "lodash.uniqWith" { + const uniqWith: typeof _.uniqWith; + export = uniqWith; +} + + +declare module "lodash.unset" { + const unset: typeof _.unset; + export = unset; +} + + +declare module "lodash.unzip" { + const unzip: typeof _.unzip; + export = unzip; +} + + +declare module "lodash.unzipWith" { + const unzipWith: typeof _.unzipWith; + export = unzipWith; +} + + +declare module "lodash.update" { + const update: typeof _.update; + export = update; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.updateWith" { + const updateWith: typeof _.updateWith; + export = updateWith; +} +*/ + +declare module "lodash.values" { + const values: typeof _.values; + export = values; +} + + +declare module "lodash.valuesIn" { + const valuesIn: typeof _.valuesIn; + export = valuesIn; +} + + +declare module "lodash.without" { + const without: typeof _.without; + export = without; +} + + +declare module "lodash.words" { + const words: typeof _.words; + export = words; +} + + +declare module "lodash.wrap" { + const wrap: typeof _.wrap; + export = wrap; +} + + +declare module "lodash.xor" { + const xor: typeof _.xor; + export = xor; +} + + +declare module "lodash.xorBy" { + const xorBy: typeof _.xorBy; + export = xorBy; +} + + +declare module "lodash.xorWith" { + const xorWith: typeof _.xorWith; + export = xorWith; +} + + +declare module "lodash.zip" { + const zip: typeof _.zip; + export = zip; +} + + +declare module "lodash.zipObject" { + const zipObject: typeof _.zipObject; + export = zipObject; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.zipObjectDeep" { + const zipObjectDeep: typeof _.zipObjectDeep; + export = zipObjectDeep; +} +*/ + + +declare module "lodash.zipWith" { + const zipWith: typeof _.zipWith; + export = zipWith; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.entries" { + const entries: typeof _.entries; + export = entries; +} +*/ +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.entriesIn" { + const entriesIn: typeof _.entriesIn; + export = entriesIn; +} +*/ + + +declare module "lodash.extend" { + const extend: typeof _.extend; + export = extend; +} + + +declare module "lodash.extendWith" { + const extendWith: typeof _.extendWith; + export = extendWith; +} + + +declare module "lodash.add" { + const add: typeof _.add; + export = add; +} + + +declare module "lodash.attempt" { + const attempt: typeof _.attempt; + export = attempt; +} + + +declare module "lodash.camelCase" { + const camelCase: typeof _.camelCase; + export = camelCase; +} + + +declare module "lodash.capitalize" { + const capitalize: typeof _.capitalize; + export = capitalize; +} + + +declare module "lodash.ceil" { + const ceil: typeof _.ceil; + export = ceil; +} + + +declare module "lodash.clamp" { + const clamp: typeof _.clamp; + export = clamp; +} + + +declare module "lodash.clone" { + const clone: typeof _.clone; + export = clone; +} + + +declare module "lodash.cloneDeep" { + const cloneDeep: typeof _.cloneDeep; + export = cloneDeep; +} + + +declare module "lodash.cloneDeepWith" { + const cloneDeepWith: typeof _.cloneDeepWith; + export = cloneDeepWith; +} + + +declare module "lodash.cloneWith" { + const cloneWith: typeof _.cloneWith; + export = cloneWith; +} + + +declare module "lodash.deburr" { + const deburr: typeof _.deburr; + export = deburr; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.divide" { + const divide: typeof _.divide; + export = divide; +} +*/ + +declare module "lodash.endsWith" { + const endsWith: typeof _.endsWith; + export = endsWith; +} + + +declare module "lodash.eq" { + const eq: typeof _.eq; + export = eq; +} + + +declare module "lodash.escape" { + const escape: typeof _.escape; + export = escape; +} + + +declare module "lodash.escapeRegExp" { + const escapeRegExp: typeof _.escapeRegExp; + export = escapeRegExp; +} + + +declare module "lodash.every" { + const every: typeof _.every; + export = every; +} + + +declare module "lodash.find" { + const find: typeof _.find; + export = find; +} + + +declare module "lodash.findIndex" { + const findIndex: typeof _.findIndex; + export = findIndex; +} + + +declare module "lodash.findKey" { + const findKey: typeof _.findKey; + export = findKey; +} + + +declare module "lodash.findLast" { + const findLast: typeof _.findLast; + export = findLast; +} + + +declare module "lodash.findLastIndex" { + const findLastIndex: typeof _.findLastIndex; + export = findLastIndex; +} + + +declare module "lodash.findLastKey" { + const findLastKey: typeof _.findLastKey; + export = findLastKey; +} + + +declare module "lodash.floor" { + const floor: typeof _.floor; + export = floor; +} + + +declare module "lodash.forEach" { + const forEach: typeof _.forEach; + export = forEach; +} + + +declare module "lodash.forEachRight" { + const forEachRight: typeof _.forEachRight; + export = forEachRight; +} + + +declare module "lodash.forIn" { + const forIn: typeof _.forIn; + export = forIn; +} + + +declare module "lodash.forInRight" { + const forInRight: typeof _.forInRight; + export = forInRight; +} + + +declare module "lodash.forOwn" { + const forOwn: typeof _.forOwn; + export = forOwn; +} + + +declare module "lodash.forOwnRight" { + const forOwnRight: typeof _.forOwnRight; + export = forOwnRight; +} + + +declare module "lodash.get" { + const get: typeof _.get; + export = get; +} + + +declare module "lodash.gt" { + const gt: typeof _.gt; + export = gt; +} + + +declare module "lodash.gte" { + const gte: typeof _.gte; + export = gte; +} + + +declare module "lodash.has" { + const has: typeof _.has; + export = has; +} + + +declare module "lodash.hasIn" { + const hasIn: typeof _.hasIn; + export = hasIn; +} + + +declare module "lodash.head" { + const head: typeof _.head; + export = head; +} + + +declare module "lodash.identity" { + const identity: typeof _.identity; + export = identity; +} + + +declare module "lodash.includes" { + const includes: typeof _.includes; + export = includes; +} + + +declare module "lodash.indexOf" { + const indexOf: typeof _.indexOf; + export = indexOf; +} + + +declare module "lodash.inRange" { + const inRange: typeof _.inRange; + export = inRange; +} + + +declare module "lodash.invoke" { + const invoke: typeof _.invoke; + export = invoke; +} + + +declare module "lodash.isArguments" { + const isArguments: typeof _.isArguments; + export = isArguments; +} + + +declare module "lodash.isArray" { + const isArray: typeof _.isArray; + export = isArray; +} + + +declare module "lodash.isArrayBuffer" { + const isArrayBuffer: typeof _.isArrayBuffer; + export = isArrayBuffer; +} + + +declare module "lodash.isArrayLike" { + const isArrayLike: typeof _.isArrayLike; + export = isArrayLike; +} + + +declare module "lodash.isArrayLikeObject" { + const isArrayLikeObject: typeof _.isArrayLikeObject; + export = isArrayLikeObject; +} + + +declare module "lodash.isBoolean" { + const isBoolean: typeof _.isBoolean; + export = isBoolean; +} + + +declare module "lodash.isBuffer" { + const isBuffer: typeof _.isBuffer; + export = isBuffer; +} + + +declare module "lodash.isDate" { + const isDate: typeof _.isDate; + export = isDate; +} + + +declare module "lodash.isElement" { + const isElement: typeof _.isElement; + export = isElement; +} + + +declare module "lodash.isEmpty" { + const isEmpty: typeof _.isEmpty; + export = isEmpty; +} + + +declare module "lodash.isEqual" { + const isEqual: typeof _.isEqual; + export = isEqual; +} + + +declare module "lodash.isEqualWith" { + const isEqualWith: typeof _.isEqualWith; + export = isEqualWith; +} + + +declare module "lodash.isError" { + const isError: typeof _.isError; + export = isError; +} + + +declare module "lodash.isFinite" { + const isFinite: typeof _.isFinite; + export = isFinite; +} + + +declare module "lodash.isFunction" { + const isFunction: typeof _.isFunction; + export = isFunction; +} + + +declare module "lodash.isInteger" { + const isInteger: typeof _.isInteger; + export = isInteger; +} + + +declare module "lodash.isLength" { + const isLength: typeof _.isLength; + export = isLength; +} + + +declare module "lodash.isMap" { + const isMap: typeof _.isMap; + export = isMap; +} + + +declare module "lodash.isMatch" { + const isMatch: typeof _.isMatch; + export = isMatch; +} + + +declare module "lodash.isMatchWith" { + const isMatchWith: typeof _.isMatchWith; + export = isMatchWith; +} + + +declare module "lodash.isNaN" { + const isNaN: typeof _.isNaN; + export = isNaN; +} + + +declare module "lodash.isNative" { + const isNative: typeof _.isNative; + export = isNative; +} + + +declare module "lodash.isNil" { + const isNil: typeof _.isNil; + export = isNil; +} + + +declare module "lodash.isNull" { + const isNull: typeof _.isNull; + export = isNull; +} + + +declare module "lodash.isNumber" { + const isNumber: typeof _.isNumber; + export = isNumber; +} + + +declare module "lodash.isObject" { + const isObject: typeof _.isObject; + export = isObject; +} + + +declare module "lodash.isObjectLike" { + const isObjectLike: typeof _.isObjectLike; + export = isObjectLike; +} + + +declare module "lodash.isPlainObject" { + const isPlainObject: typeof _.isPlainObject; + export = isPlainObject; +} + + +declare module "lodash.isRegExp" { + const isRegExp: typeof _.isRegExp; + export = isRegExp; +} + + +declare module "lodash.isSafeInteger" { + const isSafeInteger: typeof _.isSafeInteger; + export = isSafeInteger; +} + + +declare module "lodash.isSet" { + const isSet: typeof _.isSet; + export = isSet; +} + + +declare module "lodash.isString" { + const isString: typeof _.isString; + export = isString; +} + + +declare module "lodash.isSymbol" { + const isSymbol: typeof _.isSymbol; + export = isSymbol; +} + + +declare module "lodash.isTypedArray" { + const isTypedArray: typeof _.isTypedArray; + export = isTypedArray; +} + + +declare module "lodash.isUndefined" { + const isUndefined: typeof _.isUndefined; + export = isUndefined; +} + + +declare module "lodash.isWeakMap" { + const isWeakMap: typeof _.isWeakMap; + export = isWeakMap; +} + + +declare module "lodash.isWeakSet" { + const isWeakSet: typeof _.isWeakSet; + export = isWeakSet; +} + + +declare module "lodash.join" { + const join: typeof _.join; + export = join; +} + + +declare module "lodash.kebabCase" { + const kebabCase: typeof _.kebabCase; + export = kebabCase; +} + + +declare module "lodash.last" { + const last: typeof _.last; + export = last; +} + + +declare module "lodash.lastIndexOf" { + const lastIndexOf: typeof _.lastIndexOf; + export = lastIndexOf; +} + + +declare module "lodash.lowerCase" { + const lowerCase: typeof _.lowerCase; + export = lowerCase; +} + + +declare module "lodash.lowerFirst" { + const lowerFirst: typeof _.lowerFirst; + export = lowerFirst; +} + + +declare module "lodash.lt" { + const lt: typeof _.lt; + export = lt; +} + + +declare module "lodash.lte" { + const lte: typeof _.lte; + export = lte; +} + + +declare module "lodash.max" { + const max: typeof _.max; + export = max; +} + + +declare module "lodash.maxBy" { + const maxBy: typeof _.maxBy; + export = maxBy; +} + + +declare module "lodash.mean" { + const mean: typeof _.mean; + export = mean; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.meanBy" { + const meanBy: typeof _.meanBy; + export = meanBy; +} +*/ + +declare module "lodash.min" { + const min: typeof _.min; + export = min; +} + + +declare module "lodash.minBy" { + const minBy: typeof _.minBy; + export = minBy; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.multiply" { + const multiply: typeof _.multiply; + export = multiply; +} +*/ + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash.nth" { + const nth: typeof _.nth; + export = nth; +} +*/ + +declare module "lodash.noConflict" { + const noConflict: typeof _.noConflict; + export = noConflict; +} + + +declare module "lodash.noop" { + const noop: typeof _.noop; + export = noop; +} + + +declare module "lodash.now" { + const now: typeof _.now; + export = now; +} + + +declare module "lodash.pad" { + const pad: typeof _.pad; + export = pad; +} + + +declare module "lodash.padEnd" { + const padEnd: typeof _.padEnd; + export = padEnd; +} + + +declare module "lodash.padStart" { + const padStart: typeof _.padStart; + export = padStart; +} + + +declare module "lodash.parseInt" { + const parseInt: typeof _.parseInt; + export = parseInt; +} + + +declare module "lodash.random" { + const random: typeof _.random; + export = random; +} + + +declare module "lodash.reduce" { + const reduce: typeof _.reduce; + export = reduce; +} + + +declare module "lodash.reduceRight" { + const reduceRight: typeof _.reduceRight; + export = reduceRight; +} + + +declare module "lodash.repeat" { + const repeat: typeof _.repeat; + export = repeat; +} + + +declare module "lodash.replace" { + const replace: typeof _.replace; + export = replace; +} + + +declare module "lodash.result" { + const result: typeof _.result; + export = result; +} + + +declare module "lodash.round" { + const round: typeof _.round; + export = round; +} + + +declare module "lodash.runInContext" { + const runInContext: typeof _.runInContext; + export = runInContext; +} + + +declare module "lodash.sample" { + const sample: typeof _.sample; + export = sample; +} + + +declare module "lodash.size" { + const size: typeof _.size; + export = size; +} + + +declare module "lodash.snakeCase" { + const snakeCase: typeof _.snakeCase; + export = snakeCase; +} + + +declare module "lodash.some" { + const some: typeof _.some; + export = some; +} + + +declare module "lodash.sortedIndex" { + const sortedIndex: typeof _.sortedIndex; + export = sortedIndex; +} + + +declare module "lodash.sortedIndexBy" { + const sortedIndexBy: typeof _.sortedIndexBy; + export = sortedIndexBy; +} + + +declare module "lodash.sortedIndexOf" { + const sortedIndexOf: typeof _.sortedIndexOf; + export = sortedIndexOf; +} + + +declare module "lodash.sortedLastIndex" { + const sortedLastIndex: typeof _.sortedLastIndex; + export = sortedLastIndex; +} + + +declare module "lodash.sortedLastIndexBy" { + const sortedLastIndexBy: typeof _.sortedLastIndexBy; + export = sortedLastIndexBy; +} + + +declare module "lodash.sortedLastIndexOf" { + const sortedLastIndexOf: typeof _.sortedLastIndexOf; + export = sortedLastIndexOf; +} + + +declare module "lodash.startCase" { + const startCase: typeof _.startCase; + export = startCase; +} + + +declare module "lodash.startsWith" { + const startsWith: typeof _.startsWith; + export = startsWith; +} + + +declare module "lodash.subtract" { + const subtract: typeof _.subtract; + export = subtract; +} + + +declare module "lodash.sum" { + const sum: typeof _.sum; + export = sum; +} + + +declare module "lodash.sumBy" { + const sumBy: typeof _.sumBy; + export = sumBy; +} + + +declare module "lodash.template" { + const template: typeof _.template; + export = template; +} + + +declare module "lodash.times" { + const times: typeof _.times; + export = times; +} + + +declare module "lodash.toInteger" { + const toInteger: typeof _.toInteger; + export = toInteger; +} + + +declare module "lodash.toLength" { + const toLength: typeof _.toLength; + export = toLength; +} + + +declare module "lodash.toLower" { + const toLower: typeof _.toLower; + export = toLower; +} + + +declare module "lodash.toNumber" { + const toNumber: typeof _.toNumber; + export = toNumber; +} + + +declare module "lodash.toSafeInteger" { + const toSafeInteger: typeof _.toSafeInteger; + export = toSafeInteger; +} + + +declare module "lodash.toString" { + const toString: typeof _.toString; + export = toString; +} + + +declare module "lodash.toUpper" { + const toUpper: typeof _.toUpper; + export = toUpper; +} + + +declare module "lodash.trim" { + const trim: typeof _.trim; + export = trim; +} + + +declare module "lodash.trimEnd" { + const trimEnd: typeof _.trimEnd; + export = trimEnd; +} + + +declare module "lodash.trimStart" { + const trimStart: typeof _.trimStart; + export = trimStart; +} + + +declare module "lodash.truncate" { + const truncate: typeof _.truncate; + export = truncate; +} + + +declare module "lodash.unescape" { + const unescape: typeof _.unescape; + export = unescape; +} + + +declare module "lodash.uniqueId" { + const uniqueId: typeof _.uniqueId; + export = uniqueId; +} + + +declare module "lodash.upperCase" { + const upperCase: typeof _.upperCase; + export = upperCase; +} + + +declare module "lodash.upperFirst" { + const upperFirst: typeof _.upperFirst; + export = upperFirst; +} + + +declare module "lodash.each" { + const each: typeof _.each; + export = each; +} + + +declare module "lodash.eachRight" { + const eachRight: typeof _.eachRight; + export = eachRight; +} + + +declare module "lodash.first" { + const first: typeof _.first; + export = first; +} + // Backward compatibility with --target es5 interface Set {} interface Map {} diff --git a/logat/logat-tests.ts b/logat/logat-tests.ts new file mode 100644 index 0000000000..58a7333342 --- /dev/null +++ b/logat/logat-tests.ts @@ -0,0 +1,19 @@ +/// + +import logat = require('logat'); + +logat.on('LogConfigError', function(err: any){ +}) + +logat.error('This is error'); +logat.error( new Error('This is error instance') ); +logat.error( String('object1'), String('object2') ); +logat.warn('This is warn'); +logat.info('This is info'); +logat.debug('This is debug'); + +logat.setOptions( { + logLevel: 4, + logMethod: 1 +}); +logat.getOptions(); diff --git a/logat/logat.d.ts b/logat/logat.d.ts new file mode 100644 index 0000000000..f36adb3dfb --- /dev/null +++ b/logat/logat.d.ts @@ -0,0 +1,26 @@ +// Type definitions for logat 1.x.x +// Project: https://github.com/krvikash35/logat +// Definitions by: Vikash +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'logat'{ + + interface LogOptionsI { + logLevel?: number, + logMethod?: number, + logFileName?: string + } + + class Logger extends NodeJS.EventEmitter { + error(...args: any[]): void; + warn(...args: any[]): void; + info(...args: any[]): void; + debug(...args: any[]): void; + getOptions(): LogOptionsI; + setOptions(options: LogOptionsI): void; + } + + export = new Logger(); +} diff --git a/lowlight/lowlight-tests.ts b/lowlight/lowlight-tests.ts new file mode 100644 index 0000000000..0160093785 --- /dev/null +++ b/lowlight/lowlight-tests.ts @@ -0,0 +1,82 @@ +/// + +import { highlight, highlightAuto, registerLanguage } from 'lowlight'; +import * as core from 'lowlight/lib/core'; + +function highlighter(hljs: any): any { + return { + aliases: ['cmake.in'], + case_insensitive: true, + keywords: { + keyword: + 'forall all exists exist only m M i e 1 2 3 4 5 6 7 8 9 0 - + * / \ % ! . , ; : | lim limsup liminf infinity not' + }, + contains: [ + { + className: 'variable', + begin: '(', end: ')' + }, + ] + }; +} + +registerLanguage('math', highlighter); + +console.log(highlight('typescript', +`class CPP { + private year: number; + public constructor(private version: string) { + this.year = Number(version.match(/.+\d+$/)); + } + + public version(): string { + return this.version; + } +} +` +)); + +console.info(highlightAuto( +`class CPP { + private year: number; + public constructor(private version: string) { + this.year = Number(version.match(/.+\d+$/)); + } + + public version(): string { + return this.version; + } +} +` +)); + +core.registerLanguage('math', highlighter); + +console.log(core.highlight('javascript', +`class CPP { + constructor(version) { + this.version = version; + this.year = Number(version.match(/.+\d+$/)); + } + + version(){ + return this.version; + } +} +` +, { prefix: 'core-' })); + + +console.info(core.highlightAuto( +`class CPP { + constructor(version) { + this.version = version; + this.year = Number(version.match(/.+\d+$/)); + } + + version(){ + return this.version; + } +} +` +, { prefix: 'core-', subset: ['purescript', 'javascript', 'typescript', 'coffeescript'] })); \ No newline at end of file diff --git a/lowlight/lowlight.d.ts b/lowlight/lowlight.d.ts new file mode 100644 index 0000000000..589c9b50fd --- /dev/null +++ b/lowlight/lowlight.d.ts @@ -0,0 +1,99 @@ +// Type definitions for lowlight +// Project: https://github.com/wooorm/lowlight +// Definitions by: Ivo Stratev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'lowlight' { + export { highlight, highlightAuto, registerLanguage } from 'lowlight/lib/core'; +} + +declare module 'lowlight/lib/core' { + export function highlight(language: string, value: string, options?: lowlight.HighlightOptions): lowlight.HighlightResult; + export function highlightAuto(value: string, options?: lowlight.HighlightAutoOptions): lowlight.HighlightAutoResult; + export function registerLanguage(name: string, syntax: Function): void; +} + +declare namespace lowlight { + namespace AST { + namespace Unist { + interface Data { + [index: string]: any; + } + + interface Position { + line: number; + column: number; + offset?: number; + } + + interface Location { + start: Position; + end: Position; + indent?: Array; + } + + export interface Node { + type: string; + data?: Data; + position?: Location; + } + + export interface Parent extends Node { + children: Array; + } + + export interface Text extends Node { + value: string; + } + } + + interface Properties { + [index: string]: any; + } + + export interface Root extends Unist.Parent { + type: 'root'; + } + + export interface Element extends Unist.Parent { + type: 'element'; + tagName: string; + properties: Properties; + } + + export interface Doctype extends Unist.Node { + type: 'doctype'; + name: string; + public?: string; + system?: string; + } + + export interface Comment extends Unist.Text { + type: 'comment'; + } + + export interface Text extends Unist.Text { + type: 'text'; + } + } + + type HastNode = AST.Root | AST.Element | AST.Doctype | AST.Comment | AST.Text; + + interface HighlightOptions { + prefix?: string; + } + + interface HighlightAutoOptions extends HighlightOptions { + subset?: Array; + } + + interface HighlightResult { + relevance: number; + language: string; + value: Array; + } + + interface HighlightAutoResult extends HighlightResult { + secondBest?: HighlightAutoResult; + } +} \ No newline at end of file diff --git a/mapbox-gl/mapbox-gl-0.25.1.d.ts b/mapbox-gl/mapbox-gl-0.25.1.d.ts new file mode 100644 index 0000000000..2ee8d30949 --- /dev/null +++ b/mapbox-gl/mapbox-gl-0.25.1.d.ts @@ -0,0 +1,936 @@ +// Type definitions for Mapbox GL JS v0.24.0 +// Project: https://github.com/mapbox/mapbox-gl-js +// Definitions by: Dominik Bruderer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace mapboxgl { + let accessToken: string; + let version: string; + export function supported(options?: {failIfMajorPerformanceCaveat?: boolean}): boolean; + + /** + * Map + */ + export class Map extends Evented { + constructor(options?: MapboxOptions); + + addControl(control: Control): this; + + addClass(klass: string, options?: mapboxgl.StyleOptions): this; + + removeClass(klass: string, options?: mapboxgl.StyleOptions): this; + + setClasses(klasses: string[], options?: mapboxgl.StyleOptions): this; + + hasClass(klass: string): boolean; + + getClasses(): string[]; + + resize(): this; + + getBounds(): mapboxgl.LngLatBounds; + + setMaxBounds(lnglatbounds?: mapboxgl.LngLatBounds | number[][]): this; + + setMinZoom(minZoom?: number): this; + + setMaxZoom(maxZoom?: number): this; + + project(lnglat: mapboxgl.LngLat | number[]): mapboxgl.Point; + + unproject(point: mapboxgl.Point | number[]): mapboxgl.LngLat; + + queryRenderedFeatures(pointOrBox?: mapboxgl.Point|number[]|mapboxgl.Point[]|number[][], parameters?: {layers?: string[], filter?: any[]}): GeoJSON.Feature[]; + + querySourceFeatures(sourceID: string, parameters: {sourceLayer?: string, filter?: any[]}): GeoJSON.Feature[]; + + setStyle(style: mapboxgl.Style | string): this; + + getStyle(): mapboxgl.Style; + + addSource(id: string, source: VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw): this; + + removeSource(id: string): this; + + getSource(id: string): VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource; + + addLayer(layer: mapboxgl.Layer, before?: string): this; + + removeLayer(id: string): this; + + getLayer(id: string): mapboxgl.Layer; + + setFilter(layer: string, filter: any[]): this; + + setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this; + + getFilter(layer: string): any[]; + + setPaintProperty(layer: string, name: string, value: any, klass?: string): this; + + getPaintProperty(layer: string, name: string, klass?: string): any; + + setLayoutProperty(layer: string, name: string, value: any): this; + + getLayoutProperty(layer: string, name: string, klass?: string): any; + + getContainer(): HTMLElement; + + getCanvasContainer(): HTMLElement; + + getCanvas(): HTMLCanvasElement; + + loaded(): boolean; + + remove(): void; + + onError(): void; + + showTileBoundaries: boolean; + + showCollisionBoxes: boolean; + + repaint: boolean; + + getCenter(): mapboxgl.LngLat; + + setCenter(center: LngLat|number[], eventData?: mapboxgl.EventData): this; + + panBy(offset: number[], options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + panTo(lnglat: mapboxgl.LngLat, options?: mapboxgl.AnimationOptions, eventdata?: mapboxgl.EventData): this; + + getZoom(): number; + + setZoom(zoom: number, eventData?: mapboxgl.EventData): this; + + zoomTo(zoom: number, options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + zoomIn(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + zoomOut(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + getBearing(): number; + + setBearing(bearing: number, eventData?: mapboxgl.EventData): this; + + rotateTo(bearing: number, options?: mapboxgl.AnimationOptions, eventData?: EventData): this; + + resetNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + snapToNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + getPitch(): number; + + setPitch(pitch: number, eventData?: EventData): this; + + fitBounds(bounds: mapboxgl.LngLatBounds | number[][], options?: { linear?: boolean, easing?: Function, padding?: number, offset?: Point|number[],maxZoom?: number }): this; + + jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this; + + easeTo(options: mapboxgl.CameraOptions | mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + flyTo(options: mapboxgl.FlyToOptions, eventData?: mapboxgl.EventData): this; + + stop(): this; + + scrollZoom: ScrollZoomHandler; + + boxZoom: BoxZoomHandler; + + dragRotate: DragRotateHandler; + + dragPan: DragPanHandler; + + keyboard: KeyboardHandler; + + doublClickZoom: DoubleClickZoomHandler; + + touchZoomRotate: TouchZoomRotateHandler; + } + + export interface MapboxOptions { + /** If true, an attribution control will be added to the map. */ + attributionControl?: boolean; + + bearing?: number; + + /** Snap to north threshold in degrees. */ + bearingSnap?: number; + + /** If true, enable the "box zoom" interaction (see BoxZoomHandler) */ + boxZoom?: boolean; + + /** initial map center */ + center?: mapboxgl.LngLat | number[]; + + /** Style class names with which to initialize the map */ + classes?: string[]; + + /** ID of the container element */ + container?: string | Element; + + /** If true, enable the "drag to pan" interaction (see DragPanHandler). */ + dragPan?: boolean; + + /** If true, enable the "drag to rotate" interaction (see DragRotateHandler). */ + dragRotate?: boolean; + + /** If true, enable the "double click to zoom" interaction (see DoubleClickZoomHandler). */ + doubleClickZoom?: boolean; + + /** If true, the map will track and update the page URL according to map position */ + hash?: boolean; + + /** If true, map creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than expected. */ + failIfMayorPerformanceCaveat?: boolean; + + /** If false, no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input */ + interactive?: boolean; + + /** If true, enable keyboard shortcuts (see KeyboardHandler). */ + keyboard?: boolean; + + /** If set, the map is constrained to the given bounds. */ + maxBounds?: mapboxgl.LngLatBounds | number[][]; + + /** Maximum zoom of the map */ + maxZoom?: number; + + /** Minimum zoom of the map */ + minZoom?: number; + + /** If true, The maps canvas can be exported to a PNG using map.getCanvas().toDataURL();. This is false by default as a performance optimization. */ + preserveDrawingBuffer?: boolean; + + pitch?: number; + + /** If true, enable the "scroll to zoom" interaction */ + scrollZoom?: boolean; + + /** stylesheet location */ + style?: mapboxgl.Style | string; + + /** If true, the map will automatically resize when the browser window resizes */ + trackResize?: boolean; + + /** If true, enable the "pinch to rotate and zoom" interaction (see TouchZoomRotateHandler). */ + touchZoomRotate?: boolean; + + /** Initial zoom level */ + zoom?: number; + } + + /** + * BoxZoomHandler + */ + export class BoxZoomHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + isActive(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * ScrollZoomHandler + */ + export class ScrollZoomHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * DragPenHandler + */ + export class DragPanHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + isActive(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * DragRotateHandler + */ + export class DragRotateHandler { + constructor(map: mapboxgl.Map, options?: {bearingSnap?: number, pitchWithRotate?: boolean}); + + isEnabled(): boolean; + + isActive(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * KeyboardHandler + */ + export class KeyboardHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * DoubleClickZoomHandler + */ + export class DoubleClickZoomHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * TouchZoomRotateHandler + */ + export class TouchZoomRotateHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + + disableRotation(): void; + + enableRotation(): void; + } + + /** + * Control + */ + export class Control extends Evented { + addTo(map: mapboxgl.Map): this; + + remove(): this; + } + + /** + * ControlOptions + */ + export interface ControlOptions { + position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; + } + + /** + * Navigation + */ + export class Navigation extends Control { + constructor(options?: mapboxgl.ControlOptions); + } + + /** + * Geolocate + */ + export class Geolocate extends Control { + constructor(options?: mapboxgl.ControlOptions); + } + + /** + * Attribution + */ + export class Attribution extends Control { + constructor(options?: mapboxgl.ControlOptions); + } + + /** + * Scale + */ + export class Scale extends Control { + constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string}) + } + + /** + * Popup + */ + export class Popup extends Evented { + constructor(options?: mapboxgl.PopupOptions); + + addTo(map: mapboxgl.Map): this; + + isOpen(): boolean; + + remove(): this; + + getLngLat(): mapboxgl.LngLat; + + setLngLat(lnglat: mapboxgl.LngLat | number[]): this; + + setText(text: string): this; + + setHTML(html: string): this; + + setDOMContent(htmlNode: Node): this; + } + + export interface PopupOptions { + closeButton?: boolean; + + closeOnClick?: boolean; + + anchor?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; + + offset?: number | Point | number[] | { [key:string]: Point | number[];}; + } + + export interface Style { + bearing?: number; + center?: number[]; + glyphs?: string; + layers?: Layer[]; + metadata?: any; + name?: string; + pitch?: number; + sources?: any; + sprite?: string; + transition?: Transition; + version: number; + zoom?: number; + } + + export interface Transition { + delay?: number; + duration?: number; + } + + export interface Source { + type: "vector" | "raster" | "geojson" | "image" | "video"; + } + + /** + * GeoJSONSource + */ + + export interface GeoJSONSourceRaw extends Source, GeoJSONSourceOptions { + type: "geojson"; + } + + export class GeoJSONSource implements GeoJSONSourceRaw { + type: "geojson"; + + constructor(options?: mapboxgl.GeoJSONSourceOptions); + + setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this; + } + + export interface GeoJSONSourceOptions { + data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string; + + maxzoom?: number; + + buffer?: number; + + tolerance?: number; + + cluster?: number | boolean; + + clusterRadius?: number; + + clusterMaxZoom?: number; + } + + /** + * VideoSource + */ + export class VideoSource implements Source, VideoSourceOptions { + type: "video"; + + constructor(options?: mapboxgl.VideoSourceOptions); + + getVideo(): HTMLVideoElement; + + setCoordinates(coordinates: number[][]): this; + } + + export interface VideoSourceOptions { + urls?: string[]; + + coordinates?: number[][]; + } + + /** + * ImageSource + */ + export class ImageSource implements Source, ImageSourceOptions { + type: "image"; + + constructor(options?: mapboxgl.ImageSourceOptions); + + setCoordinates(coordinates: number[][]): this; + } + + export interface ImageSourceOptions { + url?: string; + + coordinates?: number[][]; + } + + interface VectorSource extends Source { + type: "vector"; + url?: string; + tiles?: string[]; + minzoom?: number; + maxzoom?: number; + } + + interface RasterSource extends Source { + type: "raster"; + url: string; + tiles?: string[]; + minzoom?: number; + maxzoom?: number; + tileSize?: number; + } + + /** + * LngLat + */ + export class LngLat { + lng: number; + lat: number; + + constructor(lng: number, lat: number); + + /** Return a new LngLat object whose longitude is wrapped to the range (-180, 180). */ + wrap(): mapboxgl.LngLat; + + /** Return a LngLat as an array */ + toArray(): number[]; + + /** Return a LngLat as a string */ + toString(): string; + + static convert(input: number[]|mapboxgl.LngLat): mapboxgl.LngLat; + } + + /** + * LngLatBounds + */ + export class LngLatBounds { + sw: LngLat | number[]; + ne: LngLat | number[]; + constructor(sw?: LngLat, ne?: LngLat); + + /** Extend the bounds to include a given LngLat or LngLatBounds. */ + extend(obj: mapboxgl.LngLat | mapboxgl.LngLatBounds): this; + + /** Get the point equidistant from this box's corners */ + getCenter(): mapboxgl.LngLat; + + /** Get southwest corner */ + getSouthWest(): mapboxgl.LngLat; + + /** Get northeast corner */ + getNorthEast(): mapboxgl.LngLat; + + /** Get northwest corner */ + getNorthWest(): mapboxgl.LngLat; + + /** Get southeast corner */ + getSouthEast(): mapboxgl.LngLat; + + /** Get west edge longitude */ + getWest(): number; + + /** Get south edge latitude */ + getSouth(): number; + + /** Get east edge longitude */ + getEast(): number; + + /** Get north edge latitude */ + getNorth(): number; + + /** Returns a LngLatBounds as an array */ + toArray(): number[][]; + + /** Return a LngLatBounds as a string */ + toString(): string; + + /** Convert an array to a LngLatBounds object, or return an existing LngLatBounds object unchanged. */ + static convert(input: mapboxgl.LngLatBounds | number[] | number[][]): mapboxgl.LngLatBounds; + } + + /** + * Point + */ + // Todo: Pull out class to seperate definition for Module "point-geometry" + export class Point { + constructor(options?: Object); + + clone(): Point; + + add(p: number): Point; + + sub(p: number): Point; + + mult(k: number): Point; + + div(k: number): Point; + + rotate(a: number): Point; + + matMult(m: number): Point; + + unit(): Point; + + perp(): Point; + + round(): Point; + + mag(): number; + + equals(): boolean; + + dist(): number; + + distSqr(): number; + + angle(): number; + + angleTo(): number; + + angleWidth(): number; + + angleWidthSep(): number; + } + + export class Marker { + constructor(element?: HTMLElement, options?: { offset?: Point | number[] }); + + addTo(map: Map): this; + + remove(): this; + + getLngLat(): LngLat; + + setLngLat(lngLat: LngLat | number[]): this; + + setPopup(popup?: Popup): this; + + getPopup(): Popup; + + togglePopup(): this; + } + + /** + * Evented + */ + export class Evented { + on(type: string, listener: Function): this; + + off(type?: string | any, listener?: Function): this; + + once(type: string, listener: Function): this; + + fire(type: string, data?: mapboxgl.EventData | Object): this; + + listens(type: string): boolean; + } + + /** + * StyleOptions + */ + export interface StyleOptions { + transition?: boolean; + } + + /** + * EventData + */ + export class EventData { + type: string; + target: Map; + originalEvent: Event; + point: mapboxgl.Point; + lngLat: mapboxgl.LngLat; + } + + export class MapMouseEvent { + type: string; + target: Map; + originalEvent: MouseEvent; + point: mapboxgl.Point; + lngLat: mapboxgl.LngLat; + } + + export class MapTouchEvent { + type: string; + target: Map; + originalEvent: TouchEvent; + point: mapboxgl.Point; + lngLat: mapboxgl.LngLat; + points: Point[]; + lngLats: LngLat[]; + } + + export class MapBoxZoomEvent { + originalEvent: MouseEvent; + boxZoomBounds: LngLatBounds; + } + + /** + * AnimationOptions + */ + export interface AnimationOptions { + /** Number in milliseconds */ + duration?: number; + easing?: Function; + /** point, origin of movement relative to map center */ + offset?: Point | number[]; + /** When set to false, no animation happens */ + animate?: boolean; + } + + /** + * CameraOptions + */ + export interface CameraOptions { + /** Map center */ + center?: mapboxgl.LngLat | number[]; + /** Map zoom level */ + zoom?: number; + /** Map rotation bearing in degrees counter-clockwise from north */ + bearing?: number; + /** Map angle in degrees at which the camera is looking at the ground */ + pitch?: number; + /** If zooming, the zoom center (defaults to map center) */ + around?: mapboxgl.LngLat | number[]; + } + + /** + * FlyToOptions + */ + export interface FlyToOptions extends AnimationOptions, CameraOptions { + curve?: number; + minZoom?: number; + speed?: number; + screenSpeed?: number; + easing?: Function; + } + + /** + * MapEvent + */ + export interface MapEvent { + webglcontextlost?: {originalEvent: WebGLContextEvent}; + webglcontextrestored?: {originalEvent: WebGLContextEvent}; + render?: void; + contextmenu?: {data: mapboxgl.MapMouseEvent}; + dblclick?: {data: mapboxgl.MapMouseEvent}; + click?: {data: mapboxgl.MapMouseEvent}; + touchcancel?: {data: mapboxgl.MapTouchEvent}; + touchmove?: {data: mapboxgl.MapTouchEvent}; + touchend?: {data: mapboxgl.MapTouchEvent}; + touchstart?: {data: mapboxgl.MapTouchEvent}; + mousemove?: {data: mapboxgl.MapMouseEvent}; + mouseup?: {data: mapboxgl.MapMouseEvent}; + mousedown?: {data: mapboxgl.MapMouseEvent}; + moveend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + move?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + movestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + mouseout?:{data: mapboxgl.MapMouseEvent}; + load?: void; + zoomend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + zoom?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + zoomstart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + boxzoomcancel?: {data: mapboxgl.MapBoxZoomEvent}; + boxzoomstart?: {data: mapboxgl.MapBoxZoomEvent}; + boxzoomend?: {data: mapboxgl.MapBoxZoomEvent}; + rotate?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + rotatestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + rotateend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + drag?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + dragend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + pitch?: {data: mapboxgl.EventData}; + } + + export interface Layer { + id: string; + type?: "fill" | "line" | "symbol" | "circle" | "raster" | "background" | string; //TODO: Ideally we wouldn't accept string here, just these specific strings + + metadata?: any; + ref?: string; + + source?: string; + + "source-layer"?: string; + + minzoom?: number; + maxzoom?: number; + + interactive?: boolean; + + filter?: any[]; + layout?: BackgroundLayout | FillLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout; + paint?: BackgroundPaint | FillPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint; + } + + export interface StyleFunction { + stops: any[][]; + property?: string; + base?: number; + type?: "continuous" | "interval" | "categorical"; + } + + export interface BackgroundLayout { + visibility?: "visible" | "none"; + } + export interface BackgroundPaint { + "background-color"?: string; + "background-pattern"?: string; + "background-opacity"?: number; + } + + export interface FillLayout { + visibility?: "visible" | "none"; + } + export interface FillPaint { + "fill-antialias"?: boolean; + "fill-opacity"?: number | StyleFunction; + "fill-color"?: string | StyleFunction; + "fill-outline-color": string | StyleFunction; + "fill-translate"?: number[]; + "fill-translate-anchor"?: "map" | "viewport"; + "fill-pattern"?: "string"; + } + + export interface LineLayout { + visibility?: "visible" | "none"; + + "line-cap"?: "butt" | "round" | "square"; + "line-join"?: "bevel" | "round" | "miter"; + "line-miter-limit"?: number; + "line-round-limit"?: number; + } + export interface LinePaint { + "line-opacity"?: number; + "line-color"?: string| StyleFunction; + "line-translate"?: number[]; + "line-translate-anchor"?: "map" | "viewport"; + "line-width"?: number; + "line-gap-width"?: number; + "line-offset"?: number; + "line-blur"?: number; + "line-dasharray"?: number[]; + "line-dasharray-transition"?: Transition; + "line-pattern"?: string; + } + + export interface SymbolLayout { + visibility?: "visible" | "none"; + + "symbol-placement"?: "point" | "line"; + "symbol-spacing"?: number; + "symbol-avoid-edges"?: boolean; + "icon-allow-overlap"?: boolean; + "icon-ignore-placement"?: boolean; + "icon-optional"?: boolean; + "icon-rotation-alignment"?: "map" | "viewport" | "auto"; + "icon-size"?: number; + "icon-text-fit"?: "none" | "both" | "width" | "height"; + "icon-text-fit-padding"?: number[]; + "icon-image"?: string; + "icon-rotate"?: number | StyleFunction; + "icon-padding"?: number; + "icon-keep-upright"?: boolean; + "icon-offset"?: number[]; + "text-pitch-alignment"?: "map" | "viewport" | "auto"; + "text-rotation-alignment"?: "map" | "viewport" | "auto"; + "text-field"?: string; + "text-font"?: string | string[]; + "text-size"?: number; + "text-max-width"?: number; + "text-line-height"?: number; + "text-letter-spacing"?: number; + "text-justify"?: "left" | "center" | "right"; + "text-anchor"?: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right"; + "text-max-angle"?: number; + "text-rotate"?: number; + "text-padding"?: number; + "text-keep-upright"?: boolean; + "text-transform"?: "none" | "uppercase" | "lowercase"; + "text-offset"?: number[]; + "text-allow-overlap"?: boolean; + "text-ignore-placement"?: boolean; + "text-optional"?: boolean; + + } + export interface SymbolPaint { + "icon-opacity"?: number; + "icon-color"?: string; + "icon-halo-color"?: string; + "icon-halo-width"?: number; + "icon-halo-blur"?: number; + "icon-translate"?: number[]; + "icon-translate-anchor"?: "map" | "viewport"; + "text-opacity"?: number; + "text-color"?: "string"; + "text-halo-color"?: "string"; + "text-halo-width"?: number; + "text-halo-blur"?: number; + "text-translate"?: number[]; + "text-translate-anchor"?: "map" | "viewport"; + } + + export interface RasterLayout { + visibility?: "visible" | "none"; + } + + export interface RasterPaint { + "raster-opacity"?: number; + "raster-hue-rotate"?: number; + "raster-brightness-min"?: number; + "raster-brightness-max"?: number; + "raster-saturation"?: number; + "raster-contrast"?: number; + "raster-fade-duration"?: number; + } + + export interface CircleLayout { + visibility?: "visible" | "none"; + } + + export interface CirclePaint { + "circle-radius"?: number | StyleFunction; + "circle-radius-transition"?: Transition; + "circle-color"?: number | StyleFunction; + "circle-blur"?: number | StyleFunction; + "circle-opacity"?: number | StyleFunction; + "circle-translate"?: number[]; + "circle-translate-anchor"?: "map" | "viewport"; + "circle-pitch-scale"?: "map" | "viewport"; + } +} + +declare module 'mapbox-gl' { + export = mapboxgl; +} diff --git a/mapbox-gl/mapbox-gl.d.ts b/mapbox-gl/mapbox-gl.d.ts index 2ee8d30949..ddb6344cbd 100644 --- a/mapbox-gl/mapbox-gl.d.ts +++ b/mapbox-gl/mapbox-gl.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mapbox GL JS v0.24.0 +// Type definitions for Mapbox GL JS v0.26.0 // Project: https://github.com/mapbox/mapbox-gl-js // Definitions by: Dominik Bruderer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -343,28 +343,28 @@ declare namespace mapboxgl { /** * Navigation */ - export class Navigation extends Control { + export class NavigationControl extends Control { constructor(options?: mapboxgl.ControlOptions); } /** * Geolocate */ - export class Geolocate extends Control { + export class GeolocateControl extends Control { constructor(options?: mapboxgl.ControlOptions); } /** * Attribution */ - export class Attribution extends Control { + export class AttributionControl extends Control { constructor(options?: mapboxgl.ControlOptions); } /** * Scale */ - export class Scale extends Control { + export class ScaleControl extends Control { constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string}) } @@ -697,6 +697,11 @@ declare namespace mapboxgl { boxZoomBounds: LngLatBounds; } + export class MapDataEvent { + type: string; + dataType: "source" | "style" | "tile"; + } + /** * AnimationOptions */ @@ -741,8 +746,12 @@ declare namespace mapboxgl { * MapEvent */ export interface MapEvent { + resize?: void; webglcontextlost?: {originalEvent: WebGLContextEvent}; webglcontextrestored?: {originalEvent: WebGLContextEvent}; + remove?: void; + dataloading?: {data: mapboxgl.MapDataEvent}; + data?: {data: mapboxgl.MapDataEvent}; render?: void; contextmenu?: {data: mapboxgl.MapMouseEvent}; dblclick?: {data: mapboxgl.MapMouseEvent}; @@ -798,7 +807,8 @@ declare namespace mapboxgl { stops: any[][]; property?: string; base?: number; - type?: "continuous" | "interval" | "categorical"; + type?: "identity" | "exponential" | "interval" | "categorical"; + "colorSpace"?: "rgb" | "lab" | "interval"; } export interface BackgroundLayout { @@ -821,6 +831,8 @@ declare namespace mapboxgl { "fill-translate"?: number[]; "fill-translate-anchor"?: "map" | "viewport"; "fill-pattern"?: "string"; + "fill-extrude-height"?: number; + "fill-extrude-base"?: number; } export interface LineLayout { diff --git a/material-ui/legacy/material-ui-0.15.1-tests.tsx b/material-ui/legacy/material-ui-0.15.1-tests.tsx new file mode 100644 index 0000000000..a3cd559123 --- /dev/null +++ b/material-ui/legacy/material-ui-0.15.1-tests.tsx @@ -0,0 +1,4953 @@ +/// +/// +/// +/// + +import * as React from 'react'; +import {Component, PropTypes} from 'react'; +import * as ReactDOM from 'react-dom'; + +import getMuiTheme from 'material-ui/styles/getMuiTheme'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; +import darkBaseTheme from 'material-ui/styles/baseThemes/darkBaseTheme'; +import muiThemeable from 'material-ui/styles/muiThemeable'; +import {MuiTheme} from 'material-ui/styles' + +import AppBar from 'material-ui/AppBar'; +import AutoComplete from 'material-ui/AutoComplete'; +import Avatar from 'material-ui/Avatar'; +import Badge from 'material-ui/Badge'; +import Checkbox from 'material-ui/Checkbox'; +import Chip from 'material-ui/Chip'; +import CircularProgress from 'material-ui/CircularProgress'; +import DatePicker from 'material-ui/DatePicker'; +import Dialog from 'material-ui/Dialog'; +import Divider from 'material-ui/Divider'; +import Drawer from 'material-ui/Drawer'; +import DropDownMenu from 'material-ui/DropDownMenu'; +import FlatButton from 'material-ui/FlatButton'; +import FloatingActionButton from 'material-ui/FloatingActionButton'; +import FontIcon from 'material-ui/FontIcon'; +import IconButton from 'material-ui/IconButton'; +import IconMenu from 'material-ui/IconMenu'; +import LinearProgress from 'material-ui/LinearProgress'; +import List from 'material-ui/List/List'; +import ListItem from 'material-ui/List/ListItem'; +import MenuItem from 'material-ui/MenuItem'; +import Paper from 'material-ui/Paper'; +import RaisedButton from 'material-ui/RaisedButton'; +import RefreshIndicator from 'material-ui/RefreshIndicator'; +import SelectField from 'material-ui/SelectField'; +import Slider from 'material-ui/Slider'; +import Snackbar from 'material-ui/Snackbar'; +import Subheader from 'material-ui/Subheader'; +import SvgIcon from 'material-ui/SvgIcon'; +import TextField from 'material-ui/TextField'; +import TimePicker from 'material-ui/TimePicker'; +import Toggle from 'material-ui/Toggle'; +import {Card, CardActions, CardHeader, CardMedia, CardTitle, CardText} from 'material-ui/Card'; +import {GridList, GridTile} from 'material-ui/GridList'; +import {MakeSelectable} from 'material-ui/List'; +import {Menu} from 'material-ui/Menu'; +import {Popover, PopoverAnimationVertical} from 'material-ui/Popover'; +import {RadioButton, RadioButtonGroup} from 'material-ui/RadioButton'; +import {Step, Stepper, StepLabel, StepContent, StepButton} from 'material-ui/Stepper'; +import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn, TableFooter} from 'material-ui/Table'; +import {Tabs, Tab} from 'material-ui/Tabs'; +import {Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarTitle} from 'material-ui/Toolbar'; + +import ActionAndroid from 'material-ui/svg-icons/action/android'; +import ActionAssignment from 'material-ui/svg-icons/action/assignment'; +import ActionFavorite from 'material-ui/svg-icons/action/favorite'; +import ActionFavoriteBorder from 'material-ui/svg-icons/action/favorite-border'; +import ActionFlightTakeoff from 'material-ui/svg-icons/action/flight-takeoff'; +import ActionGrade from 'material-ui/svg-icons/action/grade'; +import ActionHome from 'material-ui/svg-icons/action/home'; +import ActionInfo from 'material-ui/svg-icons/action/info'; +import ArrowDropRight from 'material-ui/svg-icons/navigation-arrow-drop-right'; +import CommunicationCall from 'material-ui/svg-icons/communication/call'; +import CommunicationChatBubble from 'material-ui/svg-icons/communication/chat-bubble'; +import CommunicationEmail from 'material-ui/svg-icons/communication/email'; +import ContentAdd from 'material-ui/svg-icons/content/add'; +import ContentCopy from 'material-ui/svg-icons/content/content-copy'; +import ContentDrafts from 'material-ui/svg-icons/content/drafts'; +import ContentFilter from 'material-ui/svg-icons/content/filter-list'; +import ContentInbox from 'material-ui/svg-icons/content/inbox'; +import ContentLink from 'material-ui/svg-icons/content/link'; +import ContentSend from 'material-ui/svg-icons/content/send'; +import Delete from 'material-ui/svg-icons/action/delete'; +import Download from 'material-ui/svg-icons/file/file-download'; +import EditorInsertChart from 'material-ui/svg-icons/editor/insert-chart'; +import FileCloudDownload from 'material-ui/svg-icons/file/cloud-download'; +import FileFileDownload from 'material-ui/svg-icons/file/file-download'; +import FileFolder from 'material-ui/svg-icons/file/folder'; +import FolderIcon from 'material-ui/svg-icons/file/folder-open'; +import HardwareVideogameAsset from 'material-ui/svg-icons/hardware/videogame-asset'; +import MapsPersonPin from 'material-ui/svg-icons/maps/person-pin'; +import MapsPlace from 'material-ui/svg-icons/maps/place'; +import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert'; +import NavigationClose from 'material-ui/svg-icons/navigation/close'; +import NavigationExpandMoreIcon from 'material-ui/svg-icons/navigation/expand-more'; +import NotificationsIcon from 'material-ui/svg-icons/social/notifications'; +import PersonAdd from 'material-ui/svg-icons/social/person-add'; +import RemoveRedEye from 'material-ui/svg-icons/image/remove-red-eye'; +import StarBorder from 'material-ui/svg-icons/toggle/star-border'; +import UploadIcon from 'material-ui/svg-icons/file/cloud-upload'; +import WarningIcon from 'material-ui/svg-icons/alert/warning'; + +import {cyan500, cyan700, + grey100, grey300, grey400, grey500, + pinkA200, + white, darkBlack, fullBlack, + blue300, + indigo900, + orange200, + deepOrange300, + pink400, + purple500, + fullWhite, + blue500, red500, greenA200, yellow500, + transparent, yellow600, indigo500, lightBlack, + orange500, +} from 'material-ui/styles/colors'; +import {fade} from 'material-ui/utils/colorManipulator'; + +import {SMALL, MEDIUM, LARGE, default as withWidth} from 'material-ui/utils/withWidth'; + + +import injectTapEventPlugin = require('react-tap-event-plugin'); + +// Needed for onTouchTap +// Check this repo: +// https://github.com/zilverline/react-tap-event-plugin +injectTapEventPlugin(); + +function handleTouchTap() { + alert('onTouchTap triggered on the title component'); +} + +const styles = { + title: { + cursor: 'pointer', + }, + exampleImageInput: { + cursor: 'pointer', + position: 'absolute', + top: 0, + bottom: 0, + right: 0, + left: 0, + width: '100%', + opacity: 0, + }, + button: { + margin: 12, + }, + chip: { + margin: 4 + }, + smallIcon: { + width: 36, + height: 36, + }, + mediumIcon: { + width: 48, + height: 48, + }, + largeIcon: { + width: 60, + height: 60, + }, + small: { + width: 72, + height: 72, + padding: 16, + }, + medium: { + width: 96, + height: 96, + padding: 24, + }, + large: { + width: 120, + height: 120, + padding: 30, + }, + radioButton: { + marginTop: 16, + }, + root: { + display: 'flex', + flexWrap: 'wrap', + justifyContent: 'space-around', + }, + gridList: { + width: 500, + height: 500, + overflowY: 'auto', + marginBottom: 24, + }, + paper: { + display: 'inline-block', + float: 'left', + margin: '16px 32px 16px 0', + }, + rightIcon: { + textAlign: 'center', + lineHeight: '24px', + }, + customWidth: { + width: 200, + }, + h3: { + marginTop: 20, + fontWeight: 400, + }, + block: { + display: 'flex', + maxWidth: 250, + }, + block2: { + margin: 10, + }, + container: { + position: 'relative', + }, + refresh: { + display: 'inline-block', + position: 'relative', + }, + checkbox: { + marginBottom: 16, + }, + toggle: { + marginBottom: 16, + }, + propContainer: { + width: 200, + overflow: 'hidden', + margin: '20px auto 0', + }, + propToggleHeader: { + margin: '20px auto 10px', + }, + headline: { + fontSize: 24, + paddingTop: 16, + marginBottom: 12, + fontWeight: 400, + }, + errorStyle: { + color: orange500, + }, + underlineStyle: { + borderColor: orange500, + }, + floatingLabelStyle: { + color: orange500, + }, + floatingLabelFocusStyle: { + color: blue500, + }, +}; + +const style = { + marginRight: 20, + marginLeft: 20, + display: 'inline-block', + margin: '16px 32px 16px 0', +}; + +const customContentStyle = { + width: '100%', + maxWidth: 'none', +}; + +const iconStyles = { + marginRight: 24, +}; + +// "http://www.material-ui.com/#/customization/themes" + +// This replaces the textColor value on the palette +// and then update the keys for each component that depends on it. +// More on Colors: http://www.material-ui.com/#/customization/colors +const muiTheme = getMuiTheme({ + palette: { + textColor: cyan500, + }, + appBar: { + height: 50, + }, +}); + +const darkMuiTheme = getMuiTheme(darkBaseTheme); + +const lightBaseTheme = { + spacing: { + iconSize: 24, + desktopGutter: 24, + desktopGutterMore: 32, + desktopGutterLess: 16, + desktopGutterMini: 8, + desktopKeylineIncrement: 64, + desktopDropDownMenuItemHeight: 32, + desktopDropDownMenuFontSize: 15, + desktopDrawerMenuItemHeight: 48, + desktopSubheaderHeight: 48, + desktopToolbarHeight: 56, + }, + fontFamily: 'Roboto, sans-serif', + palette: { + primary1Color: cyan500, + primary2Color: cyan700, + primary3Color: grey400, + accent1Color: pinkA200, + accent2Color: grey100, + accent3Color: grey500, + textColor: darkBlack, + alternateTextColor: white, + canvasColor: white, + borderColor: grey300, + disabledColor: fade(darkBlack, 0.3), + pickerHeaderColor: cyan500, + clockCircleColor: fade(darkBlack, 0.07), + shadowColor: fullBlack, + }, +}; + +const lightMuiTheme = getMuiTheme(lightBaseTheme); + + +class DeepDownTheTree extends React.Component<{} & {muiTheme: MuiTheme}, {}> { + static propTypes: React.ValidationMap = { + muiTheme: React.PropTypes.object.isRequired, + }; + + render() { + return ( + + Hello World! + + ); + } +} + + +// "http://www.material-ui.com/#/customization/inline-styles" +const InlineStylesCheckbox = () => ( + +); + + +// "http://www.material-ui.com/#/components/app-bar" +const AppBarExampleIcon = () => ( + +); + +const AppBarExampleIconButton = () => ( + Title} + onTitleTouchTap={handleTouchTap} + iconElementLeft={} + iconElementRight={} + /> +); + +const AppBarExampleIconMenu = () => ( + } + iconElementRight={ + + } + targetOrigin={{horizontal: 'right', vertical: 'top'}} + anchorOrigin={{horizontal: 'right', vertical: 'top'}} + > + + + + + } + /> +); + +// "http://www.material-ui.com/#/components/auto-complete" +export class AutoCompleteExampleSimple extends React.Component<{}, {dataSource: string[]}> { + + constructor(props) { + super(props); + + this.state = { + dataSource: [], + }; + } + + handleUpdateInput = (value) => { + this.setState({ + dataSource: [ + value, + value + value, + value + value + value, + ], + }); + }; + + render() { + return ( +
+ + +
+ ); + } +} + +const dataSource1 = [ + { + text: 'text-value1', + value: ( + + ), + }, + { + text: 'text-value2', + value: ( + + ), + }, +]; + +const dataSource2 = ['12345', '23456', '34567']; + +const dataSource3 = [ + {text: 'Some Text', value: 'someFirstValue'}, + {text: 'Some Text', value: 'someSecondValue'}, +]; + +const AutoCompleteExampleNoFilter = () => ( +
+
+
+ +
+); + +const colors = [ + 'Red', + 'Orange', + 'Yellow', + 'Green', + 'Blue', + 'Purple', + 'Black', + 'White', +]; + +const fruit = [ + 'Apple', 'Apricot', 'Avocado', + 'Banana', 'Bilberry', 'Blackberry', 'Blackcurrant', 'Blueberry', + 'Boysenberry', 'Blood Orange', + 'Cantaloupe', 'Currant', 'Cherry', 'Cherimoya', 'Cloudberry', + 'Coconut', 'Cranberry', 'Clementine', + 'Damson', 'Date', 'Dragonfruit', 'Durian', + 'Elderberry', + 'Feijoa', 'Fig', + 'Goji berry', 'Gooseberry', 'Grape', 'Grapefruit', 'Guava', + 'Honeydew', 'Huckleberry', + 'Jabouticaba', 'Jackfruit', 'Jambul', 'Jujube', 'Juniper berry', + 'Kiwi fruit', 'Kumquat', + 'Lemon', 'Lime', 'Loquat', 'Lychee', + 'Nectarine', + 'Mango', 'Marion berry', 'Melon', 'Miracle fruit', 'Mulberry', 'Mandarine', + 'Olive', 'Orange', + 'Papaya', 'Passionfruit', 'Peach', 'Pear', 'Persimmon', 'Physalis', 'Plum', 'Pineapple', + 'Pumpkin', 'Pomegranate', 'Pomelo', 'Purple Mangosteen', + 'Quince', + 'Raspberry', 'Raisin', 'Rambutan', 'Redcurrant', + 'Salal berry', 'Satsuma', 'Star fruit', 'Strawberry', 'Squash', 'Salmonberry', + 'Tamarillo', 'Tamarind', 'Tomato', 'Tangerine', + 'Ugli fruit', + 'Watermelon', +]; + +const AutoCompleteExampleFilters = () => ( +
+ +
+ +
+); + +// "http://www.material-ui.com/#/components/avatar" +const AvatarExampleSimple = () => ( + + + } + > + Image Avatar + + + } + > + Image Avatar with custom size + + } /> + } + > + FontIcon Avatar + + } + color={blue300} + backgroundColor={indigo900} + size={30} + style={style} + /> + } + > + FontIcon Avatar with custom colors and size + + } /> + } + > + SvgIcon Avatar + + } + color={orange200} + backgroundColor={pink400} + size={30} + style={style} + /> + } + > + SvgIcon Avatar with custom colors and size + + A} + > + Letter Avatar + + + A + + } + > + Letter Avatar with custom colors and size + + +); + + +// "http://www.material-ui.com/#/components/badge" +const BadgeExampleSimple = () => ( +
+ + + + + + + + +
+); + +const BadgeExampleContent = () => ( +
+ } + > + + + + Company Name + +
+); + + +// "http://www.material-ui.com/#/components/flat-button" +const FlatButtonExampleSimple = () => ( +
+ + + + +
+); + +const FlatButtonExampleComplex = () => ( +
+ + + + + Label before} + labelPosition="before" + primary={true} + style={styles.button} + icon={} + /> + + } + /> + +
+); + +const FlatButtonExampleIcon = () => ( +
+ } + style={style} + /> + } + style={style} + /> + } + style={style} + /> +
+); + + +// "http://www.material-ui.com/#/components/raised-button" +const RaisedButtonExampleSimple = () => ( +
+ + + + +
+); + +const RaisedButtonExampleComplex = () => ( +
+ + + + Label before} + labelPosition="before" + primary={true} + icon={} + style={styles.button} + /> + } + /> +
+); + +const RaisedButtonExampleIcon = () => ( +
+ } + style={style} + /> + } + style={style} + /> + } + style={style} + /> +
+); + + +// "http://www.material-ui.com/#/components/floating-action-button" +const FloatingActionButtonExampleSimple = () => ( +
+ + + + + + + + + + + + + + + + + + + + + + + +
+); + + +// "http://www.material-ui.com/#/components/icon-button" +const IconButtonExampleSimple = () => ( +
+ + +
+); + +const IconButtonExampleComplex = () => ( +
+ + + + + + + + + + home + +
+); + +const IconButtonExampleSize = () => ( +
+ + + + + + + + + + + + + + + +
+); + +const IconButtonExampleTooltip = () => ( +
+ + + + + + +
+); + +const IconButtonExampleTouch = () => ( +
+ + + + + + + + + + + + + + + + + + +
+); + + +// "http://www.material-ui.com/#/components/card" +const CardExampleWithAvatar = () => ( + + + } + > + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa. Aliquam erat volutpat. Nulla facilisi. + Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + +); + +const CardExampleWithoutAvatar = () => ( + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa. Aliquam erat volutpat. Nulla facilisi. + Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + +); + +class CardExampleControlled extends React.Component<{}, {expanded: boolean}> { + + constructor(props) { + super(props); + this.state = { + expanded: false, + }; + } + + handleExpandChange = (expanded) => { + this.setState({expanded: expanded}); + }; + + handleToggle = (event, toggle) => { + this.setState({expanded: toggle}); + }; + + handleExpand = () => { + this.setState({expanded: true}); + }; + + handleReduce = () => { + this.setState({expanded: false}); + }; + + render() { + return ( + + + + + + } + > + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Donec mattis pretium massa. Aliquam erat volutpat. Nulla facilisi. + Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque. + Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + + + + + + ); + } +} + +// "http://www.material-ui.com/#/components/chip" +const ChipExampleSimple = () => ( +
+ Basic Chip + Blue Background + Blue Label Color + UI Avatar + Styled +
+); + +class ChipExampleComplex extends React.Component<{}, {}>{ + handleRequestDelete = () => { + alert('You clicked the delete button.'); + } + + handleTouchTap = () => { + alert('You clicked the Chip.'); + } + + render() { + return ( +
+ Click Me +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/date-picker" +const DatePickerExampleSimple = () => ( +
+ + + +
+); + +const DatePickerExampleInline = () => ( +
+ + +
+); + +const optionsStyle = { + maxWidth: 255, + marginRight: 'auto', +}; + +interface DatePickerExampleToggleState { + minDate?: Date; + maxDate?: Date; + autoOk?: boolean; + disableYearSelection?: boolean; +} + +class DatePickerExampleToggle extends React.Component<{}, DatePickerExampleToggleState> { + constructor(props) { + super(props); + + const minDate = new Date(); + const maxDate = new Date(); + minDate.setFullYear(minDate.getFullYear() - 1); + minDate.setHours(0, 0, 0, 0); + maxDate.setFullYear(maxDate.getFullYear() + 1); + maxDate.setHours(0, 0, 0, 0); + + this.state = { + minDate: minDate, + maxDate: maxDate, + autoOk: false, + disableYearSelection: false, + }; + } + + handleChangeMinDate = (event, date) => { + this.setState({ + minDate: date, + }); + }; + + handleChangeMaxDate = (event, date) => { + this.setState({ + maxDate: date, + }); + }; + + handleToggle = (event, toggled) => { + this.setState({ + [event.target.name]: toggled, + }); + }; + + render() { + return ( +
+ +
+ + + + +
+
+ ); + } +} + +class DatePickerExampleControlled extends React.Component<{}, {controlledDate?: Date}> { + + constructor(props) { + super(props); + + this.state = { + controlledDate: null, + }; + } + + handleChange = (event, date) => { + this.setState({ + controlledDate: date, + }); + }; + + render() { + return ( + + ); + } +} + +function disableWeekends(date) { + return date.getDay() === 0 || date.getDay() === 6; +} +function disableRandomDates() { + return Math.random() > 0.7; +} +const DatePickerExampleDisableDates = () => ( +
+ + +
+); + +let DateTimeFormat = new Intl.DateTimeFormat('fr'); +const DatePickerExampleInternational = () => ( +
+ + + +
+); + + + +// "http://material-ui.com/#/components/dialog" +class DialogExampleSimple extends React.Component<{}, {open?: boolean}> { + state = { + open: false, + }; + + handleOpen = () => { + this.setState({open: true}); + }; + + handleClose = () => { + this.setState({open: false}); + }; + + render() { + const actions = [ + , + , + ]; + + return ( +
+ + + The actions in this window were passed in as an array of React objects. + +
+ ); + } +} + +class DialogExampleModal extends React.Component<{}, {open?: boolean}> { + state = { + open: false, + }; + + handleOpen = () => { + this.setState({open: true}); + }; + + handleClose = () => { + this.setState({open: false}); + }; + + render() { + const actions = [ + , + , + ]; + + return ( +
+ + + Only actions can close this dialog. + +
+ ); + } +} + +class DialogExampleCustomWidth extends React.Component<{}, {open?: boolean}> { + state = { + open: false, + }; + + handleOpen = () => { + this.setState({open: true}); + }; + + handleClose = () => { + this.setState({open: false}); + }; + + render() { + const actions = [ + , + , + ]; + + return ( +
+ + + This dialog spans the entire width of the screen. + +
+ ); + } +} + +class DialogExampleDialogDatePicker extends React.Component<{}, {open?: boolean}> { + state = { + open: false, + }; + + handleOpen = () => { + this.setState({open: true}); + }; + + handleClose = () => { + this.setState({open: false}); + }; + + render() { + const actions = [ + , + ]; + + return ( +
+ + + Open a Date Picker dialog from within a dialog. + + +
+ ); + } +} + +class DialogExampleScrollable extends React.Component<{}, {open?: boolean}> { + state = { + open: false, + }; + + handleOpen = () => { + this.setState({open: true}); + }; + + handleClose = () => { + this.setState({open: false}); + }; + + render() { + const actions = [ + , + , + ]; + + const radios = []; + for (let i = 0; i < 30; i++) { + radios.push( + + ); + } + + return ( +
+ + + + {radios} + + +
+ ); + } +} + +class DialogExampleAlert extends React.Component<{}, {open?: boolean}> { + state = { + open: false, + }; + + handleOpen = () => { + this.setState({open: true}); + }; + + handleClose = () => { + this.setState({open: false}); + }; + + render() { + const actions = [ + , + , + ]; + + return ( +
+ + + Discard draft? + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/divider" +const DividerExampleForm = () => ( + + + + + + + + + + +); + +const DividerExampleList = () => ( + + + + + + + + + + + +); + +const DividerExampleMenu = () => ( + + + + + + +); + + +// "http://www.material-ui.com/#/components/drawer" +class DrawerSimpleExample extends React.Component<{}, {open?: boolean}> { + + constructor(props) { + super(props); + this.state = {open: false}; + } + + handleToggle = () => this.setState({open: !this.state.open}); + + render() { + return ( +
+ + + Menu Item + Menu Item 2 + +
+ ); + } +} + +class DrawerUndockedExample extends React.Component<{}, {open?: boolean}> { + + constructor(props) { + super(props); + this.state = {open: false}; + } + + handleToggle = () => this.setState({open: !this.state.open}); + + handleClose = () => this.setState({open: false}); + + render() { + return ( +
+ + this.setState({open})} + > + Menu Item + Menu Item 2 + +
+ ); + } +} + +class DrawerOpenRightExample extends React.Component<{}, {open?: boolean}> { + + constructor(props) { + super(props); + this.state = {open: false}; + } + + handleToggle = () => this.setState({open: !this.state.open}); + + render() { + return ( +
+ + + + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/grid-list" +const tilesData: {img: string, title: string, author: string, featured?: boolean}[] = [ + { + img: 'images/grid-list/00-52-29-429_640.jpg', + title: 'Breakfast', + author: 'jill111', + featured: true, + }, + { + img: 'images/grid-list/burger-827309_640.jpg', + title: 'Tasty burger', + author: 'pashminu', + }, + { + img: 'images/grid-list/camera-813814_640.jpg', + title: 'Camera', + author: 'Danson67', + }, + { + img: 'images/grid-list/morning-819362_640.jpg', + title: 'Morning', + author: 'fancycrave1', + }, + { + img: 'images/grid-list/hats-829509_640.jpg', + title: 'Hats', + author: 'Hans', + }, + { + img: 'images/grid-list/honey-823614_640.jpg', + title: 'Honey', + author: 'fancycravel', + }, + { + img: 'images/grid-list/vegetables-790022_640.jpg', + title: 'Vegetables', + author: 'jill111', + }, + { + img: 'images/grid-list/water-plant-821293_640.jpg', + title: 'Water plant', + author: 'BkrmadtyaKarki', + }, +]; + +const GridListExampleSimple = () => ( +
+ + December + {tilesData.map((tile) => ( + by {tile.author}} + actionIcon={} + > + + + ))} + +
+); + +const GridListExampleComplex = () => ( +
+ + {tilesData.map((tile) => ( + } + actionPosition="left" + titlePosition="top" + titleBackground="linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%)" + cols={tile.featured ? 2 : 1} + rows={tile.featured ? 2 : 1} + > + + + ))} + +
+); + + +// "http://www.material-ui.com/#/components/font-icon" +const FontIconExampleSimple = () => ( +
+ + + + + +
+); + +const FontIconExampleIcons = () => ( +
+ home + flight_takeoff + cloud_download + videogame_asset +
+); + + +// "http://www.material-ui.com/#/components/svg-icon" +const HomeIcon = (props) => ( + + + +); + +const SvgIconExampleSimple = () => ( +
+ + + +
+); + +const SvgIconExampleIcons = () => ( +
+ + + + +
+); + + +// "http://material-ui.com/#/components/lists" +const ListExampleSimple = () => ( + + + } /> + } /> + } /> + } /> + } /> + + + + } /> + } /> + } /> + } /> + + +); + +const ListExampleChat = () => ( + + + Recent chats + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + } + rightIcon={} + /> + + + + Previous chats + } + /> + } + /> + + +); + +const ListExampleContacts = () => ( + + + } + rightAvatar={} + /> + } + /> + } + /> + } + /> + + + + + A + + } + rightAvatar={} + /> + } + /> + } + /> + } + /> + + +); + +const ListExampleFolder = () => ( + + + Folders + } />} + rightIcon={} + primaryText="Photos" + secondaryText="Jan 9, 2014" + /> + } />} + rightIcon={} + primaryText="Recipes" + secondaryText="Jan 17, 2014" + /> + } />} + rightIcon={} + primaryText="Work" + secondaryText="Jan 28, 2014" + /> + + + + Files + } backgroundColor={blue500} />} + rightIcon={} + primaryText="Vacation itinerary" + secondaryText="Jan 20, 2014" + /> + } backgroundColor={yellow600} />} + rightIcon={} + primaryText="Kitchen remodel" + secondaryText="Jan 10, 2014" + /> + + +); + +const ListExampleNested = () => ( + + + Nested List Items + } /> + } /> + } + initiallyOpen={true} + primaryTogglesNestedList={true} + nestedItems={[ + } + />, + } + disabled={true} + nestedItems={[ + } />, + ]} + />, + ]} + /> + + +); + +const ListExampleSettings = () => ( +
+ + + General + + + + + + Hangout Notifications + } + primaryText="Notifications" + secondaryText="Allow notifications" + /> + } + primaryText="Sounds" + secondaryText="Hangouts message" + /> + } + primaryText="Video sounds" + secondaryText="Hangouts video call" + /> + + + + + + + + + Priority Interruptions + } /> + } /> + } /> + + + + Hangout Notifications + } /> + } /> + } /> + + +
+); + +const ListExamplePhone = () => ( + + + } + rightIcon={} + primaryText="(650) 555 - 1234" + secondaryText="Mobile" + /> + } + primaryText="(323) 555 - 6789" + secondaryText="Work" + /> + + + + } + primaryText="aliconnors@example.com" + secondaryText="Personal" + /> + + + +); + +const iconButtonElement = ( + + + +); + +const rightIconMenu = ( + + Reply + Forward + Delete + +); + +const ListExampleMessages = () => ( +
+ + + Today + } + primaryText="Brunch this weekend?" + secondaryText={ +

+ Brendan Lim -- + I'll be in your neighborhood doing errands this weekend. Do you want to grab brunch? +

+ } + secondaryTextLines={2} + /> + + } + primaryText={ +

Summer BBQ  4

+ } + secondaryText={ +

+ to me, Scott, Jennifer -- + Wish I could come, but I'm out of town this weekend. +

+ } + secondaryTextLines={2} + /> + + } + primaryText="Oui oui" + secondaryText={ +

+ Grace Ng -- + Do you have Paris recommendations? Have you ever been? +

+ } + secondaryTextLines={2} + /> + + } + primaryText="Birdthday gift" + secondaryText={ +

+ Kerem Suer -- + Do you have any ideas what we can get Heidi for her birthday? How about a pony? +

+ } + secondaryTextLines={2} + /> + + } + primaryText="Recipe to try" + secondaryText={ +

+ Raquel Parrado -- + We should eat this: grated squash. Corn and tomatillo tacos. +

+ } + secondaryTextLines={2} + /> +
+
+ + + Today + } + rightIconButton={rightIconMenu} + primaryText="Brendan Lim" + secondaryText={ +

+ Brunch this weekend?
+ I'll be in your neighborhood doing errands this weekend. Do you want to grab brunch? +

+ } + secondaryTextLines={2} + /> + + } + rightIconButton={rightIconMenu} + primaryText="me, Scott, Jennifer" + secondaryText={ +

+ Summer BBQ
+ Wish I could come, but I'm out of town this weekend. +

+ } + secondaryTextLines={2} + /> + + } + rightIconButton={rightIconMenu} + primaryText="Grace Ng" + secondaryText={ +

+ Oui oui
+ Do you have any Paris recs? Have you ever been? +

+ } + secondaryTextLines={2} + /> + + } + rightIconButton={rightIconMenu} + primaryText="Kerem Suer" + secondaryText={ +

+ Birthday gift
+ Do you have any ideas what we can get Heidi for her birthday? How about a pony? +

+ } + secondaryTextLines={2} + /> + + } + rightIconButton={rightIconMenu} + primaryText="Raquel Parrado" + secondaryText={ +

+ Recipe to try
+ We should eat this: grated squash. Corn and tomatillo tacos. +

+ } + secondaryTextLines={2} + /> +
+
+
+); + +function wrapState(ComposedComponent: React.ComponentClass<__MaterialUI.List.SelectableProps>) { + return class SelectableList extends Component<{defaultValue: number}, {selectedIndex: number}> { + static propTypes = { + children: PropTypes.node.isRequired, + defaultValue: PropTypes.number.isRequired, + }; + + componentWillMount() { + this.setState({ + selectedIndex: this.props.defaultValue, + }); + } + + handleRequestChange = (event, index) => { + this.setState({ + selectedIndex: index, + }); + }; + + render() { + return ( + + {this.props.children} + + ); + } + }; +} + +let SelectableList = wrapState(MakeSelectable(List)); + +const ListExampleSelectable = () => ( + + + Selectable Contacts + } + nestedItems={[ + } + />, + ]} + /> + } + /> + } + /> + } + /> + + +); + + +// "http://www.material-ui.com/#/components/menu" +const MenuExampleSimple = () => ( +
+ + + + + + + + + + + + + + + + +
+); + +const MenuExampleDisable = () => ( +
+ + + + + + + + + + + + + + + + + + + + +
+); + +const MenuExampleIcons = () => ( +
+ + + } /> + } /> + } /> + + } /> + } /> + + } /> + + + + + + } /> + settings} /> + settings + } + /> + ¶} /> + §} /> + + +
+); + +const MenuExampleSecondary = () => ( +
+ + + + + + + + + + } /> + } /> + } /> + } /> + } /> + + + + + + + + + + + + + + + + + + +
+); + +const MenuExampleNested = () => ( +
+ + + + + + } + menuItems={[ + } + menuItems={[ + , + , + , + , + ]} + />, + , + , + , + ]} + /> + + + + + + + +
+); + + +// "http://www.material-ui.com/#/components/icon-menu" +const IconMenuExampleSimple = () => ( +
+ } + anchorOrigin={{horizontal: 'left', vertical: 'top'}} + targetOrigin={{horizontal: 'left', vertical: 'top'}} + > + + + + + + + } + anchorOrigin={{horizontal: 'left', vertical: 'bottom'}} + targetOrigin={{horizontal: 'left', vertical: 'bottom'}} + > + + + + + + + } + anchorOrigin={{horizontal: 'right', vertical: 'bottom'}} + targetOrigin={{horizontal: 'right', vertical: 'bottom'}} + > + + + + + + + } + anchorOrigin={{horizontal: 'right', vertical: 'top'}} + targetOrigin={{horizontal: 'right', vertical: 'top'}} + > + + + + + + +
+); + +interface IconMenuExampleControlledState { + valueSingle?: string; + valueMultiple?: string[]; + openMenu?: boolean; +} + +class IconMenuExampleControlled extends React.Component<{}, IconMenuExampleControlledState> { + constructor(props) { + super(props); + + this.state = { + valueSingle: '3', + valueMultiple: ['3', '5'], + }; + } + + handleChangeSingle = (event, value) => { + this.setState({ + valueSingle: value, + }); + }; + + handleChangeMultiple = (event, value) => { + this.setState({ + valueMultiple: value, + }); + }; + + handleOpenMenu = () => { + this.setState({ + openMenu: true, + }); + } + + handleOnRequestChange = (value) => { + this.setState({ + openMenu: value, + }); + } + + render() { + return ( +
+ } + onChange={this.handleChangeSingle} + value={this.state.valueSingle} + > + + + + + + + } + onChange={this.handleChangeMultiple} + value={this.state.valueMultiple} + multiple={true} + > + + + + + + + + } + open={this.state.openMenu} + onRequestChange={this.handleOnRequestChange} + > + + + + + + +
+ ); + } +} + +const IconMenuExampleScrollable = () => ( + } + anchorOrigin={{horizontal: 'left', vertical: 'top'}} + targetOrigin={{horizontal: 'left', vertical: 'top'}} + maxHeight={272} + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); + +const IconMenuExampleNested = () => ( +
+ } + anchorOrigin={{horizontal: 'left', vertical: 'top'}} + targetOrigin={{horizontal: 'left', vertical: 'top'}} + > + } + menuItems={[ + , + , + , + , + ]} + /> + + } + menuItems={[ + , + , + , + , + ]} + /> + + } /> + + + + +
+); + + +// "http://www.material-ui.com/#/components/dropdown-menu" +class DropDownMenuSimpleExample extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 1}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( +
+ + + + + + + +
+ + + + + + + +
+ ); + } +} + +class DropDownMenuOpenImmediateExample extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 2}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + + + + + + + ); + } +} + +const items: React.ReactElement<__MaterialUI.Menus.MenuItemProps>[] = []; +for (let i = 0; i < 100; i++ ) { + items.push(); +} + +class DropDownMenuLongMenuExample extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 10}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + {items} + + ); + } +} + +class DropDownMenuLabeledExample extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 2}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + + + + + + ); + } +} + + +// "http://material-ui.com/#/components/paper" +const PaperExampleSimple = () => ( +
+ + + + + +
+); + +const PaperExampleRounded = () => ( +
+ + + + + +
+); + +const PaperExampleCircle = () => ( +
+ + + + + +
+); + + +// "http://www.material-ui.com/#/components/popover" +class PopoverExampleSimple extends React.Component<{}, {open?: boolean, anchorEl?: React.ReactInstance}> { + + constructor(props) { + super(props); + + this.state = { + open: false, + }; + } + + handleTouchTap = (event) => { + // This prevents ghost click. + event.preventDefault(); + + this.setState({ + open: true, + anchorEl: event.currentTarget, + }); + }; + + handleRequestClose = () => { + this.setState({ + open: false, + }); + }; + + render() { + return ( +
+ + + + + + + + + +
+ ); + } +} + +class PopoverExampleAnimation extends React.Component<{}, {open?: boolean, anchorEl?: React.ReactInstance}> { + + constructor(props) { + super(props); + + this.state = { + open: false, + }; + } + + handleTouchTap = (event) => { + // This prevents ghost click. + event.preventDefault(); + this.setState({ + open: true, + anchorEl: event.currentTarget, + }); + }; + + handleRequestClose = () => { + this.setState({ + open: false, + }); + }; + + render() { + return ( +
+ + + + + + + + + +
+ ); + } +} + +interface PopoverExampleConfigurableState { + open?: boolean; + anchorOrigin?: __MaterialUI.propTypes.origin; + targetOrigin?: __MaterialUI.propTypes.origin; + anchorEl?: React.ReactInstance; +} + +class PopoverExampleConfigurable extends React.Component<{}, PopoverExampleConfigurableState> { + + constructor(props) { + super(props); + + this.state = { + open: false, + anchorOrigin: { + horizontal: 'left', + vertical: 'bottom', + }, + targetOrigin: { + horizontal: 'left', + vertical: 'top', + }, + }; + } + + handleTouchTap = (event) => { + // This prevents ghost click. + event.preventDefault(); + this.setState({ + open: true, + anchorEl: event.currentTarget, + }); + }; + + handleRequestClose = () => { + this.setState({ + open: false, + }); + }; + + setAnchor = (positionElement, position) => { + const {anchorOrigin} = this.state; + anchorOrigin[positionElement] = position; + + this.setState({ + anchorOrigin: anchorOrigin, + }); + }; + + setTarget = (positionElement, position) => { + const {targetOrigin} = this.state; + targetOrigin[positionElement] = position; + + this.setState({ + targetOrigin: targetOrigin, + }); + }; + + render() { + return ( +
+ +

Current Settings

+
+          anchorOrigin: {JSON.stringify(this.state.anchorOrigin)}
+          
+ targetOrigin: {JSON.stringify(this.state.targetOrigin)} +
+

Position Options

+

Use the settings below to toggle the positioning of the popovers above

+

Anchor Origin

+
+
+ Vertical + + + +
+
+ Horizontal + + + +
+
+

Target Origin

+
+
+ Vertical + + + +
+
+ Horizontal + + + +
+
+ + + + + + + + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/circular-progress" +const CircularProgressExampleSimple = () => ( +
+ + + +
+); + +class CircularProgressExampleDeterminate extends React.Component<{}, {completed?: number}> { + private timer: number; + + constructor(props) { + super(props); + + this.state = { + completed: 0, + }; + } + + componentDidMount() { + this.timer = setTimeout(() => this.progress(5), 1000); + } + + componentWillUnmount() { + clearTimeout(this.timer); + } + + progress(completed) { + if (completed > 100) { + this.setState({completed: 100}); + } else { + this.setState({completed}); + const diff = Math.random() * 10; + this.timer = setTimeout(() => this.progress(completed + diff), 1000); + } + } + + render() { + return ( +
+ + + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/linear-progress" +const LinearProgressExampleSimple = () => ( + +); + +class LinearProgressExampleDeterminate extends React.Component<{}, {completed?: number}> { + private timer: number; + + constructor(props) { + super(props); + + this.state = { + completed: 0, + }; + } + + componentDidMount() { + this.timer = setTimeout(() => this.progress(5), 1000); + } + + componentWillUnmount() { + clearTimeout(this.timer); + } + + progress(completed) { + if (completed > 100) { + this.setState({completed: 100}); + } else { + this.setState({completed}); + const diff = Math.random() * 10; + this.timer = setTimeout(() => this.progress(completed + diff), 1000); + } + } + + render() { + return ( + + ); + } +} + + +// "http://www.material-ui.com/#/components/refresh-indicator" +const RefreshIndicatorExampleSimple = () => ( +
+ + + + +
+); + +const RefreshIndicatorExampleLoading = () => ( +
+ + +
+); + + +// "http://www.material-ui.com/#/components/select-field" +class SelectFieldExampleSimple extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 1}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( +
+ + + + + + + +
+ + + + +
+ + + + + + + +
+ + + + + + + +
+ ); + } +} + +class SelectFieldLongMenuExample extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 10}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + {items} + + ); + } +} + +class SelectFieldExampleCustomLabel extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: 1}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + + + + + + ); + } +} + +const itemsPeriod = [ + , + , + , + , + , +]; + +export default class SelectFieldExampleFloatingLabel extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: null}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( +
+ + {itemsPeriod} + +
+ + {itemsPeriod} + +
+ ); + } +} + +class SelectFieldExampleError extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = {value: null}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + const {value} = this.state; + + const night = value === 2 || value === 3; + + return ( +
+ + {itemsPeriod} + +
+ + {itemsPeriod} + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/slider" +const SliderExampleSimple = () => ( +
+ + + +
+); + +const SliderExampleDisabled = () => ( +
+ + + +
+); + +const SliderExampleStep = () => ( + +); + +class SliderExampleControlled extends React.Component<{}, {firstSlider?: number, secondSlider?: number}> { + + state = { + firstSlider: 0.5, + secondSlider: 50, + } + + handleFirstSlider(event, value) { + this.setState({firstSlider: value}); + } + + handleSecondSlider(event, value) { + this.setState({secondSlider: value}); + } + + render() { + return ( +
+ +

+ {'The value of this slider is: '} + {this.state.firstSlider} + {' from a range of 0 to 1 inclusive'} +

+ +

+ {'The value of this slider is: '} + {this.state.secondSlider} + {' from a range of 0 to 100 inclusive'} +

+
+ ); + } +} + + +// "http://www.material-ui.com/#/components/checkbox" +const CheckboxExampleSimple = () => ( +
+ + + } + uncheckedIcon={} + label="Custom icon" + style={styles.checkbox} + /> + + + +
+); + + +// "http://www.material-ui.com/#/components/radio-button" +const RadioButtonExampleSimple = () => ( +
+ + + + } + uncheckedIcon={} + style={styles.radioButton} + /> + + + + + + + + +
+); + + +// "http://www.material-ui.com/#/components/toggle" +const ToggleExampleSimple = () => ( +
+ + + + +
+); + + +// "http://material-ui.com/#/components/snackbar" +class SnackbarExampleSimple extends React.Component<{}, {open?: boolean}> { + + constructor(props) { + super(props); + this.state = { + open: false, + }; + } + + handleTouchTap = () => { + this.setState({ + open: true, + }); + }; + + handleRequestClose = () => { + this.setState({ + open: false, + }); + }; + + render() { + return ( +
+ + +
+ ); + } +} + +class SnackbarExampleAction extends React.Component<{}, {open?: boolean, autoHideDuration?: number, message?: string}> { + + constructor(props) { + super(props); + this.state = { + autoHideDuration: 4000, + message: 'Event added to your calendar', + open: false, + }; + } + + handleTouchTap = () => { + this.setState({ + open: true, + }); + }; + + handleActionTouchTap = () => { + this.setState({ + open: false, + }); + alert('Event removed from your calendar.'); + }; + + handleChangeDuration = (event) => { + const value = event.target.value; + this.setState({ + autoHideDuration: value.length > 0 ? parseInt(value) : 0, + }); + }; + + handleRequestClose = () => { + this.setState({ + open: false, + }); + }; + + render() { + return ( +
+ +
+ + +
+ ); + } +} + +class SnackbarExampleTwice extends React.Component<{}, {open?: boolean, message?: string}> { + + private timer: number; + + constructor(props) { + super(props); + this.state = { + message: 'Event 1 added to your calendar', + open: false, + }; + this.timer = undefined; + } + + componentWillUnMount() { + clearTimeout(this.timer); + } + + handleTouchTap = () => { + this.setState({ + open: true, + }); + + this.timer = setTimeout(() => { + this.setState({ + message: `Event ${Math.round(Math.random() * 100)} added to your calendar`, + }); + }, 1500); + }; + + handleRequestClose = () => { + this.setState({ + open: false, + }); + }; + + render() { + return ( +
+ + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/stepper" +class HorizontalLinearStepper extends React.Component<{}, {stepIndex?: number, finished?: boolean}> { + + state = { + finished: false, + stepIndex: 0, + }; + + handleNext = () => { + const {stepIndex} = this.state; + this.setState({ + stepIndex: stepIndex + 1, + finished: stepIndex >= 2, + }); + }; + + handlePrev = () => { + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1}); + } + }; + + getStepContent(stepIndex) { + switch (stepIndex) { + case 0: + return 'Select campaign settings...'; + case 1: + return 'What is an ad group anyways?'; + case 2: + return 'This is the bit I really care about!'; + default: + return 'You\'re a long way from home sonny jim!'; + } + } + + render() { + const {finished, stepIndex} = this.state; + const contentStyle = {margin: '0 16px'}; + + return ( +
+ + + Select campaign settings + + + Create an ad group + + + Create an ad + + +
+ {finished ? ( +

+ { + event.preventDefault(); + this.setState({stepIndex: 0, finished: false}); + }} + > + Click here + to reset the example. +

+ ) : ( +
+

{this.getStepContent(stepIndex)}

+
+ + +
+
+ )} +
+
+ ); + } +} + +class VerticalLinearStepper extends React.Component<{}, {stepIndex?: number, finished?: boolean}> { + + state = { + finished: false, + stepIndex: 0, + }; + + handleNext = () => { + const {stepIndex} = this.state; + this.setState({ + stepIndex: stepIndex + 1, + finished: stepIndex >= 2, + }); + }; + + handlePrev = () => { + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1}); + } + }; + + renderStepActions(step) { + const {stepIndex} = this.state; + + return ( +
+ + {step > 0 && ( + + )} +
+ ); + } + + render() { + const {finished, stepIndex} = this.state; + + return ( +
+ + + Select campaign settings + +

+ For each ad campaign that you create, you can control how much + you're willing to spend on clicks and conversions, which networks + and geographical locations you want your ads to show on, and more. +

+ {this.renderStepActions(0)} +
+
+ + Create an ad group + +

An ad group contains one or more ads which target a shared set of keywords.

+ {this.renderStepActions(1)} +
+
+ + Create an ad + +

+ Try out different ad text to see what brings in the most customers, + and learn how to enhance your ads using features like ad extensions. + If you run into any problems with your ads, find out how to tell if + they're running and how to resolve approval issues. +

+ {this.renderStepActions(2)} +
+
+
+ {finished && ( +

+ { + event.preventDefault(); + this.setState({stepIndex: 0, finished: false}); + }} + > + Click here + to reset the example. +

+ )} +
+ ); + } +} + +class HorizontalNonLinearStepper extends React.Component<{}, {stepIndex?: number}> { + + state = { + stepIndex: 0, + }; + + handleNext = () => { + const {stepIndex} = this.state; + if (stepIndex < 2) { + this.setState({stepIndex: stepIndex + 1}); + } + }; + + handlePrev = () => { + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1}); + } + }; + + getStepContent(stepIndex) { + switch (stepIndex) { + case 0: + return 'Select campaign settings...'; + case 1: + return 'What is an ad group anyways?'; + case 2: + return 'This is the bit I really care about!'; + default: + return 'You\'re a long way from home sonny jim!'; + } + } + + render() { + const {stepIndex} = this.state; + const contentStyle = {margin: '0 16px'}; + + return ( +
+ + + this.setState({stepIndex: 0})}> + Select campaign settings + + + + this.setState({stepIndex: 1})}> + Create an ad group + + + + this.setState({stepIndex: 2})}> + Create an ad + + + +
+

{this.getStepContent(stepIndex)}

+
+ + +
+
+
+ ); + } +} + +class VerticalNonLinear extends React.Component<{}, {stepIndex?: number}> { + + state = { + stepIndex: 0, + }; + + handleNext = () => { + const {stepIndex} = this.state; + if (stepIndex < 2) { + this.setState({stepIndex: stepIndex + 1}); + } + }; + + handlePrev = () => { + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1}); + } + }; + + renderStepActions(step) { + return ( +
+ + {step > 0 && ( + + )} +
+ ); + } + + render() { + const {stepIndex} = this.state; + + return ( +
+ + + this.setState({stepIndex: 0})}> + Select campaign settings + + +

+ For each ad campaign that you create, you can control how much + you're willing to spend on clicks and conversions, which networks + and geographical locations you want your ads to show on, and more. +

+ {this.renderStepActions(0)} +
+
+ + this.setState({stepIndex: 1})}> + Create an ad group + + +

An ad group contains one or more ads which target a shared set of keywords.

+ {this.renderStepActions(1)} +
+
+ + this.setState({stepIndex: 2})}> + Create an ad + + +

+ Try out different ad text to see what brings in the most customers, + and learn how to enhance your ads using features like ad extensions. + If you run into any problems with your ads, find out how to tell if + they're running and how to resolve approval issues. +

+ {this.renderStepActions(2)} +
+
+
+
+ ); + } +} + +const getStyles = () => { + return { + root: { + width: '100%', + maxWidth: 700, + margin: 'auto', + }, + content: { + margin: '0 16px', + }, + actions: { + marginTop: 12, + }, + backButton: { + marginRight: 12, + }, + }; +}; + +class GranularControlStepper extends React.Component<{}, {stepIndex?: number, visited?: number[]}> { + + state = { + stepIndex: null, + visited: [], + }; + + componentWillMount() { + const {stepIndex, visited} = this.state; + this.setState({visited: visited.concat(stepIndex)}); + } + + componentWillUpdate(nextProps, nextState) { + const {stepIndex, visited} = nextState; + if (visited.indexOf(stepIndex) === -1) { + this.setState({visited: visited.concat(stepIndex)}); + } + } + + handleNext = () => { + const {stepIndex} = this.state; + if (stepIndex < 2) { + this.setState({stepIndex: stepIndex + 1}); + } + }; + + handlePrev = () => { + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1}); + } + }; + + getStepContent(stepIndex) { + switch (stepIndex) { + case 0: + return 'Select campaign settings...'; + case 1: + return 'What is an ad group anyways?'; + case 2: + return 'This is the bit I really care about!'; + default: + return 'Click a step to get started.'; + } + } + + render() { + const {stepIndex, visited} = this.state; + const styles = getStyles(); + + return ( +
+

+ { + event.preventDefault(); + this.setState({stepIndex: null, visited: []}); + }} + > + Click here + to reset the example. +

+ + + this.setState({stepIndex: 0})}> + Select campaign settings + + + + this.setState({stepIndex: 1})}> + Create an ad group + + + + this.setState({stepIndex: 2})}> + Create an ad + + + +
+

{this.getStepContent(stepIndex)}

+ {stepIndex !== null && ( +
+ + +
+ )} +
+
+ ); + } +} + +class CustomIcon extends React.Component<{}, {stepIndex?: number}> { + + state = { + stepIndex: 0, + }; + + handleNext = () => { + const {stepIndex} = this.state; + if (stepIndex < 2) { + this.setState({stepIndex: stepIndex + 1}); + } + }; + + handlePrev = () => { + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1}); + } + }; + + getStepContent(stepIndex) { + switch (stepIndex) { + case 0: + return 'Select campaign settings...'; + case 1: + return 'What is an ad group anyways?'; + case 2: + return 'This is the bit I really care about!'; + default: + return 'You\'re a long way from home sonny jim!'; + } + } + + render() { + return ( +
+ + + + Select campaign settings + + + + } + style={{color: red500}} + > + Create an ad group + + + + + Create an ad + + + +
+ ); + } +} + + +// "http://www.material-ui.com/#/components/subheader" +// Included in ListExampleChat and ListExampleFolder + +// "http://www.material-ui.com/#/components/table" +const TableExampleSimple = () => ( + + + + ID + Name + Status + + + + + 1 + John Smith + Employed + + + 2 + Randal White + Unemployed + + + 3 + Stephanie Sanders + Employed + + + 4 + Steve Brown + Employed + + +
+); + +const tableData: {name: string, status: string, selected?: boolean}[] = [ + { + name: 'John Smith', + status: 'Employed', + selected: true, + }, + { + name: 'Randal White', + status: 'Unemployed', + }, + { + name: 'Stephanie Sanders', + status: 'Employed', + selected: true, + }, + { + name: 'Steve Brown', + status: 'Employed', + }, + { + name: 'Joyce Whitten', + status: 'Employed', + }, + { + name: 'Samuel Roberts', + status: 'Employed', + }, + { + name: 'Adam Moore', + status: 'Employed', + }, +]; + +interface TableExampleComplexState { + fixedHeader?: boolean, + fixedFooter?: boolean, + stripedRows?: boolean, + showRowHover?: boolean, + selectable?: boolean, + multiSelectable?: boolean, + enableSelectAll?: boolean, + deselectOnClickaway?: boolean, + showCheckboxes?: boolean, + height?: string, +} + +class TableExampleComplex extends React.Component<{}, TableExampleComplexState> { + + constructor(props) { + super(props); + + this.state = { + fixedHeader: true, + fixedFooter: true, + stripedRows: false, + showRowHover: false, + selectable: true, + multiSelectable: false, + enableSelectAll: false, + deselectOnClickaway: true, + showCheckboxes: true, + height: '300px', + }; + } + + handleToggle = (event, toggled) => { + this.setState({ + [event.target.name]: toggled, + }); + }; + + handleChange = (event) => { + this.setState({height: event.target.value}); + }; + + render() { + return ( +
+ + + + + Super Header + + + + ID + Name + Status + + + + {tableData.map( (row, index) => ( + + {index} + {row.name} + {row.status} + + ))} + + + + ID + Name + Status + + + + Super Footer + + + +
+ +
+

Table Properties

+ + + + + + +

TableBody Properties

+ + + +

Multiple Properties

+ +
+
+ ); + } +} + +// "http://www.material-ui.com/#/components/tabs" +function handleActive(tab) { + alert(`A tab with this value property ${tab.props.value} was activated.`); +} + +const TabsExampleSimple = () => ( + + +
+

Tab One

+

+ This is an example tab. +

+

+ You can put any sort of HTML or react component in here. It even keeps the component state! +

+ +
+
+ +
+

Tab Two

+

+ This is another example tab. +

+
+
+ +
+

Tab Three

+

+ This is a third example tab. +

+
+
+
+); + +class TabsExampleControlled extends React.Component<{}, {value?: string}> { + + constructor(props) { + super(props); + this.state = { + value: 'a', + }; + } + + handleChange = (value) => { + this.setState({ + value: value, + }); + }; + + render() { + return ( + + +
+

Controllable Tab A

+

+ Tabs are also controllable if you want to programmatically pass them their values. + This allows for more functionality in Tabs such as not + having any Tab selected or assigning them different values. +

+
+
+ +
+

Controllable Tab B

+

+ This is another example of a controllable tab. Remember, if you + use controllable Tabs, you need to give all of your tabs values or else + you wont be able to select them. +

+
+
+
+ ); + } +} + +const TabsExampleIcon = () => ( + + } /> + } /> + favorite} /> + +); + +const TabsExampleIconText = () => ( + + phone} + label="RECENTS" + /> + favorite} + label="FAVORITES" + /> + } + label="NEARBY" + /> + +); + + +// "http://www.material-ui.com/#/components/text-field" +const TextFieldExampleSimple = () => ( +
+
+
+
+
+
+
+
+
+
+ +
+); + +const TextFieldExampleError = () => ( +
+
+
+
+
+
+); + +const TextFieldExampleCustomize = () => ( +
+
+
+
+
+ +
+); + +const TextFieldExampleDisabled = () => ( +
+
+
+
+ +
+); + +class TextFieldExampleControlled extends React.Component<{}, {value?: string}> { + + constructor(props) { + super(props); + + this.state = { + value: 'Property Value', + }; + } + + handleChange = (event) => { + this.setState({ + value: event.target.value, + }); + }; + + render() { + return ( +
+ +
+ ); + } +} + +// "http://www.material-ui.com/#/components/time-picker" +const TimePickerExampleSimple = () => ( +
+ + + +
+); + +class TimePickerExampleComplex extends React.Component<{}, {value24?: Date, value12?: Date}> { + + constructor(props) { + super(props); + this.state = {value24: null, value12: null}; + } + + handleChangeTimePicker24 = (event, date) => { + this.setState({value24: date}); + }; + + handleChangeTimePicker12 = (event, date) => { + this.setState({value12: date}); + }; + + render() { + return ( +
+ + +
+ ); + } +} + +const TimePickerInternational = () => ( +
+ +
+); + + +// "http://www.material-ui.com/#/components/toolbar" +class ToolbarExamplesSimple extends React.Component<{}, {value?: number}> { + + constructor(props) { + super(props); + this.state = { + value: 3, + }; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + + + + + + + + + + + + + + + + + + + + } + > + + + + + + ); + } +} + +const componentWithWidth = withWidth()(ToolbarExamplesSimple); + + +interface MaterialUiTestsState { +} + +class MaterialUiTests extends React.Component<{}, MaterialUiTestsState> { + + render () { + return ( + + + + + ); + } +} + +// "http://www.material-ui.com/#/get-started/usage" +ReactDOM.render( + , + document.getElementById('app') +); diff --git a/material-ui/legacy/material-ui-0.15.1-tests.tsx.tscparams b/material-ui/legacy/material-ui-0.15.1-tests.tsx.tscparams new file mode 100644 index 0000000000..855355b85f --- /dev/null +++ b/material-ui/legacy/material-ui-0.15.1-tests.tsx.tscparams @@ -0,0 +1 @@ +--experimentalDecorators \ No newline at end of file diff --git a/material-ui/legacy/material-ui-0.15.1.d.ts b/material-ui/legacy/material-ui-0.15.1.d.ts new file mode 100644 index 0000000000..b5ec61b14b --- /dev/null +++ b/material-ui/legacy/material-ui-0.15.1.d.ts @@ -0,0 +1,8630 @@ +// Type definitions for material-ui v0.15.1 +// Project: https://github.com/callemall/material-ui +// Definitions by: Nathan Brown , Oliver Herrmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "material-ui" { + export import AppBar = __MaterialUI.AppBar; + export import AutoComplete = __MaterialUI.AutoComplete; + export import Avatar = __MaterialUI.Avatar; + export import Badge = __MaterialUI.Badge; + export import Card = __MaterialUI.Card.Card; + export import CardActions = __MaterialUI.Card.CardActions; + export import CardHeader = __MaterialUI.Card.CardHeader; + export import CardMedia = __MaterialUI.Card.CardMedia; + export import CardText = __MaterialUI.Card.CardText; + export import CardTitle = __MaterialUI.Card.CardTitle; + export import Checkbox = __MaterialUI.Switches.Checkbox; + export import Chip = __MaterialUI.Chip; + export import CircularProgress = __MaterialUI.CircularProgress; + export import DatePicker = __MaterialUI.DatePicker.DatePicker; + export import Dialog = __MaterialUI.Dialog; + export import Divider = __MaterialUI.Divider; + export import Drawer = __MaterialUI.Drawer; + export import DropDownMenu = __MaterialUI.Menus.DropDownMenu; + export import FlatButton = __MaterialUI.FlatButton; + export import FloatingActionButton = __MaterialUI.FloatingActionButton; + export import FontIcon = __MaterialUI.FontIcon; + export import GridList = __MaterialUI.GridList.GridList; + export import GridTile = __MaterialUI.GridList.GridTile; + export import IconButton = __MaterialUI.IconButton; + export import IconMenu = __MaterialUI.Menus.IconMenu; + export import LinearProgress = __MaterialUI.LinearProgress; + export import List = __MaterialUI.List.List; + export import ListItem = __MaterialUI.List.ListItem; + export import MakeSelectable = __MaterialUI.List.MakeSelectable; + export import Menu = __MaterialUI.Menus.Menu; + export import MenuItem = __MaterialUI.Menus.MenuItem; + export import Paper = __MaterialUI.Paper; + export import Popover = __MaterialUI.Popover.Popover; + export import RadioButton = __MaterialUI.Switches.RadioButton; + export import RadioButtonGroup = __MaterialUI.Switches.RadioButtonGroup; + export import RaisedButton = __MaterialUI.RaisedButton; + export import RefreshIndicator = __MaterialUI.RefreshIndicator; + export import SelectField = __MaterialUI.SelectField; + export import Slider = __MaterialUI.Slider; + export import Subheader = __MaterialUI.Subheader; + export import SvgIcon = __MaterialUI.SvgIcon; + export import Step = __MaterialUI.Stepper.Step; + export import StepButton = __MaterialUI.Stepper.StepButton; + export import StepContent = __MaterialUI.Stepper.StepContent; + export import StepLabel = __MaterialUI.Stepper.StepLabel; + export import Stepper = __MaterialUI.Stepper; + export import Snackbar = __MaterialUI.Snackbar; + export import Tab = __MaterialUI.Tabs.Tab; + export import Tabs = __MaterialUI.Tabs.Tabs; + export import Table = __MaterialUI.Table.Table; + export import TableBody = __MaterialUI.Table.TableBody; + export import TableFooter = __MaterialUI.Table.TableFooter; + export import TableHeader = __MaterialUI.Table.TableHeader; + export import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; + export import TableRow = __MaterialUI.Table.TableRow; + export import TableRowColumn = __MaterialUI.Table.TableRowColumn; + export import TextField = __MaterialUI.TextField; + export import TimePicker = __MaterialUI.TimePicker; + export import Toggle = __MaterialUI.Switches.Toggle; + export import Toolbar = __MaterialUI.Toolbar.Toolbar; + export import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; + export import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; + export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; + + // export type definitions + export type TouchTapEvent = __MaterialUI.TouchTapEvent; + export type TouchTapEventHandler = __MaterialUI.TouchTapEventHandler; +} + +declare namespace __MaterialUI { + export import React = __React; + + // ReactLink is from "react/addons" + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + // What's common between React.TouchEvent and React.MouseEvent + interface TouchTapEvent extends React.SyntheticEvent { + altKey: boolean; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + } + + // What's common between React.TouchEventHandler and React.MouseEventHandler + interface TouchTapEventHandler extends React.EventHandler { } + + interface ThemeWrapperProps extends React.Props { + theme: Styles.MuiTheme; + } + export class ThemeWrapper extends React.Component { + } + + export namespace Styles { + interface Spacing { + iconSize?: number; + + desktopGutter?: number; + desktopGutterMore?: number; + desktopGutterLess?: number; + desktopGutterMini?: number; + desktopKeylineIncrement?: number; + desktopDropDownMenuItemHeight?: number; + desktopDropDownMenuFontSize?: number; + desktopLeftNavMenuItemHeight?: number; + desktopSubheaderHeight?: number; + desktopToolbarHeight?: number; + } + export var Spacing: Spacing; + + interface ThemePalette { + primary1Color?: string; + primary2Color?: string; + primary3Color?: string; + accent1Color?: string; + accent2Color?: string; + accent3Color?: string; + textColor?: string; + alternateTextColor?: string; + canvasColor?: string; + borderColor?: string; + disabledColor?: string; + pickerHeaderColor?: string; + clockCircleColor?: string; + shadowColor?: string; + } + export var ThemePalette: ThemePalette; + interface MuiTheme { + spacing?: Spacing; + fontFamily?: string; + palette?: ThemePalette; + isRtl?: boolean; + userAgent?: string; + zIndex?: zIndex; + baseTheme?: RawTheme; + rawTheme?: RawTheme; + appBar?: { + color?: string; + textColor?: string; + height?: number; + titleFontWeight?: number; + padding?: number; + }; + avatar?: { + color?: string; + backgroundColor?: string; + borderColor?: string; + }; + badge?: { + color?: string; + textColor?: string; + primaryColor?: string; + primaryTextColor?: string; + secondaryColor?: string; + secondaryTextColor?: string; + fontWeight?: number; + }; + button?: { + height?: number; + minWidth?: number; + iconButtonSize?: number; + }; + card?: { + titleColor?: string; + subtitleColor?: string; + fontWeight?: number; + }; + cardMedia?: { + color?: string; + overlayContentBackground?: string; + titleColor?: string; + subtitleColor?: string; + }; + cardText?: { + textColor?: string; + }; + checkbox?: { + boxColor?: string; + checkedColor?: string; + requiredColor?: string; + disabledColor?: string; + labelColor?: string; + labelDisabledColor?: string; + }; + chip?: { + backgroundColor?: string; + deleteIconColor?: string; + textColor?: string; + fontSize?: number; + fontWeight?: number; + shadow?: string; + }; + datePicker?: { + color?: string; + textColor?: string; + calendarTextColor?: string; + selectColor?: string; + selectTextColor?: string; + calendarYearBackgroundColor?: string; + }; + dialog?: { + titleFontSize?: number; + bodyFontSize?: number; + bodyColor?: string; + }; + dropDownMenu?: { + accentColor?: string; + }; + enhancedButton?: { + tapHighlightColor?: string; + }; + flatButton?: { + color?: string; + buttonFilterColor?: string; + disabledTextColor?: string; + textColor?: string; + primaryTextColor?: string; + secondaryTextColor?: string; + fontSize?: number; + fontWeight?: number; + }; + floatingActionButton?: { + buttonSize?: number; + miniSize?: number; + color?: string; + iconColor?: string; + secondaryColor?: string; + secondaryIconColor?: string; + disabledTextColor?: string; + disabledColor?: string; + }; + gridTile?: { + textColor?: string; + }; + icon?: { + color?: string; + backgroundColor?: string; + }; + inkBar?: { + backgroundColor?: string; + }; + drawer?: { + width?: number; + color?: string; + }; + listItem?: { + nestedLevelDepth?: number; + secondaryTextColor?: string; + leftIconColor?: string; + rightIconColor?: string; + }; + menu?: { + backgroundColor?: string; + containerBackgroundColor?: string; + }; + menuItem?: { + dataHeight?: number; + height?: number; + hoverColor?: string; + padding?: number; + selectedTextColor?: string; + rightIconDesktopFill?: string; + }; + menuSubheader?: { + padding?: number; + borderColor?: string; + textColor?: string; + }; + overlay?: { + backgroundColor?: string; + }; + paper?: { + color?: string; + backgroundColor?: string; + zDepthShadows?: string[]; + }; + radioButton?: { + borderColor?: string; + backgroundColor?: string; + checkedColor?: string; + requiredColor?: string; + disabledColor?: string; + size?: number; + labelColor?: string; + labelDisabledColor?: string; + }; + raisedButton?: { + color?: string; + textColor?: string; + primaryColor?: string; + primaryTextColor?: string; + secondaryColor?: string; + secondaryTextColor?: string; + disabledColor?: string; + disabledTextColor?: string; + fontSize?: number; + fontWeight?: number; + }; + refreshIndicator?: { + strokeColor?: string; + loadingStrokeColor?: string; + }; + ripple?: { + color?: string; + }; + slider?: { + trackSize?: number; + trackColor?: string; + trackColorSelected?: string; + handleSize?: number; + handleSizeDisabled?: number; + handleSizeActive?: number; + handleColorZero?: string; + handleFillColor?: string; + selectionColor?: string; + rippleColor?: string; + }; + snackbar?: { + textColor?: string; + backgroundColor?: string; + actionColor?: string; + }; + subheader?: { + color?: string; + fontWeight?: number; + }; + stepper?: { + backgroundColor?: string; + hoverBackgroundColor?: string; + iconColor?: string; + hoveredIconColor?: string; + inactiveIconColor?: string; + textColor?: string; + disabledTextColor?: string; + connectorLineColor?: string; + }; + svgIcon?: { + color?: string, + }; + table?: { + backgroundColor?: string; + }; + tableFooter?: { + borderColor?: string; + textColor?: string; + }; + tableHeader?: { + borderColor?: string; + }; + tableHeaderColumn?: { + textColor?: string; + height?: number; + spacing?: number; + }; + tableRow?: { + hoverColor?: string; + stripeColor?: string; + selectedColor?: string; + textColor?: string; + borderColor?: string; + height?: number; + }; + tableRowColumn?: { + height?: number; + spacing?: number; + }; + tabs?: { + backgroundColor?: string; + textColor?: string; + selectedTextColor?: string; + }; + textField?: { + textColor?: string; + hintColor?: string; + floatingLabelColor?: string; + disabledTextColor?: string; + errorColor?: string; + focusColor?: string; + backgroundColor?: string; + borderColor?: string; + }; + timePicker?: { + color?: string; + textColor?: string; + accentColor?: string; + clockColor?: string; + clockCircleColor?: string; + headerColor?: string; + selectColor?: string; + selectTextColor?: string; + }; + toggle?: { + thumbOnColor?: string; + thumbOffColor?: string; + thumbDisabledColor?: string; + thumbRequiredColor?: string; + trackOnColor?: string; + trackOffColor?: string; + trackDisabledColor?: string; + labelColor?: string; + labelDisabledColor?: string; + trackRequiredColor?: string; + }; + toolbar?: { + color?: string; + hoverColor?: string; + backgroundColor?: string; + height?: number; + titleFontSize?: number; + iconColor?: string; + separatorColor?: string; + menuHoverColor?: string; + }; + tooltip?: { + color?: string; + rippleBackgroundColor?: string; + }; + } + + interface zIndex { + menu: number; + appBar: number; + drawerOverlay: number; + drawer: number; + dialogOverlay: number; + dialog: number; + layer: number; + popover: number; + snackbar: number; + tooltip: number; + } + export var zIndex: zIndex; + + interface RawTheme { + spacing?: Spacing; + fontFamily?: string; + palette?: ThemePalette; + } + var lightBaseTheme: RawTheme; + var darkBaseTheme: RawTheme; + + export function muiThemeable, P, S>(): (component: TComponent) => TComponent; + + //** @deprecated use MuiThemeProvider instead **/ + export function themeDecorator(muiTheme: Styles.MuiTheme): (Component: TFunction) => TFunction; + + interface MuiThemeProviderProps extends React.Props { + muiTheme?: Styles.MuiTheme; + } + export class MuiThemeProvider extends React.Component{ + } + + export function getMuiTheme(...muiTheme: MuiTheme[]): MuiTheme; + + interface ThemeManager { + //** @deprecated ThemeManager is deprecated. please import getMuiTheme directly from "material-ui/styles/getMuiTheme" **/ + getMuiTheme(baseTheme: RawTheme, muiTheme?: MuiTheme): MuiTheme; + + //** @deprecated modifyRawThemeSpacing is deprecated. please use getMuiTheme to modify your theme directly. http://www.material-ui.com/#/customization/themes **/ + modifyRawThemeSpacing(muiTheme: MuiTheme, newSpacing: Spacing): MuiTheme; + + //** @deprecated modifyRawThemePalette is deprecated. please use getMuiTheme to modify your theme directly. http://www.material-ui.com/#/customization/themes **/ + modifyRawThemePalette(muiTheme: MuiTheme, newPaletteKeys: ThemePalette): MuiTheme; + + //** @deprecated modifyRawThemeFontFamily is deprecated. please use getMuiTheme to modify your theme directly. http://www.material-ui.com/#/customization/themes **/ + modifyRawThemeFontFamily(muiTheme: MuiTheme, newFontFamily: string): MuiTheme; + } + export var ThemeManager: ThemeManager; + + interface Transitions { + easeOut(duration?: string, property?: string | string[], delay?: string, easeFunction?: string): string; + create(duration?: string, property?: string, delay?: string, easeFunction?: string): string; + easeOutFunction: string; + easeInOutFunction: string; + } + export var Transitions: Transitions; + + interface Typography { + textFullBlack: string; + textDarkBlack: string; + textLightBlack: string; + textMinBlack: string; + textFullWhite: string; + textDarkWhite: string; + textLightWhite: string; + + // font weight + fontWeightLight: number; + fontWeightNormal: number; + fontWeightMedium: number; + + fontStyleButtonFontSize: number; + } + export var Typography: Typography; + + //** @deprecated use darkBaseTheme instead **/ + export var DarkRawTheme: RawTheme; + + //** @deprecated use lightBaseTheme instead **/ + export var LightRawTheme: RawTheme; + } + + interface AppBarProps extends React.Props { + className?: string; + iconClassNameLeft?: string; + iconClassNameRight?: string; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; + iconStyleRight?: React.CSSProperties; + iconStyleLeft?: React.CSSProperties; + onLeftIconButtonTouchTap?: TouchTapEventHandler; + onRightIconButtonTouchTap?: TouchTapEventHandler; + onTitleTouchTap?: TouchTapEventHandler; + showMenuIconButton?: boolean; + style?: React.CSSProperties; + title?: React.ReactNode; + titleStyle?: React.CSSProperties; + zDepth?: number; + } + export class AppBar extends React.Component{ + } + + interface AppCanvasProps extends React.Props { + } + export class AppCanvas extends React.Component { + } + + namespace propTypes { + type horizontal = 'left' | 'middle' | 'right'; + type vertical = 'top' | 'center' | 'bottom'; + type direction = 'left' | 'right' | 'up' | 'down'; + + interface origin { + horizontal: horizontal; + vertical: vertical; + } + + type corners = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'; + type cornersAndCenter = 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right'; + } + + type AutoCompleteDataItem = { text: string, value: React.ReactNode } | string; + type AutoCompleteDataSource = { text: string, value: React.ReactNode }[] | string[]; + interface AutoCompleteProps extends React.Props { + anchorOrigin?: propTypes.origin; + animated?: boolean; + dataSource: AutoCompleteDataSource; + disableFocusRipple?: boolean; + errorStyle?: React.CSSProperties; + errorText?: string; + filter?: (searchText: string, key: string, item: AutoCompleteDataItem) => boolean; + floatingLabelText?: React.ReactNode; + fullWidth?: boolean; + hintText?: string; + listStyle?: React.CSSProperties; + maxSearchResults?: number; + menuCloseDelay?: number; + menuProps?: any; + menuStyle?: React.CSSProperties; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyDown?: React.KeyboardEventHandler; + onNewRequest?: (chosenRequest: string, index: number) => void; + onUpdateInput?: (searchText: string, dataSource: AutoCompleteDataSource) => void; + open?: boolean; + openOnFocus?: boolean; + searchText?: string; + style?: React.CSSProperties; + targetOrigin?: propTypes.origin; + /** @deprecated Instead, use openOnFocus */ + triggerUpdateOnFocus?: boolean; + } + export class AutoComplete extends React.Component { + static noFilter: () => boolean; + static defaultFilter: (searchText: string, key: string) => boolean; + static caseSensitiveFilter: (searchText: string, key: string) => boolean; + static caseInsensitiveFilter: (searchText: string, key: string) => boolean; + static levenshteinDistanceFilter(distanceLessThan: number): (searchText: string, key: string) => boolean; + static fuzzyFilter: (searchText: string, key: string) => boolean; + static Item: Menus.MenuItem; + static Divider: Divider; + } + + interface AvatarProps extends React.Props { + backgroundColor?: string; + className?: string; + color?: string; + icon?: React.ReactElement; + size?: number; + src?: string; + style?: React.CSSProperties; + } + export class Avatar extends React.Component { + } + + interface BadgeProps extends React.Props { + badgeContent: React.ReactNode; + badgeStyle?: React.CSSProperties; + className?: string; + primary?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + } + export class Badge extends React.Component { + } + + interface BeforeAfterWrapperProps extends React.Props { + afterElementType?: string; + afterStyle?: React.CSSProperties; + beforeElementType?: string; + beforeStyle?: React.CSSProperties; + elementType?: string; + style?: React.CSSProperties; + } + export class BeforeAfterWrapper extends React.Component { + } + + // non generally overridden elements of EnhancedButton + interface SharedEnhancedButtonProps extends React.Props { + centerRipple?: boolean; + disableFocusRipple?: boolean; + disableKeyboardFocus?: boolean; + disableTouchRipple?: boolean; + focusRippleColor?: string; + focusRippleOpacity?: number; + keyboardFocused?: boolean; + linkButton?: boolean; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onTouchTap?: TouchTapEventHandler; + onClick?: React.MouseEventHandler; + style?: React.CSSProperties; + tabIndex?: number; + touchRippleColor?: string; + touchRippleOpacity?: number; + type?: string; + containerElement?: React.ReactNode | string; + } + + interface EnhancedButtonProps extends React.HTMLAttributes, SharedEnhancedButtonProps { + // container element,