diff --git a/.gitignore b/.gitignore
index 76821ff..14d0b20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,6 @@ node_modules
reports
tmp
.idea
+typings
+dist
+!.npmignore
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..586e3d7
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1 @@
+!dist
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 5e1fc51..9ba8760 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,19 +1,41 @@
-sudo: false #use container based infrastructure
+sudo: false
language: node_js
node_js:
- - "0.12"
-
+- 5.4.1
addons:
apt:
sources:
- - libnotify-bin
-
+ - libnotify-bin
+cache:
+ directories:
+ - node_modules
+branches:
+ except:
+ - "/^v[0-9\\.]+/"
+before_install:
+- npm install -g pr-bumper
+- pr-bumper check
install:
- - travis_retry npm install -g gulp
- - travis_retry npm install
-
+- travis_retry npm install -g gulp
+- travis_retry npm install
+- travis_retry typings install
script:
- - gulp test
-
+- npm test
+- npm run build
after_script:
- - gulp coveralls
+- gulp coveralls
+before_deploy:
+- pr-bumper bump
+deploy:
+ provider: npm
+ email: zak.henry@gmail.com
+ skip_cleanup: true
+ on:
+ branch: master
+ tags: false
+ api_key:
+ secure: cFYp7hSA0BIpBwkv8YdcLPkDkOtUSgAkcpwwiK7vVUjLVPw6vYzwo7EMcTDFZ6CTk9V6OuBFGZQNiHDvv6uZwXcuboItlkIrOelKM+ioer4lYJyausoIv5nkEaJv63vJsFXTZyWALHHbA784zLGqhD46UkQXIcln2OBQAmu564ivYrXF+59FyVKD/no8nb/XMgp6p4650O8XZTK4r4r9rMqfkbDIbpIWTfcbnw1QAhjTO8IcVhX7nfiOeq16zJWM9ndShbizAvRuOd849gkEelMfsUWruGCxU9r6l9wplsRKSkY3mi1cnmegp6xgeaDkuEuJ0lycazgUAr4uCYSKfxsvhE01yye6xoA0u8Zou6fbUP5Am/nPlPMJ/u9wCieAoYXbqE5A2B91DvafkiyugsERzdMMYpkuC6y4nL64EHie/stHtFVlkq1o+yClLUSisw4yrYZ31KCSmidDpJHFpL+ZD6cW5b+F5qsXHO/X5efI4nWqj+iZ4pSCj+TclSHWCy3lx40JZEckMRXvYLPWjNlJ4wacBlcdqC2LN1CtS7j7uVRbSQ6jUMOPuo+YRkspwkm2xNubp5R3zG6LZGZ1F/Z6kpmgtMr9IhsR5gYfSVeTrm+mdNv9yzqJ6ZEJ3tHqgR6IVmW8askZhSPZ04gDLtg3REkSx5UZkIZr0mq/GbA=
+env:
+ global:
+ - secure: BR68CAHOfMzJuEGW+BxhTHs1ICzHKmRJoDHVNYz/qOAB7D4RVbew9gJkAIzvotbDpGiDTXsAZJxc2n6i67BENaKcAlX7R95mETfjENvN6ozOFxoURy36pAmsGqKnSPOPIifQvkbzlsicriXHvLx2IbFCOMB8NYNDh/EJq07JKL3dtIy5sKbjT2zx6MKwJdl3iV0icfZpOhz1xhcpd10BHdKI+4omYe7wpM/b9eVrlIyyQ1lo0nFVTrVTRBANWn3IK+IR5rIv5Fl1EUY2o4rBsLjfL5yE90dHFWDjFK/e8v44NTkv08KY2llFlTh2fr0+s/u95LIkCBXQBlNKOo1Egfkr+n+n3tMADbFOHkRKdcLKYTczqtjkFpOFnomcrzIjnab3pA4WY6t7nQ4sZTr38T2++qzF1wfB0/jK9ENX3UpE3z8BQfREqVRB1g24DsQi7w86oH4ovgRtPapih7wkOasXISpduZCydGqcwNsA8Yf/blFVVZSzjS+MwJYcE81OtoriZ+e/AycIgWM3joBgJIS0X5CsR8zix78IgpRX0a0wkBm+yfnvwYfYGG3Amdjhq+i4uFTZhWhewVRJhZtWaxfp606k+rV+/2R144MF2FSEEl7q0KRDjNyKDRXiG6+mxe7b/zmZaYd6JkUA2vf4AES2hou0Uv4Jx1v40qBSlIg=
+ - secure: M7qsXNy9a4dJB9DClvHzLEkTBTW+GXMRDSmrjvmLv44Q/ZJ6QZVZZA4QwwtDs/ZX1RiMvq3YIRbRMWCxbaoUDPp3pt9aTaCWgudUO1icADUt3DmFlEGbAJGotnNI4kRVNHKr1s18Vh30aE+LxPF+7l3WBFBKzDpLddE2p/dGM8QX3E5XKGekkC3ckqEZicKJZqtqee9p8AZ0hrdlOEn7WOG+Xp9WLHPoNVgZvTS4q0RsYBefg4a71vLVOCfF/B6D0drwhW1wkG8jJocZrhfEqAwmhrqN0zm2K5MFHUu7JOYpb+f2Pfm/q9a3BB+dc7Hv0FM/FsRK6UZjRjCwnIO/m1kNU01P0aO03n9T8mzOhUXZV7w1deMPwhmZnzGFTAQ1z0tN+FOgLCjIdc1nx+Zqa5K5a2M/b2oAas6Rqd0N7f25oPxuFr75DXrG4KZyRrrG8UGf/Vb5yLKOitZXoK7vNzfjS307A5OzIHlOzs2QSN5VZHvEyH5L6BD1J/cgCiKhOw4GVpcNT1KhUeMbTdAK+HD37gT1ODNein5+mWnOO4nYCciSC8nR8ZFNUUBHiJULC/kh+w8dh2mwE4s6mTKYfJ+Fn7ExYTqkQfulBBXKDBqZmHzSOc0brHLSOZmpCHP4joj6whG451ewHjdOF8PUiSsxdf8uGtog2XYMjzgxIGc=
diff --git a/.yo-rc.json b/.yo-rc.json
deleted file mode 100644
index 0dd34b1..0000000
--- a/.yo-rc.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "generator-bower-typescript": {}
-}
diff --git a/README.md b/README.md
index 7cc89cc..e14e66a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@ Wrapper for https://github.com/victorbjelkholm/ngprogress - automatically handle
[](https://travis-ci.org/spira/angular-http-progress)
[](https://coveralls.io/r/spira/angular-http-progress?branch=master)
[](https://gemnasium.com/spira/angular-http-progress)
-[](http://badge.fury.io/bo/angular-http-progress)
[](http://badge.fury.io/js/angular-http-progress)
## Intro
@@ -13,32 +12,40 @@ This module wraps https://github.com/victorbjelkholm/ngprogress, adding an inter
## Installation
-Install through bower:
+Install with npm:
```sh
-bower install angular-http-progress --save
+npm install angular-http-progress --save
```
## Usage
* Require the `ngHttpProgress` module in your angular application
-```js
-angular.module('app', ['ngHttpProgress'])
+```ts
+
+ import "angular-http-progress";
+
+ angular.module('app', ['ngHttpProgress']);
+
```
* (Optionally) configure the service provider
-```js
-angular.module('app', ['ngHttpProgress'])
-.config(['ngHttpProgress', function(ngHttpProgressProvider){
- ngHttpProgressProvider
- .configure({
- color: '#ff000',
- height: '10px'
- })
- ;
-}])
+```ts
+
+ import {NgHttpProgressServiceProvider} from "angular-http-progress";
+
+ angular.module('app', ['ngHttpProgress'])
+ .config(['ngHttpProgress', function(ngHttpProgressProvider:NgHttpProgressServiceProvider){
+ ngHttpProgressProvider
+ .configure({
+ color: '#ff000',
+ height: '10px'
+ })
+ ;
+ }]);
+
```
* ???
diff --git a/bower.json b/bower.json
deleted file mode 100644
index 9715272..0000000
--- a/bower.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "angular-http-progress",
- "version": "0.1.5",
- "description": "Wrapper for https://github.com/victorbjelkholm/ngprogress - automatically handles http progress with interceptor",
- "main": "dist/ngHttpProgress.js",
- "dependencies": {
- "lodash": "~3.9.3",
- "moment": "~2.10.3",
- "angular": "~1.4.1",
- "ngprogress": "1.0.7"
- },
- "devDependencies": {
- "angular-mocks": "~1.4.1",
- "jquery": "~2.1.4"
- },
- "resolutions": {
- "angular": "~1.4.1"
- },
- "ignore": [
- "**/.*",
- "typings",
- "test"
- ]
-}
diff --git a/dist/ngHttpProgress.d.ts b/dist/ngHttpProgress.d.ts
index bd95920..c0ea42f 100644
--- a/dist/ngHttpProgress.d.ts
+++ b/dist/ngHttpProgress.d.ts
@@ -1,151 +1,4 @@
-///
-declare module NgHttpProgress {
- class NgHttpProgressInterceptor {
- private $q;
- private $injector;
- private ngHttpProgressService;
- /**
- * Construct the service with dependencies injected
- * @param _$q
- * @param _$injector
- */
- static $inject: string[];
- constructor($q: ng.IQService, $injector: ng.auto.IInjectorService);
- private getNgHttpProgressService;
- request: (config: any) => any;
- response: (response: any) => any;
- responseError: (rejection: any) => any;
- }
-}
-declare module NgHttpProgress {
- interface ngProgress {
- start(): void;
- height(cssHeight: string): void;
- color(cssColor: string): void;
- status(): number;
- stop(): void;
- set(percentage: number): void;
- reset(): void;
- complete(): void;
- getDomElement(): Element;
- }
- interface INgHttpProgressService {
- start(): ng.IPromise;
- stop(): ng.IPromise;
- complete(): ng.IPromise;
- rewind(): ng.IPromise;
- status(): number;
- set(percentage: number): void;
- }
- interface IngHttpProgressServiceProvider {
- configure(config: INgHttpProgressServiceConfig): NgHttpProgressServiceProvider;
- }
- interface INgHttpProgressServiceConfig {
- color?: string;
- height?: string;
- }
-}
-declare module NgHttpProgress {
- class NgHttpProgressService implements INgHttpProgressService {
- private config;
- private $q;
- private $timeout;
- private ngProgress;
- private currentProgressDeferred;
- private progressPromise;
- static ngProgressFinishTime: number;
- private pendingDelays;
- private stopped;
- /**
- * Construct the service with dependencies injected
- * @param config
- * @param $q
- * @param $timeout
- * @param ngProgress
- */
- constructor(config: INgHttpProgressServiceConfig, $q: ng.IQService, $timeout: ng.ITimeoutService, ngProgress: ngProgress);
- /**
- * Start the progress bar running
- * @returns {any}
- */
- start(): ng.IPromise;
- /**
- * Bump back the current status to less completed
- * @returns {number}
- */
- private bumpBack();
- /**
- * Halt the progress bar
- * @returns {IPromise}
- */
- stop(): ng.IPromise;
- /**
- * Complete the progress
- * @returns {IPromise}
- */
- complete(): ng.IPromise;
- /**
- * Reset the progress bar to zero
- * @returns {IPromise}
- */
- rewind(): ng.IPromise;
- /**
- * Get the status of the progress bar
- * @returns {number}
- */
- status(): number;
- progressStatus(): ng.IPromise;
- /**
- * Set the status of the progress bar
- * @param percentage
- */
- set(percentage: number): ng.IPromise;
- /**
- * Finish the progress of the promise
- * @returns {IPromise}
- */
- private finish();
- /**
- * Handle the reset. Immediately invoke as the ngProgress service executes immediately
- * @returns {IPromise}
- */
- private reset();
- /**
- * Handle the stopping.
- * @returns {IPromise}
- */
- private halt();
- /**
- * Intialise the progress deferred promise
- * @returns {IPromise}
- */
- private initProgressMeter();
- }
-}
-declare module NgHttpProgress {
- class Error {
- name: string;
- message: string;
- stack: string;
- constructor(message?: string);
- }
- class NgHttpProgressException extends Error {
- message: string;
- constructor(message: string);
- toString(): string;
- }
- class NgHttpProgressServiceProvider implements ng.IServiceProvider, IngHttpProgressServiceProvider {
- private config;
- /**
- * Initialise the service provider
- */
- constructor();
- /**
- * Set the configuration
- * @param config
- * @returns {NgHttpProgress.NgHttpProgressServiceProvider}
- */
- configure(config: INgHttpProgressServiceConfig): NgHttpProgressServiceProvider;
- $get: (string | (($q: any, $timeout: any, ngProgress: any) => NgHttpProgressService))[];
- }
-}
+import "angular";
+export * from "./provider/ngHttpProgressServiceProvider";
+export * from "./service/ngHttpProgressService";
+export * from "./interceptor/ngHttpProgressInterceptor";
diff --git a/dist/ngHttpProgress.js b/dist/ngHttpProgress.js
index 76d88e9..de7c1df 100644
--- a/dist/ngHttpProgress.js
+++ b/dist/ngHttpProgress.js
@@ -1,276 +1,19 @@
-///
-var NgHttpProgress;
-(function (NgHttpProgress) {
- var NgHttpProgressInterceptor = (function () {
- function NgHttpProgressInterceptor($q, $injector) {
- var _this = this;
- this.$q = $q;
- this.$injector = $injector;
- this.getNgHttpProgressService = function () {
- if (_this.ngHttpProgressService == null) {
- _this.ngHttpProgressService = _this.$injector.get('ngHttpProgress');
- }
- return _this.ngHttpProgressService;
- };
- this.request = function (config) {
- var progress = _this.getNgHttpProgressService();
- progress.start();
- return config;
- };
- this.response = function (response) {
- var progress = _this.getNgHttpProgressService();
- progress.complete();
- return response;
- };
- this.responseError = function (rejection) {
- var progress = _this.getNgHttpProgressService();
- progress.rewind();
- return _this.$q.reject(rejection);
- };
- }
- /**
- * Construct the service with dependencies injected
- * @param _$q
- * @param _$injector
- */
- NgHttpProgressInterceptor.$inject = ['$q', '$injector'];
- return NgHttpProgressInterceptor;
- })();
- NgHttpProgress.NgHttpProgressInterceptor = NgHttpProgressInterceptor;
-})(NgHttpProgress || (NgHttpProgress = {}));
-///
-var NgHttpProgress;
-(function (NgHttpProgress) {
- var NgHttpProgressService = (function () {
- /**
- * Construct the service with dependencies injected
- * @param config
- * @param $q
- * @param $timeout
- * @param ngProgress
- */
- function NgHttpProgressService(config, $q, $timeout, ngProgress) {
- this.config = config;
- this.$q = $q;
- this.$timeout = $timeout;
- this.ngProgress = ngProgress;
- this.pendingDelays = 0;
- this.stopped = false;
- this.ngProgress.color(this.config.color);
- this.ngProgress.height(this.config.height);
- }
- /**
- * Start the progress bar running
- * @returns {any}
- */
- NgHttpProgressService.prototype.start = function () {
- this.pendingDelays++;
- if (this.currentProgressDeferred) {
- if (this.stopped) {
- this.stopped = false;
- this.currentProgressDeferred.notify('start');
- }
- else {
- this.currentProgressDeferred.notify('bumpback');
- }
- return this.progressPromise;
- }
- return this.initProgressMeter();
- };
- /**
- * Bump back the current status to less completed
- * @returns {number}
- */
- NgHttpProgressService.prototype.bumpBack = function () {
- var currentProgress = this.status(), fallBackTo = currentProgress - currentProgress * (currentProgress / 120);
- this.set(fallBackTo);
- return this.progressPromise;
- };
- /**
- * Halt the progress bar
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.stop = function () {
- this.currentProgressDeferred.notify('stop');
- return this.progressPromise;
- };
- /**
- * Complete the progress
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.complete = function () {
- this.pendingDelays--;
- if (this.pendingDelays === 0) {
- this.currentProgressDeferred.resolve();
- }
- return this.progressPromise;
- };
- /**
- * Reset the progress bar to zero
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.rewind = function () {
- if (this.currentProgressDeferred) {
- this.currentProgressDeferred.reject();
- }
- return this.progressPromise;
- };
- /**
- * Get the status of the progress bar
- * @returns {number}
- */
- NgHttpProgressService.prototype.status = function () {
- return this.ngProgress.status();
- };
- NgHttpProgressService.prototype.progressStatus = function () {
- return this.progressPromise;
- };
- /**
- * Set the status of the progress bar
- * @param percentage
- */
- NgHttpProgressService.prototype.set = function (percentage) {
- var _this = this;
- this.$timeout(function () {
- _this.ngProgress.set(percentage);
- });
- return this.progressPromise;
- };
- /**
- * Finish the progress of the promise
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.finish = function () {
- var _this = this;
- var finishStatus = this.status();
- this.$timeout(function () {
- _this.ngProgress.complete();
- });
- return this.$timeout(function () {
- return finishStatus;
- }, NgHttpProgressService.ngProgressFinishTime);
- };
- /**
- * Handle the reset. Immediately invoke as the ngProgress service executes immediately
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.reset = function () {
- var _this = this;
- return this.$timeout(function () {
- var finishStatus = _this.status();
- _this.ngProgress.reset();
- return finishStatus;
- });
- };
- /**
- * Handle the stopping.
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.halt = function () {
- var _this = this;
- this.stopped = true;
- return this.$timeout(function () {
- var currentStatus = _this.status();
- _this.ngProgress.stop();
- return currentStatus;
- });
- };
- /**
- * Intialise the progress deferred promise
- * @returns {IPromise}
- */
- NgHttpProgressService.prototype.initProgressMeter = function () {
- var _this = this;
- this.currentProgressDeferred = this.$q.defer();
- this.ngProgress.start();
- return this.progressPromise = this.currentProgressDeferred.promise
- .then(function () {
- return _this.finish();
- }, function () {
- return _this.reset();
- }, function (action) {
- switch (action) {
- case 'start':
- _this.ngProgress.start();
- break;
- case 'stop':
- _this.halt();
- break;
- case 'bumpback':
- _this.bumpBack();
- break;
- }
- })
- .finally(function () {
- _this.currentProgressDeferred = null; //clear the current progress
- _this.progressPromise = null; //clear the current progress
- _this.pendingDelays = 0; //reset
- });
- };
- NgHttpProgressService.ngProgressFinishTime = 1600; //time for finish to complete
- return NgHttpProgressService;
- })();
- NgHttpProgress.NgHttpProgressService = NgHttpProgressService;
-})(NgHttpProgress || (NgHttpProgress = {}));
-var __extends = this.__extends || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- function __() { this.constructor = d; }
- __.prototype = b.prototype;
- d.prototype = new __();
-};
-var NgHttpProgress;
-(function (NgHttpProgress) {
- var NgHttpProgressException = (function (_super) {
- __extends(NgHttpProgressException, _super);
- function NgHttpProgressException(message) {
- _super.call(this, message);
- this.message = message;
- this.name = 'NgHttpProgressException';
- this.message = message;
- this.stack = (new Error()).stack;
- }
- NgHttpProgressException.prototype.toString = function () {
- return this.name + ': ' + this.message;
- };
- return NgHttpProgressException;
- })(Error);
- NgHttpProgress.NgHttpProgressException = NgHttpProgressException;
- var NgHttpProgressServiceProvider = (function () {
- /**
- * Initialise the service provider
- */
- function NgHttpProgressServiceProvider() {
- this.$get = ['$q', '$timeout', 'ngProgress', function ngHttpProgressServiceFactory($q, $timeout, ngProgress) {
- return new NgHttpProgress.NgHttpProgressService(this.config, $q, $timeout, ngProgress);
- }];
- //initialise service config
- this.config = {
- color: '#FF0000',
- height: '10px'
- };
- }
- /**
- * Set the configuration
- * @param config
- * @returns {NgHttpProgress.NgHttpProgressServiceProvider}
- */
- NgHttpProgressServiceProvider.prototype.configure = function (config) {
- var mismatchedConfig = _.xor(_.keys(config), _.keys(this.config));
- if (mismatchedConfig.length > 0) {
- throw new NgHttpProgressException("Invalid properties [" + mismatchedConfig.join(',') + "] passed to config)");
- }
- this.config = _.defaults(config, this.config);
- return this;
- };
- return NgHttpProgressServiceProvider;
- })();
- NgHttpProgress.NgHttpProgressServiceProvider = NgHttpProgressServiceProvider;
- angular.module('ngHttpProgress', ['ngProgress'])
- .provider('ngHttpProgress', NgHttpProgressServiceProvider)
- .service('ngHttpProgressInterceptor', NgHttpProgress.NgHttpProgressInterceptor)
- .config(['$httpProvider', '$injector', function ($httpProvider) {
- $httpProvider.interceptors.push('ngHttpProgressInterceptor');
- }]);
-})(NgHttpProgress || (NgHttpProgress = {}));
+"use strict";
+function __export(m) {
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+require("angular");
+require("ngprogress/main/ngProgress.js");
+var ngHttpProgressServiceProvider_1 = require("./provider/ngHttpProgressServiceProvider");
+var ngHttpProgressInterceptor_1 = require("./interceptor/ngHttpProgressInterceptor");
+__export(require("./provider/ngHttpProgressServiceProvider"));
+__export(require("./service/ngHttpProgressService"));
+__export(require("./interceptor/ngHttpProgressInterceptor"));
+angular.module('ngHttpProgress', ['ngProgress'])
+ .provider('ngHttpProgress', ngHttpProgressServiceProvider_1.NgHttpProgressServiceProvider)
+ .service('ngHttpProgressInterceptor', ngHttpProgressInterceptor_1.NgHttpProgressInterceptor)
+ .config(['$httpProvider', function ($httpProvider) {
+ $httpProvider.interceptors.push('ngHttpProgressInterceptor');
+ }]);
-//# sourceMappingURL=ngHttpProgress.js.map
\ No newline at end of file
+//# sourceMappingURL=ngHttpProgress.js.map
diff --git a/dist/ngHttpProgress.js.map b/dist/ngHttpProgress.js.map
index d4bf2f2..a4fea77 100644
--- a/dist/ngHttpProgress.js.map
+++ b/dist/ngHttpProgress.js.map
@@ -1 +1 @@
-{"version":3,"sources":["ngHttpProgressInterceptor.ts","ngHttpProgressInterfaces.ts","ngHttpProgressService.ts","ngHttpProgressServiceProvider.ts"],"names":["NgHttpProgress","NgHttpProgress.NgHttpProgressInterceptor","NgHttpProgress.NgHttpProgressInterceptor.constructor","NgHttpProgress.NgHttpProgressService","NgHttpProgress.NgHttpProgressService.constructor","NgHttpProgress.NgHttpProgressService.start","NgHttpProgress.NgHttpProgressService.bumpBack","NgHttpProgress.NgHttpProgressService.stop","NgHttpProgress.NgHttpProgressService.complete","NgHttpProgress.NgHttpProgressService.rewind","NgHttpProgress.NgHttpProgressService.status","NgHttpProgress.NgHttpProgressService.progressStatus","NgHttpProgress.NgHttpProgressService.set","NgHttpProgress.NgHttpProgressService.finish","NgHttpProgress.NgHttpProgressService.reset","NgHttpProgress.NgHttpProgressService.halt","NgHttpProgress.NgHttpProgressService.initProgressMeter","NgHttpProgress.NgHttpProgressException","NgHttpProgress.NgHttpProgressException.constructor","NgHttpProgress.NgHttpProgressException.toString","NgHttpProgress.NgHttpProgressServiceProvider","NgHttpProgress.NgHttpProgressServiceProvider.constructor","NgHttpProgress.NgHttpProgressServiceProvider.constructor.ngHttpProgressServiceFactory","NgHttpProgress.NgHttpProgressServiceProvider.configure"],"mappings":"AAAA,4CAA4C;AAE5C,IAAO,cAAc,CAqDpB;AArDD,WAAO,cAAc,EAAC,CAAC;IAEnBA;QAWIC,mCACYA,EAAgBA,EAChBA,SAAmCA;YAbnDC,iBAiDCA;YArCeA,OAAEA,GAAFA,EAAEA,CAAcA;YAChBA,cAASA,GAATA,SAASA,CAA0BA;YAIvCA,6BAAwBA,GAAGA;gBAC/BA,EAAEA,CAACA,CAACA,KAAIA,CAACA,qBAAqBA,IAAIA,IAAIA,CAACA,CAACA,CAACA;oBACrCA,KAAIA,CAACA,qBAAqBA,GAAGA,KAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,gBAAgBA,CAACA,CAACA;gBACtEA,CAACA;gBACDA,MAAMA,CAACA,KAAIA,CAACA,qBAAqBA,CAACA;YACtCA,CAACA,CAACA;YAEKA,YAAOA,GAAGA,UAACA,MAAMA;gBAEpBA,IAAIA,QAAQA,GAAGA,KAAIA,CAACA,wBAAwBA,EAAEA,CAACA;gBAE/CA,QAAQA,CAACA,KAAKA,EAAEA,CAACA;gBAEjBA,MAAMA,CAACA,MAAMA,CAACA;YAClBA,CAACA,CAACA;YAEKA,aAAQA,GAAGA,UAACA,QAAQA;gBAEvBA,IAAIA,QAAQA,GAAGA,KAAIA,CAACA,wBAAwBA,EAAEA,CAACA;gBAC/CA,QAAQA,CAACA,QAAQA,EAAEA,CAACA;gBAEpBA,MAAMA,CAACA,QAAQA,CAACA;YACpBA,CAACA,CAACA;YAEKA,kBAAaA,GAAGA,UAACA,SAASA;gBAE7BA,IAAIA,QAAQA,GAAGA,KAAIA,CAACA,wBAAwBA,EAAEA,CAACA;gBAC/CA,QAAQA,CAACA,MAAMA,EAAEA,CAACA;gBAElBA,MAAMA,CAACA,KAAIA,CAACA,EAAEA,CAACA,MAAMA,CAACA,SAASA,CAACA,CAACA;YACrCA,CAACA,CAACA;QAhCFA,CAACA;QAVDD;;;;WAIGA;QACIA,iCAAOA,GAAGA,CAACA,IAAIA,EAAEA,WAAWA,CAACA,CAACA;QAuCzCA,gCAACA;IAADA,CAjDAD,AAiDCC,IAAAD;IAjDYA,wCAAyBA,4BAiDrCA,CAAAA;AAELA,CAACA,EArDM,cAAc,KAAd,cAAc,QAqDpB;ACvDD,4CAA4C;ACC5C,IAAO,cAAc,CAqNpB;AArND,WAAO,cAAc,EAAC,CAAC;IAEnBA;QAUIG;;;;;;WAMGA;QACHA,+BACYA,MAAmCA,EACnCA,EAAgBA,EAChBA,QAA4BA,EAC5BA,UAAsBA;YAHtBC,WAAMA,GAANA,MAAMA,CAA6BA;YACnCA,OAAEA,GAAFA,EAAEA,CAAcA;YAChBA,aAAQA,GAARA,QAAQA,CAAoBA;YAC5BA,eAAUA,GAAVA,UAAUA,CAAYA;YAd1BA,kBAAaA,GAAGA,CAACA,CAACA;YAElBA,YAAOA,GAAWA,KAAKA,CAACA;YAe5BA,IAAIA,CAACA,UAAUA,CAACA,KAAKA,CAACA,IAAIA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA;YACzCA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,MAAMA,CAACA,CAACA;QAE/CA,CAACA;QAEDD;;;WAGGA;QACIA,qCAAKA,GAAZA;YAEIE,IAAIA,CAACA,aAAaA,EAAGA,CAACA;YAEtBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,uBAAuBA,CAACA,CAAAA,CAACA;gBAE9BA,EAAEA,CAACA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAAAA,CAACA;oBACdA,IAAIA,CAACA,OAAOA,GAAGA,KAAKA,CAACA;oBACrBA,IAAIA,CAACA,uBAAuBA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA;gBACjDA,CAACA;gBAAAA,IAAIA,CAAAA,CAACA;oBACFA,IAAIA,CAACA,uBAAuBA,CAACA,MAAMA,CAACA,UAAUA,CAACA,CAACA;gBACpDA,CAACA;gBAEDA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;YAChCA,CAACA;YAGDA,MAAMA,CAACA,IAAIA,CAACA,iBAAiBA,EAAEA,CAACA;QACpCA,CAACA;QAGDF;;;WAGGA;QACKA,wCAAQA,GAAhBA;YAEIG,IAAIA,eAAeA,GAAGA,IAAIA,CAACA,MAAMA,EAAEA,EAC/BA,UAAUA,GAAGA,eAAeA,GAAGA,eAAeA,GAAGA,CAACA,eAAeA,GAACA,GAAGA,CAACA,CAACA;YAE3EA,IAAIA,CAACA,GAAGA,CAACA,UAAUA,CAACA,CAACA;YACrBA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;QAChCA,CAACA;QAEDH;;;WAGGA;QACIA,oCAAIA,GAAXA;YACII,IAAIA,CAACA,uBAAuBA,CAACA,MAAMA,CAACA,MAAMA,CAACA,CAACA;YAC5CA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;QAChCA,CAACA;QAEDJ;;;WAGGA;QACIA,wCAAQA,GAAfA;YAEIK,IAAIA,CAACA,aAAaA,EAAGA,CAACA;YACtBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,aAAaA,KAAKA,CAACA,CAACA,CAAAA,CAACA;gBAC1BA,IAAIA,CAACA,uBAAuBA,CAACA,OAAOA,EAAEA,CAACA;YAC3CA,CAACA;YAEDA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;QAChCA,CAACA;QAEDL;;;WAGGA;QACIA,sCAAMA,GAAbA;YACIM,EAAEA,CAACA,CAACA,IAAIA,CAACA,uBAAuBA,CAACA,CAAAA,CAACA;gBAC9BA,IAAIA,CAACA,uBAAuBA,CAACA,MAAMA,EAAEA,CAACA;YAC1CA,CAACA;YACDA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;QAChCA,CAACA;QAEDN;;;WAGGA;QACIA,sCAAMA,GAAbA;YACIO,MAAMA,CAACA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,EAAEA,CAACA;QACpCA,CAACA;QAEMP,8CAAcA,GAArBA;YACIQ,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;QAChCA,CAACA;QAEDR;;;WAGGA;QACIA,mCAAGA,GAAVA,UAAWA,UAAiBA;YAA5BS,iBAOCA;YALGA,IAAIA,CAACA,QAAQA,CAACA;gBACVA,KAAIA,CAACA,UAAUA,CAACA,GAAGA,CAACA,UAAUA,CAACA,CAACA;YACpCA,CAACA,CAACA,CAACA;YAEHA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA;QAChCA,CAACA;QAEDT;;;WAGGA;QACKA,sCAAMA,GAAdA;YAAAU,iBAUCA;YATGA,IAAIA,YAAYA,GAAGA,IAAIA,CAACA,MAAMA,EAAEA,CAACA;YAEjCA,IAAIA,CAACA,QAAQA,CAACA;gBACVA,KAAIA,CAACA,UAAUA,CAACA,QAAQA,EAAEA,CAACA;YAC/BA,CAACA,CAACA,CAACA;YAEHA,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;gBACjBA,MAAMA,CAACA,YAAYA,CAACA;YACxBA,CAACA,EAAEA,qBAAqBA,CAACA,oBAAoBA,CAACA,CAACA;QACnDA,CAACA;QAEDV;;;WAGGA;QACKA,qCAAKA,GAAbA;YAAAW,iBAQCA;YANGA,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;gBACjBA,IAAIA,YAAYA,GAAGA,KAAIA,CAACA,MAAMA,EAAEA,CAACA;gBACjCA,KAAIA,CAACA,UAAUA,CAACA,KAAKA,EAAEA,CAACA;gBACxBA,MAAMA,CAACA,YAAYA,CAACA;YACxBA,CAACA,CAACA,CAACA;QAEPA,CAACA;QAEDX;;;WAGGA;QACKA,oCAAIA,GAAZA;YAAAY,iBAUCA;YARGA,IAAIA,CAACA,OAAOA,GAAGA,IAAIA,CAACA;YAEpBA,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;gBACjBA,IAAIA,aAAaA,GAAGA,KAAIA,CAACA,MAAMA,EAAEA,CAACA;gBAClCA,KAAIA,CAACA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;gBACvBA,MAAMA,CAACA,aAAaA,CAACA;YACzBA,CAACA,CAACA,CAACA;QAEPA,CAACA;QAEDZ;;;WAGGA;QACKA,iDAAiBA,GAAzBA;YAAAa,iBAgCCA;YA9BGA,IAAIA,CAACA,uBAAuBA,GAAGA,IAAIA,CAACA,EAAEA,CAACA,KAAKA,EAAEA,CAACA;YAE/CA,IAAIA,CAACA,UAAUA,CAACA,KAAKA,EAAEA,CAACA;YAExBA,MAAMA,CAACA,IAAIA,CAACA,eAAeA,GAAGA,IAAIA,CAACA,uBAAuBA,CAACA,OAAOA;iBAC7DA,IAAIA,CAACA;gBACFA,MAAMA,CAACA,KAAIA,CAACA,MAAMA,EAAEA,CAACA;YACzBA,CAACA,EAAEA;gBACCA,MAAMA,CAACA,KAAIA,CAACA,KAAKA,EAAEA,CAACA;YACxBA,CAACA,EAAEA,UAACA,MAAaA;gBAEbA,MAAMA,CAAAA,CAACA,MAAMA,CAACA,CAAAA,CAACA;oBACXA,KAAKA,OAAOA;wBACRA,KAAIA,CAACA,UAAUA,CAACA,KAAKA,EAAEA,CAACA;wBAC5BA,KAAKA,CAACA;oBACNA,KAAKA,MAAMA;wBACPA,KAAIA,CAACA,IAAIA,EAAEA,CAACA;wBAChBA,KAAKA,CAACA;oBACNA,KAAKA,UAAUA;wBACXA,KAAIA,CAACA,QAAQA,EAAEA,CAACA;wBACpBA,KAAKA,CAACA;gBACVA,CAACA;YAELA,CAACA,CAACA;iBACDA,OAAOA,CAACA;gBACLA,KAAIA,CAACA,uBAAuBA,GAAGA,IAAIA,CAACA,CAACA,4BAA4BA;gBACjEA,KAAIA,CAACA,eAAeA,GAAGA,IAAIA,CAACA,CAACA,4BAA4BA;gBACzDA,KAAIA,CAACA,aAAaA,GAAGA,CAACA,CAACA,CAACA,OAAOA;YACnCA,CAACA,CAACA,CAACA;QAEXA,CAACA;QA3MMb,0CAAoBA,GAAGA,IAAIA,CAACA,CAACA,6BAA6BA;QA4MrEA,4BAACA;IAADA,CAjNAH,AAiNCG,IAAAH;IAjNYA,oCAAqBA,wBAiNjCA,CAAAA;AAELA,CAACA,EArNM,cAAc,KAAd,cAAc,QAqNpB;;;;;;;ACtND,IAAO,cAAc,CAyEpB;AAzED,WAAO,cAAc,EAAC,CAAC;IASnBA;QAA6CiB,2CAAKA;QAE9CA,iCAAmBA,OAAeA;YAC9BC,kBAAMA,OAAOA,CAACA,CAACA;YADAA,YAAOA,GAAPA,OAAOA,CAAQA;YAE9BA,IAAIA,CAACA,IAAIA,GAAGA,yBAAyBA,CAACA;YACtCA,IAAIA,CAACA,OAAOA,GAAGA,OAAOA,CAACA;YACvBA,IAAIA,CAACA,KAAKA,GAAGA,CAAMA,IAAIA,KAAKA,EAAEA,CAACA,CAACA,KAAKA,CAACA;QAC1CA,CAACA;QACDD,0CAAQA,GAARA;YACIE,MAAMA,CAACA,IAAIA,CAACA,IAAIA,GAAGA,IAAIA,GAAGA,IAAIA,CAACA,OAAOA,CAACA;QAC3CA,CAACA;QACLF,8BAACA;IAADA,CAXAjB,AAWCiB,EAX4CjB,KAAKA,EAWjDA;IAXYA,sCAAuBA,0BAWnCA,CAAAA;IAEDA;QAIIoB;;WAEGA;QACHA;YA0BOC,SAAIA,GAAGA,CAACA,IAAIA,EAAEA,UAAUA,EAAEA,YAAYA,EAAEA,sCAAsCA,EAAEA,EAAEA,QAAQA,EAAEA,UAAUA;oBACzGC,MAAMA,CAACA,IAAIA,oCAAqBA,CAACA,IAAIA,CAACA,MAAMA,EAAEA,EAAEA,EAAEA,QAAQA,EAAEA,UAAUA,CAACA,CAACA;gBAC5EA,CAACA,CAACD,CAACA;YA1BCA,2BAA2BA;YAC3BA,IAAIA,CAACA,MAAMA,GAAGA;gBACVA,KAAKA,EAAEA,SAASA;gBAChBA,MAAMA,EAAEA,MAAMA;aACjBA,CAACA;QAENA,CAACA;QAEDD;;;;WAIGA;QACIA,iDAASA,GAAhBA,UAAiBA,MAAmCA;YAEhDG,IAAIA,gBAAgBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,CAACA;YAClEA,EAAEA,CAACA,CAACA,gBAAgBA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAAAA,CAACA;gBAC7BA,MAAMA,IAAIA,uBAAuBA,CAACA,sBAAsBA,GAACA,gBAAgBA,CAACA,IAAIA,CAACA,GAAGA,CAACA,GAACA,qBAAqBA,CAACA,CAACA;YAC/GA,CAACA;YAEDA,IAAIA,CAACA,MAAMA,GAAGA,CAACA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAC9CA,MAAMA,CAACA,IAAIA,CAACA;QAChBA,CAACA;QAMLH,oCAACA;IAADA,CArCApB,AAqCCoB,IAAApB;IArCYA,4CAA6BA,gCAqCzCA,CAAAA;IAIDA,OAAOA,CAACA,MAAMA,CAACA,gBAAgBA,EAAEA,CAACA,YAAYA,CAACA,CAACA;SAC3CA,QAAQA,CAACA,gBAAgBA,EAAEA,6BAA6BA,CAACA;SACzDA,OAAOA,CAACA,2BAA2BA,EAAEA,wCAAyBA,CAACA;SAC/DA,MAAMA,CAACA,CAACA,eAAeA,EAAEA,WAAWA,EAAEA,UAACA,aAA8BA;YAElEA,aAAaA,CAACA,YAAYA,CAACA,IAAIA,CAACA,2BAA2BA,CAACA,CAACA;QACjEA,CAACA,CAACA,CAACA,CACNA;AAGLA,CAACA,EAzEM,cAAc,KAAd,cAAc,QAyEpB","file":"ngHttpProgress.js","sourceRoot":"../src/"}
\ No newline at end of file
+{"version":3,"sources":["ngHttpProgress.ts"],"names":[],"mappings":";;;;AAAA,QAAO,SAAS,CAAC,CAAA;AACjB,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAEzC,8CAA4C,0CAA0C,CAAC,CAAA;AACvF,0CAAwC,yCAAyC,CAAC,CAAA;AAElF,iBAAc,0CAA0C,CAAC,EAAA;AACzD,iBAAc,iCAAiC,CAAC,EAAA;AAChD,iBAAc,yCAAyC,CAAC,EAAA;AAExD,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,YAAY,CAAC,CAAC;KAC3C,QAAQ,CAAC,gBAAgB,EAAE,6DAA6B,CAAC;KACzD,OAAO,CAAC,2BAA2B,EAAE,qDAAyB,CAAC;KAC/D,MAAM,CAAC,CAAC,eAAe,EAAE,UAAC,aAA8B;QAErD,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC,CACN","file":"ngHttpProgress.js","sourceRoot":"../src/"}
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
index 558a3d8..3c5e850 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -21,93 +21,39 @@ var gulpCore = require('gulp'),
}),
gulp = plugins.help(gulpCore),
_ = require('lodash'),
- path = require('path'),
- bowerJson = require('./bower.json'),
- packageJson = require('./package.json')
- ;
+ path = require('path')
+;
-var tsDefinitions = './typings/**/*.d.ts';
+var tsDefinitions = './typings/browser/**/*.d.ts';
var sources = {
- tsd: './typings/**/*.d.ts',
app: {
- ts: [tsDefinitions, './src/**/*.ts']
- },
- test: {
- ts: [tsDefinitions, './test/**/*.ts']
+ ts: [tsDefinitions, './src/**/*.ts', '!**/*.spec.ts', '!src/test.ts']
}
};
var destinations = {
app: './dist',
- testTmp: './test/tmp',
coverage: 'reports/**/lcov.info'
};
-gulp.task('test', 'runs test sequence for frontend', function (cb) {
- return plugins.runSequence('clean', 'js:app', 'js:test', 'test:karma', cb);
-});
-
-gulp.task('js:test', function () {
-
- var tsResult = gulp.src(sources.test.ts)
- .pipe(plugins.typescript({
- target: "ES5",
- typescript: require('typescript')
- }));
-
- return tsResult.js.pipe(gulp.dest(destinations.testTmp))
-});
-
-gulp.task('test:karma', function () {
+gulp.task('typescript', function () {
- var vendorFiles = plugins.mainBowerFiles({
- includeDev: true,
- paths: {
- bowerDirectory: 'bower_components',
- bowerJson: 'bower.json'
- }
+ var tsProject = plugins.typescript.createProject('tsconfig.build.json', {
+ declarationFiles: true,
+ noExternalResolve: true
});
- vendorFiles = vendorFiles.map(function (path) {
- return path.replace(/\\/g, "\/").replace(/^.+bower_components\//i, './bower_components/');
- });
-
- var testFiles = [].concat(
- vendorFiles, destinations.testTmp + '**/*.js', destinations.app + '**/*.js'
- );
-
- gulp.src(testFiles)
- .pipe(plugins.karma({
- configFile: 'karma.conf.js',
- action: 'run'
- }))
- .on('error', function (err) {
- // Make sure failed tests cause gulp to exit non-zero
- throw err;
- });
-
-});
-
-gulp.task('js:app', function () {
-
- var tsResult = gulp.src(sources.app.ts)
+ var tsStream = gulp.src(sources.app.ts)
.pipe(plugins.sourcemaps.init())
- .pipe(plugins.typescript({
- target: "ES5",
- noExternalResolve: true,
- typescript: require('typescript'),
- out: path.basename(bowerJson.main),
- declarationFiles: true
- }, undefined, plugins.typescript.reporter.longReporter()));
+ .pipe(plugins.typescript(tsProject, undefined, plugins.typescript.reporter.longReporter()));
return plugins.merge2([
- tsResult.dts
- .pipe(plugins.replace(' {
+ if (this.ngHttpProgressService == null) {
+ this.ngHttpProgressService = this.$injector.get('ngHttpProgress');
+ }
+ return this.ngHttpProgressService;
+ };
+
+ public request = (config):any => {
+
+ let progress = this.getNgHttpProgressService();
+
+ progress.start();
+
+ return config;
+ };
+
+ public response = (response):any => {
+
+ let progress = this.getNgHttpProgressService();
+ progress.complete();
+
+ return response;
+ };
+
+ public responseError = (rejection):any => {
+
+ let progress = this.getNgHttpProgressService();
+ progress.rewind();
+
+ return this.$q.reject(rejection);
+ };
+
+}
diff --git a/src/ngHttpProgress.ts b/src/ngHttpProgress.ts
new file mode 100644
index 0000000..8602a4b
--- /dev/null
+++ b/src/ngHttpProgress.ts
@@ -0,0 +1,18 @@
+import "angular";
+// import "ngprogress"
+
+import {NgHttpProgressServiceProvider} from "./provider/ngHttpProgressServiceProvider";
+import {NgHttpProgressInterceptor} from "./interceptor/ngHttpProgressInterceptor";
+
+export * from "./provider/ngHttpProgressServiceProvider";
+export * from "./service/ngHttpProgressService";
+export * from "./interceptor/ngHttpProgressInterceptor";
+
+angular.module('ngHttpProgress', [/*'ngProgress'*/])
+ .provider('ngHttpProgress', NgHttpProgressServiceProvider)
+ .service('ngHttpProgressInterceptor', NgHttpProgressInterceptor)
+ .config(['$httpProvider', ($httpProvider:ng.IHttpProvider) => {
+
+ $httpProvider.interceptors.push('ngHttpProgressInterceptor');
+ }])
+;
\ No newline at end of file
diff --git a/src/ngHttpProgressInterceptor.ts b/src/ngHttpProgressInterceptor.ts
deleted file mode 100644
index 7e682c1..0000000
--- a/src/ngHttpProgressInterceptor.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-///
-
-module NgHttpProgress {
-
- export class NgHttpProgressInterceptor {
-
- private ngHttpProgressService: NgHttpProgressService;
-
-
- /**
- * Construct the service with dependencies injected
- * @param _$q
- * @param _$injector
- */
- static $inject = ['$q', '$injector'];
- constructor(
- private $q: ng.IQService,
- private $injector: ng.auto.IInjectorService) {
-
- }
-
- private getNgHttpProgressService = (): NgHttpProgressService=> {
- if (this.ngHttpProgressService == null) {
- this.ngHttpProgressService = this.$injector.get('ngHttpProgress');
- }
- return this.ngHttpProgressService;
- };
-
- public request = (config):any => {
-
- let progress = this.getNgHttpProgressService();
-
- progress.start();
-
- return config;
- };
-
- public response = (response):any => {
-
- let progress = this.getNgHttpProgressService();
- progress.complete();
-
- return response;
- };
-
- public responseError = (rejection):any => {
-
- let progress = this.getNgHttpProgressService();
- progress.rewind();
-
- return this.$q.reject(rejection);
- };
-
- }
-
-}
diff --git a/src/ngHttpProgressInterfaces.ts b/src/ngHttpProgressInterfaces.ts
deleted file mode 100644
index 9613858..0000000
--- a/src/ngHttpProgressInterfaces.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-///
-
-module NgHttpProgress {
-
- export interface ngProgress {
- start():void;
- height(cssHeight:string):void
- color(cssColor:string):void
- status():number;
- stop():void;
- set(percentage:number):void;
- reset():void;
- complete():void;
- getDomElement():Element;
- }
-
- export interface INgHttpProgressService {
- start(): ng.IPromise;
- stop(): ng.IPromise;
- complete(): ng.IPromise;
- rewind(): ng.IPromise;
- status(): number;
- set(percentage:number):void;
- }
-
- export interface IngHttpProgressServiceProvider {
- configure(config:INgHttpProgressServiceConfig): NgHttpProgressServiceProvider;
- }
-
- export interface INgHttpProgressServiceConfig {
- color?: string;
- height?: string;
- }
-
-}
diff --git a/src/ngHttpProgressService.ts b/src/ngHttpProgressService.ts
deleted file mode 100644
index 4f9a36f..0000000
--- a/src/ngHttpProgressService.ts
+++ /dev/null
@@ -1,215 +0,0 @@
-
-module NgHttpProgress {
-
- export class NgHttpProgressService implements INgHttpProgressService {
-
- private currentProgressDeferred:ng.IDeferred;
- private progressPromise:ng.IPromise;
-
- static ngProgressFinishTime = 1600; //time for finish to complete
-
- private pendingDelays = 0;
-
- private stopped:boolean = false;
- /**
- * Construct the service with dependencies injected
- * @param config
- * @param $q
- * @param $timeout
- * @param ngProgress
- */
- constructor(
- private config:INgHttpProgressServiceConfig,
- private $q: ng.IQService,
- private $timeout: ng.ITimeoutService,
- private ngProgress: ngProgress
- ) {
-
- this.ngProgress.color(this.config.color);
- this.ngProgress.height(this.config.height);
-
- }
-
- /**
- * Start the progress bar running
- * @returns {any}
- */
- public start():ng.IPromise {
-
- this.pendingDelays ++;
-
- if (this.currentProgressDeferred){ //exists
-
- if (this.stopped){
- this.stopped = false;
- this.currentProgressDeferred.notify('start');
- }else{
- this.currentProgressDeferred.notify('bumpback');
- }
-
- return this.progressPromise;
- }
-
-
- return this.initProgressMeter();
- }
-
-
- /**
- * Bump back the current status to less completed
- * @returns {number}
- */
- private bumpBack():ng.IPromise {
-
- let currentProgress = this.status(),
- fallBackTo = currentProgress - currentProgress * (currentProgress/120);
-
- this.set(fallBackTo);
- return this.progressPromise;
- }
-
- /**
- * Halt the progress bar
- * @returns {IPromise}
- */
- public stop():ng.IPromise {
- this.currentProgressDeferred.notify('stop');
- return this.progressPromise;
- }
-
- /**
- * Complete the progress
- * @returns {IPromise}
- */
- public complete():ng.IPromise {
-
- this.pendingDelays --;
- if (this.pendingDelays === 0){ //no more delays remaining
- this.currentProgressDeferred.resolve();
- }
-
- return this.progressPromise;
- }
-
- /**
- * Reset the progress bar to zero
- * @returns {IPromise}
- */
- public rewind():ng.IPromise {
- if (this.currentProgressDeferred){
- this.currentProgressDeferred.reject();
- }
- return this.progressPromise;
- }
-
- /**
- * Get the status of the progress bar
- * @returns {number}
- */
- public status():number {
- return this.ngProgress.status();
- }
-
- public progressStatus():ng.IPromise {
- return this.progressPromise;
- }
-
- /**
- * Set the status of the progress bar
- * @param percentage
- */
- public set(percentage:number):ng.IPromise {
-
- this.$timeout(() => { //immediately invoke timeout in case a $digest cycle is busy
- this.ngProgress.set(percentage);
- });
-
- return this.progressPromise;
- }
-
- /**
- * Finish the progress of the promise
- * @returns {IPromise}
- */
- private finish():ng.IPromise {
- let finishStatus = this.status();
-
- this.$timeout(() => { //wrap in $timeout to allow $digest to have a cycle
- this.ngProgress.complete();
- });
-
- return this.$timeout(() => { //wait for the animation to finish before setting status
- return finishStatus;
- }, NgHttpProgressService.ngProgressFinishTime);
- }
-
- /**
- * Handle the reset. Immediately invoke as the ngProgress service executes immediately
- * @returns {IPromise}
- */
- private reset():ng.IPromise {
-
- return this.$timeout(() => { //wrap in $timeout to allow $digest to have a cycle
- let finishStatus = this.status();
- this.ngProgress.reset();
- return finishStatus;
- });
-
- }
-
- /**
- * Handle the stopping.
- * @returns {IPromise}
- */
- private halt():ng.IPromise {
-
- this.stopped = true;
-
- return this.$timeout(() => { //wrap in $timeout to allow $digest to have a cycle
- let currentStatus = this.status();
- this.ngProgress.stop();
- return currentStatus;
- });
-
- }
-
- /**
- * Intialise the progress deferred promise
- * @returns {IPromise}
- */
- private initProgressMeter():ng.IPromise {
-
- this.currentProgressDeferred = this.$q.defer();
-
- this.ngProgress.start();
-
- return this.progressPromise = this.currentProgressDeferred.promise
- .then(() => { //success
- return this.finish();
- }, () => { //error
- return this.reset();
- }, (action:string) => { //notify
-
- switch(action){
- case 'start':
- this.ngProgress.start();
- break;
- case 'stop':
- this.halt();
- break;
- case 'bumpback':
- this.bumpBack();
- break;
- }
-
- })
- .finally(() => {
- this.currentProgressDeferred = null; //clear the current progress
- this.progressPromise = null; //clear the current progress
- this.pendingDelays = 0; //reset
- });
-
- }
- }
-
-}
diff --git a/src/ngHttpProgressServiceProvider.ts b/src/ngHttpProgressServiceProvider.ts
deleted file mode 100644
index a6ffff3..0000000
--- a/src/ngHttpProgressServiceProvider.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-module NgHttpProgress {
-
- export declare class Error {
- public name: string;
- public message: string;
- public stack: string;
- constructor(message?: string);
- }
-
- export class NgHttpProgressException extends Error {
-
- constructor(public message: string) {
- super(message);
- this.name = 'NgHttpProgressException';
- this.message = message;
- this.stack = (new Error()).stack;
- }
- toString() {
- return this.name + ': ' + this.message;
- }
- }
-
- export class NgHttpProgressServiceProvider implements ng.IServiceProvider, IngHttpProgressServiceProvider {
-
- private config: INgHttpProgressServiceConfig;
-
- /**
- * Initialise the service provider
- */
- constructor() {
-
- //initialise service config
- this.config = {
- color: '#FF0000',
- height: '10px'
- };
-
- }
-
- /**
- * Set the configuration
- * @param config
- * @returns {NgHttpProgress.NgHttpProgressServiceProvider}
- */
- public configure(config:INgHttpProgressServiceConfig) : NgHttpProgressServiceProvider {
-
- let mismatchedConfig = _.xor(_.keys(config), _.keys(this.config));
- if (mismatchedConfig.length > 0){
- throw new NgHttpProgressException("Invalid properties ["+mismatchedConfig.join(',')+"] passed to config)");
- }
-
- this.config = _.defaults(config, this.config);
- return this;
- }
-
- public $get = ['$q', '$timeout', 'ngProgress', function ngHttpProgressServiceFactory($q, $timeout, ngProgress) {
- return new NgHttpProgressService(this.config, $q, $timeout, ngProgress);
- }];
-
- }
-
-
-
- angular.module('ngHttpProgress', ['ngProgress'])
- .provider('ngHttpProgress', NgHttpProgressServiceProvider)
- .service('ngHttpProgressInterceptor', NgHttpProgressInterceptor)
- .config(['$httpProvider', '$injector', ($httpProvider:ng.IHttpProvider) => {
-
- $httpProvider.interceptors.push('ngHttpProgressInterceptor');
- }])
- ;
-
-
-}
diff --git a/src/provider/ngHttpProgressServiceProvider.ts b/src/provider/ngHttpProgressServiceProvider.ts
new file mode 100644
index 0000000..87843c1
--- /dev/null
+++ b/src/provider/ngHttpProgressServiceProvider.ts
@@ -0,0 +1,71 @@
+import * as _ from "lodash";
+import {NgHttpProgressService} from "../service/ngHttpProgressService";
+
+export interface INgHttpProgressServiceConfig {
+ color?:string; //eg "FF0000"
+ height?:string; //eg "10px"
+}
+
+export declare class Error {
+ public name:string;
+ public message:string;
+ public stack:string;
+
+ constructor(message?:string);
+}
+
+export class NgHttpProgressException extends Error {
+
+ constructor(public message:string) {
+ super(message);
+ this.name = 'NgHttpProgressException';
+ this.message = message;
+ this.stack = (new Error()).stack;
+ }
+
+ toString() {
+ return this.name + ': ' + this.message;
+ }
+}
+
+export class NgHttpProgressServiceProvider implements ng.IServiceProvider {
+
+ private config:INgHttpProgressServiceConfig;
+
+ /**
+ * Initialise the service provider
+ */
+ constructor() {
+
+ //initialise service config
+ this.config = {
+ color: '#FF0000',
+ height: '10px'
+ };
+
+ }
+
+ /**
+ * Set the configuration
+ * @param config
+ * @returns {NgHttpProgressServiceProvider}
+ */
+ public configure(config:INgHttpProgressServiceConfig):this {
+
+ let mismatchedConfig = _.xor(_.keys(config), _.keys(this.config));
+ if (mismatchedConfig.length > 0) {
+ throw new NgHttpProgressException("Invalid properties [" + mismatchedConfig.join(',') + "] passed to config)");
+ }
+
+ this.config = _.defaults(config, this.config);
+ return this;
+ }
+
+ public $get = ['$q', '$timeout', /*'ngProgress',*/ function ngHttpProgressServiceFactory($q, $timeout/*, ngProgress*/) {
+ return new NgHttpProgressService(this.config, $q, $timeout/*, ngProgress*/);
+ }];
+
+}
+
+
+
diff --git a/test/test.ts b/src/service/ngHttpProgress.spec.ts
similarity index 88%
rename from test/test.ts
rename to src/service/ngHttpProgress.spec.ts
index 863864d..c728e9e 100644
--- a/test/test.ts
+++ b/src/service/ngHttpProgress.spec.ts
@@ -1,20 +1,11 @@
-///
-///
-
-
-let expect = chai.expect;
-
-let fixtures = {
-
-
- get customConfig():NgHttpProgress.INgHttpProgressServiceConfig{
- return {
- color: 'rgb(255, 0, 255)',
- height: '2px'
- };
- },
-
-};
+import {
+ expect,
+ // sinon,
+ fixtures,
+ NgHttpProgressServiceProvider
+} from "../testBootstrap.spec";
+import {NgHttpProgressService} from "./ngHttpProgressService";
+import {NgHttpProgressException} from "../provider/ngHttpProgressServiceProvider";
let $http:ng.IHttpService;
let $q:ng.IQService;
@@ -35,14 +26,14 @@ let tickTime = (seconds) => {
-describe('Custom configuration', function () {
+describe('Custom configuration', () => {
- let ngHttpProgressProvider:NgHttpProgress.NgHttpProgressServiceProvider;
- let customProgressService:NgHttpProgress.NgHttpProgressService;
+ let ngHttpProgressProvider:NgHttpProgressServiceProvider;
+ let customProgressService:NgHttpProgressService;
beforeEach(() => {
- module('ngHttpProgress', (_ngHttpProgressProvider_) => {
+ angular.mock.module('ngHttpProgress', (_ngHttpProgressProvider_) => {
ngHttpProgressProvider = _ngHttpProgressProvider_; //register injection of service provider
ngHttpProgressProvider.configure(fixtures.customConfig);
@@ -54,10 +45,10 @@ describe('Custom configuration', function () {
it('should throw an exception when invalid configuration is passed', () => {
let testInvalidConfigurationFn = () => {
- ngHttpProgressProvider.configure({invalid:'config'});
+ ngHttpProgressProvider.configure({invalid:'config'});
};
- expect(testInvalidConfigurationFn).to.throw(NgHttpProgress.NgHttpProgressException);
+ expect(testInvalidConfigurationFn).to.throw(NgHttpProgressException);
});
@@ -67,7 +58,7 @@ describe('Custom configuration', function () {
})
});
- it('should have the configured color and height', function() {
+ it('should have the configured color and height', () => {
let element:Element = (customProgressService).ngProgress.getDomElement(),
styledElement = jQuery(element).find('#ngProgress')
@@ -82,12 +73,12 @@ describe('Custom configuration', function () {
describe('Service tests', () => {
let $httpBackend:ng.IHttpBackendService;
- let ngHttpProgressService:NgHttpProgress.NgHttpProgressService;
+ let ngHttpProgressService:NgHttpProgressService;
beforeEach(()=>{
- module('ngHttpProgress');
+ angular.mock.module('ngHttpProgress');
inject((_$httpBackend_, _ngHttpProgress_, _$http_, _$q_, _$interval_, _$timeout_) => {
@@ -258,7 +249,7 @@ describe('Service tests', () => {
tickTime(2); //flush the completion timeout
- })
+ });
});
diff --git a/src/service/ngHttpProgressService.ts b/src/service/ngHttpProgressService.ts
new file mode 100644
index 0000000..fcff9fd
--- /dev/null
+++ b/src/service/ngHttpProgressService.ts
@@ -0,0 +1,208 @@
+import {INgHttpProgressServiceConfig} from "../provider/ngHttpProgressServiceProvider";
+export class NgHttpProgressService {
+
+ private currentProgressDeferred:ng.IDeferred;
+ private progressPromise:ng.IPromise;
+
+ static ngProgressFinishTime = 1600; //time for finish to complete
+
+ private pendingDelays = 0;
+
+ private stopped:boolean = false;
+
+ /**
+ * Construct the service with dependencies injected
+ * @param config
+ * @param $q
+ * @param $timeout
+ * @param ngProgress
+ */
+ constructor(private config:INgHttpProgressServiceConfig,
+ private $q:ng.IQService,
+ private $timeout:ng.ITimeoutService,
+ private ngProgress:NgProgress.NgProgress) {
+
+ this.ngProgress.color(this.config.color);
+ this.ngProgress.height(this.config.height);
+
+ }
+
+ /**
+ * Start the progress bar running
+ * @returns {any}
+ */
+ public start():ng.IPromise {
+
+ this.pendingDelays++;
+
+ if (this.currentProgressDeferred) { //exists
+
+ if (this.stopped) {
+ this.stopped = false;
+ this.currentProgressDeferred.notify('start');
+ } else {
+ this.currentProgressDeferred.notify('bumpback');
+ }
+
+ return this.progressPromise;
+ }
+
+ return this.initProgressMeter();
+ }
+
+ /**
+ * Bump back the current status to less completed
+ * @returns {number}
+ */
+ private bumpBack():ng.IPromise {
+
+ let currentProgress = this.status(),
+ fallBackTo = currentProgress - currentProgress * (currentProgress / 120);
+
+ this.set(fallBackTo);
+ return this.progressPromise;
+ }
+
+ /**
+ * Halt the progress bar
+ * @returns {IPromise}
+ */
+ public stop():ng.IPromise {
+ this.currentProgressDeferred.notify('stop');
+ return this.progressPromise;
+ }
+
+ /**
+ * Complete the progress
+ * @returns {IPromise}
+ */
+ public complete():ng.IPromise {
+
+ this.pendingDelays--;
+ if (this.pendingDelays === 0) { //no more delays remaining
+ this.currentProgressDeferred.resolve();
+ }
+
+ return this.progressPromise;
+ }
+
+ /**
+ * Reset the progress bar to zero
+ * @returns {IPromise}
+ */
+ public rewind():ng.IPromise {
+ if (this.currentProgressDeferred) {
+ this.currentProgressDeferred.reject();
+ }
+ return this.progressPromise;
+ }
+
+ /**
+ * Get the status of the progress bar
+ * @returns {number}
+ */
+ public status():number {
+ return this.ngProgress.status();
+ }
+
+ public progressStatus():ng.IPromise {
+ return this.progressPromise;
+ }
+
+ /**
+ * Set the status of the progress bar
+ * @param percentage
+ */
+ public set(percentage:number):ng.IPromise {
+
+ this.$timeout(() => { //immediately invoke timeout in case a $digest cycle is busy
+ this.ngProgress.set(percentage);
+ });
+
+ return this.progressPromise;
+ }
+
+ /**
+ * Finish the progress of the promise
+ * @returns {IPromise}
+ */
+ private finish():ng.IPromise {
+ let finishStatus = this.status();
+
+ this.$timeout(() => { //wrap in $timeout to allow $digest to have a cycle
+ this.ngProgress.complete();
+ });
+
+ return this.$timeout(() => { //wait for the animation to finish before setting status
+ return finishStatus;
+ }, NgHttpProgressService.ngProgressFinishTime);
+ }
+
+ /**
+ * Handle the reset. Immediately invoke as the ngProgress service executes immediately
+ * @returns {IPromise}
+ */
+ private reset():ng.IPromise {
+
+ return this.$timeout(() => { //wrap in $timeout to allow $digest to have a cycle
+ let finishStatus = this.status();
+ this.ngProgress.reset();
+ return finishStatus;
+ });
+
+ }
+
+ /**
+ * Handle the stopping.
+ * @returns {IPromise}
+ */
+ private halt():ng.IPromise {
+
+ this.stopped = true;
+
+ return this.$timeout(() => { //wrap in $timeout to allow $digest to have a cycle
+ let currentStatus = this.status();
+ this.ngProgress.stop();
+ return currentStatus;
+ });
+
+ }
+
+ /**
+ * Intialise the progress deferred promise
+ * @returns {IPromise}
+ */
+ private initProgressMeter():ng.IPromise {
+
+ this.currentProgressDeferred = this.$q.defer();
+
+ this.ngProgress.start();
+
+ return this.progressPromise = this.currentProgressDeferred.promise
+ .then(() => { //success
+ return this.finish();
+ }, () => { //error
+ return this.reset();
+ }, (action:string) => { //notify
+
+ switch (action) {
+ case 'start':
+ this.ngProgress.start();
+ break;
+ case 'stop':
+ this.halt();
+ break;
+ case 'bumpback':
+ this.bumpBack();
+ break;
+ }
+
+ })
+ .finally(() => {
+ this.currentProgressDeferred = null; //clear the current progress
+ this.progressPromise = null; //clear the current progress
+ this.pendingDelays = 0; //reset
+ });
+
+ }
+}
diff --git a/src/test.ts b/src/test.ts
new file mode 100644
index 0000000..c603681
--- /dev/null
+++ b/src/test.ts
@@ -0,0 +1,7 @@
+// this file is only being used by karma
+require('phantomjs-polyfill');
+
+requireAll((require).context("./", true, /spec.ts$/));
+function requireAll(r:any):any {
+ r.keys().forEach(r);
+}
\ No newline at end of file
diff --git a/src/testBootstrap.spec.ts b/src/testBootstrap.spec.ts
new file mode 100644
index 0000000..b48002b
--- /dev/null
+++ b/src/testBootstrap.spec.ts
@@ -0,0 +1,16 @@
+import "angular";
+import "angular-mocks";
+import "./ngHttpProgress";
+import * as chai from "chai";
+import * as chaiAsPromised from "chai-as-promised";
+// import * as sinon from "sinon";
+import * as sinonChai from "sinon-chai";
+
+chai.use(chaiAsPromised);
+chai.use(sinonChai);
+
+
+export * from "./fixtures.spec";
+export * from "./ngHttpProgress";
+export const expect = chai.expect;
+export const sinon = sinon;
\ No newline at end of file
diff --git a/tsconfig.build.json b/tsconfig.build.json
new file mode 100644
index 0000000..fdb9784
--- /dev/null
+++ b/tsconfig.build.json
@@ -0,0 +1,12 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "noImplicitAny": false,
+ "removeComments": false,
+ "sourceMap": true,
+ "module": "commonjs",
+ "experimentalDecorators": true,
+ "outDir": "dist"
+ },
+ "version": "1.8.9"
+}
\ No newline at end of file
diff --git a/tsconfig.test.json b/tsconfig.test.json
new file mode 100644
index 0000000..100c4e4
--- /dev/null
+++ b/tsconfig.test.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "noImplicitAny": false,
+ "removeComments": false,
+ "sourceMap": true,
+ "module": "commonjs",
+ "experimentalDecorators": true,
+ "outDir": "dist"
+ },
+ "exclude": [
+ "out",
+ "node_modules",
+ "dist",
+ "dev",
+ "typings/main.d.ts",
+ "typings/main",
+ "reports",
+ "examples"
+ ],
+ "version": "1.8.9"
+}
\ No newline at end of file
diff --git a/typings.json b/typings.json
new file mode 100644
index 0000000..8a58fce
--- /dev/null
+++ b/typings.json
@@ -0,0 +1,17 @@
+{
+ "ambientDependencies": {
+ "angular": "registry:dt/angular#1.5.0+20160328125810",
+ "angular-mocks": "registry:dt/angular-mocks#1.3.0+20160322011350",
+ "chai": "registry:dt/chai#3.4.0+20160317120654",
+ "chai-as-promised": "registry:dt/chai-as-promised#0.0.0+20160317120654",
+ "chance": "registry:dt/chance#0.7.3+20160317120654",
+ "jquery": "registry:dt/jquery#1.10.0+20160316155526",
+ "mocha": "registry:dt/mocha#2.2.5+20160317120654",
+ "promises-a-plus": "registry:dt/promises-a-plus#0.0.0+20160317120654",
+ "sinon": "registry:dt/sinon#1.16.0+20160317120654",
+ "sinon-chai": "registry:dt/sinon-chai#2.7.0+20160317120654"
+ },
+ "dependencies": {
+ "lodash": "registry:npm/lodash#4.0.0+20160305082308"
+ }
+}
diff --git a/typings/angularjs/angular-mocks.d.ts b/typings/angularjs/angular-mocks.d.ts
deleted file mode 100644
index 1d7c80c..0000000
--- a/typings/angularjs/angular-mocks.d.ts
+++ /dev/null
@@ -1,239 +0,0 @@
-// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module)
-// Project: http://angularjs.org
-// Definitions by: Diego Vilar
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-///
-
-declare module "angular-mocks/ngMock" {
- var _: string;
- export = _;
-}
-
-declare module "angular-mocks/ngAnimateMock" {
- var _: string;
- export = _;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// functions attached to global object (window)
-///////////////////////////////////////////////////////////////////////////////
-declare var module: (...modules: any[]) => any;
-declare var inject: (...fns: Function[]) => any;
-
-///////////////////////////////////////////////////////////////////////////////
-// ngMock module (angular-mocks.js)
-///////////////////////////////////////////////////////////////////////////////
-declare module angular {
-
- ///////////////////////////////////////////////////////////////////////////
- // AngularStatic
- // We reopen it to add the MockStatic definition
- ///////////////////////////////////////////////////////////////////////////
- interface IAngularStatic {
- mock: IMockStatic;
- }
-
- interface IMockStatic {
- // see http://docs.angularjs.org/api/angular.mock.dump
- dump(obj: any): string;
-
- // see http://docs.angularjs.org/api/angular.mock.inject
- inject: {
- (...fns: Function[]): any;
- (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
- strictDi(val?: boolean): void;
- }
-
- // see http://docs.angularjs.org/api/angular.mock.module
- module(...modules: any[]): any;
-
- // see http://docs.angularjs.org/api/angular.mock.TzDate
- TzDate(offset: number, timestamp: number): Date;
- TzDate(offset: number, timestamp: string): Date;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // ExceptionHandlerService
- // see http://docs.angularjs.org/api/ngMock.$exceptionHandler
- // see http://docs.angularjs.org/api/ngMock.$exceptionHandlerProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IExceptionHandlerProvider extends IServiceProvider {
- mode(mode: string): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // TimeoutService
- // see http://docs.angularjs.org/api/ngMock.$timeout
- // Augments the original service
- ///////////////////////////////////////////////////////////////////////////
- interface ITimeoutService {
- flush(delay?: number): void;
- flushNext(expectedDelay?: number): void;
- verifyNoPendingTasks(): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // IntervalService
- // see http://docs.angularjs.org/api/ngMock.$interval
- // Augments the original service
- ///////////////////////////////////////////////////////////////////////////
- interface IIntervalService {
- flush(millis?: number): number;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // LogService
- // see http://docs.angularjs.org/api/ngMock.$log
- // Augments the original service
- ///////////////////////////////////////////////////////////////////////////
- interface ILogService {
- assertEmpty(): void;
- reset(): void;
- }
-
- interface ILogCall {
- logs: string[];
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // HttpBackendService
- // see http://docs.angularjs.org/api/ngMock.$httpBackend
- ///////////////////////////////////////////////////////////////////////////
- interface IHttpBackendService {
- flush(count?: number): void;
- resetExpectations(): void;
- verifyNoOutstandingExpectation(): void;
- verifyNoOutstandingRequest(): void;
-
- expect(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
- expect(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
-
- expectDELETE(url: string, headers?: Object): mock.IRequestHandler;
- expectDELETE(url: RegExp, headers?: Object): mock.IRequestHandler;
- expectGET(url: string, headers?: Object): mock.IRequestHandler;
- expectGET(url: RegExp, headers?: Object): mock.IRequestHandler;
- expectHEAD(url: string, headers?: Object): mock.IRequestHandler;
- expectHEAD(url: RegExp, headers?: Object): mock.IRequestHandler;
- expectJSONP(url: string): mock.IRequestHandler;
- expectJSONP(url: RegExp): mock.IRequestHandler;
-
- expectPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expectPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
-
- expectPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler;
- expectPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expectPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expectPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- expectPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- expectPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expectPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expectPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
-
- expectPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler;
- expectPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expectPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expectPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- expectPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- expectPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- expectPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- expectPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
-
- when(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler;
- when(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- when(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- when(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- when(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
- when(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
-
- whenDELETE(url: string, headers?: Object): mock.IRequestHandler;
- whenDELETE(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- whenDELETE(url: RegExp, headers?: Object): mock.IRequestHandler;
- whenDELETE(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
-
- whenGET(url: string, headers?: Object): mock.IRequestHandler;
- whenGET(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- whenGET(url: RegExp, headers?: Object): mock.IRequestHandler;
- whenGET(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
-
- whenHEAD(url: string, headers?: Object): mock.IRequestHandler;
- whenHEAD(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
- whenHEAD(url: RegExp, headers?: Object): mock.IRequestHandler;
- whenHEAD(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
-
- whenJSONP(url: string): mock.IRequestHandler;
- whenJSONP(url: RegExp): mock.IRequestHandler;
-
- whenPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- whenPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
-
- whenPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler;
- whenPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- whenPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- whenPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- whenPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- whenPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- whenPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- whenPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
-
- whenPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler;
- whenPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
- whenPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- whenPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
- whenPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
- whenPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
- whenPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
- whenPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
- }
-
- export module mock {
-
- // returned interface by the the mocked HttpBackendService expect/when methods
- interface IRequestHandler {
- respond(func: Function): void;
- respond(status: number, data?: any, headers?: any): void;
- respond(data: any, headers?: any): void;
-
- // Available wehn ngMockE2E is loaded
- passThrough(): void;
- }
-
- }
-
-}
diff --git a/typings/angularjs/angular.d.ts b/typings/angularjs/angular.d.ts
deleted file mode 100644
index 0ea364d..0000000
--- a/typings/angularjs/angular.d.ts
+++ /dev/null
@@ -1,1715 +0,0 @@
-// Type definitions for Angular JS 1.4+
-// Project: http://angularjs.org
-// Definitions by: Diego Vilar
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-
-///
-
-declare var angular: angular.IAngularStatic;
-
-// Support for painless dependency injection
-interface Function {
- $inject?: string[];
-}
-
-// Collapse angular into ng
-import ng = angular;
-// Support AMD require
-declare module 'angular' {
- export = angular;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// ng module (angular.js)
-///////////////////////////////////////////////////////////////////////////////
-declare module angular {
-
- // not directly implemented, but ensures that constructed class implements $get
- interface IServiceProviderClass {
- new (...args: any[]): IServiceProvider;
- }
-
- interface IServiceProviderFactory {
- (...args: any[]): IServiceProvider;
- }
-
- // All service providers extend this interface
- interface IServiceProvider {
- $get: any;
- }
-
- interface IAngularBootstrapConfig {
- strictDi?: boolean;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // AngularStatic
- // see http://docs.angularjs.org/api
- ///////////////////////////////////////////////////////////////////////////
- interface IAngularStatic {
- bind(context: any, fn: Function, ...args: any[]): Function;
-
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
- /**
- * Use this function to manually start up angular application.
- *
- * @param element DOM element which is the root of angular application.
- * @param modules An array of modules to load into the application.
- * Each item in the array should be the name of a predefined module or a (DI annotated)
- * function that will be invoked by the injector as a run block.
- * @param config an object for defining configuration options for the application. The following keys are supported:
- * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
- */
- bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
-
- /**
- * Creates a deep copy of source, which should be an object or an array.
- *
- * - If no destination is supplied, a copy of the object or array is created.
- * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it.
- * - If source is not an object or array (inc. null and undefined), source is returned.
- * - If source is identical to 'destination' an exception will be thrown.
- *
- * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined.
- * @param destination Destination into which the source is copied. If provided, must be of the same type as source.
- */
- copy(source: T, destination?: T): T;
-
- /**
- * Wraps a raw DOM element or HTML string as a jQuery element.
- *
- * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
- */
- element: IAugmentedJQueryStatic;
- equals(value1: any, value2: any): boolean;
- extend(destination: any, ...sources: any[]): any;
-
- /**
- * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
- *
- * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
- *
- * @param obj Object to iterate over.
- * @param iterator Iterator function.
- * @param context Object to become context (this) for the iterator function.
- */
- forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any;
- /**
- * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
- *
- * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
- *
- * @param obj Object to iterate over.
- * @param iterator Iterator function.
- * @param context Object to become context (this) for the iterator function.
- */
- forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any;
- /**
- * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
- *
- * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
- *
- * @param obj Object to iterate over.
- * @param iterator Iterator function.
- * @param context Object to become context (this) for the iterator function.
- */
- forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any;
-
- fromJson(json: string): any;
- identity(arg?: any): any;
- injector(modules?: any[]): auto.IInjectorService;
- isArray(value: any): boolean;
- isDate(value: any): boolean;
- isDefined(value: any): boolean;
- isElement(value: any): boolean;
- isFunction(value: any): boolean;
- isNumber(value: any): boolean;
- isObject(value: any): boolean;
- isString(value: any): boolean;
- isUndefined(value: any): boolean;
- lowercase(str: string): string;
-
- /**
- * Deeply extends the destination object dst by copying own enumerable properties from the src object(s) to dst. You can specify multiple src objects. If you want to preserve original objects, you can do so by passing an empty object as the target: var object = angular.merge({}, object1, object2).
- *
- * Unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy.
- *
- * @param dst Destination object.
- * @param src Source object(s).
- */
- merge(dst: any, ...src: any[]): any;
-
- /**
- * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
- *
- * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved.
- *
- * @param name The name of the module to create or retrieve.
- * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration.
- * @param configFn Optional configuration function for the module.
- */
- module(
- name: string,
- requires?: string[],
- configFn?: Function): IModule;
-
- noop(...args: any[]): void;
- reloadWithDebugInfo(): void;
- toJson(obj: any, pretty?: boolean): string;
- uppercase(str: string): string;
- version: {
- full: string;
- major: number;
- minor: number;
- dot: number;
- codeName: string;
- };
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // Module
- // see http://docs.angularjs.org/api/angular.Module
- ///////////////////////////////////////////////////////////////////////////
- interface IModule {
- animation(name: string, animationFactory: Function): IModule;
- animation(name: string, inlineAnnotatedFunction: any[]): IModule;
- animation(object: Object): IModule;
- /**
- * Use this method to register work which needs to be performed on module loading.
- *
- * @param configFn Execute this function on module load. Useful for service configuration.
- */
- config(configFn: Function): IModule;
- /**
- * Use this method to register work which needs to be performed on module loading.
- *
- * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration.
- */
- config(inlineAnnotatedFunction: any[]): IModule;
- /**
- * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
- *
- * @param name The name of the constant.
- * @param value The constant value.
- */
- constant(name: string, value: any): IModule;
- constant(object: Object): IModule;
- /**
- * The $controller service is used by Angular to create new controllers.
- *
- * This provider allows controller registration via the register method.
- *
- * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
- * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
- */
- controller(name: string, controllerConstructor: Function): IModule;
- /**
- * The $controller service is used by Angular to create new controllers.
- *
- * This provider allows controller registration via the register method.
- *
- * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
- * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
- */
- controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
- controller(object: Object): IModule;
- /**
- * Register a new directive with the compiler.
- *
- * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
- * @param directiveFactory An injectable directive factory function.
- */
- directive(name: string, directiveFactory: IDirectiveFactory): IModule;
- /**
- * Register a new directive with the compiler.
- *
- * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
- * @param directiveFactory An injectable directive factory function.
- */
- directive(name: string, inlineAnnotatedFunction: any[]): IModule;
- directive(object: Object): IModule;
- /**
- * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
- *
- * @param name The name of the instance.
- * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
- */
- factory(name: string, $getFn: Function): IModule;
- /**
- * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
- *
- * @param name The name of the instance.
- * @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
- */
- factory(name: string, inlineAnnotatedFunction: any[]): IModule;
- factory(object: Object): IModule;
- filter(name: string, filterFactoryFunction: Function): IModule;
- filter(name: string, inlineAnnotatedFunction: any[]): IModule;
- filter(object: Object): IModule;
- provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
- provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
- provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
- provider(name: string, providerObject: IServiceProvider): IModule;
- provider(object: Object): IModule;
- /**
- * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
- */
- run(initializationFunction: Function): IModule;
- /**
- * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
- */
- run(inlineAnnotatedFunction: any[]): IModule;
- service(name: string, serviceConstructor: Function): IModule;
- service(name: string, inlineAnnotatedConstructor: any[]): IModule;
- service(object: Object): IModule;
- /**
- * Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service.
-
- Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator.
- *
- * @param name The name of the instance.
- * @param value The value.
- */
- value(name: string, value: any): IModule;
- value(object: Object): IModule;
-
- /**
- * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
- * @param name The name of the service to decorate
- * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
- */
- decorator(name:string, decoratorConstructor: Function): IModule;
- decorator(name:string, inlineAnnotatedConstructor: any[]): IModule;
-
- // Properties
- name: string;
- requires: string[];
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // Attributes
- // see http://docs.angularjs.org/api/ng.$compile.directive.Attributes
- ///////////////////////////////////////////////////////////////////////////
- interface IAttributes {
- /**
- * this is necessary to be able to access the scoped attributes. it's not very elegant
- * because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
- * this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
- */
- [name: string]: any;
-
- /**
- * Adds the CSS class value specified by the classVal parameter to the
- * element. If animations are enabled then an animation will be triggered
- * for the class addition.
- */
- $addClass(classVal: string): void;
-
- /**
- * Removes the CSS class value specified by the classVal parameter from the
- * element. If animations are enabled then an animation will be triggered for
- * the class removal.
- */
- $removeClass(classVal: string): void;
-
- /**
- * Set DOM element attribute value.
- */
- $set(key: string, value: any): void;
-
- /**
- * Observes an interpolated attribute.
- * The observer function will be invoked once during the next $digest
- * following compilation. The observer is then invoked whenever the
- * interpolated value changes.
- */
- $observe(name: string, fn: (value?: any) => any): Function;
-
- /**
- * A map of DOM element attribute names to the normalized name. This is needed
- * to do reverse lookup from normalized name back to actual name.
- */
- $attr: Object;
- }
-
- /**
- * form.FormController - type in module ng
- * see https://docs.angularjs.org/api/ng/type/form.FormController
- */
- interface IFormController {
-
- /**
- * Indexer which should return ng.INgModelController for most properties but cannot because of "All named properties must be assignable to string indexer type" constraint - see https://github.com/Microsoft/TypeScript/issues/272
- */
- [name: string]: any;
-
- $pristine: boolean;
- $dirty: boolean;
- $valid: boolean;
- $invalid: boolean;
- $submitted: boolean;
- $error: any;
- $addControl(control: INgModelController): void;
- $removeControl(control: INgModelController): void;
- $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void;
- $setDirty(): void;
- $setPristine(): void;
- $commitViewValue(): void;
- $rollbackViewValue(): void;
- $setSubmitted(): void;
- $setUntouched(): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // NgModelController
- // see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController
- ///////////////////////////////////////////////////////////////////////////
- interface INgModelController {
- $render(): void;
- $setValidity(validationErrorKey: string, isValid: boolean): void;
- // Documentation states viewValue and modelValue to be a string but other
- // types do work and it's common to use them.
- $setViewValue(value: any, trigger?: string): void;
- $setPristine(): void;
- $setDirty(): void;
- $validate(): void;
- $setTouched(): void;
- $setUntouched(): void;
- $rollbackViewValue(): void;
- $commitViewValue(): void;
- $isEmpty(value: any): boolean;
-
- $viewValue: any;
-
- $modelValue: any;
-
- $parsers: IModelParser[];
- $formatters: IModelFormatter[];
- $viewChangeListeners: IModelViewChangeListener[];
- $error: any;
- $name: string;
-
- $touched: boolean;
- $untouched: boolean;
-
- $validators: IModelValidators;
- $asyncValidators: IAsyncModelValidators;
-
- $pending: any;
- $pristine: boolean;
- $dirty: boolean;
- $valid: boolean;
- $invalid: boolean;
- }
-
- interface IModelValidators {
- [index: string]: (modelValue: any, viewValue: string) => boolean;
- }
-
- interface IAsyncModelValidators {
- [index: string]: (modelValue: any, viewValue: string) => IPromise;
- }
-
- interface IModelParser {
- (value: any): any;
- }
-
- interface IModelFormatter {
- (value: any): any;
- }
-
- interface IModelViewChangeListener {
- (): void;
- }
-
- /**
- * $rootScope - $rootScopeProvider - service in module ng
- * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope
- */
- interface IRootScopeService {
- [index: string]: any;
-
- $apply(): any;
- $apply(exp: string): any;
- $apply(exp: (scope: IScope) => any): any;
-
- $applyAsync(): any;
- $applyAsync(exp: string): any;
- $applyAsync(exp: (scope: IScope) => any): any;
-
- /**
- * Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.
- *
- * The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled.
- *
- * Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
- *
- * @param name Event name to broadcast.
- * @param args Optional one or more arguments which will be passed onto the event listeners.
- */
- $broadcast(name: string, ...args: any[]): IAngularEvent;
- $destroy(): void;
- $digest(): void;
- /**
- * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners.
- *
- * The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it.
- *
- * Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
- *
- * @param name Event name to emit.
- * @param args Optional one or more arguments which will be passed onto the event listeners.
- */
- $emit(name: string, ...args: any[]): IAngularEvent;
-
- $eval(): any;
- $eval(expression: string, locals?: Object): any;
- $eval(expression: (scope: IScope) => any, locals?: Object): any;
-
- $evalAsync(): void;
- $evalAsync(expression: string): void;
- $evalAsync(expression: (scope: IScope) => any): void;
-
- // Defaults to false by the implementation checking strategy
- $new(isolate?: boolean, parent?: IScope): IScope;
-
- /**
- * Listens on events of a given type. See $emit for discussion of event life cycle.
- *
- * The event listener function format is: function(event, args...).
- *
- * @param name Event name to listen on.
- * @param listener Function to call when the event is emitted.
- */
- $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function;
-
- $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function;
- $watch(watchExpression: string, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function;
- $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): Function;
- $watch(watchExpression: (scope: IScope) => any, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function;
-
- $watchCollection(watchExpression: string, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
- $watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
-
- $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
- $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
-
- $parent: IScope;
- $root: IRootScopeService;
- $id: number;
-
- // Hidden members
- $$isolateBindings: any;
- $$phase: any;
- }
-
- interface IScope extends IRootScopeService { }
-
- /**
- * $scope for ngRepeat directive.
- * see https://docs.angularjs.org/api/ng/directive/ngRepeat
- */
- interface IRepeatScope extends IScope {
-
- /**
- * iterator offset of the repeated element (0..length-1).
- */
- $index: number;
-
- /**
- * true if the repeated element is first in the iterator.
- */
- $first: boolean;
-
- /**
- * true if the repeated element is between the first and last in the iterator.
- */
- $middle: boolean;
-
- /**
- * true if the repeated element is last in the iterator.
- */
- $last: boolean;
-
- /**
- * true if the iterator position $index is even (otherwise false).
- */
- $even: boolean;
-
- /**
- * true if the iterator position $index is odd (otherwise false).
- */
- $odd: boolean;
-
- }
-
- interface IAngularEvent {
- /**
- * the scope on which the event was $emit-ed or $broadcast-ed.
- */
- targetScope: IScope;
- /**
- * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null.
- */
- currentScope: IScope;
- /**
- * name of the event.
- */
- name: string;
- /**
- * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed).
- */
- stopPropagation?: Function;
- /**
- * calling preventDefault sets defaultPrevented flag to true.
- */
- preventDefault: Function;
- /**
- * true if preventDefault was called.
- */
- defaultPrevented: boolean;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // WindowService
- // see http://docs.angularjs.org/api/ng.$window
- ///////////////////////////////////////////////////////////////////////////
- interface IWindowService extends Window {
- [key: string]: any;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // BrowserService
- // TODO undocumented, so we need to get it from the source code
- ///////////////////////////////////////////////////////////////////////////
- interface IBrowserService {
- defer: angular.ITimeoutService;
- [key: string]: any;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // TimeoutService
- // see http://docs.angularjs.org/api/ng.$timeout
- ///////////////////////////////////////////////////////////////////////////
- interface ITimeoutService {
- (func: Function, delay?: number, invokeApply?: boolean): IPromise;
- cancel(promise: IPromise): boolean;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // IntervalService
- // see http://docs.angularjs.org/api/ng.$interval
- ///////////////////////////////////////////////////////////////////////////
- interface IIntervalService {
- (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise;
- cancel(promise: IPromise): boolean;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // AngularProvider
- // see http://docs.angularjs.org/api/ng/provider/$animateProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IAnimateProvider {
- /**
- * Registers a new injectable animation factory function.
- *
- * @param name The name of the animation.
- * @param factory The factory function that will be executed to return the animation object.
- */
- register(name: string, factory: () => IAnimateCallbackObject): void;
-
- /**
- * Gets and/or sets the CSS class expression that is checked when performing an animation.
- *
- * @param expression The className expression which will be checked against all animations.
- * @returns The current CSS className expression value. If null then there is no expression value.
- */
- classNameFilter(expression?: RegExp): RegExp;
- }
-
- /**
- * The animation object which contains callback functions for each event that is expected to be animated.
- */
- interface IAnimateCallbackObject {
- eventFn(element: Node, doneFn: () => void): Function;
- }
-
- /**
- * $filter - $filterProvider - service in module ng
- *
- * Filters are used for formatting data displayed to the user.
- *
- * see https://docs.angularjs.org/api/ng/service/$filter
- */
- interface IFilterService {
- /**
- * Usage:
- * $filter(name);
- *
- * @param name Name of the filter function to retrieve
- */
- (name: string): Function;
- }
-
- /**
- * $filterProvider - $filter - provider in module ng
- *
- * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function.
- *
- * see https://docs.angularjs.org/api/ng/provider/$filterProvider
- */
- interface IFilterProvider extends IServiceProvider {
- /**
- * register(name);
- *
- * @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx).
- */
- register(name: string | {}): IServiceProvider;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // LocaleService
- // see http://docs.angularjs.org/api/ng.$locale
- ///////////////////////////////////////////////////////////////////////////
- interface ILocaleService {
- id: string;
-
- // These are not documented
- // Check angular's i18n files for exemples
- NUMBER_FORMATS: ILocaleNumberFormatDescriptor;
- DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor;
- pluralCat: (num: any) => string;
- }
-
- interface ILocaleNumberFormatDescriptor {
- DECIMAL_SEP: string;
- GROUP_SEP: string;
- PATTERNS: ILocaleNumberPatternDescriptor[];
- CURRENCY_SYM: string;
- }
-
- interface ILocaleNumberPatternDescriptor {
- minInt: number;
- minFrac: number;
- maxFrac: number;
- posPre: string;
- posSuf: string;
- negPre: string;
- negSuf: string;
- gSize: number;
- lgSize: number;
- }
-
- interface ILocaleDateTimeFormatDescriptor {
- MONTH: string[];
- SHORTMONTH: string[];
- DAY: string[];
- SHORTDAY: string[];
- AMPMS: string[];
- medium: string;
- short: string;
- fullDate: string;
- longDate: string;
- mediumDate: string;
- shortDate: string;
- mediumTime: string;
- shortTime: string;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // LogService
- // see http://docs.angularjs.org/api/ng.$log
- // see http://docs.angularjs.org/api/ng.$logProvider
- ///////////////////////////////////////////////////////////////////////////
- interface ILogService {
- debug: ILogCall;
- error: ILogCall;
- info: ILogCall;
- log: ILogCall;
- warn: ILogCall;
- }
-
- interface ILogProvider {
- debugEnabled(): boolean;
- debugEnabled(enabled: boolean): ILogProvider;
- }
-
- // We define this as separate interface so we can reopen it later for
- // the ngMock module.
- interface ILogCall {
- (...args: any[]): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // ParseService
- // see http://docs.angularjs.org/api/ng.$parse
- // see http://docs.angularjs.org/api/ng.$parseProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IParseService {
- (expression: string): ICompiledExpression;
- }
-
- interface IParseProvider {
- logPromiseWarnings(): boolean;
- logPromiseWarnings(value: boolean): IParseProvider;
-
- unwrapPromises(): boolean;
- unwrapPromises(value: boolean): IParseProvider;
- }
-
- interface ICompiledExpression {
- (context: any, locals?: any): any;
-
- // If value is not provided, undefined is gonna be used since the implementation
- // does not check the parameter. Let's force a value for consistency. If consumer
- // whants to undefine it, pass the undefined value explicitly.
- assign(context: any, value: any): any;
- }
-
- /**
- * $location - $locationProvider - service in module ng
- * see https://docs.angularjs.org/api/ng/service/$location
- */
- interface ILocationService {
- absUrl(): string;
- hash(): string;
- hash(newHash: string): ILocationService;
- host(): string;
-
- /**
- * Return path of current url
- */
- path(): string;
-
- /**
- * Change path when called with parameter and return $location.
- * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
- *
- * @param path New path
- */
- path(path: string): ILocationService;
-
- port(): number;
- protocol(): string;
- replace(): ILocationService;
-
- /**
- * Return search part (as object) of current url
- */
- search(): any;
-
- /**
- * Change search part when called with parameter and return $location.
- *
- * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value.
- *
- * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url.
- */
- search(search: any): ILocationService;
-
- /**
- * Change search part when called with parameter and return $location.
- *
- * @param search New search params
- * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. If paramValue is an array, it will override the property of the search component of $location specified via the first argument. If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
- */
- search(search: string, paramValue: string|number|string[]|boolean): ILocationService;
-
- state(): any;
- state(state: any): ILocationService;
- url(): string;
- url(url: string): ILocationService;
- }
-
- interface ILocationProvider extends IServiceProvider {
- hashPrefix(): string;
- hashPrefix(prefix: string): ILocationProvider;
- html5Mode(): boolean;
-
- // Documentation states that parameter is string, but
- // implementation tests it as boolean, which makes more sense
- // since this is a toggler
- html5Mode(active: boolean): ILocationProvider;
- html5Mode(mode: { enabled?: boolean; requireBase?: boolean; rewriteLinks?: boolean; }): ILocationProvider;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // DocumentService
- // see http://docs.angularjs.org/api/ng.$document
- ///////////////////////////////////////////////////////////////////////////
- interface IDocumentService extends IAugmentedJQuery {}
-
- ///////////////////////////////////////////////////////////////////////////
- // ExceptionHandlerService
- // see http://docs.angularjs.org/api/ng.$exceptionHandler
- ///////////////////////////////////////////////////////////////////////////
- interface IExceptionHandlerService {
- (exception: Error, cause?: string): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // RootElementService
- // see http://docs.angularjs.org/api/ng.$rootElement
- ///////////////////////////////////////////////////////////////////////////
- interface IRootElementService extends JQuery {}
-
- interface IQResolveReject {
- (): void;
- (value: T): void;
- }
- /**
- * $q - service in module ng
- * A promise/deferred implementation inspired by Kris Kowal's Q.
- * See http://docs.angularjs.org/api/ng/service/$q
- */
- interface IQService {
- new (resolver: (resolve: IQResolveReject) => any): IPromise;
- new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise;
- new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise;
-
- /**
- * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
- *
- * Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
- *
- * @param promises An array of promises.
- */
- all(promises: IPromise[]): IPromise;
- /**
- * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
- *
- * Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
- *
- * @param promises A hash of promises.
- */
- all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>;
- /**
- * Creates a Deferred object which represents a task which will finish in the future.
- */
- defer(): IDeferred;
- /**
- * Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.
- *
- * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject.
- *
- * @param reason Constant, message, exception or an object representing the rejection reason.
- */
- reject(reason?: 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.
- *
- * @param value Value or a promise
- */
- when(value: IPromise|T): 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.
- *
- * @param value Value or a promise
- */
- when(): IPromise;
- }
-
- interface IPromise {
- /**
- * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
- *
- * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
- */
- then(successCallback: (promiseValue: T) => IHttpPromise|IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
-
- /**
- * Shorthand for promise.then(null, errorCallback)
- */
- catch(onRejected: (reason: any) => IHttpPromise|IPromise|TResult): IPromise;
-
- /**
- * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
- *
- * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
- */
- finally(finallyCallback: () => any): IPromise;
- }
-
- interface IDeferred {
- resolve(value?: T): void;
- reject(reason?: any): void;
- notify(state?: any): void;
- promise: IPromise;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // AnchorScrollService
- // see http://docs.angularjs.org/api/ng.$anchorScroll
- ///////////////////////////////////////////////////////////////////////////
- interface IAnchorScrollService {
- (): void;
- yOffset: any;
- }
-
- interface IAnchorScrollProvider extends IServiceProvider {
- disableAutoScrolling(): void;
- }
-
- /**
- * $cacheFactory - service in module ng
- *
- * Factory that constructs Cache objects and gives access to them.
- *
- * see https://docs.angularjs.org/api/ng/service/$cacheFactory
- */
- interface ICacheFactoryService {
- /**
- * Factory that constructs Cache objects and gives access to them.
- *
- * @param cacheId Name or id of the newly created cache.
- * @param optionsMap Options object that specifies the cache behavior. Properties:
- *
- * capacity — turns the cache into LRU cache.
- */
- (cacheId: string, optionsMap?: { capacity?: number; }): ICacheObject;
-
- /**
- * Get information about all the caches that have been created.
- * @returns key-value map of cacheId to the result of calling cache#info
- */
- info(): any;
-
- /**
- * Get access to a cache object by the cacheId used when it was created.
- *
- * @param cacheId Name or id of a cache to access.
- */
- get(cacheId: string): ICacheObject;
- }
-
- /**
- * $cacheFactory.Cache - type in module ng
- *
- * A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data.
- *
- * see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache
- */
- interface ICacheObject {
- /**
- * Retrieve information regarding a particular Cache.
- */
- info(): {
- /**
- * the id of the cache instance
- */
- id: string;
-
- /**
- * the number of entries kept in the cache instance
- */
- size: number;
-
- //...: any additional properties from the options object when creating the cache.
- };
-
- /**
- * Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set.
- *
- * It will not insert undefined values into the cache.
- *
- * @param key the key under which the cached data is stored.
- * @param value the value to store alongside the key. If it is undefined, the key will not be stored.
- */
- put(key: string, value?: T): T;
-
- /**
- * Retrieves named data stored in the Cache object.
- *
- * @param key the key of the data to be retrieved
- */
- get(key: string): any;
-
- /**
- * Removes an entry from the Cache object.
- *
- * @param key the key of the entry to be removed
- */
- remove(key: string): void;
-
- /**
- * Clears the cache object of any entries.
- */
- removeAll(): void;
-
- /**
- * Destroys the Cache object entirely, removing it from the $cacheFactory set.
- */
- destroy(): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // CompileService
- // see http://docs.angularjs.org/api/ng.$compile
- // see http://docs.angularjs.org/api/ng.$compileProvider
- ///////////////////////////////////////////////////////////////////////////
- interface ICompileService {
- (element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
- (element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
- (element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
- }
-
- interface ICompileProvider extends IServiceProvider {
- directive(name: string, directiveFactory: Function): ICompileProvider;
-
- // Undocumented, but it is there...
- directive(directivesMap: any): ICompileProvider;
-
- aHrefSanitizationWhitelist(): RegExp;
- aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider;
-
- imgSrcSanitizationWhitelist(): RegExp;
- imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider;
-
- debugInfoEnabled(enabled?: boolean): any;
- }
-
- interface ICloneAttachFunction {
- // Let's hint but not force cloneAttachFn's signature
- (clonedElement?: JQuery, scope?: IScope): any;
- }
-
- // This corresponds to the "publicLinkFn" returned by $compile.
- interface ITemplateLinkingFunction {
- (scope: IScope, cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
- }
-
- // This corresponds to $transclude (and also the transclude function passed to link).
- interface ITranscludeFunction {
- // If the scope is provided, then the cloneAttachFn must be as well.
- (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;
- // If one argument is provided, then it's assumed to be the cloneAttachFn.
- (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // ControllerService
- // see http://docs.angularjs.org/api/ng.$controller
- // see http://docs.angularjs.org/api/ng.$controllerProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IControllerService {
- // Although the documentation doesn't state this, locals are optional
- (controllerConstructor: Function, locals?: any): any;
- (controllerName: string, locals?: any): any;
- }
-
- interface IControllerProvider extends IServiceProvider {
- register(name: string, controllerConstructor: Function): void;
- register(name: string, dependencyAnnotatedConstructor: any[]): void;
- allowGlobals(): void;
- }
-
- /**
- * HttpService
- * see http://docs.angularjs.org/api/ng/service/$http
- */
- interface IHttpService {
- /**
- * Object describing the request to be made and how it should be processed.
- */
- (config: IRequestConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform GET request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param config Optional configuration object
- */
- get(url: string, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform DELETE request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param config Optional configuration object
- */
- delete(url: string, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform HEAD request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param config Optional configuration object
- */
- head(url: string, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform JSONP request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param config Optional configuration object
- */
- jsonp(url: string, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform POST request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param data Request content
- * @param config Optional configuration object
- */
- post(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform PUT request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param data Request content
- * @param config Optional configuration object
- */
- put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Shortcut method to perform PATCH request.
- *
- * @param url Relative or absolute URL specifying the destination of the request
- * @param data Request content
- * @param config Optional configuration object
- */
- patch(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
-
- /**
- * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations.
- */
- defaults: IRequestConfig;
-
- /**
- * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes.
- */
- pendingRequests: any[];
- }
-
- /**
- * Object describing the request to be made and how it should be processed.
- * see http://docs.angularjs.org/api/ng/service/$http#usage
- */
- interface IRequestShortcutConfig {
- /**
- * {Object.}
- * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified.
- */
- params?: any;
-
- /**
- * Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent.
- */
- headers?: any;
-
- /**
- * Name of HTTP header to populate with the XSRF token.
- */
- xsrfHeaderName?: string;
-
- /**
- * Name of cookie containing the XSRF token.
- */
- xsrfCookieName?: string;
-
- /**
- * {boolean|Cache}
- * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching.
- */
- cache?: any;
-
- /**
- * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information.
- */
- withCredentials?: boolean;
-
- /**
- * {string|Object}
- * Data to be sent as the request message data.
- */
- data?: any;
-
- /**
- * {function(data, headersGetter)|Array.}
- * Transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version.
- */
- transformRequest?: any;
-
- /**
- * {function(data, headersGetter)|Array.}
- * Transform function or an array of such functions. The transform function takes the http response body and headers and returns its transformed (typically deserialized) version.
- */
- transformResponse?: any;
-
- /**
- * {number|Promise}
- * Timeout in milliseconds, or promise that should abort the request when resolved.
- */
- timeout?: any;
-
- /**
- * See requestType.
- */
- responseType?: string;
- }
-
- /**
- * Object describing the request to be made and how it should be processed.
- * see http://docs.angularjs.org/api/ng/service/$http#usage
- */
- interface IRequestConfig extends IRequestShortcutConfig {
- /**
- * HTTP method (e.g. 'GET', 'POST', etc)
- */
- method: string;
- /**
- * Absolute or relative URL of the resource that is being requested.
- */
- url: string;
- }
-
- interface IHttpHeadersGetter {
- (): { [name: string]: string; };
- (headerName: string): string;
- }
-
- interface IHttpPromiseCallback {
- (data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void;
- }
-
- interface IHttpPromiseCallbackArg {
- data?: T;
- status?: number;
- headers?: IHttpHeadersGetter;
- config?: IRequestConfig;
- statusText?: string;
- }
-
- interface IHttpPromise extends IPromise> {
- success(callback: IHttpPromiseCallback): IHttpPromise;
- error(callback: IHttpPromiseCallback): IHttpPromise;
- then(successCallback: (response: IHttpPromiseCallbackArg) => IPromise|TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise;
- }
-
- /**
- * Object that controls the defaults for $http provider
- * https://docs.angularjs.org/api/ng/service/$http#defaults
- */
- interface IHttpProviderDefaults {
- cache?: boolean;
- xsrfCookieName?: string;
- xsrfHeaderName?: string;
- withCredentials?: boolean;
- headers?: {
- common?: any;
- post?: any;
- put?: any;
- patch?: any;
- }
- }
-
- interface IHttpProvider extends IServiceProvider {
- defaults: IHttpProviderDefaults;
- interceptors: any[];
- useApplyAsync(): boolean;
- useApplyAsync(value: boolean): IHttpProvider;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // HttpBackendService
- // see http://docs.angularjs.org/api/ng.$httpBackend
- // You should never need to use this service directly.
- ///////////////////////////////////////////////////////////////////////////
- interface IHttpBackendService {
- // XXX Perhaps define callback signature in the future
- (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // InterpolateService
- // see http://docs.angularjs.org/api/ng.$interpolate
- // see http://docs.angularjs.org/api/ng.$interpolateProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IInterpolateService {
- (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction;
- endSymbol(): string;
- startSymbol(): string;
- }
-
- interface IInterpolationFunction {
- (context: any): string;
- }
-
- interface IInterpolateProvider extends IServiceProvider {
- startSymbol(): string;
- startSymbol(value: string): IInterpolateProvider;
- endSymbol(): string;
- endSymbol(value: string): IInterpolateProvider;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // TemplateCacheService
- // see http://docs.angularjs.org/api/ng.$templateCache
- ///////////////////////////////////////////////////////////////////////////
- interface ITemplateCacheService extends ICacheObject {}
-
- ///////////////////////////////////////////////////////////////////////////
- // SCEService
- // see http://docs.angularjs.org/api/ng.$sce
- ///////////////////////////////////////////////////////////////////////////
- interface ISCEService {
- getTrusted(type: string, mayBeTrusted: any): any;
- getTrustedCss(value: any): any;
- getTrustedHtml(value: any): any;
- getTrustedJs(value: any): any;
- getTrustedResourceUrl(value: any): any;
- getTrustedUrl(value: any): any;
- parse(type: string, expression: string): (context: any, locals: any) => any;
- parseAsCss(expression: string): (context: any, locals: any) => any;
- parseAsHtml(expression: string): (context: any, locals: any) => any;
- parseAsJs(expression: string): (context: any, locals: any) => any;
- parseAsResourceUrl(expression: string): (context: any, locals: any) => any;
- parseAsUrl(expression: string): (context: any, locals: any) => any;
- trustAs(type: string, value: any): any;
- trustAsHtml(value: any): any;
- trustAsJs(value: any): any;
- trustAsResourceUrl(value: any): any;
- trustAsUrl(value: any): any;
- isEnabled(): boolean;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // SCEProvider
- // see http://docs.angularjs.org/api/ng.$sceProvider
- ///////////////////////////////////////////////////////////////////////////
- interface ISCEProvider extends IServiceProvider {
- enabled(value: boolean): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // SCEDelegateService
- // see http://docs.angularjs.org/api/ng.$sceDelegate
- ///////////////////////////////////////////////////////////////////////////
- interface ISCEDelegateService {
- getTrusted(type: string, mayBeTrusted: any): any;
- trustAs(type: string, value: any): any;
- valueOf(value: any): any;
- }
-
-
- ///////////////////////////////////////////////////////////////////////////
- // SCEDelegateProvider
- // see http://docs.angularjs.org/api/ng.$sceDelegateProvider
- ///////////////////////////////////////////////////////////////////////////
- interface ISCEDelegateProvider extends IServiceProvider {
- resourceUrlBlacklist(blacklist: any[]): void;
- resourceUrlWhitelist(whitelist: any[]): void;
- }
-
- /**
- * $templateRequest service
- * see http://docs.angularjs.org/api/ng/service/$templateRequest
- */
- interface ITemplateRequestService {
- /**
- * Downloads a template using $http and, upon success, stores the
- * contents inside of $templateCache.
- *
- * If the HTTP request fails or the response data of the HTTP request is
- * empty then a $compile error will be thrown (unless
- * {ignoreRequestError} is set to true).
- *
- * @param tpl The template URL.
- * @param ignoreRequestError Whether or not to ignore the exception
- * when the request fails or the template is
- * empty.
- *
- * @return A promise whose value is the template content.
- */
- (tpl: string, ignoreRequestError?: boolean): IPromise;
- /**
- * total amount of pending template requests being downloaded.
- * @type {number}
- */
- totalPendingRequests: number;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // Directive
- // see http://docs.angularjs.org/api/ng.$compileProvider#directive
- // and http://docs.angularjs.org/guide/directive
- ///////////////////////////////////////////////////////////////////////////
-
- interface IDirectiveFactory {
- (...args: any[]): IDirective;
- }
-
- interface IDirectiveLinkFn {
- (
- scope: IScope,
- instanceElement: IAugmentedJQuery,
- instanceAttributes: IAttributes,
- controller: any,
- transclude: ITranscludeFunction
- ): void;
- }
-
- interface IDirectivePrePost {
- pre?: IDirectiveLinkFn;
- post?: IDirectiveLinkFn;
- }
-
- interface IDirectiveCompileFn {
- (
- templateElement: IAugmentedJQuery,
- templateAttributes: IAttributes,
- transclude: ITranscludeFunction
- ): IDirectivePrePost;
- }
-
- interface IDirective {
- compile?: IDirectiveCompileFn;
- controller?: any;
- controllerAs?: string;
- bindToController?: boolean|Object;
- link?: IDirectiveLinkFn | IDirectivePrePost;
- name?: string;
- priority?: number;
- replace?: boolean;
- require?: any;
- restrict?: string;
- scope?: any;
- template?: any;
- templateUrl?: any;
- terminal?: boolean;
- transclude?: any;
- }
-
- /**
- * angular.element
- * when calling angular.element, angular returns a jQuery object,
- * augmented with additional methods like e.g. scope.
- * see: http://docs.angularjs.org/api/angular.element
- */
- interface IAugmentedJQueryStatic extends JQueryStatic {
- (selector: string, context?: any): IAugmentedJQuery;
- (element: Element): IAugmentedJQuery;
- (object: {}): IAugmentedJQuery;
- (elementArray: Element[]): IAugmentedJQuery;
- (object: JQuery): IAugmentedJQuery;
- (func: Function): IAugmentedJQuery;
- (array: any[]): IAugmentedJQuery;
- (): IAugmentedJQuery;
- }
-
- interface IAugmentedJQuery extends JQuery {
- // TODO: events, how to define?
- //$destroy
-
- find(selector: string): IAugmentedJQuery;
- find(element: any): IAugmentedJQuery;
- find(obj: JQuery): IAugmentedJQuery;
- controller(): any;
- controller(name: string): any;
- injector(): any;
- scope(): IScope;
- isolateScope(): IScope;
-
- inheritedData(key: string, value: any): JQuery;
- inheritedData(obj: { [key: string]: any; }): JQuery;
- inheritedData(key?: string): any;
- }
-
- ///////////////////////////////////////////////////////////////////////
- // AnimateService
- // see http://docs.angularjs.org/api/ng.$animate
- ///////////////////////////////////////////////////////////////////////
- interface IAnimateService {
- addClass(element: JQuery, className: string, done?: Function): IPromise;
- enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
- leave(element: JQuery, done?: Function): void;
- move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
- removeClass(element: JQuery, className: string, done?: Function): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // AUTO module (angular.js)
- ///////////////////////////////////////////////////////////////////////////
- export module auto {
-
- ///////////////////////////////////////////////////////////////////////
- // InjectorService
- // see http://docs.angularjs.org/api/AUTO.$injector
- ///////////////////////////////////////////////////////////////////////
- interface IInjectorService {
- annotate(fn: Function): string[];
- annotate(inlineAnnotatedFunction: any[]): string[];
- get(name: string): any;
- has(name: string): boolean;
- instantiate(typeConstructor: Function, locals?: any): any;
- invoke(inlineAnnotatedFunction: any[]): any;
- invoke(func: Function, context?: any, locals?: any): any;
- }
-
- ///////////////////////////////////////////////////////////////////////
- // ProvideService
- // see http://docs.angularjs.org/api/AUTO.$provide
- ///////////////////////////////////////////////////////////////////////
- interface IProvideService {
- // Documentation says it returns the registered instance, but actual
- // implementation does not return anything.
- // constant(name: string, value: any): any;
- /**
- * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
- *
- * @param name The name of the constant.
- * @param value The constant value.
- */
- constant(name: string, value: any): void;
-
- /**
- * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
- *
- * @param name The name of the service to decorate.
- * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
- *
- * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
- */
- decorator(name: string, decorator: Function): void;
- /**
- * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
- *
- * @param name The name of the service to decorate.
- * @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
- *
- * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
- */
- decorator(name: string, inlineAnnotatedFunction: any[]): void;
- factory(name: string, serviceFactoryFunction: Function): IServiceProvider;
- factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider;
- provider(name: string, provider: IServiceProvider): IServiceProvider;
- provider(name: string, serviceProviderConstructor: Function): IServiceProvider;
- service(name: string, constructor: Function): IServiceProvider;
- value(name: string, value: any): IServiceProvider;
- }
-
- }
-}
diff --git a/typings/chai-as-promised/chai-as-promised.d.ts b/typings/chai-as-promised/chai-as-promised.d.ts
deleted file mode 100644
index 106bbf4..0000000
--- a/typings/chai-as-promised/chai-as-promised.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-// Type definitions for chai-as-promised
-// Project: https://github.com/domenic/chai-as-promised/
-// Definitions by: jt000
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-///
-
-declare module 'chai-as-promised' {
- function chaiAsPromised(chai: any, utils: any): void;
- export = chaiAsPromised;
-}
-
-declare module Chai {
-
- interface Assertion {
- become(expected: any): Assertion;
- fulfilled: Assertion;
- rejected: Assertion;
- rejectedWith(expected: any): Assertion;
- notify(fn: Function): Assertion;
- }
-
- interface LanguageChains {
- eventually: Assertion;
- }
-
- interface Assert {
- eventually: Assert;
- isFulfilled(promise: any, message?: string): void;
- becomes(promise: any, expected: any, message?: string): void;
- doesNotBecome(promise: any, expected: any, message?: string): void;
- isRejected(promise: any, message?: string): void;
- isRejected(promise: any, expected: any, message?: string): void;
- isRejected(promise: any, match: RegExp, message?: string): void;
- }
-}
diff --git a/typings/chai/chai.d.ts b/typings/chai/chai.d.ts
deleted file mode 100644
index cb685f3..0000000
--- a/typings/chai/chai.d.ts
+++ /dev/null
@@ -1,308 +0,0 @@
-// Type definitions for chai 2.0.0
-// Project: http://chaijs.com/
-// Definitions by: Jed Mao ,
-// Bart van der Schoor ,
-// Andrew Brown
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-declare module Chai {
-
- interface ChaiStatic {
- expect: ExpectStatic;
- should(): Should;
- /**
- * Provides a way to extend the internals of Chai
- */
- use(fn: (chai: any, utils: any) => void): any;
- assert: AssertStatic;
- config: Config;
- }
-
- export interface ExpectStatic extends AssertionStatic {
- }
-
- export interface AssertStatic extends Assert {
- }
-
- export interface AssertionStatic {
- (target: any, message?: string): Assertion;
- }
-
- interface ShouldAssertion {
- equal(value1: any, value2: any, message?: string): void;
- Throw: ShouldThrow;
- throw: ShouldThrow;
- exist(value: any, message?: string): void;
- }
-
- interface Should extends ShouldAssertion {
- not: ShouldAssertion;
- fail(actual: any, expected: any, message?: string, operator?: string): void;
- }
-
- interface ShouldThrow {
- (actual: Function): void;
- (actual: Function, expected: string|RegExp, message?: string): void;
- (actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
- }
-
- interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
- not: Assertion;
- deep: Deep;
- a: TypeComparison;
- an: TypeComparison;
- include: Include;
- contain: Include;
- ok: Assertion;
- true: Assertion;
- false: Assertion;
- null: Assertion;
- undefined: Assertion;
- exist: Assertion;
- empty: Assertion;
- arguments: Assertion;
- Arguments: Assertion;
- equal: Equal;
- equals: Equal;
- eq: Equal;
- eql: Equal;
- eqls: Equal;
- property: Property;
- ownProperty: OwnProperty;
- haveOwnProperty: OwnProperty;
- length: Length;
- lengthOf: Length;
- match(regexp: RegExp|string, message?: string): Assertion;
- string(string: string, message?: string): Assertion;
- keys: Keys;
- key(string: string): Assertion;
- throw: Throw;
- throws: Throw;
- Throw: Throw;
- respondTo(method: string, message?: string): Assertion;
- itself: Assertion;
- satisfy(matcher: Function, message?: string): Assertion;
- closeTo(expected: number, delta: number, message?: string): Assertion;
- members: Members;
- }
-
- interface LanguageChains {
- to: Assertion;
- be: Assertion;
- been: Assertion;
- is: Assertion;
- that: Assertion;
- which: Assertion;
- and: Assertion;
- has: Assertion;
- have: Assertion;
- with: Assertion;
- at: Assertion;
- of: Assertion;
- same: Assertion;
- }
-
- interface NumericComparison {
- above: NumberComparer;
- gt: NumberComparer;
- greaterThan: NumberComparer;
- least: NumberComparer;
- gte: NumberComparer;
- below: NumberComparer;
- lt: NumberComparer;
- lessThan: NumberComparer;
- most: NumberComparer;
- lte: NumberComparer;
- within(start: number, finish: number, message?: string): Assertion;
- }
-
- interface NumberComparer {
- (value: number, message?: string): Assertion;
- }
-
- interface TypeComparison {
- (type: string, message?: string): Assertion;
- instanceof: InstanceOf;
- instanceOf: InstanceOf;
- }
-
- interface InstanceOf {
- (constructor: Object, message?: string): Assertion;
- }
-
- interface Deep {
- equal: Equal;
- include: Include;
- property: Property;
- }
-
- interface Equal {
- (value: any, message?: string): Assertion;
- }
-
- interface Property {
- (name: string, value?: any, message?: string): Assertion;
- }
-
- interface OwnProperty {
- (name: string, message?: string): Assertion;
- }
-
- interface Length extends LanguageChains, NumericComparison {
- (length: number, message?: string): Assertion;
- }
-
- interface Include {
- (value: Object, message?: string): Assertion;
- (value: string, message?: string): Assertion;
- (value: number, message?: string): Assertion;
- keys: Keys;
- members: Members;
- }
-
- interface Keys {
- (...keys: string[]): Assertion;
- (keys: any[]): Assertion;
- }
-
- interface Throw {
- (): Assertion;
- (expected: string, message?: string): Assertion;
- (expected: RegExp, message?: string): Assertion;
- (constructor: Error, expected?: string, message?: string): Assertion;
- (constructor: Error, expected?: RegExp, message?: string): Assertion;
- (constructor: Function, expected?: string, message?: string): Assertion;
- (constructor: Function, expected?: RegExp, message?: string): Assertion;
- }
-
- interface Members {
- (set: any[], message?: string): Assertion;
- }
-
- export interface Assert {
- /**
- * @param expression Expression to test for truthiness.
- * @param message Message to display on error.
- */
- (expression: any, message?: string): void;
-
- fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
-
- ok(val: any, msg?: string): void;
- notOk(val: any, msg?: string): void;
-
- equal(act: any, exp: any, msg?: string): void;
- notEqual(act: any, exp: any, msg?: string): void;
-
- strictEqual(act: any, exp: any, msg?: string): void;
- notStrictEqual(act: any, exp: any, msg?: string): void;
-
- deepEqual(act: any, exp: any, msg?: string): void;
- notDeepEqual(act: any, exp: any, msg?: string): void;
-
- isTrue(val: any, msg?: string): void;
- isFalse(val: any, msg?: string): void;
-
- isNull(val: any, msg?: string): void;
- isNotNull(val: any, msg?: string): void;
-
- isUndefined(val: any, msg?: string): void;
- isDefined(val: any, msg?: string): void;
-
- isFunction(val: any, msg?: string): void;
- isNotFunction(val: any, msg?: string): void;
-
- isObject(val: any, msg?: string): void;
- isNotObject(val: any, msg?: string): void;
-
- isArray(val: any, msg?: string): void;
- isNotArray(val: any, msg?: string): void;
-
- isString(val: any, msg?: string): void;
- isNotString(val: any, msg?: string): void;
-
- isNumber(val: any, msg?: string): void;
- isNotNumber(val: any, msg?: string): void;
-
- isBoolean(val: any, msg?: string): void;
- isNotBoolean(val: any, msg?: string): void;
-
- typeOf(val: any, type: string, msg?: string): void;
- notTypeOf(val: any, type: string, msg?: string): void;
-
- instanceOf(val: any, type: Function, msg?: string): void;
- notInstanceOf(val: any, type: Function, msg?: string): void;
-
- include(exp: string, inc: any, msg?: string): void;
- include(exp: any[], inc: any, msg?: string): void;
-
- notInclude(exp: string, inc: any, msg?: string): void;
- notInclude(exp: any[], inc: any, msg?: string): void;
-
- match(exp: any, re: RegExp, msg?: string): void;
- notMatch(exp: any, re: RegExp, msg?: string): void;
-
- property(obj: Object, prop: string, msg?: string): void;
- notProperty(obj: Object, prop: string, msg?: string): void;
- deepProperty(obj: Object, prop: string, msg?: string): void;
- notDeepProperty(obj: Object, prop: string, msg?: string): void;
-
- propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
- propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
-
- deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
- deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
-
- lengthOf(exp: any, len: number, msg?: string): void;
- //alias frenzy
- throw(fn: Function, msg?: string): void;
- throw(fn: Function, regExp: RegExp): void;
- throw(fn: Function, errType: Function, msg?: string): void;
- throw(fn: Function, errType: Function, regExp: RegExp): void;
-
- throws(fn: Function, msg?: string): void;
- throws(fn: Function, regExp: RegExp): void;
- throws(fn: Function, errType: Function, msg?: string): void;
- throws(fn: Function, errType: Function, regExp: RegExp): void;
-
- Throw(fn: Function, msg?: string): void;
- Throw(fn: Function, regExp: RegExp): void;
- Throw(fn: Function, errType: Function, msg?: string): void;
- Throw(fn: Function, errType: Function, regExp: RegExp): void;
-
- doesNotThrow(fn: Function, msg?: string): void;
- doesNotThrow(fn: Function, regExp: RegExp): void;
- doesNotThrow(fn: Function, errType: Function, msg?: string): void;
- doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
-
- operator(val: any, operator: string, val2: any, msg?: string): void;
- closeTo(act: number, exp: number, delta: number, msg?: string): void;
-
- sameMembers(set1: any[], set2: any[], msg?: string): void;
- includeMembers(set1: any[], set2: any[], msg?: string): void;
-
- ifError(val: any, msg?: string): void;
- }
-
- export interface Config {
- includeStack: boolean;
- }
-
- export class AssertionError {
- constructor(message: string, _props?: any, ssf?: Function);
- name: string;
- message: string;
- showDiff: boolean;
- stack: string;
- }
-}
-
-declare var chai: Chai.ChaiStatic;
-
-declare module "chai" {
- export = chai;
-}
-
-interface Object {
- should: Chai.Assertion;
-}
diff --git a/typings/chance/chance.d.ts b/typings/chance/chance.d.ts
deleted file mode 100644
index 2af960e..0000000
--- a/typings/chance/chance.d.ts
+++ /dev/null
@@ -1,213 +0,0 @@
-// Type definitions for Chance 0.7.3
-// Project: http://chancejs.com
-// Definitions by: Chris Bowdon
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-declare module Chance {
-
- interface ChanceStatic {
- Chance(): Chance;
- new(): Chance;
- new(seed: number): Chance;
- new(generator: () => any): Chance;
- }
-
- interface Chance {
-
- // Basics
- bool(opts?: Options): boolean;
- character(opts?: Options): string;
- floating(opts?: Options): number;
- integer(opts?: Options): number;
- natural(opts?: Options): number;
- string(opts?: Options): string;
-
- // Text
- paragraph(opts?: Options): string;
- sentence(opts?: Options): string;
- syllable(opts?: Options): string;
- word(opts?: Options): string;
-
- // Person
- age(opts?: Options): number;
- birthday(): Date;
- birthday(opts?: Options): Date|string;
- cpf(): string;
- first(opts?: Options): string;
- last(opts?: Options): string;
- name(opts?: Options): string;
- name_prefix(opts?: Options): string;
- name_suffix(opts?: Options): string;
- prefix(opts?: Options): string;
- ssn(opts?: Options): string;
- suffix(opts?: Options): string;
-
- // Mobile
- android_id(): string;
- apple_token(): string;
- bb_pin(): string;
- wp7_anid(): string;
- wp8_anid2(): string;
-
- // Web
- color(opts?: Options): string;
- domain(opts?: Options): string;
- email(opts?: Options): string;
- fbid(): string;
- google_analytics(): string;
- hashtag(): string;
- ip(): string;
- ipv6(): string;
- klout(): string;
- tld(): string;
- twitter(): string;
- url(opts?: Options): string;
-
- // Location
- address(opts?: Options): string;
- altitude(opts?: Options): number;
- areacode(): string;
- city(): string;
- coordinates(opts?: Options): string;
- country(opts?: Options): string;
- depth(opts?: Options): number;
- geohash(opts?: Options): string;
- latitude(opts?: Options): number;
- longitude(opts?: Options): number;
- phone(opts?: Options): string;
- postal(): string;
- province(opts?: Options): string;
- state(opts?: Options): string;
- street(opts?: Options): string;
- zip(opts?: Options): string;
-
- // Time
- ampm(): string;
- date(): Date;
- date(opts: DateOptions): Date|string;
- hammertime(): number;
- hour(opts?: Options): number;
- millisecond(): number;
- minute(): number;
- month(): string;
- month(opts: Options): Month;
- second(): number;
- timestamp(): number;
- year(opts?: Options): string;
-
- // Finance
- cc(opts?: Options): string;
- cc_type(): string;
- cc_type(opts: Options): string|CreditCardType;
- currency(): Currency;
- currency_pair(): [ Currency, Currency ];
- dollar(opts?: Options): string;
- exp(): string;
- exp(opts: Options): string|CreditCardExpiration;
- exp_month(opts?: Options): string;
- exp_year(opts?: Options): string;
-
- // Helpers
- capitalize(str: string): string;
- mixin(desc: MixinDescriptor): any;
- pad(num: number, width: number, padChar?: string): string;
- pick(arr: T[]): T;
- pick(arr: T[], count: number): T[];
- set: Setter;
- shuffle(arr: T[]): T[];
-
- // Miscellaneous
- d4(): number;
- d6(): number;
- d8(): number;
- d10(): number;
- d12(): number;
- d20(): number;
- d30(): number;
- d100(): number;
- guid(): string;
- hash(opts?: Options): string;
- n(generator: () => T, count: number, opts?: Options): T[];
- normal(opts?: Options): string;
- radio(opts?: Options): string;
- rpg(dice: string): number[];
- rpg(dice: string, opts?: Options): number[]|number;
- tv(opts?: Options): string;
- unique(generator: () => T, count: number, opts?: Options): T[];
- weighted(values: T[], weights: number[]): T;
-
- // "Hidden"
- cc_types(): CreditCardType[];
- mersenne_twister(seed?: number): any; // API return type not defined in docs
- months(): Month[];
- name_prefixes(): Name[];
- provinces(): Name[];
- states(): Name[];
- street_suffix(): Name;
- street_suffixes(): Name[];
- }
-
- // A more rigorous approach might be to produce
- // the correct options interfaces for each method
- interface Options { [id: string]: any; }
-
- interface DateOptions {
- string?: boolean;
- american?: boolean;
- year?: number;
- month?: number;
- day?: number;
- }
-
- interface Month {
- name: string;
- short_name: string;
- numeric: string;
- }
-
- interface CreditCardType {
- name: string;
- short_name: string;
- prefix: string;
- length: number;
- }
-
- interface Currency {
- code: string;
- name: string;
- }
-
- interface CreditCardExpiration {
- month: string;
- year: string;
- }
-
- interface MixinDescriptor { [id: string]: () => any; }
-
- interface Setter {
- (key: 'firstNames', values: string[]): any;
- (key: 'lastNames', values: string[]): any;
- (key: 'provinces', values: string[]): any;
- (key: 'us_states_and_dc', values: string[]): any;
- (key: 'territories', values: string[]): any;
- (key: 'armed_forces', values: string[]): any;
- (key: 'street_suffixes', values: string[]): any;
- (key: 'months', values: string[]): any;
- (key: 'cc_types', values: string[]): any;
- (key: 'currency_types', values: string[]): any;
- (key: string, values: T[]): any;
- }
-
- interface Name {
- name: string;
- abbreviation: string;
- }
-}
-
-// window.chance
-declare var chance: Chance.Chance;
-declare var Chance: Chance.ChanceStatic;
-
-// import Chance = require('chance');
-declare module 'chance' {
- export = Chance;
-}
diff --git a/typings/jquery/jquery.d.ts b/typings/jquery/jquery.d.ts
deleted file mode 100644
index 4653239..0000000
--- a/typings/jquery/jquery.d.ts
+++ /dev/null
@@ -1,3170 +0,0 @@
-// Type definitions for jQuery 1.10.x / 2.0.x
-// Project: http://jquery.com/
-// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-/* *****************************************************************************
-Copyright (c) Microsoft Corporation. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at http://www.apache.org/licenses/LICENSE-2.0
-
-THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-MERCHANTABLITY OR NON-INFRINGEMENT.
-
-See the Apache Version 2.0 License for specific language governing permissions
-and limitations under the License.
-***************************************************************************** */
-
-
-/**
- * Interface for the AJAX setting that will configure the AJAX request
- */
-interface JQueryAjaxSettings {
- /**
- * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
- */
- accepts?: any;
- /**
- * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().
- */
- async?: boolean;
- /**
- * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
- */
- beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
- /**
- * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.
- */
- cache?: boolean;
- /**
- * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
- */
- complete? (jqXHR: JQueryXHR, textStatus: string): any;
- /**
- * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
- */
- contents?: { [key: string]: any; };
- //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
- // https://github.com/borisyankov/DefinitelyTyped/issues/742
- /**
- * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.
- */
- contentType?: any;
- /**
- * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax).
- */
- context?: any;
- /**
- * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5)
- */
- converters?: { [key: string]: any; };
- /**
- * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5)
- */
- crossDomain?: boolean;
- /**
- * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
- */
- data?: any;
- /**
- * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
- */
- dataFilter? (data: any, ty: any): any;
- /**
- * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string).
- */
- dataType?: string;
- /**
- * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
- */
- error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
- /**
- * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events.
- */
- global?: boolean;
- /**
- * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5)
- */
- headers?: { [key: string]: any; };
- /**
- * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data.
- */
- ifModified?: boolean;
- /**
- * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1)
- */
- isLocal?: boolean;
- /**
- * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
- */
- jsonp?: any;
- /**
- * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
- */
- jsonpCallback?: any;
- /**
- * A mime type to override the XHR mime type. (version added: 1.5.1)
- */
- mimeType?: string;
- /**
- * A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
- */
- password?: string;
- /**
- * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.
- */
- processData?: boolean;
- /**
- * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script.
- */
- scriptCharset?: string;
- /**
- * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5)
- */
- statusCode?: { [key: string]: any; };
- /**
- * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
- */
- success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
- /**
- * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
- */
- timeout?: number;
- /**
- * Set this to true if you wish to use the traditional style of param serialization.
- */
- traditional?: boolean;
- /**
- * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
- */
- type?: string;
- /**
- * A string containing the URL to which the request is sent.
- */
- url?: string;
- /**
- * A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
- */
- username?: string;
- /**
- * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.
- */
- xhr?: any;
- /**
- * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1)
- */
- xhrFields?: { [key: string]: any; };
-}
-
-/**
- * Interface for the jqXHR object
- */
-interface JQueryXHR extends XMLHttpRequest, JQueryPromise {
- /**
- * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5).
- */
- overrideMimeType(mimeType: string): any;
- /**
- * Cancel the request.
- *
- * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
- */
- abort(statusText?: string): void;
- /**
- * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
- */
- then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise;
- /**
- * Property containing the parsed response if the response Content-Type is json
- */
- responseJSON?: any;
-}
-
-/**
- * Interface for the JQuery callback
- */
-interface JQueryCallback {
- /**
- * Add a callback or a collection of callbacks to a callback list.
- *
- * @param callbacks A function, or array of functions, that are to be added to the callback list.
- */
- add(callbacks: Function): JQueryCallback;
- /**
- * Add a callback or a collection of callbacks to a callback list.
- *
- * @param callbacks A function, or array of functions, that are to be added to the callback list.
- */
- add(callbacks: Function[]): JQueryCallback;
-
- /**
- * Disable a callback list from doing anything more.
- */
- disable(): JQueryCallback;
-
- /**
- * Determine if the callbacks list has been disabled.
- */
- disabled(): boolean;
-
- /**
- * Remove all of the callbacks from a list.
- */
- empty(): JQueryCallback;
-
- /**
- * Call all of the callbacks with the given arguments
- *
- * @param arguments The argument or list of arguments to pass back to the callback list.
- */
- fire(...arguments: any[]): JQueryCallback;
-
- /**
- * Determine if the callbacks have already been called at least once.
- */
- fired(): boolean;
-
- /**
- * Call all callbacks in a list with the given context and arguments.
- *
- * @param context A reference to the context in which the callbacks in the list should be fired.
- * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
- */
- fireWith(context?: any, ...args: any[]): JQueryCallback;
-
- /**
- * Determine whether a supplied callback is in a list
- *
- * @param callback The callback to search for.
- */
- has(callback: Function): boolean;
-
- /**
- * Lock a callback list in its current state.
- */
- lock(): JQueryCallback;
-
- /**
- * Determine if the callbacks list has been locked.
- */
- locked(): boolean;
-
- /**
- * Remove a callback or a collection of callbacks from a callback list.
- *
- * @param callbacks A function, or array of functions, that are to be removed from the callback list.
- */
- remove(callbacks: Function): JQueryCallback;
- /**
- * Remove a callback or a collection of callbacks from a callback list.
- *
- * @param callbacks A function, or array of functions, that are to be removed from the callback list.
- */
- remove(callbacks: Function[]): JQueryCallback;
-}
-
-/**
- * Allows jQuery Promises to interop with non-jQuery promises
- */
-interface JQueryGenericPromise {
- /**
- * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
- *
- * @param doneFilter A function that is called when the Deferred is resolved.
- * @param failFilter An optional function that is called when the Deferred is rejected.
- */
- then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise;
-
- /**
- * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
- *
- * @param doneFilter A function that is called when the Deferred is resolved.
- * @param failFilter An optional function that is called when the Deferred is rejected.
- */
- then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise;
-}
-
-/**
- * Interface for the JQuery promise/deferred callbacks
- */
-interface JQueryPromiseCallback {
- (value?: T, ...args: any[]): void;
-}
-
-interface JQueryPromiseOperator {
- (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise;
-}
-
-/**
- * Interface for the JQuery promise, part of callbacks
- */
-interface JQueryPromise extends JQueryGenericPromise {
- /**
- * Determine the current state of a Deferred object.
- */
- state(): string;
- /**
- * Add handlers to be called when the Deferred object is either resolved or rejected.
- *
- * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
- * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
- */
- always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise;
- /**
- * Add handlers to be called when the Deferred object is resolved.
- *
- * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
- * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
- */
- done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise;
- /**
- * Add handlers to be called when the Deferred object is rejected.
- *
- * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
- * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
- */
- fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise;
- /**
- * Add handlers to be called when the Deferred object generates progress notifications.
- *
- * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
- */
- progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise;
-
- // Deprecated - given no typings
- pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise;
-}
-
-/**
- * Interface for the JQuery deferred, part of callbacks
- */
-interface JQueryDeferred extends JQueryGenericPromise {
- /**
- * Determine the current state of a Deferred object.
- */
- state(): string;
- /**
- * Add handlers to be called when the Deferred object is either resolved or rejected.
- *
- * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
- * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
- */
- always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred;
- /**
- * Add handlers to be called when the Deferred object is resolved.
- *
- * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
- * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
- */
- done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred;
- /**
- * Add handlers to be called when the Deferred object is rejected.
- *
- * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
- * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
- */
- fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred;
- /**
- * Add handlers to be called when the Deferred object generates progress notifications.
- *
- * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
- */
- progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred;
-
- /**
- * Call the progressCallbacks on a Deferred object with the given args.
- *
- * @param args Optional arguments that are passed to the progressCallbacks.
- */
- notify(value?: any, ...args: any[]): JQueryDeferred;
-
- /**
- * Call the progressCallbacks on a Deferred object with the given context and args.
- *
- * @param context Context passed to the progressCallbacks as the this object.
- * @param args Optional arguments that are passed to the progressCallbacks.
- */
- notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred;
-
- /**
- * Reject a Deferred object and call any failCallbacks with the given args.
- *
- * @param args Optional arguments that are passed to the failCallbacks.
- */
- reject(value?: any, ...args: any[]): JQueryDeferred;
- /**
- * Reject a Deferred object and call any failCallbacks with the given context and args.
- *
- * @param context Context passed to the failCallbacks as the this object.
- * @param args An optional array of arguments that are passed to the failCallbacks.
- */
- rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred;
-
- /**
- * Resolve a Deferred object and call any doneCallbacks with the given args.
- *
- * @param value First argument passed to doneCallbacks.
- * @param args Optional subsequent arguments that are passed to the doneCallbacks.
- */
- resolve(value?: T, ...args: any[]): JQueryDeferred;
-
- /**
- * Resolve a Deferred object and call any doneCallbacks with the given context and args.
- *
- * @param context Context passed to the doneCallbacks as the this object.
- * @param args An optional array of arguments that are passed to the doneCallbacks.
- */
- resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred;
-
- /**
- * Return a Deferred's Promise object.
- *
- * @param target Object onto which the promise methods have to be attached
- */
- promise(target?: any): JQueryPromise;
-
- // Deprecated - given no typings
- pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise;
-}
-
-/**
- * Interface of the JQuery extension of the W3C event object
- */
-interface BaseJQueryEventObject extends Event {
- data: any;
- delegateTarget: Element;
- isDefaultPrevented(): boolean;
- isImmediatePropagationStopped(): boolean;
- isPropagationStopped(): boolean;
- namespace: string;
- originalEvent: Event;
- preventDefault(): any;
- relatedTarget: Element;
- result: any;
- stopImmediatePropagation(): void;
- stopPropagation(): void;
- target: Element;
- pageX: number;
- pageY: number;
- which: number;
- metaKey: boolean;
-}
-
-interface JQueryInputEventObject extends BaseJQueryEventObject {
- altKey: boolean;
- ctrlKey: boolean;
- metaKey: boolean;
- shiftKey: boolean;
-}
-
-interface JQueryMouseEventObject extends JQueryInputEventObject {
- button: number;
- clientX: number;
- clientY: number;
- offsetX: number;
- offsetY: number;
- pageX: number;
- pageY: number;
- screenX: number;
- screenY: number;
-}
-
-interface JQueryKeyEventObject extends JQueryInputEventObject {
- char: any;
- charCode: number;
- key: any;
- keyCode: number;
-}
-
-interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
-}
-
-/*
- Collection of properties of the current browser
-*/
-
-interface JQuerySupport {
- ajax?: boolean;
- boxModel?: boolean;
- changeBubbles?: boolean;
- checkClone?: boolean;
- checkOn?: boolean;
- cors?: boolean;
- cssFloat?: boolean;
- hrefNormalized?: boolean;
- htmlSerialize?: boolean;
- leadingWhitespace?: boolean;
- noCloneChecked?: boolean;
- noCloneEvent?: boolean;
- opacity?: boolean;
- optDisabled?: boolean;
- optSelected?: boolean;
- scriptEval? (): boolean;
- style?: boolean;
- submitBubbles?: boolean;
- tbody?: boolean;
-}
-
-interface JQueryParam {
- /**
- * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
- *
- * @param obj An array or object to serialize.
- */
- (obj: any): string;
-
- /**
- * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
- *
- * @param obj An array or object to serialize.
- * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
- */
- (obj: any, traditional: boolean): string;
-}
-
-/**
- * The interface used to construct jQuery events (with $.Event). It is
- * defined separately instead of inline in JQueryStatic to allow
- * overriding the construction function with specific strings
- * returning specific event objects.
- */
-interface JQueryEventConstructor {
- (name: string, eventProperties?: any): JQueryEventObject;
- new (name: string, eventProperties?: any): JQueryEventObject;
-}
-
-/**
- * The interface used to specify coordinates.
- */
-interface JQueryCoordinates {
- left: number;
- top: number;
-}
-
-/**
- * Elements in the array returned by serializeArray()
- */
-interface JQuerySerializeArrayElement {
- name: string;
- value: string;
-}
-
-interface JQueryAnimationOptions {
- /**
- * A string or number determining how long the animation will run.
- */
- duration?: any;
- /**
- * A string indicating which easing function to use for the transition.
- */
- easing?: string;
- /**
- * A function to call once the animation is complete.
- */
- complete?: Function;
- /**
- * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
- */
- step?: (now: number, tween: any) => any;
- /**
- * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8)
- */
- progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any;
- /**
- * A function to call when the animation begins. (version added: 1.8)
- */
- start?: (animation: JQueryPromise) => any;
- /**
- * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
- */
- done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any;
- /**
- * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
- */
- fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any;
- /**
- * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8)
- */
- always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any;
- /**
- * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it.
- */
- queue?: any;
- /**
- * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
- */
- specialEasing?: Object;
-}
-
-/**
- * Static members of jQuery (those on $ and jQuery themselves)
- */
-interface JQueryStatic {
-
- /**
- * Perform an asynchronous HTTP (Ajax) request.
- *
- * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
- */
- ajax(settings: JQueryAjaxSettings): JQueryXHR;
- /**
- * Perform an asynchronous HTTP (Ajax) request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
- */
- ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
-
- /**
- * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
- *
- * @param dataTypes An optional string containing one or more space-separated dataTypes
- * @param handler A handler to set default values for future Ajax requests.
- */
- ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
- /**
- * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
- *
- * @param handler A handler to set default values for future Ajax requests.
- */
- ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
-
- ajaxSettings: JQueryAjaxSettings;
-
- /**
- * Set default values for future Ajax requests. Its use is not recommended.
- *
- * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
- */
- ajaxSetup(options: JQueryAjaxSettings): void;
-
- /**
- * Load data from the server using a HTTP GET request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param success A callback function that is executed if the request succeeds.
- * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
- */
- get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
- /**
- * Load data from the server using a HTTP GET request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param data A plain object or string that is sent to the server with the request.
- * @param success A callback function that is executed if the request succeeds.
- * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
- */
- get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
- /**
- * Load JSON-encoded data from the server using a GET HTTP request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param success A callback function that is executed if the request succeeds.
- */
- getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
- /**
- * Load JSON-encoded data from the server using a GET HTTP request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param data A plain object or string that is sent to the server with the request.
- * @param success A callback function that is executed if the request succeeds.
- */
- getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
- /**
- * Load a JavaScript file from the server using a GET HTTP request, then execute it.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param success A callback function that is executed if the request succeeds.
- */
- getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
-
- /**
- * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
- */
- param: JQueryParam;
-
- /**
- * Load data from the server using a HTTP POST request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
- * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
- */
- post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
- /**
- * Load data from the server using a HTTP POST request.
- *
- * @param url A string containing the URL to which the request is sent.
- * @param data A plain object or string that is sent to the server with the request.
- * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
- * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
- */
- post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
-
- /**
- * A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
- *
- * @param flags An optional list of space-separated flags that change how the callback list behaves.
- */
- Callbacks(flags?: string): JQueryCallback;
-
- /**
- * Holds or releases the execution of jQuery's ready event.
- *
- * @param hold Indicates whether the ready hold is being requested or released
- */
- holdReady(hold: boolean): void;
-
- /**
- * Accepts a string containing a CSS selector which is then used to match a set of elements.
- *
- * @param selector A string containing a selector expression
- * @param context A DOM Element, Document, or jQuery to use as context
- */
- (selector: string, context?: Element|JQuery): JQuery;
-
- /**
- * Accepts a string containing a CSS selector which is then used to match a set of elements.
- *
- * @param element A DOM element to wrap in a jQuery object.
- */
- (element: Element): JQuery;
-
- /**
- * Accepts a string containing a CSS selector which is then used to match a set of elements.
- *
- * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
- */
- (elementArray: Element[]): JQuery;
-
- /**
- * Binds a function to be executed when the DOM has finished loading.
- *
- * @param callback A function to execute after the DOM is ready.
- */
- (callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
-
- /**
- * Accepts a string containing a CSS selector which is then used to match a set of elements.
- *
- * @param object A plain object to wrap in a jQuery object.
- */
- (object: {}): JQuery;
-
- /**
- * Accepts a string containing a CSS selector which is then used to match a set of elements.
- *
- * @param object An existing jQuery object to clone.
- */
- (object: JQuery): JQuery;
-
- /**
- * Specify a function to execute when the DOM is fully loaded.
- */
- (): JQuery;
-
- /**
- * Creates DOM elements on the fly from the provided string of raw HTML.
- *
- * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
- * @param ownerDocument A document in which the new elements will be created.
- */
- (html: string, ownerDocument?: Document): JQuery;
-
- /**
- * Creates DOM elements on the fly from the provided string of raw HTML.
- *
- * @param html A string defining a single, standalone, HTML element (e.g. or ).
- * @param attributes An object of attributes, events, and methods to call on the newly-created element.
- */
- (html: string, attributes: Object): JQuery;
-
- /**
- * Relinquish jQuery's control of the $ variable.
- *
- * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
- */
- noConflict(removeAll?: boolean): Object;
-
- /**
- * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
- *
- * @param deferreds One or more Deferred objects, or plain JavaScript objects.
- */
- when(...deferreds: Array