...
+ * ...
+ * ```
+ *
+ * Whenever the `someExpression` expression changes, the `properties` declaration instructs
+ * Angular to update the `Tooltip`'s `text` property.
+ *
+ *
+ *
+ * ## Bindings With Pipes
+ *
+ * You can also use pipes when writing binding definitions for a directive.
+ *
+ * For example, we could write a binding that updates the directive on structural changes, rather than on reference
+ * changes, as normally occurs in change detection.
+ *
+ * See {@link Pipe} and {@link keyValDiff} documentation for more details.
+ *
+ * ```
+ * @Directive({
+ * selector: '[class-set]',
+ * properties: {
+ * 'classChanges': 'classSet | keyValDiff'
+ * }
+ * })
+ * class ClassSet {
+ * set classChanges(changes:KeyValueChanges) {
+ * // This will get called every time the `class-set` expressions changes its structure.
+ * }
+ * }
+ * ```
+ *
+ * The template that this directive is used in may also contain its own pipes. For example:
+ *
+ * ```html
+ *
+ * ```
+ *
+ * In this case, the two pipes compose as if they were inlined: `someExpression | somePipe | keyValDiff`.
+ *
+ */
+ properties?: Object;
+
+ /**
+ * Specifies which DOM hostListeners a directive listens to.
+ *
+ * The `hostListeners` property defines a set of `event` to `method` key-value pairs:
+ *
+ * - `event1`: the DOM event that the directive listens to.
+ * - `statement`: the statement to execute when the event occurs.
+ * If the evalutation of the statement returns `false`, then `preventDefault`is applied on the DOM event.
+ *
+ * To listen to global events, a target must be added to the event name.
+ * The target can be `window`, `document` or `body`.
+ *
+ * When writing a directive event binding, you can also refer to the following local variables:
+ * - `$event`: Current event object which triggered the event.
+ * - `$target`: The source of the event. This will be either a DOM element or an Angular directive.
+ * (will be implemented in later release)
+ *
+ *
+ * ## Syntax
+ *
+ * ```
+ * @Directive({
+ * hostListeners: {
+ * 'event1': 'onMethod1(arguments)',
+ * 'target:event2': 'onMethod2(arguments)',
+ * ...
+ * }
+ * }
+ * ```
+ *
+ * ## Basic Event Binding:
+ *
+ * Suppose you want to write a directive that triggers on `change` events in the DOM and on `resize` events in window.
+ * You would define the event binding as follows:
+ *
+ * ```
+ * @Directive({
+ * selector: 'input',
+ * hostListeners: {
+ * 'change': 'onChange($event)',
+ * 'window:resize': 'onResize($event)'
+ * }
+ * })
+ * class InputDirective {
+ * onChange(event:Event) {
+ * }
+ * onResize(event:Event) {
+ * }
+ * }
+ * ```
+ *
+ * Here the `onChange` method of `InputDirective` is invoked whenever the DOM element fires the 'change' event.
+ *
+ */
+ hostListeners?: Object;
+
+ /**
+ * Defines the set of injectable objects that are visible to a Component and its children.
+ *
+ * The `injectables` defined in the Component annotation allow you to configure a set of bindings for the component's
+ * injector.
+ *
+ * When a component is instantiated, Angular creates a new child Injector, which is configured with the bindings in
+ * the Component `injectables` annotation. The injectable objects then become available for injection to the component
+ * itself and any of the directives in the component's template, i.e. they are not available to the directives which
+ * are children in the component's light DOM.
+ *
+ *
+ * The syntax for configuring the `injectables` injectable is identical to {@link Injector} injectable configuration.
+ * See {@link Injector} for additional detail.
+ *
+ *
+ * ## Simple Example
+ *
+ * Here is an example of a class that can be injected:
+ *
+ * ```
+ * class Greeter {
+ * greet(name:string) {
+ * return 'Hello ' + name + '!';
+ * }
+ * }
+ *
+ * @Component({
+ * selector: 'greet',
+ * injectables: [
+ * Greeter
+ * ]
+ * })
+ * @View({
+ * template: `{{greeter.greet('world')}}!`,
+ * directives: Child
+ * })
+ * class HelloWorld {
+ * greeter:Greeter;
+ *
+ * constructor(greeter:Greeter) {
+ * this.greeter = greeter;
+ * }
+ * }
+ * ```
+ */
+ injectables?: List
;
+
+ /**
+ * Specifies a set of lifecycle hostListeners in which the directive participates.
+ *
+ * See {@link onChange}, {@link onDestroy}, {@link onAllChangesDone} for details.
+ */
+ lifecycle?: List;
+
+ /**
+ * Defines the used change detection strategy.
+ *
+ * When a component is instantiated, Angular creates a change detector, which is responsible for propagating
+ * the component's bindings.
+ *
+ * The `changeDetection` property defines, whether the change detection will be checked every time or only when the component
+ * tells it to do so.
+ */
+ changeDetection?: string;
+}
+
+interface _ViewArg {
+ /**
+ * Specifies a template URL for an angular component.
+ *
+ * NOTE: either `templateUrl` or `template` should be used, but not both.
+ */
+ templateUrl?: string;
+
+ /**
+ * Specifies an inline template for an angular component.
+ *
+ * NOTE: either `templateUrl` or `template` should be used, but not both.
+ */
+ template?: string;
+
+ /**
+ * Specifies a list of directives that can be used within a template.
+ *
+ * Directives must be listed explicitly to provide proper component encapsulation.
+ */
+ directives?: List;
+}
+
+declare module "angular2/angular2" {
+ /**
+ * Bootstrapping for Angular applications.
+ *
+ * You instantiate an Angular application by explicitly specifying a component to use as the root component for your
+ * application via the `bootstrap()` method.
+ *
+ * ## Simple Example
+ *
+ * Assuming this `index.html`:
+ *
+ * ```html
+ *
+ *
+ *
+ * loading...
+ *
+ *
+ * ```
+ *
+ * An application is bootstrapped inside an existing browser DOM, typically `index.html`. Unlike Angular 1, Angular 2
+ * does not compile/process bindings in `index.html`. This is mainly for security reasons, as well as architectural
+ * changes in Angular 2. This means that `index.html` can safely be processed using server-side technologies such as
+ * bindings. Bindings can thus use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly
+ * `{{ syntax }}`.
+ *
+ * We can use this script code:
+ *
+ * ```
+ * @Component({
+ * selector: 'my-app'
+ * })
+ * @View({
+ * template: 'Hello {{ name }}!'
+ * })
+ * class MyApp {
+ * name:string;
+ *
+ * constructor() {
+ * this.name = 'World';
+ * }
+ * }
+ *
+ * main() {
+ * return bootstrap(MyApp);
+ * }
+ * ```
+ *
+ * When the app developer invokes `bootstrap()` with the root component `MyApp` as its argument, Angular performs the
+ * following tasks:
+ *
+ * 1. It uses the component's `selector` property to locate the DOM element which needs to be upgraded into
+ * the angular component.
+ * 2. It creates a new child injector (from the platform injector) and configures the injector with the component's
+ * `injectables`. Optionally, you can also override the injector configuration for an app by invoking
+ * `bootstrap` with the `componentInjectableBindings` argument.
+ * 3. It creates a new `Zone` and connects it to the angular application's change detection domain instance.
+ * 4. It creates a shadow DOM on the selected component's host element and loads the template into it.
+ * 5. It instantiates the specified component.
+ * 6. Finally, Angular performs change detection to apply the initial data bindings for the application.
+ *
+ *
+ * ## Instantiating Multiple Applications on a Single Page
+ *
+ * There are two ways to do this.
+ *
+ *
+ * ### Isolated Applications
+ *
+ * Angular creates a new application each time that the `bootstrap()` method is invoked. When multiple applications
+ * are created for a page, Angular treats each application as independent within an isolated change detection and
+ * `Zone` domain. If you need to share data between applications, use the strategy described in the next
+ * section, "Applications That Share Change Detection."
+ *
+ *
+ * ### Applications That Share Change Detection
+ *
+ * If you need to bootstrap multiple applications that share common data, the applications must share a common
+ * change detection and zone. To do that, create a meta-component that lists the application components in its template.
+ * By only invoking the `bootstrap()` method once, with the meta-component as its argument, you ensure that only a
+ * single change detection zone is created and therefore data can be shared across the applications.
+ *
+ *
+ * ## Platform Injector
+ *
+ * When working within a browser window, there are many singleton resources: cookies, title, location, and others.
+ * Angular services that represent these resources must likewise be shared across all Angular applications that
+ * occupy the same browser window. For this reason, Angular creates exactly one global platform injector which stores
+ * all shared services, and each angular application injector has the platform injector as its parent.
+ *
+ * Each application has its own private injector as well. When there are multiple applications on a page, Angular treats
+ * each application injector's services as private to that application.
+ *
+ *
+ * # API
+ * - `appComponentType`: The root component which should act as the application. This is a reference to a `Type`
+ * which is annotated with `@Component(...)`.
+ * - `componentInjectableBindings`: An additional set of bindings that can be added to `injectables` for the
+ * {@link Component} to override default injection behavior.
+ * - `errorReporter`: `function(exception:any, stackTrace:string)` a default error reporter for unhandled exceptions.
+ *
+ * Returns a `Promise` with the application`s private {@link Injector}.
+ *
+ */
+ function bootstrap(appComponentType: any): void;
+
+ /**
+ * Declare reusable UI building blocks for an application.
+ *
+ * Each Angular component requires a single `@Component` and at least one `@View` annotation. The `@Component`
+ * annotation specifies when a component is instantiated, and which properties and hostListeners it binds to.
+ *
+ * When a component is instantiated, Angular
+ * - creates a shadow DOM for the component.
+ * - loads the selected template into the shadow DOM.
+ * - creates a child {@link Injector} which is configured with the `injectables` for the {@link Component}.
+ *
+ * All template expressions and statements are then evaluated against the component instance.
+ *
+ * For details on the `@View` annotation, see {@link View}.
+ *
+ * ## Example
+ *
+ * ```
+ * @Component({
+ * selector: 'greet'
+ * })
+ * @View({
+ * template: 'Hello {{name}}!'
+ * })
+ * class Greet {
+ * name: string;
+ *
+ * constructor() {
+ * this.name = 'World';
+ * }
+ * }
+ * ```
+ *
+ *
+ * Dynamically loading a component at runtime:
+ *
+ * Regular Angular components are statically resolved. Dynamic components allows to resolve a component at runtime
+ * instead by providing a placeholder into which a regular Angular component can be dynamically loaded. Once loaded,
+ * the dynamically-loaded component becomes permanent and cannot be changed.
+ * Dynamic components are declared just like components, but without a `@View` annotation.
+ *
+ *
+ * ## Example
+ *
+ * Here we have `DynamicComp` which acts as the placeholder for `HelloCmp`. At runtime, the dynamic component
+ * `DynamicComp` requests loading of the `HelloCmp` component.
+ *
+ * There is nothing special about `HelloCmp`, which is a regular Angular component. It can also be used in other static
+ * locations.
+ *
+ * ```
+ * @Component({
+ * selector: 'dynamic-comp'
+ * })
+ * class DynamicComp {
+ * helloCmp:HelloCmp;
+ * constructor(loader:DynamicComponentLoader, location:ElementRef) {
+ * loader.load(HelloCmp, location).then((helloCmp) => {
+ * this.helloCmp = helloCmp;
+ * });
+ * }
+ * }
+ *
+ * @Component({
+ * selector: 'hello-cmp'
+ * })
+ * @View({
+ * template: "{{greeting}}"
+ * })
+ * class HelloCmp {
+ * greeting:string;
+ * constructor() {
+ * this.greeting = "hello";
+ * }
+ * }
+ * ```
+ *
+ */
+ function Component(arg: _ComponentArg): (target: any) => any;
+
+ /**
+ * Declares the available HTML templates for an application.
+ *
+ * Each angular component requires a single `@Component` and at least one `@View` annotation. The @View
+ * annotation specifies the HTML template to use, and lists the directives that are active within the template.
+ *
+ * When a component is instantiated, the template is loaded into the component's shadow root, and the
+ * expressions and statements in the template are evaluated against the component.
+ *
+ * For details on the `@Component` annotation, see {@link Component}.
+ *
+ * ## Example
+ *
+ * ```
+ * @Component({
+ * selector: 'greet'
+ * })
+ * @View({
+ * template: 'Hello {{name}}!',
+ * directives: [GreetUser, Bold]
+ * })
+ * class Greet {
+ * name: string;
+ *
+ * constructor() {
+ * this.name = 'World';
+ * }
+ * }
+ * ```
+ *
+ */
+ function View(arg: _ViewArg): (target: any) => any;
+
+ /**
+ * The `For` directive instantiates a template once per item from an iterable. The context for each
+ * instantiated template inherits from the outer context with the given loop variable set to the
+ * current item from the iterable.
+ *
+ * It is possible to alias the `index` to a local variable that will be set to the current loop
+ * iteration in the template context.
+ *
+ * When the contents of the iterator changes, `For` makes the corresponding changes to the DOM:
+ *
+ * * When an item is added, a new instance of the template is added to the DOM.
+ * * When an item is removed, its template instance is removed from the DOM.
+ * * When items are reordered, their respective templates are reordered in the DOM.
+ *
+ * # Example
+ *
+ * ```
+ *
+ * -
+ * Error {{i}} of {{errors.length}}: {{error.message}}
+ *
+ *
+ * ```
+ *
+ * # Syntax
+ *
+ * - `...`
+ * - `...`
+ * - `...`
+ *
+ */
+ function For(): void;
+
+ /**
+ * Removes or recreates a portion of the DOM tree based on an {expression}.
+ *
+ * If the expression assigned to `if` evaluates to a false value then the element is removed from the
+ * DOM, otherwise a clone of the element is reinserted into the DOM.
+ *
+ * # Example:
+ *
+ * ```
+ * 0" class="error">
+ *
+ * {{errorCount}} errors detected
+ *
+ * ```
+ *
+ * # Syntax
+ *
+ * - `...
`
+ * - `...
`
+ * - `...
`
+ *
+ */
+ function If(): void;
+
+ /**
+ * The `NonBindable` directive tells Angular not to compile or bind the contents of the current
+ * DOM element. This is useful if the element contains what appears to be Angular directives and
+ * bindings but which should be ignored by Angular. This could be the case if you have a site that
+ * displays snippets of code, for instance.
+ *
+ * Example:
+ *
+ * ```
+ * Normal: {{1 + 2}}
// output "Normal: 3"
+ * Ignored: {{1 + 2}}
// output "Ignored: {{1 + 2}}"
+ * ```
+ *
+ */
+ function NonBindable(): void;
+
+ /**
+ * The `Switch` directive is used to conditionally swap DOM structure on your template based on a
+ * scope expression.
+ * Elements within `Switch` but without `SwitchWhen` or `SwitchDefault` directives will be
+ * preserved at the location as specified in the template.
+ *
+ * `Switch` simply chooses nested elements and makes them visible based on which element matches
+ * the value obtained from the evaluated expression. In other words, you define a container element
+ * (where you place the directive), place an expression on the **`[switch]="..."` attribute**),
+ * define any inner elements inside of the directive and place a `[switch-when]` attribute per
+ * element.
+ * The when attribute is used to inform Switch which element to display when the expression is
+ * evaluated. If a matching expression is not found via a when attribute then an element with the
+ * default attribute is displayed.
+ *
+ * # Example:
+ *
+ * ```
+ *
+ * ...
+ * ...
+ * ...
+ *
+ * ```
+ *
+ */
+ function Switch(): void;
+}
+
+declare module "angular2/di" {
+ /**
+ * Provides an API for imperatively constructing {@link Binding}s.
+ *
+ * This is only relevant for JavaScript. See {@link BindingBuilder}.
+ *
+ * ## Example
+ *
+ * ```javascript
+ * bind(MyInterface).toClass(MyClass)
+ *
+ * ```
+ *
+ */
+ function bind(token: any): any;
+}
diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts
index 7d39e4181..d636c88e6 100644
--- a/angularfire/angularfire-tests.ts
+++ b/angularfire/angularfire-tests.ts
@@ -62,8 +62,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
obj.$save();
});
- // $inst()
- if (obj.$inst() !== sync) throw "error";
+ // $ref()
+ if (obj.$ref() !== sync) throw "error";
// $bindTo()
obj.$bindTo($scope, "data").then(function () {
@@ -81,8 +81,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
// $destroy()
obj.$destroy();
- // $extendFactory()
- var NewFactory = $FirebaseObject.$extendFactory({
+ // $extend()
+ var NewFactory = $FirebaseObject.$extend({
getMyFavoriteColor: function () {
return this.favoriteColor + ", no green!"; // obscure Monty Python reference
}
@@ -94,8 +94,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
{
var list = sync.$asArray();
- // $inst()
- if (list.$inst() !== sync) throw "error";
+ // $ref()
+ if (list.$ref() !== sync) throw "error";
// $add()
list.$add({ foo: "foo value" });
@@ -145,8 +145,8 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
// $destroy()
list.$destroy();
- // $extendFactory()
- var ArrayWithSum = $FirebaseArray.$extendFactory({
+ // $extend()
+ var ArrayWithSum = $FirebaseArray.$extend({
sum: function () {
var total = 0;
angular.forEach(this.$list, function (rec) {
@@ -167,30 +167,43 @@ interface AngularFireAuthScope extends ng.IScope {
loginObj: AngularFireAuth;
}
-myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin",
- function($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) {
+myapp.controller("MyAuthController", ["$scope", "$firebaseAuth",
+ function($scope: AngularFireAuthScope, $firebaseAuth: AngularFireAuthService) {
var dataRef = new Firebase(url);
- $scope.loginObj = $firebaseSimpleLogin(dataRef);
- $scope.loginObj.$getCurrentUser().then(_ => {
- });
- var email = 'my@email.com';
- var password = 'mypassword';
- $scope.loginObj.$login('password', {
- email: email,
- password: password
- }).then(function(user) {
- console.log('Logged in as: ', user.uid);
- }, function(error) {
- console.error('Login failed: ', error);
- });
- $scope.loginObj.$logout();
- $scope.loginObj.$createUser(email, password).then(_ => {
- });
- $scope.loginObj.$changePassword(email, password, password).then(_ => {
- });
- $scope.loginObj.$removeUser(email, password).then(_ => {
- });
- $scope.loginObj.$sendPasswordResetEmail(email).then(_ => {
- });
+ $scope.loginObj = $firebaseAuth(dataRef);
+ $scope.loginObj.$getAuth();
+ var credentials = {
+ email: 'my@email.com',
+ password: 'mypassword'
+ };
+ var resetPasswordCredentials = {
+ email: 'my@email.com'
+ };
+ var changePasswordCredentials = {
+ email: 'my@email.com',
+ oldPassword: 'mypassword',
+ newPassword: 'mypassword'
+ };
+ var changeUserCredentials = {
+ oldEmail: 'my@email.com',
+ newEmail: 'my@email.com',
+ password: 'mypassword'
+ };
+ $scope.loginObj.$authWithCustomToken("token").then(_ => {});
+ $scope.loginObj.$authAnonymously().then(_ => {});
+ $scope.loginObj.$authWithPassword(credentials).then(_ => {});
+ $scope.loginObj.$authWithOAuthPopup("github").then(_ => {});
+ $scope.loginObj.$authWithOAuthRedirect("google").then(_ => {});
+ $scope.loginObj.$authWithOAuthToken("twitter", "token").then(_ => {});
+ $scope.loginObj.$getAuth();
+ $scope.loginObj.$onAuth(() => {});
+ $scope.loginObj.$unauth();
+ $scope.loginObj.$waitForAuth();
+ $scope.loginObj.$requireAuth();
+ $scope.loginObj.$createUser(credentials).then(_ => {});
+ $scope.loginObj.$removeUser(credentials).then(_ => {});
+ $scope.loginObj.$changeEmail(changeUserCredentials).then(_ => {});
+ $scope.loginObj.$changePassword(changePasswordCredentials).then(_ => {});
+ $scope.loginObj.$resetPassword(resetPasswordCredentials).then(_ => {});
}
-]);
\ No newline at end of file
+]);
diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts
index e4129e4ba..46d95750c 100644
--- a/angularfire/angularfire.d.ts
+++ b/angularfire/angularfire.d.ts
@@ -28,17 +28,19 @@ interface AngularFireObject extends AngularFireSimpleObject {
$id: string;
$priority: number;
$value: any;
+ $remove(): ng.IPromise;
$save(): ng.IPromise;
$loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise;
$loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise;
$loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise;
- $inst(): AngularFire;
+ $ref(): AngularFire;
$bindTo(scope: ng.IScope, varName: string): ng.IPromise;
$watch(callback: Function, context?: any): Function;
$destroy(): void;
}
interface AngularFireObjectService {
- $extendFactory(ChildClass: Object, methods?: Object): Object;
+ (firebase: Firebase): AngularFireObject;
+ $extend(ChildClass: Object, methods?: Object): Object;
}
interface AngularFireArray extends Array {
@@ -51,12 +53,13 @@ interface AngularFireArray extends Array {
$loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise;
$loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise;
$loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise;
- $inst(): AngularFire;
+ $ref(): AngularFire;
$watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function;
$destroy(): void;
}
interface AngularFireArrayService {
- $extendFactory(ChildClass: Object, methods?: Object): Object;
+ (firebase: Firebase): AngularFireArray;
+ $extend(ChildClass: Object, methods?: Object): Object;
}
interface AngularFireSimpleObject {
@@ -72,11 +75,20 @@ interface AngularFireAuthService {
}
interface AngularFireAuth {
- $getCurrentUser(): ng.IPromise;
- $login(provider: string, options?: Object): ng.IPromise;
- $logout(): void;
- $createUser(email: string, password: string): ng.IPromise;
- $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise;
- $removeUser(email: string, password: string): ng.IPromise;
- $sendPasswordResetEmail(email: string): ng.IPromise;
+ $authWithCustomToken(authToken: string, options?: Object): ng.IPromise;
+ $authAnonymously(options?: Object): ng.IPromise;
+ $authWithPassword(credentials: FirebaseCredentials, options?: Object): ng.IPromise;
+ $authWithOAuthPopup(provider: string, options?: Object): ng.IPromise;
+ $authWithOAuthRedirect(provider: string, options?: Object): ng.IPromise;
+ $authWithOAuthToken(provider: string, credentials: Object|string, options?: Object): ng.IPromise;
+ $getAuth(): FirebaseAuthData;
+ $onAuth(callback: Function, context?: any): Function;
+ $unauth(): void;
+ $waitForAuth(): ng.IPromise;
+ $requireAuth(): ng.IPromise;
+ $createUser(credentials: FirebaseCredentials): ng.IPromise;
+ $removeUser(credentials: FirebaseCredentials): ng.IPromise;
+ $changeEmail(credentials: FirebaseChangeEmailCredentials): ng.IPromise;
+ $changePassword(credentials: FirebaseChangePasswordCredentials): ng.IPromise;
+ $resetPassword(credentials: FirebaseResetPasswordCredentials): ng.IPromise;
}
diff --git a/angularjs-toaster/angularjs-toaster-tests.ts b/angularjs-toaster/angularjs-toaster-tests.ts
new file mode 100644
index 000000000..ffff32159
--- /dev/null
+++ b/angularjs-toaster/angularjs-toaster-tests.ts
@@ -0,0 +1,42 @@
+///
+class NgToasterTestController {
+ constructor(public $scope: ng.IScope, public $window: ng.IWindowService, public toaster: ngtoaster.IToasterService) {
+ this.bar = 'Hi';
+ }
+ bar: string;
+
+ pop(): void {
+ this.toaster.success({ title: "title", body: "text1" });
+ this.toaster.error("title", "text2");
+ this.toaster.pop({ type: 'wait', title: "title", body: "text" });
+ this.toaster.pop('success', "title", '', 5000, 'trustedHtml');
+ this.toaster.pop('error', "title", '', null, 'trustedHtml');
+ this.toaster.pop('wait', "title", null, null, 'template');
+ this.toaster.pop('warning', "title", "myTemplate.html", null, 'template');
+ this.toaster.pop('note', "title", "text");
+ this.toaster.pop('success', "title", 'Its address is https://google.com.', 5000, 'trustedHtml', (toaster: ngtoaster.IToast): boolean => {
+ var match = toaster.body.match(/http[s]?:\/\/[^\s]+/);
+ if (match) {
+ this.$window.open(match[0]);
+ }
+ return true;
+ });
+ this.toaster.pop('warning', "Hi ", "{template: 'myTemplateWithData.html', data: 'MyData'}", 15000, 'templateWithData');
+ }
+
+ goToLink(toaster: ngtoaster.IToast): boolean {
+ var match = toaster.body.match(/http[s]?:\/\/[^\s]+/);
+ if (match) {
+ this.$window.open(match[0]);
+ }
+ return true;
+ }
+
+ clear(): void {
+ this.toaster.clear();
+ }
+}
+
+angular
+ .module('main', ['ngAnimate', 'toaster'])
+ .controller('myController', NgToasterTestController);
\ No newline at end of file
diff --git a/angularjs-toaster/angularjs-toaster.d.ts b/angularjs-toaster/angularjs-toaster.d.ts
new file mode 100644
index 000000000..398704514
--- /dev/null
+++ b/angularjs-toaster/angularjs-toaster.d.ts
@@ -0,0 +1,109 @@
+// Type definitions for angularjs-toaster v0.4.13
+// Project: https://github.com/jirikavi/AngularJS-Toaster
+// Definitions by: Ben Tesser
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module ngtoaster {
+ interface IToasterService {
+ pop(params:IPopParams): void
+ /**
+ * @param {string} type Type of toaster -- 'error', 'info', 'wait', 'success', and 'warning'
+ */
+ pop(type?:string, title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
+ toasterId?:number, showCloseButton?:boolean): void
+ error(params: IPopParams): void
+ error(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
+ toasterId?:number): void
+ into(params: IPopParams): void
+ info(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
+ toasterId?:number): void
+ wait(params: IPopParams): void
+ wait(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
+ toasterId?:number): void
+ success(params: IPopParams): void
+ success(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
+ toasterId?:number): void
+ warning(params: IPopParams): void
+ warning(title?:string, body?:string, timeout?:number, bodyOutputType?:string, clickHandler?:EventListener,
+ toasterId?:number): void
+ clear(): void
+ toast:IToast;
+ }
+
+ interface IToasterEventRegistry {
+ setup(): void
+ subscribeToNewToastEvent(onNewToast:IToastEventListener): void
+ subscribeToClearToastsEvent(onClearToasts:IToastEventListener): void
+ unsubscribeToNewToastEvent(onNewToast:IToastEventListener): void
+ unsubscribeToClearToastsEvent(onClearToasts:IToastEventListener): void
+ }
+
+ interface IPopParams extends IToast{
+ toasterId?: number;
+ }
+
+ interface IToastEventListener {
+ (event:Event, toasterId: number): void;
+ }
+
+ interface IToast {
+ /**
+ * Acceptable types are:
+ * 'error', 'info', 'wait', 'success', and 'warning'
+ */
+ type?: string;
+ title?: string;
+ body?: string;
+ timeout?: number;
+ bodyOutputType?: string;
+ clickHandler?: EventListener;
+ showCloseButton?: boolean;
+ }
+
+ interface IToasterConfig {
+ /**
+ * limits max number of toasts
+ */
+ limit?: number;
+ 'tap-to-dismiss'?: boolean;
+ 'close-button'?: boolean;
+ 'newest-on-top'?: boolean;
+ 'time-out'?: number;
+ 'icon-classes'?: IIconClasses;
+ /**
+ * Options include:
+ * '', 'trustedHtml', 'template', 'templateWithData'
+ */
+ 'body-output-type'?: string;
+ 'body-template'?: string;
+ 'icon-class'?: string;
+ /**
+ * Options include:
+ * 'toast-top-full-width', 'toast-bottom-full-width', 'toast-center',
+ * 'toast-top-left', 'toast-top-center', 'toast-top-rigt',
+ * 'toast-bottom-left', 'toast-bottom-center', 'toast-bottom-rigt',
+ */
+ 'position-class'?: string;
+ 'title-class'?: string;
+ 'message-class'?: string;
+ 'prevent-duplicates'?: boolean;
+ /**
+ * stop timeout on mouseover and restart timer on mouseout
+ */
+ 'mouseover-timer-stop'?: boolean;
+ }
+
+ interface IIconClasses {
+ error: string;
+ info: string;
+ wait: string;
+ success: string;
+ warning: string;
+ }
+}
+
+declare module "ngtoaster" {
+ export = ngtoaster
+}
diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts
index e78b85c3e..3ecc95b5b 100644
--- a/angularjs/angular-animate.d.ts
+++ b/angularjs/angular-animate.d.ts
@@ -19,7 +19,7 @@ declare module angular.animate {
// AnimateService
// see http://docs.angularjs.org/api/ngAnimate/service/$animate
///////////////////////////////////////////////////////////////////////////
- interface IAnimateService extends ng.IAnimateService {
+ interface IAnimateService extends angular.IAnimateService {
/**
* Globally enables / disables animations.
*
@@ -39,7 +39,7 @@ declare module angular.animate {
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
* @returns the animation callback promise
*/
- animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): ng.IPromise;
+ animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): IPromise;
/**
* Appends the element to the parentElement element that resides in the document and then runs the enter animation.
@@ -50,7 +50,7 @@ declare module angular.animate {
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
* @returns the animation callback promise
*/
- enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): ng.IPromise;
+ enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): IPromise;
/**
* Runs the leave animation operation and, upon completion, removes the element from the DOM.
@@ -59,7 +59,7 @@ declare module angular.animate {
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
* @returns the animation callback promise
*/
- leave(element: JQuery, options?: IAnimationOptions): ng.IPromise;
+ leave(element: JQuery, options?: IAnimationOptions): IPromise;
/**
* Fires the move DOM operation. Just before the animation starts, the animate service will either append
@@ -71,7 +71,7 @@ declare module angular.animate {
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation
* @returns the animation callback promise
*/
- move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): ng.IPromise;
+ move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): IPromise;
/**
* Triggers a custom animation event based off the className variable and then attaches the className
@@ -82,7 +82,7 @@ declare module angular.animate {
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
* @returns the animation callback promise
*/
- addClass(element: JQuery, className: string, options?: IAnimationOptions): ng.IPromise;
+ addClass(element: JQuery, className: string, options?: IAnimationOptions): IPromise;
/**
* Triggers a custom animation event based off the className variable and then removes the CSS class
@@ -93,7 +93,7 @@ declare module angular.animate {
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
* @returns the animation callback promise
*/
- removeClass(element: JQuery, className: string, options?: IAnimationOptions): ng.IPromise;
+ removeClass(element: JQuery, className: string, options?: IAnimationOptions): IPromise;
/**
* Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback
@@ -105,12 +105,12 @@ declare module angular.animate {
* @param options an optional collection of styles that will be picked up by the CSS transition/animation
* @returns the animation callback promise
*/
- setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): ng.IPromise;
+ setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): IPromise;
/**
* Cancels the provided animation.
*/
- cancel(animationPromise: ng.IPromise): void;
+ cancel(animationPromise: IPromise): void;
}
///////////////////////////////////////////////////////////////////////////
@@ -124,7 +124,7 @@ declare module angular.animate {
* @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: () => ng.IAnimateCallbackObject): void;
+ register(name: string, factory: () => IAnimateCallbackObject): void;
/**
* Gets and/or sets the CSS class expression that is checked when performing an animation.
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index 1e62aa5f2..92784af38 100755
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -539,9 +539,29 @@ declare module angular {
$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;
@@ -1012,37 +1032,98 @@ declare module angular {
disableAutoScrolling(): void;
}
- ///////////////////////////////////////////////////////////////////////////
- // CacheFactoryService
- // see http://docs.angularjs.org/api/ng.$cacheFactory
- ///////////////////////////////////////////////////////////////////////////
+ /**
+ * $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 {
- // Lets not foce the optionsMap to have the capacity member. Even though
- // it's the ONLY option considered by the implementation today, a consumer
- // might find it useful to associate some other options to the cache object.
- //(cacheId: string, optionsMap?: { capacity: number; }): CacheObject;
- (cacheId: string, optionsMap?: { capacity: number; }): ICacheObject;
+ /**
+ * 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;
- // Methods bellow are not documented
+ /**
+ * 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;
- // Not garanteed to have, since it's a non-mandatory option
- //capacity: 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
diff --git a/applicationinsights/applicationinsights-tests.ts b/applicationinsights/applicationinsights-tests.ts
new file mode 100644
index 000000000..871a029e8
--- /dev/null
+++ b/applicationinsights/applicationinsights-tests.ts
@@ -0,0 +1,25 @@
+///
+import appInsights = require("applicationinsights");
+
+// basic use
+appInsights.setup("").start();
+
+// basic use with auto-collection configuration
+appInsights.setup("")
+ .setAutoCollectRequests(false)
+ .setAutoCollectPerformance(false)
+ .setAutoCollectExceptions(false)
+ // no telemetry will be sent until .start() is called
+ // this prevents any of the auto-collectors from initializing
+ .enableVerboseLogging()
+ .start();
+
+appInsights.client.trackEvent("custom event", {customProperty: "custom property value"});
+appInsights.client.trackException(new Error("handled exceptions can be logged with this method"));
+appInsights.client.trackMetric("custom metric", 3);
+appInsights.client.trackTrace("trace message");
+
+// assign common properties to all telemetry
+appInsights.client.commonProperties = {
+ environment: "dev"
+};
diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts
new file mode 100644
index 000000000..6b80adc2a
--- /dev/null
+++ b/applicationinsights/applicationinsights.d.ts
@@ -0,0 +1,429 @@
+// Type definitions for Application Insights v0.15.1
+// Project: https://github.com/Microsoft/ApplicationInsights-node.js
+// Definitions by: Scott Southwood
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+interface AutoCollectConsole {
+ enable(isEnabled: boolean): void;
+ isInitialized(): boolean;
+}
+
+interface AutoCollectExceptions {
+ isInitialized(): boolean;
+ enable(isEnabled:boolean): void;
+}
+
+interface AutoCollectPerformance {
+ enable(isEnabled: boolean): void;
+ isInitialized(): boolean;
+}
+
+interface AutoCollectRequests {
+ enable(isEnabled: boolean): void;
+ isInitialized(): boolean;
+}
+
+
+declare module ContractsModule {
+ enum DataPointType {
+ Measurement = 0,
+ Aggregation = 1,
+ }
+ enum DependencyKind {
+ SQL = 0,
+ Http = 1,
+ Other = 2,
+ }
+ enum DependencySourceType {
+ Undefined = 0,
+ Aic = 1,
+ Apmc = 2,
+ }
+ enum SessionState {
+ Start = 0,
+ End = 1,
+ }
+ enum SeverityLevel {
+ Verbose = 0,
+ Information = 1,
+ Warning = 2,
+ Error = 3,
+ Critical = 4,
+ }
+ interface ContextTagKeys {
+ applicationVersion: string;
+ applicationBuild: string;
+ deviceId: string;
+ deviceIp: string;
+ deviceLanguage: string;
+ deviceLocale: string;
+ deviceModel: string;
+ deviceNetwork: string;
+ deviceOEMName: string;
+ deviceOS: string;
+ deviceOSVersion: string;
+ deviceRoleInstance: string;
+ deviceRoleName: string;
+ deviceScreenResolution: string;
+ deviceType: string;
+ deviceMachineName: string;
+ locationIp: string;
+ operationId: string;
+ operationName: string;
+ operationParentId: string;
+ operationRootId: string;
+ operationSyntheticSource: string;
+ operationIsSynthetic: string;
+ sessionId: string;
+ sessionIsFirst: string;
+ sessionIsNew: string;
+ userAccountAcquisitionDate: string;
+ userAccountId: string;
+ userAgent: string;
+ userId: string;
+ userStoreRegion: string;
+ sampleRate: string;
+ internalSdkVersion: string;
+ internalAgentVersion: string;
+ }
+ interface Domain {
+ ver: number;
+ properties: any;
+ }
+ interface Data {
+ baseType: string;
+ baseData: TDomain;
+ }
+ interface Envelope {
+ ver: number;
+ name: string;
+ time: string;
+ sampleRate: number;
+ seq: string;
+ iKey: string;
+ flags: number;
+ deviceId: string;
+ os: string;
+ osVer: string;
+ appId: string;
+ appVer: string;
+ userId: string;
+ tags: {
+ [key: string]: string;
+ };
+ data: Data;
+ }
+ interface EventData extends ContractsModule.Domain {
+ ver: number;
+ name: string;
+ properties: any;
+ measurements: any;
+ }
+ interface MessageData extends ContractsModule.Domain {
+ ver: number;
+ message: string;
+ severityLevel: ContractsModule.SeverityLevel;
+ properties: any;
+ }
+ interface ExceptionData extends ContractsModule.Domain {
+ ver: number;
+ handledAt: string;
+ exceptions: ExceptionDetails[];
+ severityLevel: ContractsModule.SeverityLevel;
+ problemId: string;
+ crashThreadId: number;
+ properties: any;
+ measurements: any;
+ }
+ interface StackFrame {
+ level: number;
+ method: string;
+ assembly: string;
+ fileName: string;
+ line: number;
+ }
+ interface ExceptionDetails {
+ id: number;
+ outerId: number;
+ typeName: string;
+ message: string;
+ hasFullStack: boolean;
+ stack: string;
+ parsedStack: StackFrame[];
+ }
+ interface DataPoint {
+ name: string;
+ kind: ContractsModule.DataPointType;
+ value: number;
+ count: number;
+ min: number;
+ max: number;
+ stdDev: number;
+ }
+ interface MetricData extends ContractsModule.Domain {
+ ver: number;
+ metrics: DataPoint[];
+ properties: any;
+ }
+ interface PageViewData extends ContractsModule.EventData {
+ ver: number;
+ url: string;
+ name: string;
+ duration: string;
+ properties: any;
+ measurements: any;
+ }
+ interface PageViewPerfData extends ContractsModule.PageViewData {
+ ver: number;
+ url: string;
+ perfTotal: string;
+ name: string;
+ duration: string;
+ networkConnect: string;
+ sentRequest: string;
+ receivedResponse: string;
+ domProcessing: string;
+ properties: any;
+ measurements: any;
+ }
+ interface RemoteDependencyData extends ContractsModule.Domain {
+ ver: number;
+ name: string;
+ kind: ContractsModule.DataPointType;
+ value: number;
+ count: number;
+ min: number;
+ max: number;
+ stdDev: number;
+ dependencyKind: ContractsModule.DependencyKind;
+ success: boolean;
+ async: boolean;
+ dependencySource: ContractsModule.DependencySourceType;
+ commandName: string;
+ dependencyTypeName: string;
+ properties: any;
+ }
+ interface AjaxCallData extends ContractsModule.PageViewData {
+ ver: number;
+ url: string;
+ ajaxUrl: string;
+ name: string;
+ duration: string;
+ requestSize: number;
+ responseSize: number;
+ timeToFirstByte: string;
+ timeToLastByte: string;
+ callbackDuration: string;
+ responseCode: string;
+ success: boolean;
+ properties: any;
+ measurements: any;
+ }
+ interface RequestData extends ContractsModule.Domain {
+ ver: number;
+ id: string;
+ name: string;
+ startTime: string;
+ duration: string;
+ responseCode: string;
+ success: boolean;
+ httpMethod: string;
+ url: string;
+ properties: any;
+ measurements: any;
+ }
+ interface SessionStateData extends ContractsModule.Domain {
+ ver: number;
+ state: ContractsModule.SessionState;
+ }
+ interface PerformanceCounterData extends ContractsModule.Domain {
+ ver: number;
+ categoryName: string;
+ counterName: string;
+ instanceName: string;
+ kind: DataPointType;
+ count: number;
+ min: number;
+ max: number;
+ stdDev: number;
+ value: number;
+ properties: any;
+ }
+}
+
+
+interface Channel {
+ constructor(isDisabled: () => boolean, getBatchSize: () => number, getBatchIntervalMs: () => number, sender: Sender): Channel;
+ /**
+ * Add a telemetry item to the send buffer
+ */
+ send(envelope: ContractsModule.Envelope): void;
+ handleCrash(envelope: ContractsModule.Envelope): void;
+ /**
+ * Immediately send buffered data
+ */
+ triggerSend(isNodeCrashing?: boolean): void;
+}
+
+interface Client {
+ config: Config;
+ context: Context;
+ commonProperties: {
+ [key: string]: string;
+ };
+ channel: Channel;
+ /**
+ * Constructs a new client of the client
+ * @param iKey the instrumentation key to use (read from environment variable if not specified)
+ */
+ constructor(iKey?: string): Client;
+ /**
+ * Log a user action or other occurrence.
+ * @param name A string to identify this event in the portal.
+ * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
+ * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
+ */
+ trackEvent(name: string, properties?: {
+ [key: string]: string;
+ }, measurements?: {
+ [key: string]: number;
+ }): void;
+ /**
+ * Log a trace message
+ * @param message A string to identify this event in the portal.
+ * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
+ */
+ trackTrace(message: string, severityLevel?: ContractsModule.SeverityLevel, properties?: {
+ [key: string]: string;
+ }): void;
+ /**
+ * Log an exception you have caught.
+ * @param exception An Error from a catch clause, or the string error message.
+ * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
+ * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
+ */
+ trackException(exception: Error, properties?: {
+ [key: string]: string;
+ }): void;
+ /**
+ * Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators.
+ * To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the
+ * telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals.
+ * @param name A string that identifies the metric.
+ * @param value The value of the metric
+ */
+ trackMetric(name: string, value: number): void;
+ trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
+ [key: string]: string;
+ }): void;
+ /**
+ * Immediately send all queued telemetry.
+ */
+ sendPendingData(): void;
+ getEnvelope(data: ContractsModule.Data, tagOverrides?: {
+ [key: string]: string;
+ }): ContractsModule.Envelope;
+ /**
+ * Generic track method for all telemetry types
+ * @param data the telemetry to send
+ * @param tagOverrides the context tags to use for this telemetry which overwrite default context values
+ */
+ track(data: ContractsModule.Data, tagOverrides?: {
+ [key: string]: string;
+ }): void;
+}
+
+interface Config {
+ instrumentationKey: string;
+ sessionRenewalMs: number;
+ sessionExpirationMs: number;
+ endpointUrl: string;
+ maxBatchSize: number;
+ maxBatchIntervalMs: number;
+ disableAppInsights: boolean;
+ constructor(instrumentationKey?: string): Config;
+}
+
+interface Context {
+ keys: ContractsModule.ContextTagKeys;
+ tags: {
+ [key: string]: string;
+ };
+ constructor(packageJsonPath?: string): Context;
+}
+
+interface Sender {
+ constructor(getUrl: () => string, onSuccess?: (response: string) => void, onError?: (error: Error) => void): Sender;
+ send(payload: any/* Buffer */): void;
+ saveOnCrash(payload: string): void;
+ /**
+ * enable caching events locally on error
+ */
+ enableCacheOnError(): void;
+ /**
+ * disable caching events locally on error
+ */
+ disableCacheOnError(): void;
+}
+
+/**
+ * The singleton meta interface for the default client of the client. This interface is used to setup/start and configure
+ * the auto-collection behavior of the application insights module.
+ */
+declare class ApplicationInsights {
+ static client: Client;
+ private static _isConsole;
+ private static _isExceptions;
+ private static _isPerformance;
+ private static _isRequests;
+ private static _console;
+ private static _exceptions;
+ private static _performance;
+ private static _requests;
+ private static _isStarted;
+ /**
+ * Initializes the default client of the client and sets the default configuration
+ * @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
+ * read from the environment variable APPINSIGHTS_INSTRUMENTATION_KEY
+ * @returns {ApplicationInsights} this interface
+ */
+ static setup(instrumentationKey?: string): typeof ApplicationInsights;
+ /**
+ * Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected
+ * @returns {ApplicationInsights} this interface
+ */
+ static start(): typeof ApplicationInsights;
+ /**
+ * Sets the state of console tracking (enabled by default)
+ * @param value if true console activity will be sent to Application Insights
+ * @returns {ApplicationInsights} this interface
+ */
+ static setAutoCollectConsole(value: boolean): typeof ApplicationInsights;
+ /**
+ * Sets the state of exception tracking (enabled by default)
+ * @param value if true uncaught exceptions will be sent to Application Insights
+ * @returns {ApplicationInsights} this interface
+ */
+ static setAutoCollectExceptions(value: boolean): typeof ApplicationInsights;
+ /**
+ * Sets the state of performance tracking (enabled by default)
+ * @param value if true performance counters will be collected every second and sent to Application Insights
+ * @returns {ApplicationInsights} this interface
+ */
+ static setAutoCollectPerformance(value: boolean): typeof ApplicationInsights;
+ /**
+ * Sets the state of request tracking (enabled by default)
+ * @param value if true requests will be sent to Application Insights
+ * @returns {ApplicationInsights} this interface
+ */
+ static setAutoCollectRequests(value: boolean): typeof ApplicationInsights;
+ /**
+ * Enables verbose debug logging
+ * @returns {ApplicationInsights} this interface
+ */
+ static enableVerboseLogging(): typeof ApplicationInsights;
+}
+
+declare module "applicationinsights" {
+ export = ApplicationInsights;
+}
\ No newline at end of file
diff --git a/blocks/blocks-tests.ts b/blocks/blocks-tests.ts
new file mode 100644
index 000000000..7b83b52a6
--- /dev/null
+++ b/blocks/blocks-tests.ts
@@ -0,0 +1,322 @@
+///
+
+function test_blocks_methods() {
+ var extended: Object;
+ blocks.extend(extended, new Object());
+
+ blocks.each([3, 1, 4], function(value, index, collection) {
+ // value is the current item (3, 1 and 4)
+ // index is the current index (0, 1 and 2)
+ // collection points to the array passed to the function - [3, 1, 4]
+ });
+
+ blocks.eachRight([3, 1, 4], function(value, index, collection) {
+ // value is the current item (4, 1 and 3)
+ // index is the current index (2, 1 and 0)
+ // collection points to the array passed to the function - [3, 1, 4]
+ });
+
+ blocks.isArray([1, 2, 3]);
+ // -> true
+
+ function calculate() {
+ blocks.isArray(arguments);
+ // -> false
+ }
+
+ function max(collection: any, callback: any) {
+ callback = callback || blocks.noop;
+ }
+
+ blocks.type('a string');
+ // -> string
+
+ blocks.type(314);
+ // -> number
+
+ blocks.type([]);
+ // -> array
+
+ blocks.type({});
+ // -> object
+
+ blocks.type(blocks.noop);
+ // -> function
+
+ blocks.type(new RegExp(''));
+ // -> regexp
+
+ blocks.type(undefined);
+ // -> undefined
+
+ blocks.type(null);
+ // -> null
+
+ blocks.is([], 'array');
+ // -> true
+
+ blocks.is(function() { }, 'object');
+ // -> false
+
+ blocks.has({
+ price: undefined
+ }, 'price');
+ // -> true
+
+ blocks.has({
+ price: 314
+ }, 'ratio');
+ // -> false
+
+ blocks.unwrap(blocks.observable(314));
+ // -> 314
+
+ blocks.unwrap(blocks([3, 1, 4]));
+ // -> [3, 1, 4]
+
+ blocks.unwrap('a string or any other value will not be changed');
+ // -> 'a string or any other value will not be changed'
+
+ blocks.toArray(3);
+ // -> [3]
+
+ blocks.toArray([3, 1, 4]);
+ // -> [3, 1, 4]
+
+ blocks.toUnit(230);
+ // -> 230px
+
+ blocks.toUnit(230, '%');
+ // -> 230%
+
+ blocks.toUnit('60px', '%');
+ // -> 60%
+
+ var array = [3, 1, 4];
+ var cloned = blocks.clone(array);
+ // -> [3, 1, 4]
+ var areEqual = array == cloned;
+ // -> false
+
+ blocks.isElement(document.body);
+ // -> true
+
+ blocks.isElement({});
+ // -> false
+
+ blocks.isBoolean(true);
+ // -> true
+
+ blocks.isBoolean(new Boolean(false));
+ // -> true
+
+ blocks.isBoolean(1);
+ // -> false
+
+ blocks.isPlainObject({ property: true });
+ // -> true
+
+ blocks.isPlainObject(new Object());
+ // -> true
+
+ var car = new Object();
+
+ blocks.isPlainObject(car);
+ // -> false
+
+ var alert = blocks.bind(() => {
+ alert(this);
+ }, 'Hello bind method!');
+
+ alert();
+ // -> alerts 'Hello bind method'
+
+ var alertAll = blocks.bind((firstName: string, lastName: string) => {
+ alert('My name is ' + firstName + ' ' + lastName);
+ }, null, 'John', 'Doe');
+
+ alertAll();
+ // -> alerts 'My name is John Doe'
+
+ blocks.equals([3, 4], [3, 4]);
+ // -> true
+
+ blocks.equals({ value: 7 }, { value: 7, result: 1 });
+ // -> false
+
+ blocks.query({
+ message: 'Hello World!'
+ });
+
+ blocks.query({
+ items: ['John', 'Alf', 'Mega'],
+ alertIndex: (e: any) => {
+ alert('Clicked an item with index:' + blocks.context(e.target).$index);
+ }
+ });
+
+ blocks.query({
+ items: [1, 2, 3],
+ alertValue: (e: any) => {
+ alert('Clicked the value: ' + blocks.dataItem(e.target));
+ }
+ });
+
+ blocks.isObservable(blocks.observable(3));
+ // -> true
+
+ blocks.isObservable(3);
+ // -> false
+
+ blocks.unwrapObservable(blocks.observable(304));
+ // -> 304
+
+ blocks.unwrapObservable(305);
+ // -> 305
+}
+
+function test_observable_array() {
+ // creates an observable array with [1, 2, 3] as values
+ var items = blocks.observable([1, 2, 3]);
+
+ // removes the previous values and fills the observable array with [5, 6, 7] values
+ items.reset([5, 6, 7])
+
+ // results in observable array with [1, 2, 3, 4] values
+ items.add(4);
+
+ // results in observable array with [1, 2, 3, 4, 5, 6] values
+ items.addMany([4, 5, 6]);
+
+ var items = blocks.observable([4, 2, 3, 1]);
+
+ // results in observable array with [1, 2, 3, 4] values
+ items.swap(0, 3);
+
+ var items = blocks.observable([1, 4, 2, 3, 5]);
+
+ // results in observable array with [1, 2, 3, 4, 5] values
+ items.move(1, 4);
+}
+
+function test_Property() {
+ var App = blocks.Application();
+
+ var User = App.Model({
+ username: App.Property({
+ defaultValue: 'John Doe'
+ })
+ });
+}
+
+function test_Model() {
+ var App = blocks.Application();
+
+ var User = App.Model({
+ firstName: App.Property({
+ required: true,
+ validateOnChange: true
+ }),
+
+ lastName: App.Property({
+ required: true,
+ validateOnChange: true
+ }),
+
+ fullName: App.Property({
+ value: function() {
+ return this.firstName() + ' ' + this.lastName();
+ }
+ })
+ });
+
+ App.View('Profile', {
+ user: User({
+ firstName: 'John',
+ lastName: 'Doe'
+ })
+ });
+}
+
+function test_Collection() {
+ var App = blocks.Application();
+
+ var User = App.Model({
+ firstName: App.Property({
+ required: true,
+ validateOnChange: true
+ }),
+
+ lastName: App.Property({
+ required: true,
+ validateOnChange: true
+ }),
+
+ fullName: App.Property({
+ value: function() {
+ return this.firstName() + ' ' + this.lastName();
+ }
+ })
+ });
+
+ var Users = App.Collection(User, {
+ count: App.Property({
+ value: () => {
+ return this().length;
+ }
+ })
+ });
+
+ App.View('Profiles', {
+ users: Users([{
+ firstName: 'John',
+ lastName: 'Doe'
+ }, {
+ firstName: 'Johna',
+ lastName: 'Doa'
+ }])
+ });
+}
+
+function test_View() {
+ var App = blocks.Application();
+
+ App.View('Clicker', {
+ handleClick: () => {
+ alert('Clicky! Click!');
+ }
+ });
+
+
+ App.View('Statistics', {
+ init: () => {
+ this.loadRemoteData();
+ },
+
+ loadRemoteData: () => {
+ // ...stuff...
+ }
+ });
+
+ App.View('ContactUs', {
+ options: {
+ route: 'contactus'
+ },
+
+ routed: () => {
+ alert('Navigated to ContactUs page!')
+ }
+ });
+
+ App.View('ContactUs', {
+ options: {
+ route: 'contactus'
+ }
+ });
+
+ App.View('Navigation', {
+ navigateToContactUs: () => {
+ this.route('contactus')
+ }
+ });
+}
\ No newline at end of file
diff --git a/blocks/blocks.d.ts b/blocks/blocks.d.ts
new file mode 100644
index 000000000..ad492333e
--- /dev/null
+++ b/blocks/blocks.d.ts
@@ -0,0 +1,731 @@
+// Type definitions for jsblocks v0.3.0
+// Project: http://jsblocks.com/
+// Definitions by: Krzysztof Śmigiel
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/////////////////////////////////////////
+// blocks methods
+/////////////////////////////////////////
+
+interface BlocksStatic {
+ (obj: any): any;
+
+ /**
+ * Performs a query operation on the DOM. Executes all data-query attributes
+ * and renders the html result to the specified HTMLElement if not specified
+ * uses document.body by default.
+ *
+ * @param model The model that will be used to query the DOM.
+ */
+ query(model: any): void;
+ /**
+ * @param model The model that will be used to query the DOM.
+ * @param element Optional element on which to execute the query.
+ */
+ query(model: any, element: HTMLElement): void;
+
+ /**
+ * Copies properties from all provided objects into the first object parameter
+ */
+ extend(obj: Object, ...objects: any[]): void;
+
+ /**
+ * Iterates over the collection
+ *
+ * @param collection The array or object to iterate over
+ * @param callback The callback that will be executed for each element in the collection
+ * @param thisArg Optional this context for the callback
+ */
+ each(collection: any, callback: (value: any, index: any, collection: any) => void, thisArg?: any): void;
+
+ /**
+ * Iterates over the collection from end to start
+ *
+ * @param collection The array or object to iterate over
+ * @param callback The callback that will be executed for each element in the collection
+ * @param thisArg Optional this context for the callback
+ */
+ eachRight(collection: any, callback: (value: any, index: any, collection: any) => void, thisArg?: any): void;
+
+ /**
+ * Determines if a value is an array.
+ * Returns false for array like objects (for example arguments object).
+ *
+ * @param value The value to check if it is an array
+ */
+ isArray(value: any): boolean;
+
+ /**
+ * Represents a dummy empty function
+ */
+ noop(): Function;
+
+ /**
+ * Determines the true type of an object.
+ * Returns the type of the value as a string.
+ *
+ * @param value The value for which to determine its type
+ */
+ type(value: any): string;
+
+ /**
+ * Determines if a specific value is the specified type
+ *
+ * @param value The value
+ * @param type The type
+ */
+ is(value: any, type: string): boolean;
+
+ /**
+ * Checks if a variable has the specified property. Uses hasOwnProperty internally
+ *
+ * @param obj The object to call hasOwnPrototype for
+ * @param key The key to check if exists in the object
+ */
+ has(obj: any, key: string): boolean;
+
+ /**
+ * Unwraps a jsblocks value to its raw representation.
+ * Unwraps blocks.observable() and blocks() values
+ *
+ * @param value The value that will be unwrapped
+ */
+ unwrap(value: any): any;
+
+ /**
+ * Converts a value to an array. Arguments object is converted to array and primitive values
+ * are wrapped in an array.
+ * Does nothing when value is already an array
+ *
+ * @param value The value to be converted to an array
+ */
+ toArray(value: any): any[];
+
+ /**
+ * Converts an integer or string to a unit. If the value could not be parsed to a number it is not converted
+ *
+ * @param value The value to be converted to the specified unit
+ */
+ toUnit(value: any): any;
+ /**
+ * @param value The value to be converted to the specified unit
+ * @param unit Optionally provide a unit to convert to. Default value is 'px'
+ */
+ toUnit(value: any, unit: string): any;
+
+ /**
+ * Clones value. If deepClone is set to true the value will be cloned recursively
+ *
+ * @param value Value/object to be cloned
+ */
+ clone(value: any): any;
+ /**
+ * @param value Value/object to be cloned
+ * @param deepClone By default false
+ */
+ clone(value: any, deepClone: boolean): any;
+
+ /**
+ * Determines if the specified value is a HTML elements collection.
+ * Returns whether the value is elements collection.
+ *
+ * @param value The value to check if it is elements collection
+ */
+ isElements(value: any): boolean;
+
+ /**
+ * Determines if the specified value is a HTML element.
+ * Returns whether the value is a HTML element.
+ *
+ * @param value The value to check if it is a HTML element
+ */
+ isElement(value: any): boolean;
+
+ /**
+ * Determines if a the specified value is a boolean.
+ * Whether the value is a boolean or not.
+ *
+ * @param value The value to be checked if it is a boolean
+ */
+ isBoolean(value: any): boolean;
+
+ /**
+ * Determines if the specified value is an object.
+ * Returns whether the value is an object.
+ *
+ * @param obj The value to check for if it is an object
+ */
+ isObject(obj: any): boolean;
+
+ /**
+ * Determines if a value is a object created using {} or new Object.
+ * Whether the value is a plain object or not.
+ *
+ * @param obj The value that will be checked
+ */
+ isPlainObject(obj: any): boolean;
+
+ /**
+ * Changes the this binding to a function and optionally passes additional parameters to the function.
+ * Returns the newly created function having the new this binding and optional arguments.
+ *
+ * @param func The function for which to change the this binding and optionally add arguments
+ * @param thisArg The new this binding context value
+ * @param args Optional arguments that will be passed to the function
+ */
+ bind(func: Function, thisArg: any, ...args: any[]): Function;
+
+ /**
+ * Determines if two values are deeply equal. Set deepEqual to false to stop recusively equality checking
+ *
+ * @param a The first object to be campared
+ * @param b The second object to be compared
+ */
+ equals(a: any, b: any): boolean;
+ /**
+ * @param a The first object to be campared
+ * @param b The second object to be compared
+ * @param deepEqual Determines if the equality check will recursively check all child properties
+ */
+ equals(a: any, b: any, deepEqual: boolean): boolean;
+
+ /**
+ * Gets the context for a particular element. Searches all parents until it finds the context.
+ *
+ * @param element The element from which to search for a context
+ *
+ */
+ context(element: any): any;
+
+ /**
+ * Gets the associated dataItem for a particlar element. Searches all parents until it finds the context
+ *
+ * @param element The element from which to search for a dataItem
+ */
+ dataItem(element: any): any;
+
+ /**
+ * Determines if particular value is an blocks.observable
+ *
+ * @param value The value to check if the value is observable
+ */
+ isObservable(value: any): boolean;
+
+ /**
+ * Gets the raw value of an observable or returns the value if the specified object is not an observable
+ *
+ * @param value The value that could be any object observable or not
+ */
+ unwrapObservable(value: any): any;
+
+ route(route: string): BlocksStatic;
+
+ optional(param: string): BlocksStatic;
+ optional(param: string, defaultValue: any): BlocksStatic;
+
+ range(start: number, end: number): BlocksStatic;
+
+ /**
+ * Creates the server which will automatically handle server-side rendering.
+ */
+ server(): { express(): any };
+ /**
+ * @param options Overrides default jsblocks options
+ */
+ server(options: Server): { express(): any };
+
+ /**
+ * Make observable property. You can specify initial value in parentheses.
+ */
+ observable(): BlocksObservable;
+ observable(value: any[]): BlocksArray;
+ observable(value: any): BlocksObservable;
+
+ /**
+ * Use blocks.Application and its MVC(Model-View-Collection) structure to create better architecture and maintainability for your application.
+ */
+ Application(): App;
+ Application(options: { history: string }): App;
+}
+
+/////////////////////////////////////////
+// blocks observable
+/////////////////////////////////////////
+
+interface BlocksObservable extends Extendable {
+ (arg: any): BlocksObservable;
+
+ /**
+ * Updates all elements, expressions and dependencies where the observable is used
+ */
+ update(): BlocksObservable;
+
+ /**
+ * If event in prototype is not defined use this function instead.
+ *
+ * @param event Name of the event to raise
+ * @param trigger Function to be called when event is fired
+ */
+ on(event: string, trigger: Function): BlocksObservable;
+}
+
+/////////////////////////////////////////
+// blocks array
+/////////////////////////////////////////
+
+interface BlocksArray extends BlocksObservable {
+
+ /**
+ * Updates all elements, expressions and dependencies where the observable is used
+ */
+ update(): BlocksArray;
+
+ /**
+ * Extends the current observable with particular functionality depending on the parameters specified.
+ * If the method is called without arguments and jsvalue framework is included the observable will be
+ * extended with the methods available in jsvalue for the current type.
+ *
+ * @param options Optional options
+ */
+ extend(...options: any[]): BlocksArray;
+ /**
+ * @param name Name of the extender
+ * @param options Optional options
+ */
+ extend(name: string, ...options: any[]): BlocksArray;
+
+ /**
+ * Removes all items from the collection and replaces them with the new value provided.
+ * The value could be Array, observable array or jsvalue.Array
+ *
+ * @param value The new value that will be populated
+ */
+ reset(value: any[]): BlocksArray;
+
+ /**
+ * Adds values to the end of the observable array
+ *
+ * @param value The values that will be added to the end of the array
+ */
+ add(value: any): BlocksArray;
+ /**
+ * @param value The values that will be added to the end of the array
+ * @param index Optional index specifying where to insert the value
+ */
+ add(value: any, index: number): BlocksArray;
+
+ /**
+ * Adds the values from the provided array(s) to the end of the collection
+ *
+ * @param value The array that will be added to the end of the array
+ */
+ addMany(value: any[]): BlocksArray;
+ /**
+ * @param value The array that will be added to the end of the array
+ * @param index Optional position where the array of values to be inserted
+ */
+ addMany(value: any[], index: number): BlocksArray;
+
+ /**
+ * Swaps two values in the observable array. Note: Faster than removing the items and adding them at the locations
+ *
+ * @param indexA The first index that points to the index in the array that will be swapped
+ * @param indexB The second index that points to the index in the array that will be swapped
+ */
+ swap(indexA: number, indexB: number): BlocksArray;
+
+ /**
+ * Moves an item from one location to another in the array. Note: Faster than removing the item and adding it at the location
+ *
+ * @param sourceIndex The index pointing to the item that will be moved
+ * @param targetIndex The index where the item will be moved to
+ */
+ move(sourceIndex: number, targetIndex: number): BlocksArray;
+
+ /**
+ * Removes an item from the observable array
+ *
+ * @param value The value that will be removed or a callback function which returns true or false to determine if the value should be removed
+ */
+ remove(value: any): BlocksArray;
+ /**
+ * @param value The value that will be removed or a callback function which returns true or false to determine if the value should be removed
+ * @param thisArg Optional this context for the callback
+ */
+ remove(value: any, thisArg: Function): BlocksArray;
+
+ /**
+ * Removes an item at the specified index
+ *
+ * @param index The index location of the item that will be removed
+ */
+ removeAt(index: number): BlocksArray;
+ /**
+ * @param index The index location of the item that will be removed
+ * @param count Optional parameter that if specified will remove the next items starting from the specified index
+ */
+ removeAt(index: number, count: number): BlocksArray;
+
+ /**
+ * Removes all items from the observable array and optionally filter which items to be removed by providing a callback
+ */
+ removeAll(): BlocksArray;
+ /**
+ * @param callback Optional callback function which filters which items to be removed. Returning a truthy value will remove the item and vice versa
+ */
+ removeAll(callback: Function): BlocksArray;
+ /**
+ * @param callback Optional callback function which filters which items to be removed. Returning a truthy value will remove the item and vice versa
+ * @param thisArg Optional this context for the callback function
+ */
+ removeAll(callback: Function, thisArg: any): BlocksArray;
+
+ /**
+ * The concat() method is used to join two or more arrays
+ *
+ * @param arrays The arrays to be joined
+ */
+ concat(...arrays: any[]): any[]
+
+ /**
+ * The slice() method returns the selected elements in an array, as a new array object
+ *
+ * @param start An integer that specifies where to start the selection (The first element has an index of 0)
+ */
+ slice(start: number): any[];
+ /**
+ * @param start An integer that specifies where to start the selection (The first element has an index of 0)
+ * @param end An integer that specifies where to end the selection. If omitted, all elements from the start position and to the end of the array will be selected.
+ * Use negative numbers to select from the end of an array
+ */
+ slice(start: number, end: number): any[];
+
+ /**
+ * The join() method joins the elements of an array into a string, and returns the string
+ */
+ join(): string;
+ /**
+ * @param separator The separator to be used. If omitted, the elements are separated with a comma
+ */
+ join(seperator: string): string;
+
+ /**
+ * The pop() method removes the last element of a observable array, and returns that element
+ */
+ pop(): any;
+
+ /**
+ * The push() method adds new items to the end of the observable array, and returns the new length
+ *
+ * @param values The item(s) to add to the observable array
+ */
+ push(...values: any[]): number;
+
+ /**
+ * Reverses the order of the elements in the observable array
+ */
+ reverse(): any[];
+
+ /**
+ * Removes the first element of a observable array, and returns that element
+ */
+ shift(): any
+
+ /**
+ * Sorts the elements of an array
+ */
+ sort(): any[];
+ /**
+ * @param sortfunction A function that defines the sort order
+ */
+ sort(sortfunction: Function): any[];
+
+ /**
+ * Adds and/or removes elements from the observable array
+ * Returns A new array containing the removed items, if any.
+ *
+ * @param index An integer that specifies at what position to add/remove items. Use negative values to specify the position from the end of the array.
+ * @param howMany The number of items to be removed. If set to 0, no items will be removed.
+ * @param items The new item(s) to be added to the array.
+ */
+ splice(index: number, howMany: number, ...items: any[]): any[];
+
+ /**
+ * The unshift() method adds new items to the beginning of an array, and returns the new length.
+ *
+ * @param items
+ */
+ unshift(...items: any[]): number;
+}
+
+/////////////////////////////////////////
+// blocks MVC App
+/////////////////////////////////////////
+
+interface App extends Extendable {
+
+ /**
+ * Creates an application property for a Model.
+ */
+ Property(): any;
+ /**
+ * @param options Configuration options for property
+ */
+ Property(options: PropertyPrototype): any;
+
+ /**
+ * Defines a view that will be part of the Application.
+ *
+ * @param name The name of the View you are creating
+ * @param prototype The object that will represent the View
+ */
+ View(name: string, prototype: ViewPrototype): any;
+ /**
+ * Defines a view that will be part of the Application.
+ *
+ * @param parentViewName Provide this parameter only if you are creating nested views. This is the name of the parent View
+ * @param name The name of the View you are creating
+ * @param prototype The object that will represent the View
+ */
+ View(parentViewName: string, name: string, prototype: ViewPrototype): any;
+
+ /**
+ * Creates a new Model
+ *
+ * @param prototype The Model object properties that will be created
+ */
+ Model(prototype: ModelPrototype): Model;
+
+ /**
+ * Creates a new Collection
+ *
+ * @param prototype The Collection object properties that will be created.
+ */
+ Collection(prototype: CollectionPrototype): Collection;
+ Collection(model: Model, prototype: CollectionPrototype): Collection;
+}
+
+/////////////////////////////////////////
+// App.Property
+/////////////////////////////////////////
+
+interface PropertyPrototype {
+ defaultValue?: any;
+ isObservable?: boolean;
+ field?: string;
+ value?: any;
+ validateOnChange?: boolean;
+ maxErrors?: number;
+ validateInitially?: boolean
+
+ // Validators
+ required?: Validator;
+ minlength?: Validator;
+ maxlength?: Validator;
+ min?: Validator;
+ max?: Validator;
+ email?: Validator;
+ url?: Validator;
+ date?: Validator;
+ creditcard?: Validator;
+ regexp?: Validator;
+ number?: Validator;
+ digits?: Validator;
+ letters?: Validator;
+ equals?: Validator;
+}
+
+interface Validator { }
+
+/////////////////////////////////////////
+// App.View
+/////////////////////////////////////////
+
+interface ViewPrototype {
+ parentView?: any;
+
+ /**
+ * Routes to a specific URL and actives the appropriate views associated with the URL
+ *
+ * @param name Name of the route
+ */
+ route?(name: string): ViewPrototype;
+
+
+ /**
+ * Determines if the view is visible
+ */
+ isActive?(): boolean;
+
+ /**
+ * Override the init method to perform actions when the View is first created and shown on the page
+ */
+ init?: Function;
+
+ /**
+ * Override the routed method to perform actions when the View have routing and routing mechanism actives it.
+ */
+ routed?: Function;
+
+ navigateTo?: Function;
+
+ /**
+ * Override the ready method to perform actions when the DOM is ready and
+ * all data-query have been executed.
+ */
+ ready?: Function;
+
+ options?: {
+ route?: any;
+ url?: string
+ };
+}
+
+/////////////////////////////////////////
+// App.Model
+/////////////////////////////////////////
+
+interface Model {
+ (): Model;
+ (props: Object): Model;
+
+ /**
+ * Fires a request to the server to populate the Model based on the read URL specified
+ */
+ read(): Model;
+ /**
+ * @param params The parameters Object that will be used to populate the Model from the specified options.read URL. If the URL does not contain parameters
+ */
+ read(params: Object): Model;
+
+ /**
+ * Synchronizes the changes with the server by sending requests to the provided URL's
+ */
+ sync(): Model;
+}
+
+interface ModelPrototype {
+
+ /**
+ * Override the init method to perform actions on creation for each Model instance
+ */
+ init?: Function;
+
+ /**
+ * Validates all observable properties that have validation and returns true if all values are valid otherwise returns false
+ */
+ validate?(): boolean;
+
+ /**
+ * Extracts the raw(non observable) dataItem object values from the Model
+ */
+ dataItem?(): Object;
+
+ /**
+ * Applies new properties to the Model by providing an Object
+ *
+ * @param dataItem The object from which the new values will be applied
+ */
+ reset?(dataItem: ModelPrototype): ModelPrototype;
+
+ /**
+ * Determines whether the instance is new. If true when syncing the item will send for insertion instead of updating it.
+ * The check is determined by the idAttr value specified in the options. If idAttr is not specified the item will always be considered new.
+ *
+ */
+ isNew?(): boolean;
+
+ options?: {
+ idAttr?: string;
+ baseUrl?: string;
+ read?: { url?: string };
+ create?: { url?: string };
+ destroy?: { url?: string };
+ update?: { url?: string };
+ };
+}
+
+/////////////////////////////////////////
+// App.Collection
+/////////////////////////////////////////
+
+interface Collection extends Extendable {
+ (): Collection;
+ (props: Object[]): Collection;
+
+ /**
+ * Fires a request to the server to populate the Model based on the read URL specified
+ */
+ read(): Collection;
+ /**
+ * @param params The parameters Object that will be used to populate the Collection from the specified options.read URL. If the URL does not contain parameters
+ */
+ read(params: Object): Collection;
+
+ /**
+ * Clear all changes made to the collection
+ */
+ clearChanges(): Collection;
+
+ /**
+ * Performs an ajax request for all create, update and delete operations in order to sync them with a database.
+ */
+ sync(): Collection;
+
+ update(id: number, newValues: Object): Collection;
+}
+
+interface CollectionPrototype {
+ options?: {
+ read?: { url?: string };
+ create?: { url?: string };
+ destroy?: { url?: string };
+ update?: { url?: string };
+ };
+}
+
+interface Extendable {
+
+ /**
+ * Extends the current observable with particular functionality depending on the parameters specified.
+ * If the method is called without arguments and jsvalue framework is included the observable will be
+ * extended with the methods available in jsvalue for the current type.
+ *
+ * @param name Name of the extender
+ * @param options Optional options
+ */
+ extend(name?: string, ...options: any[]): T;
+ extend(arg: any): T;
+}
+
+interface Server {
+
+ /**
+ * The port at which your application will be run
+ */
+ port?: number;
+
+ /**
+ * The folder where your application files like .html; .js and .css are going to be.
+ * The value is passed to express.static() middleware.
+ */
+ static?: string;
+
+ /**
+ * Caches pages result instead of executing them each time.
+ * Disabling cache could impact performance.
+ */
+ cache?: boolean;
+
+ /**
+ * Provide an express middleware function or an array of middleware functions.
+ * Use: [compression(); bodyParser()]
+ */
+ use?: any;
+}
+
+declare var blocks: BlocksStatic;
+
+declare module "blocks" {
+ export = blocks;
+}
\ No newline at end of file
diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts
index 2f5459c2f..0af5dfc00 100644
--- a/browser-sync/browser-sync-tests.ts
+++ b/browser-sync/browser-sync-tests.ts
@@ -70,3 +70,13 @@ evt.on("init", function () {
});
browserSync(config);
+
+var bs = browserSync.create();
+
+bs.init({
+ server: "./app"
+});
+
+bs.reload();
+
+
diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts
index 4b0cd72c0..db9f3ad3b 100644
--- a/browser-sync/browser-sync.d.ts
+++ b/browser-sync/browser-sync.d.ts
@@ -3,96 +3,113 @@
// Definitions by: Asana
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+///
///
declare module "browser-sync" {
+ import chokidar = require("chokidar");
+ import fs = require("fs");
import http = require("http");
-
- function BrowserSync(config?: BrowserSync.Options, callback?: (err: Error, bs: Object) => any): void;
-
- module BrowserSync {
- export function reload(): void;
- export function reload(file: string): void;
- export function reload(files: string[]): void;
- export function reload(options: {stream: boolean}): NodeJS.ReadWriteStream;
- export function notify(message: string, timeout?: number): void;
-
- export function exit(): void;
-
- export var active: boolean;
-
- export var emitter: NodeJS.EventEmitter;
-
- interface Options {
- files?: string | string[];
- watchOptions?: GazeOptions;
- server?: ServerOptions;
- proxy?: string | boolean;
- port?: number;
- https?: boolean;
- ghostMode?: GhostOptions | boolean;
- logLevel?: string;
- logPrefix?: string;
- logConnections?: boolean;
- logFileChanges?: boolean;
- logSnippet?: boolean;
- snippetOptions?: SnippetOptions;
- tunnel?: string | boolean;
- online?: boolean;
- open?: string | boolean;
- browser?: string | string[];
- xip?: boolean;
- notify?: boolean;
- scrollProportionally?: boolean;
- scrollThrottle?: number;
- reloadDelay?: number;
- injectChanges?: boolean;
- startPath?: string;
- minify?: boolean;
- host?: string;
- codeSync?: boolean;
- timestamps?: boolean;
- scriptPath?: (path: string) => string;
- socket?: SocketOptions;
- }
-
- interface GazeOptions {
- interval?: number;
- debounceDelay?: number;
- mode?: string;
- cwd?: string;
- }
-
- interface ServerOptions {
- baseDir?: string | string[];
- directory?: boolean;
- index?: string;
- routes?: {[path: string]: string};
- middleware?: MiddlewareHandler[];
- }
-
- interface MiddlewareHandler {
- (req: http.ServerRequest, res: http.ServerResponse, next: Function): any;
- }
-
- interface GhostOptions {
- clicks?: boolean;
- scroll?: boolean;
- forms?: boolean;
- }
-
- interface SnippetOptions {
- ignorePaths?: string;
- rule?: {match?: RegExp; fn?: (snippet: string, match: string) => any};
- }
-
- interface SocketOptions {
- path?: string;
- clientPath?: string;
- namespace?: string;
- }
+ interface Options {
+ files?: string | string[];
+ watchOptions?: GazeOptions;
+ server?: ServerOptions;
+ proxy?: string | boolean;
+ port?: number;
+ https?: boolean;
+ ghostMode?: GhostOptions | boolean;
+ logLevel?: string;
+ logPrefix?: string;
+ logConnections?: boolean;
+ logFileChanges?: boolean;
+ logSnippet?: boolean;
+ snippetOptions?: SnippetOptions;
+ rewriteRules?: boolean | RewriteRules[];
+ tunnel?: string | boolean;
+ online?: boolean;
+ open?: string | boolean;
+ browser?: string | string[];
+ xip?: boolean;
+ notify?: boolean;
+ scrollProportionally?: boolean;
+ scrollThrottle?: number;
+ reloadDelay?: number;
+ reloadDebounce?: number;
+ plugins?: any[];
+ injectChanges?: boolean;
+ startPath?: string;
+ minify?: boolean;
+ host?: string;
+ codeSync?: boolean;
+ timestamps?: boolean;
+ scriptPath?: (path: string) => string;
+ socket?: SocketOptions;
}
- export = BrowserSync;
+ interface GazeOptions {
+ interval?: number;
+ debounceDelay?: number;
+ mode?: string;
+ cwd?: string;
+ }
+
+ interface ServerOptions {
+ baseDir?: string | string[];
+ directory?: boolean;
+ index?: string;
+ routes?: {[path: string]: string};
+ middleware?: MiddlewareHandler[];
+ }
+
+ interface MiddlewareHandler {
+ (req: http.ServerRequest, res: http.ServerResponse, next: Function): any;
+ }
+
+ interface GhostOptions {
+ clicks?: boolean;
+ scroll?: boolean;
+ forms?: boolean;
+ }
+
+ interface SnippetOptions {
+ ignorePaths?: string;
+ rule?: {match?: RegExp; fn?: (snippet: string, match: string) => any};
+ }
+
+ interface SocketOptions {
+ path?: string;
+ clientPath?: string;
+ namespace?: string;
+ }
+
+ interface RewriteRules {
+ match: RegExp;
+ fn: (match: string) => string;
+ }
+
+ interface BrowserSync {
+ init(config?: Options, callback?: (err: Error, bs: Object) => any): void;
+ reload(): void;
+ reload(file: string): void;
+ reload(files: string[]): void;
+ reload(options: {stream: boolean}): NodeJS.ReadWriteStream;
+ notify(message: string, timeout?: number): void;
+ exit(): void;
+ watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any): NodeJS.EventEmitter;
+ pause(): void;
+ resume(): void;
+ emitter: NodeJS.EventEmitter;
+ active: boolean;
+ paused: boolean;
+ }
+
+ interface Exports extends BrowserSync {
+ create(): BrowserSync;
+ (config?: Options, callback?: (err: Error, bs: Object) => any): void;
+ }
+
+ var browserSync: Exports;
+
+ export = browserSync;
}
diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts
index 20a773cdd..a2dcb72ed 100644
--- a/chai-as-promised/chai-as-promised-tests.ts
+++ b/chai-as-promised/chai-as-promised-tests.ts
@@ -1,4 +1,3 @@
-///
///
import chai = require('chai');
@@ -6,6 +5,7 @@ import chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
+// ReSharper disable WrongExpressionStatement
var promise: any;
chai.expect(promise).to.eventually.equal(3);
chai.expect(promise).to.become(3);
diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts
index 20b697bb5..6ff150eb4 100644
--- a/chai-as-promised/chai-as-promised.d.ts
+++ b/chai-as-promised/chai-as-promised.d.ts
@@ -6,21 +6,21 @@
///
declare module 'chai-as-promised' {
- import chai = require('chai');
-
function chaiAsPromised(chai: any, utils: any): void;
-
export = chaiAsPromised;
}
-declare module chai {
+declare module Chai {
+
+ interface Assertion {
+ become(expected: any): Assertion;
+ rejected: Assertion;
+ rejectedWith(expected: any): Assertion;
+ notify(fn: Function): Assertion;
+ }
interface LanguageChains {
- become(expected: any): Expect;
- eventually: Expect;
- rejected: Expect;
- rejectedWith(expected: any): Expect;
- notify(fn: Function): Expect;
+ eventually: Assertion;
}
interface Assert {
@@ -32,4 +32,4 @@ declare module chai {
isRejected(promise: any, expected: any, message?: string): void;
isRejected(promise: any, match: RegExp, message?: string): void;
}
-}
\ No newline at end of file
+}
diff --git a/chai-datetime/chai-datetime-tests.ts b/chai-datetime/chai-datetime-tests.ts
index 8f8238b4e..5c15326f4 100644
--- a/chai-datetime/chai-datetime-tests.ts
+++ b/chai-datetime/chai-datetime-tests.ts
@@ -1,13 +1,16 @@
-///
///
+import chai = require('chai');
+import chaiDateTime = require('chai-datetime');
+
+chai.use(chaiDateTime);
var expect = chai.expect;
var assert = chai.assert;
function test_equalTime(){
var date: Date = new Date(2014, 1, 1);
- expect(date).to.be.equalTime(date);
- date.should.be.equalTime(date);
+ expect(date).to.equalTime(date);
+ date.should.equalTime(date);
assert.equalTime(date, date);
}
@@ -34,14 +37,14 @@ function test_equalDate(){
function test_beforeDate(){
var date: Date = new Date(2014, 1, 1);
- expect(date).to.beforeDate(date);
- date.should.beforeDate(date);
+ expect(date).to.be.beforeDate(date);
+ date.should.be.beforeDate(date);
assert.beforeDate(date, date);
}
function test_afterDate(){
var date: Date = new Date(2014, 1, 1);
- expect(date).to.afterDate(date);
- date.should.afterDate(date);
+ expect(date).to.be.afterDate(date);
+ date.should.be.afterDate(date);
assert.afterDate(date, date);
}
diff --git a/chai-datetime/chai-datetime.d.ts b/chai-datetime/chai-datetime.d.ts
index bce063443..b6140689c 100644
--- a/chai-datetime/chai-datetime.d.ts
+++ b/chai-datetime/chai-datetime.d.ts
@@ -5,35 +5,38 @@
///
-declare module chai {
+declare module Chai {
- interface Expect {
- afterDate(date: Date): boolean;
- beforeDate(date: Date): boolean;
- equalDate(date: Date): boolean;
+ interface Assertion {
+ afterDate(date: Date): Assertion;
+ beforeDate(date: Date): Assertion;
+ equalDate(date: Date): Assertion;
+ afterTime(date: Date): Assertion;
+ beforeTime(date: Date): Assertion;
+ equalTime(date: Date): Assertion;
+ }
- afterTime(date: Date): boolean;
- beforeTime(date: Date): boolean;
- equalTime(date: Date): boolean;
- }
-
- interface Assert {
- equalTime(val: Date, exp: Date, msg?: string): boolean;
- notEqualTime(val: Date, exp: Date, msg?: string): boolean;
- beforeTime(val: Date, exp: Date, msg?: string): boolean;
- notBeforeTime(val: Date, exp: Date, msg?: string): boolean;
- afterTime(val: Date, exp: Date, msg?: string): boolean;
- notAfterTime(val: Date, exp: Date, msg?: string): boolean;
-
- equalDate(val: Date, exp: Date, msg?: string): boolean;
- notEqualDate(val: Date, exp: Date, msg?: string): boolean;
- beforeDate(val: Date, exp: Date, msg?: string): boolean;
- notBeforeDate(val: Date, exp: Date, msg?: string): boolean;
- afterDate(val: Date, exp: Date, msg?: string): boolean;
- notAfterDate(val: Date, exp: Date, msg?: string): boolean;
- }
+ interface Assert {
+ equalTime(val: Date, exp: Date, msg?: string): void;
+ notEqualTime(val: Date, exp: Date, msg?: string): void;
+ beforeTime(val: Date, exp: Date, msg?: string): void;
+ notBeforeTime(val: Date, exp: Date, msg?: string): void;
+ afterTime(val: Date, exp: Date, msg?: string): void;
+ notAfterTime(val: Date, exp: Date, msg?: string): void;
+ equalDate(val: Date, exp: Date, msg?: string): void;
+ notEqualDate(val: Date, exp: Date, msg?: string): void;
+ beforeDate(val: Date, exp: Date, msg?: string): void;
+ notBeforeDate(val: Date, exp: Date, msg?: string): void;
+ afterDate(val: Date, exp: Date, msg?: string): void;
+ notAfterDate(val: Date, exp: Date, msg?: string): void;
+ }
}
interface Date {
- should: chai.Expect;
+ should: Chai.Assertion;
+}
+
+declare module "chai-datetime" {
+ function chaiDateTime(chai: any, utils: any): void;
+ export = chaiDateTime;
}
diff --git a/chai-fuzzy/chai-fuzzy-tests.ts b/chai-fuzzy/chai-fuzzy-tests.ts
new file mode 100644
index 000000000..292b25002
--- /dev/null
+++ b/chai-fuzzy/chai-fuzzy-tests.ts
@@ -0,0 +1,35 @@
+///
+
+// tests taken from http://chaijs.com/plugins/chai-fuzzy
+
+import chai = require('chai');
+import chaiFuzzy = require('chai-fuzzy');
+
+chai.use(chaiFuzzy);
+var expect = chai.expect;
+var assert = chai.assert;
+
+/**
+ * compare object attributes and values rather than checking to see if they're the same reference
+ */
+function like() {
+ var subject = { a: 'a' };
+
+ expect(subject).to.be.like({ a: 'a' });
+ expect(subject).not.to.be.like({ x: 'x' });
+ expect(subject).not.to.be.like({ a: 'a', b: 'b' });
+
+ assert.like(subject, { a: 'a' });
+ assert.notLike(subject, { x: 'x' });
+ assert.notLike(subject, { a: 'a', b: 'b' });
+
+ var subject2 = ['a'];
+
+ expect(subject2).to.be.like(['a']);
+ expect(subject2).not.to.be.like(['x']);
+ expect(subject2).not.to.be.like(['a', 'b']);
+
+ assert.like(subject2, ['a']);
+ assert.notLike(subject2, ['x']);
+ assert.notLike(subject2, ['a', 'b']);
+}
diff --git a/chai-fuzzy/chai-fuzzy.d.ts b/chai-fuzzy/chai-fuzzy.d.ts
index acfb515f4..90955e1e1 100644
--- a/chai-fuzzy/chai-fuzzy.d.ts
+++ b/chai-fuzzy/chai-fuzzy.d.ts
@@ -5,13 +5,72 @@
///
-declare module chai {
- interface Assert {
- like(act:any, exp:any, msg?:string);
- notLike(act:any, exp:any, msg?:string);
- containOneLike(act:any, exp:any, msg?:string);
- notContainOneLike(act:any, exp:any, msg?:string);
- jsonOf(act:any, exp:any, msg?:string);
- notJsonOf(act:any, exp:any, msg?:string);
+declare module Chai {
+
+ interface Assertion {
+ /**
+ * Compare object attributes and values rather than checking to see if
+ * they're the same reference.
+ */
+ like(expected: any, message?: string): Assertion;
+ /**
+ * Compare object attributes and values rather than checking to see if
+ * they're the same reference.
+ */
+ notLike(expected: any, message?: string): Assertion;
+ /**
+ * Check the first level of the container for a value like the one provided.
+ */
+ containOneLike(expected: any, message?: string): Assertion;
+ /**
+ * Check the first level of the container for a value like the one provided.
+ */
+ notContainOneLike(expected: any, message?: string): Assertion;
+ /**
+ * Check that the given javascript object is like the JSON-ified expected
+ * value. Useful for checking stringification and parsing of an object.
+ */
+ jsonOf(expected: any, message?: string): Assertion;
+ /**
+ * Check that the given javascript object is like the JSON-ified expected
+ * value. Useful for checking stringification and parsing of an object.
+ */
+ notJsonOf(expected: any, message?: string): Assertion;
+ }
+
+ export interface Assert {
+ /**
+ * Compare object attributes and values rather than checking to see if
+ * they're the same reference.
+ */
+ like(actual: any, expected: any, message?: string): void;
+ /**
+ * Compare object attributes and values rather than checking to see if
+ * they're the same reference.
+ */
+ notLike(actual: any, expected: any, message?: string): void;
+ /**
+ * Check the first level of the container for a value like the one provided.
+ */
+ containOneLike(actual: any, expected: any, message?: string): void;
+ /**
+ * Check the first level of the container for a value like the one provided.
+ */
+ notContainOneLike(actual: any, expected: any, message?: string): void;
+ /**
+ * Check that the given javascript object is like the JSON-ified expected
+ * value. Useful for checking stringification and parsing of an object.
+ */
+ jsonOf(actual: any, expected: any, message?: string): void;
+ /**
+ * Check that the given javascript object is like the JSON-ified expected
+ * value. Useful for checking stringification and parsing of an object.
+ */
+ notJsonOf(actual: any, expected: any, message?: string): void;
}
}
+
+declare module "chai-fuzzy" {
+ function chaiFuzzy(chai: any, utils: any): void;
+ export = chaiFuzzy;
+}
diff --git a/chai-fuzzy/chai-fuzzy.d.ts.tscparams b/chai-fuzzy/chai-fuzzy.d.ts.tscparams
deleted file mode 100644
index d3f5a12fa..000000000
--- a/chai-fuzzy/chai-fuzzy.d.ts.tscparams
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/chai-http/chai-http-tests.ts b/chai-http/chai-http-tests.ts
index e6e471321..078a7799c 100644
--- a/chai-http/chai-http-tests.ts
+++ b/chai-http/chai-http-tests.ts
@@ -1,20 +1,21 @@
///
-///
+///
import fs = require('fs');
import http = require('http');
import chai = require('chai');
-import chaiHttp = require('chai-http');
+import ChaiHttp = require('chai-http');
import when = require('when');
-chai.use(chaiHttp);
+chai.use(ChaiHttp);
+
+// ReSharper disable WrongExpressionStatement
// Add promise support if this does not exist natively.
if (!global.Promise) {
chai.request.addPromises(when.promise);
}
-
var app: http.Server;
chai.request(app).get('/');
@@ -41,13 +42,12 @@ chai.request(app)
chai.request(app)
.get('/search')
- .query('name', 'foo')
- .query('limit', '10');
+ .query({name: 'foo', limit: 10});
chai.request(app)
.put('/user/me')
.send({ passsword: '123', confirmPassword: '123' })
- .end((err: any, res: chaiHttp.Response) => {
+ .end((err: any, res: ChaiHttp.Response) => {
chai.expect(err).to.be.null;
chai.expect(res).to.have.status(200);
});
@@ -55,7 +55,7 @@ chai.request(app)
chai.request(app)
.put('/user/me')
.send({ passsword: '123', confirmPassword: '123' })
- .then((res: chaiHttp.Response) => chai.expect(res).to.have.status(200))
+ .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200))
.catch((err: any) => { throw err; });
var agent = chai.request.agent(app);
@@ -63,17 +63,17 @@ var agent = chai.request.agent(app);
agent
.post('/session')
.send({ username: 'me', password: '123' })
- .then((res: chaiHttp.Response) => {
+ .then((res: ChaiHttp.Response) => {
chai.expect(res).to.have.cookie('sessionid');
// The `agent` now has the sessionid cookie saved, and will send it
// back to the server in the next request:
return agent.get('/user/me')
- .then((res: chaiHttp.Response) => chai.expect(res).to.have.status(200));
+ .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200));
});
function test1() {
var req = chai.request(app).get('/');
- req.then((res: chaiHttp.Response) => {
+ req.then((res: ChaiHttp.Response) => {
chai.expect(res).to.have.status(200);
chai.expect(res).to.have.header('content-type', 'text/plain');
chai.expect(res).to.have.header('content-type', /^text/);
@@ -99,5 +99,4 @@ function test1() {
});
}
-
when(chai.request(app).get('/')).done(() => console.log('success'), () => console.log('failure'));
diff --git a/chai-http/chai-http.d.ts b/chai-http/chai-http.d.ts
index fed2a8416..8f009c6ab 100644
--- a/chai-http/chai-http.d.ts
+++ b/chai-http/chai-http.d.ts
@@ -6,27 +6,38 @@
///
///
-declare module chai {
- export function request(server: any): chaiHttp.Agent;
+declare module Chai {
- export module request {
- export function agent(server: any): chaiHttp.Agent;
- export function addPromises(promiseConstructor: chaiHttp.PromiseConstructor): void;
+ interface ChaiStatic {
+ request: ChaiHttpRequest;
}
- interface Assertions extends chaiHttp.Assertions {
+ interface ChaiHttpRequest {
+ (server: any): ChaiHttp.Agent;
+ agent(server: any): ChaiHttp.Agent;
+ addPromises(promiseConstructor: any): void;
}
- interface TypeComparison extends chaiHttp.TypeComparison {
+ interface Assertion {
+ status(code: number): Assertion;
+ header(key: string, value?: string): Assertion;
+ header(key: string, value?: RegExp): Assertion;
+ headers: Assertion;
+ json: Assertion;
+ text: Assertion;
+ html: Assertion;
+ redirect: Assertion;
+ redirectTo(location: string): Assertion;
+ param(key: string, value?: string): Assertion;
+ cookie(key: string, value?: string): Assertion;
+ }
+
+ interface TypeComparison {
+ ip: Assertion;
}
}
-declare function chaiHttp(chai: any, utils: any): void;
-declare module chaiHttp {
- interface PromiseConstructor {
- (resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): Promise;
- }
-
+declare module ChaiHttp {
interface Promise {
then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Promise;
}
@@ -38,10 +49,9 @@ declare module chaiHttp {
}
interface Request extends FinishedRequest {
- attach(field: string, file: string, filename: string): Request;
- attach(field: string, file: Buffer, filename: string): Request;
+ attach(field: string, file: string|Buffer, filename: string): Request;
set(field: string, val: string): Request;
- query(key: string, value: string): Request;
+ query(params: Object): Request;
send(data: Object): Request;
auth(user: string, name: string): Request;
field(name: string, val: string): Request;
@@ -63,25 +73,12 @@ declare module chaiHttp {
patch(url: string, callback?: (err: any, res: Response) => void): Request;
}
- interface Assertions {
- status(code: number): any;
- header(key: string, value?: string): any;
- header(key: string, value?: RegExp): any;
- headers: any;
- json: any;
- // text: any;
- // html: any;
- redirect: any;
- redirectTo(location: string): any;
- param(key: string, value?: string): any;
- cookie(key: string, value?: string): any;
- }
-
interface TypeComparison {
ip: any;
}
}
declare module "chai-http" {
+ function chaiHttp(chai: any, utils: any): void;
export = chaiHttp;
}
diff --git a/chai-jquery/chai-jquery-tests.ts b/chai-jquery/chai-jquery-tests.ts
index 45c9981f5..64f6b040b 100644
--- a/chai-jquery/chai-jquery-tests.ts
+++ b/chai-jquery/chai-jquery-tests.ts
@@ -1,9 +1,9 @@
-///
///
// tests taken from https://github.com/chaijs/chai-jquery
-declare var $;
+declare var $: ChaiJQueryStatic;
+import chai = require('chai');
var expect = chai.expect;
function test_attr() {
@@ -19,7 +19,7 @@ function test_css() {
function test_data() {
expect($('#foo')).to.have.data('toggle');
expect($('#foo')).to.have.css('toggle', 'true');
- expect($('body')).to.have.css('font-family').match(/sans-serif/);
+ expect($('body')).to.have.css('font-family').and.match(/sans-serif/);
}
function test_class() {
@@ -88,4 +88,4 @@ function test_be_selector() {
function test_have_selector() {
$('body').should.have('h1');
expect($('#foo')).to.have('div');
-}
\ No newline at end of file
+}
diff --git a/chai-jquery/chai-jquery-tests.ts.tscparams b/chai-jquery/chai-jquery-tests.ts.tscparams
deleted file mode 100644
index d3f5a12fa..000000000
--- a/chai-jquery/chai-jquery-tests.ts.tscparams
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/chai-jquery/chai-jquery.d.ts b/chai-jquery/chai-jquery.d.ts
index 826e66579..d4eb7465f 100644
--- a/chai-jquery/chai-jquery.d.ts
+++ b/chai-jquery/chai-jquery.d.ts
@@ -4,34 +4,2577 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///
+///
-declare module chai {
- interface NameValueRegexMatcher {
- match(value: RegExp): boolean;
- }
+declare module Chai {
- interface NameValueMatcher {
- (name: string, value?: string): boolean;
- }
-
- interface Have {
- attr: NameValueMatcher;
- css: NameValueMatcher;
- data: NameValueMatcher;
- class(className: string): boolean;
- id(id: string): boolean;
- html(html: string): boolean;
- text(text: string): boolean;
- value(text: string): boolean;
- (selector: string): boolean;
- }
-
- interface Be {
- visible: boolean;
- hidden: boolean;
- selected: boolean;
- checked: boolean;
- disabled: boolean;
- (selector: string): boolean;
+ interface Assertion {
+ attr: (name: string, value?: string) => Assertion;
+ css: (name: string, value?: string) => Assertion;
+ data: (name: string, value?: string) => Assertion;
+ class(className: string): Assertion;
+ id(id: string): Assertion;
+ html(html: string): Assertion;
+ text(text: string): Assertion;
+ value(text: string): Assertion;
+ (selector: string): Assertion;
+ visible: Assertion;
+ hidden: Assertion;
+ selected: Assertion;
+ checked: Assertion;
+ disabled: Assertion;
+ (selector: string): Assertion;
}
}
+
+/**
+ * Static members of chai-jquery (those on $ and jQuery themselves)
+ */
+interface ChaiJQueryStatic {
+
+ /**
+ * 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): ChaiJQuery;
+ /**
+ * 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): ChaiJQuery;
+ /**
+ * 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[]): ChaiJQuery;
+ /**
+ * 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: {}): ChaiJQuery;
+ /**
+ * 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): ChaiJQuery;
+ /**
+ * Specify a function to execute when the DOM is fully loaded.
+ */
+ (): ChaiJQuery;
+
+ /**
+ * 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): ChaiJQuery;
+ /**
+ * 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): ChaiJQuery;
+
+ /**
+ * Binds a function to be executed when the DOM has finished loading.
+ *
+ * @param callback A function to execute after the DOM is ready.
+ */
+ (callback: Function): ChaiJQuery;
+
+ /**
+ * 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/* as JQueryDeferred */>): JQueryPromise;
+
+ /**
+ * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
+ */
+ cssHooks: { [key: string]: any; };
+ cssNumber: any;
+
+ /**
+ * Store arbitrary data associated with the specified element. Returns the value that was set.
+ *
+ * @param element The DOM element to associate with the data.
+ * @param key A string naming the piece of data to set.
+ * @param value The new data value.
+ */
+ data(element: Element, key: string, value: T): T;
+ /**
+ * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
+ *
+ * @param element The DOM element to associate with the data.
+ * @param key A string naming the piece of data to set.
+ */
+ data(element: Element, key: string): any;
+ /**
+ * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
+ *
+ * @param element The DOM element to associate with the data.
+ */
+ data(element: Element): any;
+
+ /**
+ * Execute the next function on the queue for the matched element.
+ *
+ * @param element A DOM element from which to remove and execute a queued function.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ dequeue(element: Element, queueName?: string): void;
+
+ /**
+ * Determine whether an element has any jQuery data associated with it.
+ *
+ * @param element A DOM element to be checked for data.
+ */
+ hasData(element: Element): boolean;
+
+ /**
+ * Show the queue of functions to be executed on the matched element.
+ *
+ * @param element A DOM element to inspect for an attached queue.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ queue(element: Element, queueName?: string): any[];
+ /**
+ * Manipulate the queue of functions to be executed on the matched element.
+ *
+ * @param element A DOM element where the array of queued functions is attached.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param newQueue An array of functions to replace the current queue contents.
+ */
+ queue(element: Element, queueName: string, newQueue: Function[]): ChaiJQuery;
+ /**
+ * Manipulate the queue of functions to be executed on the matched element.
+ *
+ * @param element A DOM element on which to add a queued function.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param callback The new function to add to the queue.
+ */
+ queue(element: Element, queueName: string, callback: Function): ChaiJQuery;
+
+ /**
+ * Remove a previously-stored piece of data.
+ *
+ * @param element A DOM element from which to remove data.
+ * @param name A string naming the piece of data to remove.
+ */
+ removeData(element: Element, name?: string): ChaiJQuery;
+
+ /**
+ * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
+ *
+ * @param beforeStart A function that is called just before the constructor returns.
+ */
+ Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred;
+
+ /**
+ * Effects
+ */
+ fx: {
+ tick: () => void;
+ /**
+ * The rate (in milliseconds) at which animations fire.
+ */
+ interval: number;
+ stop: () => void;
+ speeds: { slow: number; fast: number; };
+ /**
+ * Globally disable all animations.
+ */
+ off: boolean;
+ step: any;
+ };
+
+ /**
+ * Takes a function and returns a new one that will always have a particular context.
+ *
+ * @param fnction The function whose context will be changed.
+ * @param context The object to which the context (this) of the function should be set.
+ * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
+ */
+ proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
+ /**
+ * Takes a function and returns a new one that will always have a particular context.
+ *
+ * @param context The object to which the context (this) of the function should be set.
+ * @param name The name of the function whose context will be changed (should be a property of the context object).
+ * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
+ */
+ proxy(context: Object, name: string, ...additionalArguments: any[]): any;
+
+ Event: JQueryEventConstructor;
+
+ /**
+ * Takes a string and throws an exception containing it.
+ *
+ * @param message The message to send out.
+ */
+ error(message: any): ChaiJQuery;
+
+ expr: any;
+ fn: any; //TODO: Decide how we want to type this
+
+ isReady: boolean;
+
+ // Properties
+ support: JQuerySupport;
+
+ /**
+ * Check to see if a DOM element is a descendant of another DOM element.
+ *
+ * @param container The DOM element that may contain the other element.
+ * @param contained The DOM element that may be contained by (a descendant of) the other element.
+ */
+ contains(container: Element, contained: Element): boolean;
+
+ /**
+ * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
+ *
+ * @param collection The object or array to iterate over.
+ * @param callback The function that will be executed on every object.
+ */
+ each(
+ collection: T[],
+ callback: (indexInArray: number, valueOfElement: T) => any
+ ): any;
+
+ /**
+ * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
+ *
+ * @param collection The object or array to iterate over.
+ * @param callback The function that will be executed on every object.
+ */
+ each(
+ collection: any,
+ callback: (indexInArray: any, valueOfElement: any) => any
+ ): any;
+
+ /**
+ * Merge the contents of two or more objects together into the first object.
+ *
+ * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.
+ * @param object1 An object containing additional properties to merge in.
+ * @param objectN Additional objects containing properties to merge in.
+ */
+ extend(target: any, object1?: any, ...objectN: any[]): any;
+ /**
+ * Merge the contents of two or more objects together into the first object.
+ *
+ * @param deep If true, the merge becomes recursive (aka. deep copy).
+ * @param target The object to extend. It will receive the new properties.
+ * @param object1 An object containing additional properties to merge in.
+ * @param objectN Additional objects containing properties to merge in.
+ */
+ extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
+
+ /**
+ * Execute some JavaScript code globally.
+ *
+ * @param code The JavaScript code to execute.
+ */
+ globalEval(code: string): any;
+
+ /**
+ * Finds the elements of an array which satisfy a filter function. The original array is not affected.
+ *
+ * @param array The array to search through.
+ * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
+ * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
+ */
+ grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
+
+ /**
+ * Search for a specified value within an array and return its index (or -1 if not found).
+ *
+ * @param value The value to search for.
+ * @param array An array through which to search.
+ * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
+ */
+ inArray(value: T, array: T[], fromIndex?: number): number;
+
+ /**
+ * Determine whether the argument is an array.
+ *
+ * @param obj Object to test whether or not it is an array.
+ */
+ isArray(obj: any): boolean;
+ /**
+ * Check to see if an object is empty (contains no enumerable properties).
+ *
+ * @param obj The object that will be checked to see if it's empty.
+ */
+ isEmptyObject(obj: any): boolean;
+ /**
+ * Determine if the argument passed is a Javascript function object.
+ *
+ * @param obj Object to test whether or not it is a function.
+ */
+ isFunction(obj: any): boolean;
+ /**
+ * Determines whether its argument is a number.
+ *
+ * @param obj The value to be tested.
+ */
+ isNumeric(value: any): boolean;
+ /**
+ * Check to see if an object is a plain object (created using "{}" or "new Object").
+ *
+ * @param obj The object that will be checked to see if it's a plain object.
+ */
+ isPlainObject(obj: any): boolean;
+ /**
+ * Determine whether the argument is a window.
+ *
+ * @param obj Object to test whether or not it is a window.
+ */
+ isWindow(obj: any): boolean;
+ /**
+ * Check to see if a DOM node is within an XML document (or is an XML document).
+ *
+ * @param node he DOM node that will be checked to see if it's in an XML document.
+ */
+ isXMLDoc(node: Node): boolean;
+
+ /**
+ * Convert an array-like object into a true JavaScript array.
+ *
+ * @param obj Any object to turn into a native Array.
+ */
+ makeArray(obj: any): any[];
+
+ /**
+ * Translate all items in an array or object to new array of items.
+ *
+ * @param array The Array to translate.
+ * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
+ */
+ map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
+ /**
+ * Translate all items in an array or object to new array of items.
+ *
+ * @param arrayOrObject The Array or Object to translate.
+ * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.
+ */
+ map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
+
+ /**
+ * Merge the contents of two arrays together into the first array.
+ *
+ * @param first The first array to merge, the elements of second added.
+ * @param second The second array to merge into the first, unaltered.
+ */
+ merge(first: T[], second: T[]): T[];
+
+ /**
+ * An empty function.
+ */
+ noop(): any;
+
+ /**
+ * Return a number representing the current time.
+ */
+ now(): number;
+
+ /**
+ * Takes a well-formed JSON string and returns the resulting JavaScript object.
+ *
+ * @param json The JSON string to parse.
+ */
+ parseJSON(json: string): any;
+
+ /**
+ * Parses a string into an XML document.
+ *
+ * @param data a well-formed XML string to be parsed
+ */
+ parseXML(data: string): XMLDocument;
+
+ /**
+ * Remove the whitespace from the beginning and end of a string.
+ *
+ * @param str Remove the whitespace from the beginning and end of a string.
+ */
+ trim(str: string): string;
+
+ /**
+ * Determine the internal JavaScript [[Class]] of an object.
+ *
+ * @param obj Object to get the internal JavaScript [[Class]] of.
+ */
+ type(obj: any): string;
+
+ /**
+ * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
+ *
+ * @param array The Array of DOM elements.
+ */
+ unique(array: Element[]): Element[];
+
+ /**
+ * Parses a string into an array of DOM nodes.
+ *
+ * @param data HTML string to be parsed
+ * @param context DOM element to serve as the context in which the HTML fragment will be created
+ * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
+ */
+ parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
+
+ /**
+ * Parses a string into an array of DOM nodes.
+ *
+ * @param data HTML string to be parsed
+ * @param context DOM element to serve as the context in which the HTML fragment will be created
+ * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
+ */
+ parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
+}
+
+/**
+ * The chai-jquery instance members
+ */
+interface ChaiJQuery {
+ /**
+ * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): ChaiJQuery;
+ /**
+ * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): ChaiJQuery;
+ /**
+ * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): ChaiJQuery;
+ /**
+ * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxStart(handler: () => any): ChaiJQuery;
+ /**
+ * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxStop(handler: () => any): ChaiJQuery;
+ /**
+ * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): ChaiJQuery;
+
+ /**
+ * Load data from the server and place the returned HTML into the matched element.
+ *
+ * @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 complete A callback function that is executed when the request completes.
+ */
+ load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): ChaiJQuery;
+
+ /**
+ * Encode a set of form elements as a string for submission.
+ */
+ serialize(): string;
+ /**
+ * Encode a set of form elements as an array of names and values.
+ */
+ serializeArray(): JQuerySerializeArrayElement[];
+
+ /**
+ * Adds the specified class(es) to each of the set of matched elements.
+ *
+ * @param className One or more space-separated classes to be added to the class attribute of each matched element.
+ */
+ addClass(className: string): ChaiJQuery;
+ /**
+ * Adds the specified class(es) to each of the set of matched elements.
+ *
+ * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.
+ */
+ addClass(func: (index: number, className: string) => string): ChaiJQuery;
+
+ /**
+ * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
+ */
+ addBack(selector?: string): ChaiJQuery;
+
+ /**
+ * Get the value of an attribute for the first element in the set of matched elements.
+ *
+ * @param attributeName The name of the attribute to get.
+ */
+ attr(attributeName: string): string;
+ /**
+ * Set one or more attributes for the set of matched elements.
+ *
+ * @param attributeName The name of the attribute to set.
+ * @param value A value to set for the attribute.
+ */
+ attr(attributeName: string, value: string|number): ChaiJQuery;
+ /**
+ * Set one or more attributes for the set of matched elements.
+ *
+ * @param attributeName The name of the attribute to set.
+ * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
+ */
+ attr(attributeName: string, func: (index: number, attr: string) => string|number): ChaiJQuery;
+ /**
+ * Set one or more attributes for the set of matched elements.
+ *
+ * @param attributes An object of attribute-value pairs to set.
+ */
+ attr(attributes: Object): ChaiJQuery;
+
+ /**
+ * Determine whether any of the matched elements are assigned the given class.
+ *
+ * @param className The class name to search for.
+ */
+ hasClass(className: string): boolean;
+
+ /**
+ * Get the HTML contents of the first element in the set of matched elements.
+ */
+ html(): string;
+ /**
+ * Set the HTML contents of each element in the set of matched elements.
+ *
+ * @param htmlString A string of HTML to set as the content of each matched element.
+ */
+ html(htmlString: string): ChaiJQuery;
+ /**
+ * Set the HTML contents of each element in the set of matched elements.
+ *
+ * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
+ */
+ html(func: (index: number, oldhtml: string) => string): ChaiJQuery;
+ /**
+ * Set the HTML contents of each element in the set of matched elements.
+ *
+ * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
+ */
+
+ /**
+ * Get the value of a property for the first element in the set of matched elements.
+ *
+ * @param propertyName The name of the property to get.
+ */
+ prop(propertyName: string): any;
+ /**
+ * Set one or more properties for the set of matched elements.
+ *
+ * @param propertyName The name of the property to set.
+ * @param value A value to set for the property.
+ */
+ prop(propertyName: string, value: string|number|boolean): ChaiJQuery;
+ /**
+ * Set one or more properties for the set of matched elements.
+ *
+ * @param properties An object of property-value pairs to set.
+ */
+ prop(properties: Object): ChaiJQuery;
+ /**
+ * Set one or more properties for the set of matched elements.
+ *
+ * @param propertyName The name of the property to set.
+ * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
+ */
+ prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): ChaiJQuery;
+
+ /**
+ * Remove an attribute from each element in the set of matched elements.
+ *
+ * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
+ */
+ removeAttr(attributeName: string): ChaiJQuery;
+
+ /**
+ * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
+ *
+ * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
+ */
+ removeClass(className?: string): ChaiJQuery;
+ /**
+ * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
+ *
+ * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.
+ */
+ removeClass(func: (index: number, className: string) => string): ChaiJQuery;
+
+ /**
+ * Remove a property for the set of matched elements.
+ *
+ * @param propertyName The name of the property to remove.
+ */
+ removeProp(propertyName: string): ChaiJQuery;
+
+ /**
+ * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
+ *
+ * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
+ * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
+ */
+ toggleClass(className: string, swtch?: boolean): ChaiJQuery;
+ /**
+ * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
+ *
+ * @param swtch A boolean value to determine whether the class should be added or removed.
+ */
+ toggleClass(swtch?: boolean): ChaiJQuery;
+ /**
+ * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
+ *
+ * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
+ * @param swtch A boolean value to determine whether the class should be added or removed.
+ */
+ toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): ChaiJQuery;
+
+ /**
+ * Get the current value of the first element in the set of matched elements.
+ */
+ val(): any;
+ /**
+ * Set the value of each element in the set of matched elements.
+ *
+ * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
+ */
+ val(value: string|string[]): ChaiJQuery;
+ /**
+ * Set the value of each element in the set of matched elements.
+ *
+ * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
+ */
+ val(func: (index: number, value: string) => string): ChaiJQuery;
+
+
+ /**
+ * Get the value of style properties for the first element in the set of matched elements.
+ *
+ * @param propertyName A CSS property.
+ */
+ css(propertyName: string): string;
+ /**
+ * Set one or more CSS properties for the set of matched elements.
+ *
+ * @param propertyName A CSS property name.
+ * @param value A value to set for the property.
+ */
+ css(propertyName: string, value: string|number): ChaiJQuery;
+ /**
+ * Set one or more CSS properties for the set of matched elements.
+ *
+ * @param propertyName A CSS property name.
+ * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
+ */
+ css(propertyName: string, value: (index: number, value: string) => string|number): ChaiJQuery;
+ /**
+ * Set one or more CSS properties for the set of matched elements.
+ *
+ * @param properties An object of property-value pairs to set.
+ */
+ css(properties: Object): ChaiJQuery;
+
+ /**
+ * Get the current computed height for the first element in the set of matched elements.
+ */
+ height(): number;
+ /**
+ * Set the CSS height of every matched element.
+ *
+ * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
+ */
+ height(value: number|string): ChaiJQuery;
+ /**
+ * Set the CSS height of every matched element.
+ *
+ * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.
+ */
+ height(func: (index: number, height: number) => number|string): ChaiJQuery;
+
+ /**
+ * Get the current computed height for the first element in the set of matched elements, including padding but not border.
+ */
+ innerHeight(): number;
+
+ /**
+ * Sets the inner height on elements in the set of matched elements, including padding but not border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ innerHeight(height: number|string): ChaiJQuery;
+
+ /**
+ * Get the current computed width for the first element in the set of matched elements, including padding but not border.
+ */
+ innerWidth(): number;
+
+ /**
+ * Sets the inner width on elements in the set of matched elements, including padding but not border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ innerWidth(width: number|string): ChaiJQuery;
+
+ /**
+ * Get the current coordinates of the first element in the set of matched elements, relative to the document.
+ */
+ offset(): JQueryCoordinates;
+ /**
+ * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
+ *
+ * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
+ */
+ offset(coordinates: JQueryCoordinates): ChaiJQuery;
+ /**
+ * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
+ *
+ * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.
+ */
+ offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): ChaiJQuery;
+
+ /**
+ * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
+ *
+ * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
+ */
+ outerHeight(includeMargin?: boolean): number;
+
+ /**
+ * Sets the outer height on elements in the set of matched elements, including padding and border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ outerHeight(height: number|string): ChaiJQuery;
+
+ /**
+ * Get the current computed width for the first element in the set of matched elements, including padding and border.
+ *
+ * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
+ */
+ outerWidth(includeMargin?: boolean): number;
+
+ /**
+ * Sets the outer width on elements in the set of matched elements, including padding and border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ outerWidth(width: number|string): ChaiJQuery;
+
+ /**
+ * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
+ */
+ position(): JQueryCoordinates;
+
+ /**
+ * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.
+ */
+ scrollLeft(): number;
+ /**
+ * Set the current horizontal position of the scroll bar for each of the set of matched elements.
+ *
+ * @param value An integer indicating the new position to set the scroll bar to.
+ */
+ scrollLeft(value: number): ChaiJQuery;
+
+ /**
+ * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
+ */
+ scrollTop(): number;
+ /**
+ * Set the current vertical position of the scroll bar for each of the set of matched elements.
+ *
+ * @param value An integer indicating the new position to set the scroll bar to.
+ */
+ scrollTop(value: number): ChaiJQuery;
+
+ /**
+ * Get the current computed width for the first element in the set of matched elements.
+ */
+ width(): number;
+ /**
+ * Set the CSS width of each element in the set of matched elements.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ width(value: number|string): ChaiJQuery;
+ /**
+ * Set the CSS width of each element in the set of matched elements.
+ *
+ * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.
+ */
+ width(func: (index: number, width: number) => number|string): ChaiJQuery;
+
+ /**
+ * Remove from the queue all items that have not yet been run.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ clearQueue(queueName?: string): ChaiJQuery;
+
+ /**
+ * Store arbitrary data associated with the matched elements.
+ *
+ * @param key A string naming the piece of data to set.
+ * @param value The new data value; it can be any Javascript type including Array or Object.
+ */
+ data(key: string, value: any): ChaiJQuery;
+ /**
+ * Store arbitrary data associated with the matched elements.
+ *
+ * @param obj An object of key-value pairs of data to update.
+ */
+ data(obj: { [key: string]: any; }): ChaiJQuery;
+ /**
+ * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
+ *
+ * @param key Name of the data stored.
+ */
+ data(key: string): any;
+ /**
+ * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
+ */
+ data(): any;
+
+ /**
+ * Execute the next function on the queue for the matched elements.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ dequeue(queueName?: string): ChaiJQuery;
+
+ /**
+ * Remove a previously-stored piece of data.
+ *
+ * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
+ */
+ removeData(name: string): ChaiJQuery;
+ /**
+ * Remove a previously-stored piece of data.
+ *
+ * @param list An array of strings naming the pieces of data to delete.
+ */
+ removeData(list: string[]): ChaiJQuery;
+
+ /**
+ * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
+ *
+ * @param type The type of queue that needs to be observed. (default: fx)
+ * @param target Object onto which the promise methods have to be attached
+ */
+ promise(type?: string, target?: Object): JQueryPromise;
+
+ /**
+ * Perform a custom animation of a set of CSS properties.
+ *
+ * @param properties An object of CSS properties and values that the animation will move toward.
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ animate(properties: Object, duration?: string|number, complete?: Function): ChaiJQuery;
+ /**
+ * Perform a custom animation of a set of CSS properties.
+ *
+ * @param properties An object of CSS properties and values that the animation will move toward.
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition. (default: swing)
+ * @param complete A function to call once the animation is complete.
+ */
+ animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Perform a custom animation of a set of CSS properties.
+ *
+ * @param properties An object of CSS properties and values that the animation will move toward.
+ * @param options A map of additional options to pass to the method.
+ */
+ animate(properties: Object, options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Set a timer to delay execution of subsequent items in the queue.
+ *
+ * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ delay(duration: number, queueName?: string): ChaiJQuery;
+
+ /**
+ * Display the matched elements by fading them to opaque.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeIn(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Display the matched elements by fading them to opaque.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeIn(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Display the matched elements by fading them to opaque.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ fadeIn(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Hide the matched elements by fading them to transparent.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeOut(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Hide the matched elements by fading them to transparent.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeOut(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Hide the matched elements by fading them to transparent.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ fadeOut(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Adjust the opacity of the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param opacity A number between 0 and 1 denoting the target opacity.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeTo(duration: string|number, opacity: number, complete?: Function): ChaiJQuery;
+ /**
+ * Adjust the opacity of the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param opacity A number between 0 and 1 denoting the target opacity.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): ChaiJQuery;
+
+ /**
+ * Display or hide the matched elements by animating their opacity.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeToggle(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Display or hide the matched elements by animating their opacity.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeToggle(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Display or hide the matched elements by animating their opacity.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ fadeToggle(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
+ *
+ * @param queue The name of the queue in which to stop animations.
+ */
+ finish(queue?: string): ChaiJQuery;
+
+ /**
+ * Hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ hide(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ hide(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Hide the matched elements.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ hide(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Display the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ show(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Display the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ show(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Display the matched elements.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ show(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Display the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideDown(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Display the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideDown(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Display the matched elements with a sliding motion.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ slideDown(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Display or hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideToggle(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Display or hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideToggle(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Display or hide the matched elements with a sliding motion.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ slideToggle(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideUp(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideUp(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Hide the matched elements with a sliding motion.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ slideUp(options: JQueryAnimationOptions): ChaiJQuery;
+
+ /**
+ * Stop the currently-running animation on the matched elements.
+ *
+ * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
+ * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
+ */
+ stop(clearQueue?: boolean, jumpToEnd?: boolean): ChaiJQuery;
+ /**
+ * Stop the currently-running animation on the matched elements.
+ *
+ * @param queue The name of the queue in which to stop animations.
+ * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
+ * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
+ */
+ stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): ChaiJQuery;
+
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ toggle(duration?: number|string, complete?: Function): ChaiJQuery;
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ toggle(duration?: number|string, easing?: string, complete?: Function): ChaiJQuery;
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ toggle(options: JQueryAnimationOptions): ChaiJQuery;
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param showOrHide A Boolean indicating whether to show or hide the elements.
+ */
+ toggle(showOrHide: boolean): ChaiJQuery;
+
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
+ */
+ bind(eventType: string, eventData: any, preventBubble: boolean): ChaiJQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
+ */
+ bind(eventType: string, preventBubble: boolean): ChaiJQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param events An object containing one or more DOM event types and functions to execute for them.
+ */
+ bind(events: any): ChaiJQuery;
+
+ /**
+ * Trigger the "blur" event on an element
+ */
+ blur(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "blur" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ blur(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "blur" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "change" event on an element.
+ */
+ change(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "change" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ change(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "change" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "click" event on an element.
+ */
+ click(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "click" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ */
+ click(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "click" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "dblclick" event on an element.
+ */
+ dblclick(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "dblclick" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ dblclick(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "dblclick" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "focus" event on an element.
+ */
+ focus(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "focus" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focus(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "focus" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Bind an event handler to the "focusin" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusin(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "focusin" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Bind an event handler to the "focusout" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusout(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "focusout" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
+ *
+ * @param handlerIn A function to execute when the mouse pointer enters the element.
+ * @param handlerOut A function to execute when the mouse pointer leaves the element.
+ */
+ hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
+ *
+ * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
+ */
+ hover(handlerInOut: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "keydown" event on an element.
+ */
+ keydown(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "keydown" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keydown(handler: (eventObject: JQueryKeyEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "keydown" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "keypress" event on an element.
+ */
+ keypress(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "keypress" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keypress(handler: (eventObject: JQueryKeyEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "keypress" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "keyup" event on an element.
+ */
+ keyup(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "keyup" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keyup(handler: (eventObject: JQueryKeyEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "keyup" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): ChaiJQuery;
+
+ /**
+ * Bind an event handler to the "load" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ load(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "load" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mousedown" event on an element.
+ */
+ mousedown(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mousedown" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousedown(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mousedown" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mouseenter" event on an element.
+ */
+ mouseenter(): ChaiJQuery;
+ /**
+ * Bind an event handler to be fired when the mouse enters an element.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to be fired when the mouse enters an element.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mouseleave" event on an element.
+ */
+ mouseleave(): ChaiJQuery;
+ /**
+ * Bind an event handler to be fired when the mouse leaves an element.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to be fired when the mouse leaves an element.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mousemove" event on an element.
+ */
+ mousemove(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mousemove" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousemove(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mousemove" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mouseout" event on an element.
+ */
+ mouseout(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mouseout" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseout(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mouseout" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mouseover" event on an element.
+ */
+ mouseover(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mouseover" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseover(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mouseover" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "mouseup" event on an element.
+ */
+ mouseup(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mouseup" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseup(handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "mouseup" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): ChaiJQuery;
+
+ /**
+ * Remove an event handler.
+ */
+ off(): ChaiJQuery;
+ /**
+ * Remove an event handler.
+ *
+ * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
+ * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
+ * @param handler A handler function previously attached for the event(s), or the special value false.
+ */
+ off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Remove an event handler.
+ *
+ * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
+ * @param handler A handler function previously attached for the event(s), or the special value false.
+ */
+ off(events: string, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Remove an event handler.
+ *
+ * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
+ * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
+ */
+ off(events: { [key: string]: any; }, selector?: string): ChaiJQuery;
+
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
+ */
+ on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): ChaiJQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param data Data to be passed to the handler in event.data when an event is triggered.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): ChaiJQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): ChaiJQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event is triggered.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): ChaiJQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ on(events: { [key: string]: any; }, selector?: string, data?: any): ChaiJQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ on(events: { [key: string]: any; }, data?: any): ChaiJQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
+ * @param handler A function to execute at the time the event is triggered.
+ */
+ one(events: string, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
+ * @param data An object containing data that will be passed to the event handler.
+ * @param handler A function to execute at the time the event is triggered.
+ */
+ one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event is triggered.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ one(events: { [key: string]: any; }, selector?: string, data?: any): ChaiJQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ one(events: { [key: string]: any; }, data?: any): ChaiJQuery;
+
+
+ /**
+ * Specify a function to execute when the DOM is fully loaded.
+ *
+ * @param handler A function to execute after the DOM is ready.
+ */
+ ready(handler: Function): ChaiJQuery;
+
+ /**
+ * Trigger the "resize" event on an element.
+ */
+ resize(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "resize" JavaScript event.
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ resize(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "resize" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "scroll" event on an element.
+ */
+ scroll(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "scroll" JavaScript event.
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ scroll(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "scroll" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "select" event on an element.
+ */
+ select(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "select" JavaScript event.
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ select(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "select" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Trigger the "submit" event on an element.
+ */
+ submit(): ChaiJQuery;
+ /**
+ * Bind an event handler to the "submit" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ submit(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "submit" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Execute all handlers and behaviors attached to the matched elements for the given event type.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param extraParameters Additional parameters to pass along to the event handler.
+ */
+ trigger(eventType: string, extraParameters?: any[]|Object): ChaiJQuery;
+ /**
+ * Execute all handlers and behaviors attached to the matched elements for the given event type.
+ *
+ * @param event A jQuery.Event object.
+ * @param extraParameters Additional parameters to pass along to the event handler.
+ */
+ trigger(event: JQueryEventObject, extraParameters?: any[]|Object): ChaiJQuery;
+
+ /**
+ * Execute all handlers attached to an element for an event.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param extraParameters An array of additional parameters to pass along to the event handler.
+ */
+ triggerHandler(eventType: string, ...extraParameters: any[]): Object;
+
+ /**
+ * Remove a previously-attached event handler from the elements.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param handler The function that is to be no longer executed.
+ */
+ unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Remove a previously-attached event handler from the elements.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
+ */
+ unbind(eventType: string, fls: boolean): ChaiJQuery;
+ /**
+ * Remove a previously-attached event handler from the elements.
+ *
+ * @param evt A JavaScript event object as passed to an event handler.
+ */
+ unbind(evt: any): ChaiJQuery;
+
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ */
+ undelegate(): ChaiJQuery;
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ *
+ * @param selector A selector which will be used to filter the event results.
+ * @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
+ * @param handler A function to execute at the time the event is triggered.
+ */
+ undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ *
+ * @param selector A selector which will be used to filter the event results.
+ * @param events An object of one or more event types and previously bound functions to unbind from them.
+ */
+ undelegate(selector: string, events: Object): ChaiJQuery;
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ *
+ * @param namespace A string containing a namespace to unbind all events from.
+ */
+ undelegate(namespace: string): ChaiJQuery;
+
+ /**
+ * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ unload(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param eventData A plain object of data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
+ */
+ context: Element;
+
+ jquery: string;
+
+ /**
+ * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ error(handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+ /**
+ * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param eventData A plain object of data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ error(eventData: any, handler: (eventObject: JQueryEventObject) => any): ChaiJQuery;
+
+ /**
+ * Add a collection of DOM elements onto the jQuery stack.
+ *
+ * @param elements An array of elements to push onto the stack and make into a new jQuery object.
+ */
+ pushStack(elements: any[]): ChaiJQuery;
+ /**
+ * Add a collection of DOM elements onto the jQuery stack.
+ *
+ * @param elements An array of elements to push onto the stack and make into a new jQuery object.
+ * @param name The name of a jQuery method that generated the array of elements.
+ * @param arguments The arguments that were passed in to the jQuery method (for serialization).
+ */
+ pushStack(elements: any[], name: string, arguments: any[]): ChaiJQuery;
+
+ /**
+ * Insert content, specified by the parameter, after each element in the set of matched elements.
+ *
+ * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
+ */
+ after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): ChaiJQuery;
+ /**
+ * Insert content, specified by the parameter, after each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ after(func: (index: number, html: string) => string|Element|JQuery): ChaiJQuery;
+
+ /**
+ * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
+ *
+ * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
+ */
+ append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): ChaiJQuery;
+ /**
+ * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
+ */
+ append(func: (index: number, html: string) => string|Element|JQuery): ChaiJQuery;
+
+ /**
+ * Insert every element in the set of matched elements to the end of the target.
+ *
+ * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
+ */
+ appendTo(target: JQuery|any[]|Element|string): ChaiJQuery;
+
+ /**
+ * Insert content, specified by the parameter, before each element in the set of matched elements.
+ *
+ * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
+ */
+ before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): ChaiJQuery;
+ /**
+ * Insert content, specified by the parameter, before each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ before(func: (index: number, html: string) => string|Element|JQuery): ChaiJQuery;
+
+ /**
+ * Create a deep copy of the set of matched elements.
+ *
+ * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
+ * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
+ */
+ clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): ChaiJQuery;
+
+ /**
+ * Remove the set of matched elements from the DOM.
+ *
+ * param selector A selector expression that filters the set of matched elements to be removed.
+ */
+ detach(selector?: string): ChaiJQuery;
+
+ /**
+ * Remove all child nodes of the set of matched elements from the DOM.
+ */
+ empty(): ChaiJQuery;
+
+ /**
+ * Insert every element in the set of matched elements after the target.
+ *
+ * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
+ */
+ insertAfter(target: JQuery|any[]|Element|Text|string): ChaiJQuery;
+
+ /**
+ * Insert every element in the set of matched elements before the target.
+ *
+ * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
+ */
+ insertBefore(target: JQuery|any[]|Element|Text|string): ChaiJQuery;
+
+ /**
+ * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
+ *
+ * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
+ */
+ prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): ChaiJQuery;
+ /**
+ * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
+ */
+ prepend(func: (index: number, html: string) => string|Element|JQuery): ChaiJQuery;
+
+ /**
+ * Insert every element in the set of matched elements to the beginning of the target.
+ *
+ * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
+ */
+ prependTo(target: JQuery|any[]|Element|string): ChaiJQuery;
+
+ /**
+ * Remove the set of matched elements from the DOM.
+ *
+ * @param selector A selector expression that filters the set of matched elements to be removed.
+ */
+ remove(selector?: string): ChaiJQuery;
+
+ /**
+ * Replace each target element with the set of matched elements.
+ *
+ * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
+ */
+ replaceAll(target: JQuery|any[]|Element|string): ChaiJQuery;
+
+ /**
+ * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
+ *
+ * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
+ */
+ replaceWith(newContent: JQuery|any[]|Element|Text|string): ChaiJQuery;
+ /**
+ * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
+ *
+ * param func A function that returns content with which to replace the set of matched elements.
+ */
+ replaceWith(func: () => Element|JQuery): ChaiJQuery;
+
+ /**
+ * Get the combined text contents of each element in the set of matched elements, including their descendants.
+ */
+ text(): string;
+ /**
+ * Set the content of each element in the set of matched elements to the specified text.
+ *
+ * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
+ */
+ text(text: string|number|boolean): ChaiJQuery;
+ /**
+ * Set the content of each element in the set of matched elements to the specified text.
+ *
+ * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
+ */
+ text(func: (index: number, text: string) => string): ChaiJQuery;
+
+ /**
+ * Retrieve all the elements contained in the jQuery set, as an array.
+ */
+ toArray(): any[];
+
+ /**
+ * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
+ */
+ unwrap(): ChaiJQuery;
+
+ /**
+ * Wrap an HTML structure around each element in the set of matched elements.
+ *
+ * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
+ */
+ wrap(wrappingElement: JQuery|Element|string): ChaiJQuery;
+ /**
+ * Wrap an HTML structure around each element in the set of matched elements.
+ *
+ * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ wrap(func: (index: number) => string|JQuery): ChaiJQuery;
+
+ /**
+ * Wrap an HTML structure around all elements in the set of matched elements.
+ *
+ * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
+ */
+ wrapAll(wrappingElement: JQuery|Element|string): ChaiJQuery;
+ wrapAll(func: (index: number) => string): ChaiJQuery;
+
+ /**
+ * Wrap an HTML structure around the content of each element in the set of matched elements.
+ *
+ * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
+ */
+ wrapInner(wrappingElement: JQuery|Element|string): ChaiJQuery;
+ /**
+ * Wrap an HTML structure around the content of each element in the set of matched elements.
+ *
+ * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ wrapInner(func: (index: number) => string): ChaiJQuery;
+
+ /**
+ * Iterate over a jQuery object, executing a function for each matched element.
+ *
+ * @param func A function to execute for each matched element.
+ */
+ each(func: (index: number, elem: Element) => any): ChaiJQuery;
+
+ /**
+ * Retrieve one of the elements matched by the jQuery object.
+ *
+ * @param index A zero-based integer indicating which element to retrieve.
+ */
+ get(index: number): HTMLElement;
+ /**
+ * Retrieve the elements matched by the jQuery object.
+ */
+ get(): any[];
+
+ /**
+ * Search for a given element from among the matched elements.
+ */
+ index(): number;
+ /**
+ * Search for a given element from among the matched elements.
+ *
+ * @param selector A selector representing a jQuery collection in which to look for an element.
+ */
+ index(selector: string|JQuery|Element): number;
+
+ /**
+ * The number of elements in the jQuery object.
+ */
+ length: number;
+ /**
+ * A selector representing selector passed to jQuery(), if any, when creating the original set.
+ * version deprecated: 1.7, removed: 1.9
+ */
+ selector: string;
+ [index: string]: any;
+ [index: number]: HTMLElement;
+
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
+ * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
+ */
+ add(selector: string, context?: Element): ChaiJQuery;
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param elements One or more elements to add to the set of matched elements.
+ */
+ add(...elements: Element[]): ChaiJQuery;
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param html An HTML fragment to add to the set of matched elements.
+ */
+ add(html: string): ChaiJQuery;
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param obj An existing jQuery object to add to the set of matched elements.
+ */
+ add(obj: JQuery): ChaiJQuery;
+
+ /**
+ * Get the children of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ children(selector?: string): ChaiJQuery;
+
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ closest(selector: string): ChaiJQuery;
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
+ */
+ closest(selector: string, context?: Element): ChaiJQuery;
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param obj A jQuery object to match elements against.
+ */
+ closest(obj: JQuery): ChaiJQuery;
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param element An element to match elements against.
+ */
+ closest(element: Element): ChaiJQuery;
+
+ /**
+ * Get an array of all the elements and selectors matched against the current element up through the DOM tree.
+ *
+ * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
+ * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
+ */
+ closest(selectors: any, context?: Element): any[];
+
+ /**
+ * Get the children of each element in the set of matched elements, including text and comment nodes.
+ */
+ contents(): ChaiJQuery;
+
+ /**
+ * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
+ */
+ end(): ChaiJQuery;
+
+ /**
+ * Reduce the set of matched elements to the one at the specified index.
+ *
+ * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
+ *
+ */
+ eq(index: number): ChaiJQuery;
+
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param selector A string containing a selector expression to match the current set of elements against.
+ */
+ filter(selector: string): ChaiJQuery;
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param func A function used as a test for each element in the set. this is the current DOM element.
+ */
+ filter(func: (index: number, element: Element) => any): ChaiJQuery;
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param element An element to match the current set of elements against.
+ */
+ filter(element: Element): ChaiJQuery;
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param obj An existing jQuery object to match the current set of elements against.
+ */
+ filter(obj: JQuery): ChaiJQuery;
+
+ /**
+ * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ find(selector: string): ChaiJQuery;
+ /**
+ * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
+ *
+ * @param element An element to match elements against.
+ */
+ find(element: Element): ChaiJQuery;
+ /**
+ * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
+ *
+ * @param obj A jQuery object to match elements against.
+ */
+ find(obj: JQuery): ChaiJQuery;
+
+ /**
+ * Reduce the set of matched elements to the first in the set.
+ */
+ first(): ChaiJQuery;
+
+ /**
+ * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ has(selector: string): ChaiJQuery;
+ /**
+ * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
+ *
+ * @param contained A DOM element to match elements against.
+ */
+ has(contained: Element): ChaiJQuery;
+
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ is(selector: string): boolean;
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
+ */
+ is(func: (index: number, element: Element) => boolean): boolean;
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param obj An existing jQuery object to match the current set of elements against.
+ */
+ is(obj: JQuery): boolean;
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param elements One or more elements to match the current set of elements against.
+ */
+ is(elements: any): boolean;
+
+ /**
+ * Reduce the set of matched elements to the final one in the set.
+ */
+ last(): ChaiJQuery;
+
+ /**
+ * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
+ *
+ * @param callback A function object that will be invoked for each element in the current set.
+ */
+ map(callback: (index: number, domElement: Element) => any): ChaiJQuery;
+
+ /**
+ * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ next(selector?: string): ChaiJQuery;
+
+ /**
+ * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ nextAll(selector?: string): ChaiJQuery;
+
+ /**
+ * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
+ *
+ * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ nextUntil(selector?: string, filter?: string): ChaiJQuery;
+ /**
+ * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
+ *
+ * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ nextUntil(element?: Element, filter?: string): ChaiJQuery;
+ /**
+ * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
+ *
+ * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ nextUntil(obj?: JQuery, filter?: string): ChaiJQuery;
+
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ not(selector: string): ChaiJQuery;
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param func A function used as a test for each element in the set. this is the current DOM element.
+ */
+ not(func: (index: number, element: Element) => boolean): ChaiJQuery;
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param elements One or more DOM elements to remove from the matched set.
+ */
+ not(...elements: Element[]): ChaiJQuery;
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param obj An existing jQuery object to match the current set of elements against.
+ */
+ not(obj: JQuery): ChaiJQuery;
+
+ /**
+ * Get the closest ancestor element that is positioned.
+ */
+ offsetParent(): ChaiJQuery;
+
+ /**
+ * Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ parent(selector?: string): ChaiJQuery;
+
+ /**
+ * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ parents(selector?: string): ChaiJQuery;
+
+ /**
+ * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ parentsUntil(selector?: string, filter?: string): ChaiJQuery;
+ /**
+ * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ parentsUntil(element?: Element, filter?: string): ChaiJQuery;
+ /**
+ * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ parentsUntil(obj?: JQuery, filter?: string): ChaiJQuery;
+
+ /**
+ * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ prev(selector?: string): ChaiJQuery;
+
+ /**
+ * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ prevAll(selector?: string): ChaiJQuery;
+
+ /**
+ * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ prevUntil(selector?: string, filter?: string): ChaiJQuery;
+ /**
+ * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ prevUntil(element?: Element, filter?: string): ChaiJQuery;
+ /**
+ * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ prevUntil(obj?: JQuery, filter?: string): ChaiJQuery;
+
+ /**
+ * Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ siblings(selector?: string): ChaiJQuery;
+
+ /**
+ * Reduce the set of matched elements to a subset specified by a range of indices.
+ *
+ * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
+ * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
+ */
+ slice(start: number, end?: number): ChaiJQuery;
+
+ /**
+ * Show the queue of functions to be executed on the matched elements.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ queue(queueName?: string): any[];
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param newQueue An array of functions to replace the current queue contents.
+ */
+ queue(newQueue: Function[]): ChaiJQuery;
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
+ */
+ queue(callback: Function): ChaiJQuery;
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param newQueue An array of functions to replace the current queue contents.
+ */
+ queue(queueName: string, newQueue: Function[]): ChaiJQuery;
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
+ */
+ queue(queueName: string, callback: Function): ChaiJQuery;
+ should: Chai.Assertion;
+}
diff --git a/chai-subset/chai-subset-tests.ts b/chai-subset/chai-subset-tests.ts
new file mode 100644
index 000000000..8b88e5c6a
--- /dev/null
+++ b/chai-subset/chai-subset-tests.ts
@@ -0,0 +1,62 @@
+///
+
+import chai = require('chai');
+import chaiSubset = require('chai-subset');
+
+chai.use(chaiSubset);
+var expect = chai.expect;
+var assert = chai.assert;
+
+function test_containSubset() {
+ var obj: Object = {
+ a: 'b',
+ c: 'd',
+ e: {
+ foo: 'bar',
+ baz: {
+ qux: 'quux'
+ }
+ }
+ };
+
+ expect(obj).to.containSubset({
+ a: 'b',
+ e: {
+ baz: {
+ qux: 'quux'
+ }
+ }
+ });
+
+ obj.should.containSubset({ a: 'b' });
+}
+
+function test_notContainSubset() {
+ var obj: Object = {
+ a: 'b',
+ c: 'd',
+ e: {
+ foo: 'bar',
+ baz: {
+ qux: 'quux'
+ }
+ }
+ };
+
+ expect(obj).to.not.containSubset({ g: 'whatever' });
+ obj.should.not.containSubset({ g: 'whatever' });
+}
+
+function test_arrayContainSubset() {
+ var list: Array