diff --git a/README.md b/README.md
index 7e305efe3..4613bb106 100755
--- a/README.md
+++ b/README.md
@@ -97,6 +97,7 @@ List of Definitions
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
+* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn))
* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac))
* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter))
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts
index 7f9c3869b..bc3e27c2d 100644
--- a/angular-ui/angular-ui-router.d.ts
+++ b/angular-ui/angular-ui-router.d.ts
@@ -19,8 +19,8 @@ declare module ng.ui {
params?: any[];
views?: {};
abstract?: boolean;
- onEnter?: Function;
- onExit?: Function;
+ onEnter?: any;
+ onExit?: any;
data?: any;
}
diff --git a/angularjs/README.md b/angularjs/README.md
index 9cf668559..263e046ea 100644
--- a/angularjs/README.md
+++ b/angularjs/README.md
@@ -43,11 +43,11 @@ To avoid cluttering the list of suggestions as you type in your IDE, all interfa
**ngMockE2E** does not define a new namespace, but rather modifies some of **ng**'s interfaces.
Bellow is an example of how to use the interfaces:
-
- function MainController($scope: ng.IScope, $http: ng.IHttpService) {
- // code assistance will now be available for $scope and $http
- }
-
+```ts
+function MainController($scope: ng.IScope, $http: ng.IHttpService) {
+ // code assistance will now be available for $scope and $http
+}
+```
## Services and other injectables
@@ -71,156 +71,160 @@ The **$httpProvider**, thus, is defined by **ng.IHttpProvider**.
TypeScript allows for static checking. Among other obvious things, that means you're gonna have to extend interfaces when you need to augment an object whose interface has been defined, because otherwise the compiler will see it as an error to try to assign a value to a unspecified member.
Consider the following ordinary code:
-
- function Controller($scope) {
- $scope.$broadcast('myEvent');
- $scope.title = 'Yabadabadu';
- }
-
+```ts
+function Controller($scope) {
+ $scope.$broadcast('myEvent');
+ $scope.title = 'Yabadabadu';
+}
+```
That will not produce any compilation error because the compiler does not know the first thing about $scope to do any checking. For that same reason, you will not get any assistance either.
Now consider this:
-
- function Controller($scope: ng.IScope) {
- $scope.$broadcast('myEvent');
- $scope.title = 'Yabadabadu';
- }
+```ts
+function Controller($scope: ng.IScope) {
+ $scope.$broadcast('myEvent');
+ $scope.title = 'Yabadabadu';
+}
+```
Now we annotated `$scope` with the interface `ng.IScope`. The compiler now knows that, among other members, `$scope` has a method called `$broadcast`. That interface, however, does not define a `title` property. The compiler will complain about it.
Since you are augmenting the $scope object, you should let the compiler know what to expect then:
+```ts
+interface ICustomScope extends ng.IScope {
+ title: string;
+}
- interface ICustomScope extends ng.IScope {
- title: string;
- }
-
- function Controller($scope: ng.ICustomScope) {
- $scope.$broadcast('myEvent');
- $scope.title = 'Yabadabadu';
- }
+function Controller($scope: ng.ICustomScope) {
+ $scope.$broadcast('myEvent');
+ $scope.title = 'Yabadabadu';
+}
+```
## Examples
### Working with $resource
+```ts
+///
+///
- ///
- ///
+// We have the option to define arguments for a custom resource
+interface IArticleParameters {
+ id: number;
+}
- // We have the option to define arguments for a custom resource
- interface IArticleParameters {
- id: number;
+interface IArticleResource extends ng.resource.IResource {
+ title: string;
+ text: string;
+ date: Date;
+ author: number;
+
+ // Although all actions defined on IArticleResourceClass are avaiable with
+ // the '$' prefix, we have the choice to expose only what we will use
+ $publish(): IArticleResource;
+ $unpublish(): IArticleResource;
+}
+
+// Let's define a custom resource
+interface IArticleResourceClass extends ng.resource.IResourceClass {
+ // Overload get to accept our custom parameters
+ get(): ng.resource.IResource;
+ get(params: IArticleParameters, onSuccess: Function): IArticleResource;
+
+ // Add our custom resource actions
+ publish(): IArticleResource;
+ publish(params: IArticleParameters): IArticleResource;
+ unpublish(params: IArticleParameters): IArticleResource;
+}
+
+function MainController($resource: ng.resource.IResourceService) {
+
+ // IntelliSense will provide IActionDescriptor interface and will validate
+ // your assignment against it
+ var publishDescriptor: ng.resource.IActionDescriptor;
+ publishDescriptor = {
+ method: 'GET',
+ isArray: false
+ };
+
+ // I could still create a descriptor without the interface...
+ var unpublishDescriptor = {
+ method: 'POST'
}
- // Let's define a custom resource
- interface IArticleResourceClass extends ng.resource.IResourceClass {
- // Overload get to accept our custom parameters
- get(): ng.resource.IResource;
- get(params: IArticleParameters, onSuccess: Function): IArticleResource;
+ // A call to the $resource service returns a IResourceClass. Since
+ // our own IArticleResourceClass defines 2 more actions, we cast the return
+ // value to make the compiler aware of that
+ var articleResource = $resource('/articles/:id', null, {
+ publish : publishDescriptor,
+ unpublish : unpublishDescriptor
+ });
- // Add our custom resource actions
- publish(): IArticleResource;
- publish(params: IArticleParameters): IArticleResource;
- unpublish(params: IArticleParameters): IArticleResource;
- }
-
- interface IArticleResource extends ng.resource.IResource {
- title: string;
- text: string;
- date: Date;
- author: number;
-
- // Although all actions defined on IArticleResourceClass are avaiable with
- // the '$' prefix, we have the choice to expose only what we will use
- $publish(): IArticleResource;
- $unpublish(): IArticleResource;
- }
-
- function MainController($resource: ng.resource.IResourceService) {
-
- // IntelliSense will provide IActionDescriptor interface and will validate
- // your assignment against it
- var publishDescriptor: ng.resource.IActionDescriptor;
- publishDescriptor = {
- method: 'GET',
- isArray: false
- };
-
- // I could still create a descriptor without the interface...
- var unpublishDescriptor = {
- method: 'POST'
- }
-
- // A call to the $resource service returns a IResourceClass. Since
- // our own IArticleResourceClass defines 2 more actions, we cast the return
- // value to make the compiler aware of that
- var articleResource = $resource('/articles/:id', null, {
- publish : publishDescriptor,
- unpublish : unpublishDescriptor
- });
-
- // Now we can do this
- articleResource.unpublish({ id: 1 });
-
- // IResourceClass.get() will be automatically available here
- var article: IArticleResource = articleResource.get({id: 1}, function success() {
- // Again, default + custom action here...
- article.title = 'New Title';
- article.$save();
- article.$publish();
- });
- }
-
-### Working with $resource in angular-1.0 definitions
-
- ///
- ///
-
- // Let's define a custom resource
- interface IArticleResourceClass extends ng.resource.IResourceClass {
- publish: ng.resource.IActionCall;
- unpublish: ng.resource.IActionCall;
- }
- interface IArticleResource extends ng.resource.IResource {
- title: string;
- text: string;
- date: Date;
- author: number;
- $publish: ng.resource.IActionCall;
- $unpublish: ng.resource.IActionCall;
- }
-
- function MainController($resource: ng.resource.IResourceService) {
-
- // IntelliSense will provide IActionDescriptor interface and will validate
- // your assignment against it
- var publishDescriptor: ng.resource.IActionDescriptor;
- publishDescriptor = {
- method: 'GET',
- isArray: false
- };
-
- // I could still create a descriptor without the interface...
- var unpublishDescriptor = {
- method: 'POST'
- }
-
- // A call to the $resource service returns a IResourceClass. Since
- // our own IArticleResourceClass defines 2 more actions, we cast the return
- // value to make the compiler aware of that
- var articles = $resource('/articles/:id', null, {
- publish : publishDescriptor,
- unpublish : unpublishDescriptor
- });
-
- // Now we can do this
- articles.unpublish({ id: 1 });
-
- // IResourceClass.get() will be automatically available here
- var article = articles.get({id: 1});
+ // Now we can do this
+ articleResource.unpublish({ id: 1 });
+ // IResourceClass.get() will be automatically available here
+ var article: IArticleResource = articleResource.get({id: 1}, function success() {
// Again, default + custom action here...
article.title = 'New Title';
article.$save();
article.$publish();
-
+ });
+}
+```
+
+### Working with $resource in angular-1.0 definitions
+```ts
+///
+///
+
+// Let's define a custom resource
+interface IArticleResourceClass extends ng.resource.IResourceClass {
+ publish: ng.resource.IActionCall;
+ unpublish: ng.resource.IActionCall;
+}
+interface IArticleResource extends ng.resource.IResource {
+ title: string;
+ text: string;
+ date: Date;
+ author: number;
+ $publish: ng.resource.IActionCall;
+ $unpublish: ng.resource.IActionCall;
+}
+
+function MainController($resource: ng.resource.IResourceService) {
+
+ // IntelliSense will provide IActionDescriptor interface and will validate
+ // your assignment against it
+ var publishDescriptor: ng.resource.IActionDescriptor;
+ publishDescriptor = {
+ method: 'GET',
+ isArray: false
+ };
+
+ // I could still create a descriptor without the interface...
+ var unpublishDescriptor = {
+ method: 'POST'
}
+
+ // A call to the $resource service returns a IResourceClass. Since
+ // our own IArticleResourceClass defines 2 more actions, we cast the return
+ // value to make the compiler aware of that
+ var articles = $resource('/articles/:id', null, {
+ publish : publishDescriptor,
+ unpublish : unpublishDescriptor
+ });
+
+ // Now we can do this
+ articles.unpublish({ id: 1 });
+
+ // IResourceClass.get() will be automatically available here
+ var article = articles.get({id: 1});
+
+ // Again, default + custom action here...
+ article.title = 'New Title';
+ article.$save();
+ article.$publish();
+
+}
+```
diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts
index 2b7c5c438..b223b8171 100644
--- a/angularjs/angular-resource-tests.ts
+++ b/angularjs/angular-resource-tests.ts
@@ -1,5 +1,8 @@
///
+interface IMyResource extends ng.resource.IResource { };
+interface IMyResourceClass extends ng.resource.IResourceClass { };
+
///////////////////////////////////////
// IActionDescriptor
///////////////////////////////////////
@@ -14,9 +17,9 @@ actionDescriptor.params = { key: 'value' };
///////////////////////////////////////
// IResourceClass
///////////////////////////////////////
-var resourceClass: ng.resource.IResourceClass;
-var resource: ng.resource.IResource;
-var resourceArray: ng.resource.IResource[];
+var resourceClass: IMyResourceClass;
+var resource: IMyResource;
+var resourceArray: IMyResource[];
resource = resourceClass.delete();
resource = resourceClass.delete({ key: 'value' });
@@ -63,13 +66,22 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' });
resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { });
resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }, function () { });
+///////////////////////////////////////
+// IResourceService
+///////////////////////////////////////
+var resourceService: ng.resource.IResourceService;
+resourceClass = resourceService('test');
+resourceClass = resourceService('test');
+resourceClass = resourceService('test');
///////////////////////////////////////
// IModule
///////////////////////////////////////
var mod: ng.IModule;
-var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction;
+var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction;
var resourceService: ng.resource.IResourceService;
+resourceClass = resourceServiceFactoryFunction(resourceService);
+
resourceServiceFactoryFunction = function (resourceService) { return resourceClass };
mod = mod.factory('factory name', resourceServiceFactoryFunction);
diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts
index f74f3eb44..f3a8870cd 100644
--- a/angularjs/angular-resource.d.ts
+++ b/angularjs/angular-resource.d.ts
@@ -1,7 +1,6 @@
// Type definitions for Angular JS 1.2 (ngResource module)
// Project: http://angularjs.org
-// Definitions by: Diego Vilar
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
+// Definitions: https://github.com/daptiv/DefinitelyTyped
///
@@ -19,10 +18,19 @@ declare module ng.resource {
// that deeply.
///////////////////////////////////////////////////////////////////////////
interface IResourceService {
+
+ , U extends IResourceClass>(url: string, paramDefaults?: any,
+ /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
+ where deleteDescriptor : IActionDescriptor */
+ actionDescriptors?: any): U;
+ >(url: string, paramDefaults?: any,
+ /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
+ where deleteDescriptor : IActionDescriptor */
+ actionDescriptors?: any): IResourceClass;
(url: string, paramDefaults?: any,
- /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
- where deleteDescriptor : IActionDescriptor */
- actionDescriptors?: any): IResourceClass;
+ /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
+ where deleteDescriptor : IActionDescriptor */
+ actionDescriptors?: any): IResourceClass>;
}
// Just a reference to facilitate describing new actions
@@ -42,65 +50,66 @@ declare module ng.resource {
// PATCH (in other words, methods with body). Otherwise, it's going
// to be considered as parameters to the request.
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465
- interface IResourceClass {
- get(): IResource;
- get(dataOrParams: any): IResource;
- get(dataOrParams: any, success: Function): IResource;
- get(success: Function, error?: Function): IResource;
- get(params: any, data: any, success?: Function, error?: Function): IResource;
- save(): IResource;
- save(dataOrParams: any): IResource;
- save(dataOrParams: any, success: Function): IResource;
- save(success: Function, error?: Function): IResource;
- save(params: any, data: any, success?: Function, error?: Function): IResource;
- query(): IResource[];
- query(dataOrParams: any): IResource[];
- query(dataOrParams: any, success: Function): IResource[];
- query(success: Function, error?: Function): IResource[];
- query(params: any, data: any, success?: Function, error?: Function): IResource[];
- remove(): IResource;
- remove(dataOrParams: any): IResource;
- remove(dataOrParams: any, success: Function): IResource;
- remove(success: Function, error?: Function): IResource;
- remove(params: any, data: any, success?: Function, error?: Function): IResource;
- delete(): IResource;
- delete(dataOrParams: any): IResource;
- delete(dataOrParams: any, success: Function): IResource;
- delete(success: Function, error?: Function): IResource;
- delete(params: any, data: any, success?: Function, error?: Function): IResource;
+ interface IResourceClass> {
+ get(): T;
+ get(dataOrParams: any): T;
+ get(dataOrParams: any, success: Function): T;
+ get(success: Function, error?: Function): T;
+ get(params: any, data: any, success?: Function, error?: Function): T;
+ save(): T;
+ save(dataOrParams: any): T;
+ save(dataOrParams: any, success: Function): T;
+ save(success: Function, error?: Function): T;
+ save(params: any, data: any, success?: Function, error?: Function): T;
+ query(): T[];
+ query(dataOrParams: any): T[];
+ query(dataOrParams: any, success: Function): T[];
+ query(success: Function, error?: Function): T[];
+ query(params: any, data: any, success?: Function, error?: Function): T[];
+ remove(): T;
+ remove(dataOrParams: any): T;
+ remove(dataOrParams: any, success: Function): T;
+ remove(success: Function, error?: Function): T;
+ remove(params: any, data: any, success?: Function, error?: Function): T;
+ delete(): T;
+ delete(dataOrParams: any): T;
+ delete(dataOrParams: any, success: Function): T;
+ delete(success: Function, error?: Function): T;
+ delete(params: any, data: any, success?: Function, error?: Function): T;
}
- interface IResource {
- $get(): IResource;
- $get(dataOrParams: any): IResource;
- $get(dataOrParams: any, success: Function): IResource;
- $get(success: Function, error?: Function): IResource;
- $get(params: any, data: any, success?: Function, error?: Function): IResource;
- $save(): IResource;
- $save(dataOrParams: any): IResource;
- $save(dataOrParams: any, success: Function): IResource;
- $save(success: Function, error?: Function): IResource;
- $save(params: any, data: any, success?: Function, error?: Function): IResource;
- $query(): IResource[];
- $query(dataOrParams: any): IResource[];
- $query(dataOrParams: any, success: Function): IResource[];
- $query(success: Function, error?: Function): IResource[];
- $query(params: any, data: any, success?: Function, error?: Function): IResource[];
- $remove(): IResource;
- $remove(dataOrParams: any): IResource;
- $remove(dataOrParams: any, success: Function): IResource;
- $remove(success: Function, error?: Function): IResource;
- $remove(params: any, data: any, success?: Function, error?: Function): IResource;
- $delete(): IResource;
- $delete(dataOrParams: any): IResource;
- $delete(dataOrParams: any, success: Function): IResource;
- $delete(success: Function, error?: Function): IResource;
- $delete(params: any, data: any, success?: Function, error?: Function): IResource;
+ interface IResource> {
+ $get(): T;
+ $get(dataOrParams: any): T;
+ $get(dataOrParams: any, success: Function): T;
+ $get(success: Function, error?: Function): T;
+ $get(params: any, data: any, success?: Function, error?: Function): T;
+ $save(): T;
+ $save(dataOrParams: any): T;
+ $save(dataOrParams: any, success: Function): T;
+ $save(success: Function, error?: Function): T;
+ $save(params: any, data: any, success?: Function, error?: Function): T;
+ $query(): T[];
+ $query(dataOrParams: any): T[];
+ $query(dataOrParams: any, success: Function): T[];
+ $query(success: Function, error?: Function): T[];
+ $query(params: any, data: any, success?: Function, error?: Function): T[];
+ $remove(): T;
+ $remove(dataOrParams: any): T;
+ $remove(dataOrParams: any, success: Function): T;
+ $remove(success: Function, error?: Function): T;
+ $remove(params: any, data: any, success?: Function, error?: Function): T;
+ $delete(): T;
+ $delete(dataOrParams: any): T;
+ $delete(dataOrParams: any, success: Function): T;
+ $delete(success: Function, error?: Function): T;
+ $delete(params: any, data: any, success?: Function, error?: Function): T;
}
/** when creating a resource factory via IModule.factory */
- interface IResourceServiceFactoryFunction {
- ($resource: ng.resource.IResourceService): ng.resource.IResourceClass;
+ interface IResourceServiceFactoryFunction> {
+ ($resource: ng.resource.IResourceService): IResourceClass;
+ >($resource: ng.resource.IResourceService): U;
}
}
@@ -109,6 +118,6 @@ declare module ng {
interface IModule {
/** creating a resource service factory */
- factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction): IModule;
+ factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction): IModule;
}
}
diff --git a/angularjs/angular-scenario.d.ts b/angularjs/angular-scenario.d.ts
index cdd66edf7..abd5709db 100644
--- a/angularjs/angular-scenario.d.ts
+++ b/angularjs/angular-scenario.d.ts
@@ -3,10 +3,13 @@
// Definitions by: [RomanoLindano]
// Definitions: https://github.com/borisyankov/DefinitelyTyped
-declare module angularScenario {
- export interface AngularModel {
+declare module ng {
+ export interface IAngularStatic {
scenario: any;
}
+}
+
+declare module angularScenario {
export interface RunFunction {
(functionToRun: any): any;
@@ -46,25 +49,25 @@ declare module angularScenario {
reload(): void;
window(): testWindow;
location(): testLocation;
- }
-
+ }
+
export interface Matchers {
toEqual(value: any): void;
- toBe(value: any): void;
- toBeDefined(): void;
- toBeTruthy(): void;
- toBeFalsy(): void;
- toMatch(regularExpression: any): void;
- toBeNull(): void;
+ toBe(value: any): void;
+ toBeDefined(): void;
+ toBeTruthy(): void;
+ toBeFalsy(): void;
+ toMatch(regularExpression: any): void;
+ toBeNull(): void;
toContain(value: any): void;
- toBeLessThan(value: any): void;
- toBeGreaterThan(value: any): void;
+ toBeLessThan(value: any): void;
+ toBeGreaterThan(value: any): void;
}
- export interface CustomMatchers extends Matchers{
+ export interface CustomMatchers extends Matchers {
}
- export interface Expect extends CustomMatchers {
+ export interface Expect extends CustomMatchers {
not(): angularScenario.CustomMatchers;
}
@@ -77,7 +80,7 @@ declare module angularScenario {
}
export interface Input {
- enter(value: any);
+ enter(value: any): any;
check(): any;
select(radioButtonValue: any): any;
val(): Future;
@@ -92,12 +95,12 @@ declare module angularScenario {
export interface Select {
option(value: any): any;
option(...listOfValues: any[]): any;
- }
+ }
export interface Element {
count(): Future;
click(): any;
- query(callback: (selectedDOMElements: any[], callbackWhenDone: (objNull: any, futureValue: any) => any) =>any): any;
+ query(callback: (selectedDOMElements: any[], callbackWhenDone: (objNull: any, futureValue: any) => any) => any): any;
val(): Future;
text(): Future;
html(): Future;
@@ -111,7 +114,7 @@ declare module angularScenario {
scrollLeft(): Future;
scrollTop(): Future;
offset(): Future;
-
+
val(value: any): void;
text(value: any): void;
html(value: any): void;
@@ -154,4 +157,4 @@ declare function input(ngModelBinding: string): angularScenario.Input;
declare function repeater(selector: string, repeaterDescription?: string): angularScenario.Repeater;
declare function select(ngModelBinding: string): angularScenario.Select;
declare function element(selector: string, elementDescription?: string): angularScenario.Element;
-declare var angular: angularScenario.AngularModel;
+declare var angular: ng.IAngularStatic;
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index 3b0599ac4..12742a531 100755
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -127,15 +127,15 @@ declare module ng {
// this is necessary to be able to access the scoped attributes. it's not very elegant
// because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
// this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
- [name: string]: any;
-
- // Adds the CSS class value specified by the classVal parameter to the
- // element. If animations are enabled then an animation will be triggered
+ [name: string]: any;
+
+ // Adds the CSS class value specified by the classVal parameter to the
+ // element. If animations are enabled then an animation will be triggered
// for the class addition.
$addClass(classVal: string): void;
- // Removes the CSS class value specified by the classVal parameter from the
- // element. If animations are enabled then an animation will be triggered for
+ // Removes the CSS class value specified by the classVal parameter from the
+ // element. If animations are enabled then an animation will be triggered for
// the class removal.
$removeClass(classVal: string): void;
@@ -143,12 +143,12 @@ declare module ng {
$set(key: string, value: any): void;
// Observes an interpolated attribute.
- // The observer function will be invoked once during the next $digest
- // following compilation. The observer is then invoked whenever the
+ // The observer function will be invoked once during the next $digest
+ // following compilation. The observer is then invoked whenever the
// interpolated value changes.
$observe(name: string, fn:(value?:any)=>any): Function;
- // A map of DOM element attribute names to the normalized name. This is needed
+ // A map of DOM element attribute names to the normalized name. This is needed
// to do reverse lookup from normalized name back to actual name.
$attr: Object;
}
@@ -451,12 +451,12 @@ declare module ng {
then(successCallback: (promiseValue: T) => IHttpPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
then(successCallback: (promiseValue: T) => IPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
then(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise;
-
-
+
+
catch(onRejected: (reason: any) => IHttpPromise): IPromise;
catch(onRejected: (reason: any) => IPromise): IPromise;
catch(onRejected: (reason: any) => TResult): IPromise;
-
+
finally(finallyCallback: ()=>any):IPromise;
}
@@ -700,7 +700,7 @@ declare module ng {
valueOf(value: any): any;
}
-
+
///////////////////////////////////////////////////////////////////////////
// SCEDelegateProvider
// see http://docs.angularjs.org/api/ng.$sceDelegateProvider
@@ -709,7 +709,7 @@ declare module ng {
resourceUrlBlacklist(blacklist: any[]): void;
resourceUrlWhitelist(whitelist: any[]): void;
}
-
+
///////////////////////////////////////////////////////////////////////////
// Directive
// see http://docs.angularjs.org/api/ng.$compileProvider#directive
@@ -793,6 +793,7 @@ declare module ng {
annotate(inlineAnnotadedFunction: any[]): string[];
get (name: string): any;
instantiate(typeConstructor: Function, locals?: any): any;
+ invoke(inlineAnnotadedFunction: any[]): any;
invoke(func: Function, context?: any, locals?: any): any;
}
diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts
index e05150c64..cdcd145c2 100644
--- a/backbone/backbone.d.ts
+++ b/backbone/backbone.d.ts
@@ -10,7 +10,7 @@
declare module Backbone {
interface AddOptions extends Silenceable {
- at: number;
+ at?: number;
}
interface HistoryOptions extends Silenceable {
@@ -19,7 +19,7 @@ declare module Backbone {
}
interface NavigateOptions {
- trigger: boolean;
+ trigger?: boolean;
}
interface RouterOptions {
@@ -158,7 +158,9 @@ declare module Backbone {
comparator(compare: Model, to?: Model): any;
add(model: Model, options?: AddOptions): Collection;
+ add(model: any, options?: AddOptions): Collection;
add(models: Model[], options?: AddOptions): Collection;
+ add(models: any[], options?: AddOptions): Collection;
at(index: number): Model;
get(id: any): Model;
create(attributes: any, options?: ModelSaveOptions): Model;
@@ -168,6 +170,7 @@ declare module Backbone {
remove(model: Model, options?: Silenceable): Model;
remove(models: Model[], options?: Silenceable): Model[];
reset(models?: Model[], options?: Silenceable): Model[];
+ reset(models?: any[], options?: Silenceable): Model[];
shift(options?: Silenceable): Model;
sort(options?: Silenceable): Collection;
unshift(model: Model, options?: AddOptions): Model;
diff --git a/chartjs/dx.chartjs-tests.tscparams b/chartjs/dx.chartjs-tests.tscparams
deleted file mode 100644
index 3cc762b55..000000000
--- a/chartjs/dx.chartjs-tests.tscparams
+++ /dev/null
@@ -1 +0,0 @@
-""
\ No newline at end of file
diff --git a/chartjs/dx.chartjs.d.ts b/chartjs/dx.chartjs.d.ts
index 13a2e8bc2..7c961da9e 100644
--- a/chartjs/dx.chartjs.d.ts
+++ b/chartjs/dx.chartjs.d.ts
@@ -208,7 +208,7 @@ declare module DevExpress.data {
}
export interface StoreOptions {
key?: any;
- errorHandler: ErrorHandler;
+ errorHandler?: ErrorHandler;
loaded?: JQueryCallback;
loading?: JQueryCallback;
modified?: JQueryCallback;
@@ -294,14 +294,6 @@ declare module DevExpress.data {
export class ODataStore extends Store {
constructor(options?: ODataStoreOptions);
}
- interface IODataContextBase {
- get(operationName: string, params: { [key: string]: any }): JQueryDeferred>;
- invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>;
- objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }
- }
- interface IODataContext extends IODataContextBase {
- [entitySetName: string]: Store;
- }
export interface ODataContextOptions {
url: string;
jsonp?: boolean;
@@ -310,11 +302,11 @@ declare module DevExpress.data {
beforeSend?: () => any;
entities?: Array;
}
- export class ODataContext implements IODataContextBase {
+ export class ODataContext {
constructor(options?: ODataContextOptions);
get(operationName: string, params: { [key: string]: any }): JQueryDeferred>;
invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryDeferred>;
- objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }
+ objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; };
}
}
declare module DevExpress.ui {
@@ -1030,7 +1022,12 @@ declare module DevExpress.viz.charts.series {
hoverStyle?: AreaSeriesStyle;
point?: BasePointOptions;
}
- export interface RangeBarSeriesOptions extends z_BaseRangeSeriesOptions, z_BaseBarSeriesOptions { }
+ export interface RangeBarSeriesOptions extends z_BaseBarSeriesOptions {
+ rangeValue1Field?: string;
+ rangeValue2Field?: string;
+ pane?: string;
+ axis?: string;
+ }
export interface SplineSeriesOptions extends LineSeriesOptions { }
export interface SplineAreaSeries extends AreaSeriesOptions { }
export interface StackedLineSeries extends LineSeriesOptions { }
@@ -1373,8 +1370,8 @@ declare module DevExpress.viz.map {
borderColor?: string;
color?: string;
};
- dataSource?: any;
- area?: {
+ mapData?: any;
+ areaSettings?: {
borderColor?: string;
color?: string;
hoveredBorderColor?: string;
@@ -1389,8 +1386,8 @@ declare module DevExpress.viz.map {
click?: (arg: Proxy) => void;
selectionChanged?: (arg: Proxy) => void;
};
- markerDataSource?: any;
- marker?: {
+ markers?: any;
+ markerSettings?: {
borderColor?: string;
color?: string;
hoveredBorderColor?: string;
@@ -1448,7 +1445,7 @@ declare module DevExpress.viz.map {
}
export class Proxy {
type: string;
- attr(name: string): any;
+ attribute(name: string): any;
selected(state: boolean): void;
selected(): boolean;
}
diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts
index 03dc2878f..97568dbdc 100644
--- a/codemirror/codemirror.d.ts
+++ b/codemirror/codemirror.d.ts
@@ -10,77 +10,77 @@ declare module CodeMirror {
/** If you want to define extra methods in terms of the CodeMirror API, it is possible to use defineExtension.
This will cause the given value(usually a method) to be added to all CodeMirror instances created from then on. */
- function defineExtension(name: string, value: any);
+ function defineExtension(name: string, value: any): void;
/** Like defineExtension, but the method will be added to the interface for Doc objects instead. */
- function defineDocExtension(name: string, value: any);
+ function defineDocExtension(name: string, value: any): void;
/** Similarly, defineOption can be used to define new options for CodeMirror.
The updateFunc will be called with the editor instance and the new value when an editor is initialized,
and whenever the option is modified through setOption. */
- function defineOption(name: string, default_: any, updateFunc: Function);
+ function defineOption(name: string, default_: any, updateFunc: Function): void;
/** If your extention just needs to run some code whenever a CodeMirror instance is initialized, use CodeMirror.defineInitHook.
Give it a function as its only argument, and from then on, that function will be called (with the instance as argument)
whenever a new CodeMirror instance is initialized. */
- function defineInitHook(func: Function);
+ function defineInitHook(func: Function): void;
- function on(element: any, eventName: string, handler: Function);
- function off(element: any, eventName: string, handler: Function);
+ function on(element: any, eventName: string, handler: Function): void;
+ function off(element: any, eventName: string, handler: Function): void;
/** Fired whenever a change occurs to the document. changeObj has a similar type as the object passed to the editor's "change" event,
but it never has a next property, because document change events are not batched (whereas editor change events are). */
- function on(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void );
- function off(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void );
+ function on(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void ): void;
+ function off(doc: Doc, eventName: 'change', handler: (instance: Doc, change: EditorChange) => void ): void;
/** See the description of the same event on editor instances. */
- function on(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void );
- function off(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void );
+ function on(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void ): void;
+ function off(doc: Doc, eventName: 'beforeChange', handler: (instance: Doc, change: EditorChangeCancellable) => void ): void;
/** Fired whenever the cursor or selection in this document changes. */
- function on(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void );
- function off(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void );
+ function on(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void;
+ function off(doc: Doc, eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void;
/** Equivalent to the event by the same name as fired on editor instances. */
- function on(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void );
- function off(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void );
+ function on(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void ): void;
+ function off(doc: Doc, eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: Position; anchor: Position; }) => void ): void;
/** Will be fired when the line object is deleted. A line object is associated with the start of the line.
Mostly useful when you need to find out when your gutter markers on a given line are removed. */
- function on(line: LineHandle, eventName: 'delete', handler: () => void );
- function off(line: LineHandle, eventName: 'delete', handler: () => void );
+ function on(line: LineHandle, eventName: 'delete', handler: () => void ): void;
+ function off(line: LineHandle, eventName: 'delete', handler: () => void ): void;
/** Fires when the line's text content is changed in any way (but the line is not deleted outright).
The change object is similar to the one passed to change event on the editor object. */
- function on(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void );
- function off(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void );
+ function on(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void ): void;
+ function off(line: LineHandle, eventName: 'change', handler: (line: LineHandle, change: EditorChange) => void ): void;
/** Fired when the cursor enters the marked range. From this event handler, the editor state may be inspected but not modified,
with the exception that the range on which the event fires may be cleared. */
- function on(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void );
- function off(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void );
+ function on(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void ): void;
+ function off(marker: TextMarker, eventName: 'beforeCursorEnter', handler: () => void ): void;
/** Fired when the range is cleared, either through cursor movement in combination with clearOnEnter or through a call to its clear() method.
Will only be fired once per handle. Note that deleting the range through text editing does not fire this event,
because an undo action might bring the range back into existence. */
- function on(marker: TextMarker, eventName: 'clear', handler: () => void );
- function off(marker: TextMarker, eventName: 'clear', handler: () => void );
+ function on(marker: TextMarker, eventName: 'clear', handler: () => void ): void;
+ function off(marker: TextMarker, eventName: 'clear', handler: () => void ): void;
/** Fired when the last part of the marker is removed from the document by editing operations. */
- function on(marker: TextMarker, eventName: 'hide', handler: () => void );
- function off(marker: TextMarker, eventName: 'hide', handler: () => void );
+ function on(marker: TextMarker, eventName: 'hide', handler: () => void ): void;
+ function off(marker: TextMarker, eventName: 'hide', handler: () => void ): void;
/** Fired when, after the marker was removed by editing, a undo operation brought the marker back. */
- function on(marker: TextMarker, eventName: 'unhide', handler: () => void );
- function off(marker: TextMarker, eventName: 'unhide', handler: () => void );
+ function on(marker: TextMarker, eventName: 'unhide', handler: () => void ): void;
+ function off(marker: TextMarker, eventName: 'unhide', handler: () => void ): void;
/** Fired whenever the editor re-adds the widget to the DOM. This will happen once right after the widget is added (if it is scrolled into view),
and then again whenever it is scrolled out of view and back in again, or when changes to the editor options
or the line the widget is on require the widget to be redrawn. */
- function on(line: LineWidget, eventName: 'redraw', handler: () => void );
- function off(line: LineWidget, eventName: 'redraw', handler: () => void );
+ function on(line: LineWidget, eventName: 'redraw', handler: () => void ): void;
+ function off(line: LineWidget, eventName: 'redraw', handler: () => void ): void;
interface Editor {
@@ -100,7 +100,7 @@ declare module CodeMirror {
/** Change the configuration of the editor. option should the name of an option, and value should be a valid value for that option. */
- setOption(option: string, value: any);
+ setOption(option: string, value: any): void;
/** Retrieves the current value of the given option for this editor instance. */
getOption(option: string): any;
@@ -110,21 +110,21 @@ declare module CodeMirror {
Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them,
the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed,
in which case they end up below other keymaps added with this method. */
- addKeyMap(map: any, bottom?: boolean);
+ addKeyMap(map: any, bottom?: boolean): void;
/** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string,
which will be compared against the name property of the active keymaps. */
- removeKeyMap(map: any);
+ removeKeyMap(map: any): void;
/** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting.
For example, the search add - on uses it to highlight the term that's currently being searched.
mode can be a mode spec or a mode object (an object with a token method). The options parameter is optional. If given, it should be an object.
Currently, only the opaque option is recognized. This defaults to off, but can be given to allow the overlay styling, when not null,
to override the styling of the base mode entirely, instead of the two being applied together. */
- addOverlay(mode: any, options?: any);
+ addOverlay(mode: any, options?: any): void;
/** Pass this the exact argument passed for the mode parameter to addOverlay to remove an overlay again. */
- removeOverlay(mode: any);
+ removeOverlay(mode: any): void;
/** Retrieve the currently active document from an editor. */
@@ -140,7 +140,7 @@ declare module CodeMirror {
setGutterMarker(line: any, gutterID: string, value: HTMLElement): CodeMirror.LineHandle;
/** Remove all gutter markers in the gutter with the given ID. */
- clearGutter(gutterID: string);
+ clearGutter(gutterID: string): void;
/** Set a CSS class name for the given line.line can be a number or a line handle.
where determines to which element this class should be applied, can can be one of "text" (the text element, which lies in front of the selection),
@@ -171,7 +171,7 @@ declare module CodeMirror {
/** Puts node, which should be an absolutely positioned DOM node, into the editor, positioned right below the given { line , ch } position.
When scrollIntoView is true, the editor will ensure that the entire node is visible (if possible).
To remove the widget again, simply use DOM methods (move it somewhere else, or call removeChild on its parent). */
- addWidget(pos: CodeMirror.Position, node: HTMLElement, scrollIntoView: boolean);
+ addWidget(pos: CodeMirror.Position, node: HTMLElement, scrollIntoView: boolean): void;
/** Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards.
line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line.
@@ -192,10 +192,10 @@ declare module CodeMirror {
/** Programatically set the size of the editor (overriding the applicable CSS rules).
width and height height can be either numbers(interpreted as pixels) or CSS units ("100%", for example).
You can pass null for either of them to indicate that that dimension should not be changed. */
- setSize(width: any, height: any);
+ setSize(width: any, height: any): void;
/** Scroll the editor to a given(pixel) position.Both arguments may be left as null or undefined to have no effect. */
- scrollTo(x: number, y: number);
+ scrollTo(x: number, y: number): void;
/** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area,
and the size of the visible area(minus scrollbars). */
@@ -210,11 +210,11 @@ declare module CodeMirror {
/** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
- scrollIntoView(pos: CodeMirror.Position, margin?: number);
+ scrollIntoView(pos: CodeMirror.Position, margin?: number): void;
/** Scrolls the given element into view. pos is a { left , top , right , bottom } object, in editor-local coordinates.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
- scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number);
+ scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number): void;
/** Returns an { left , top , bottom } object containing the coordinates of the cursor position.
If mode is "local" , they will be relative to the top-left corner of the editable document.
@@ -251,7 +251,7 @@ declare module CodeMirror {
/** If your code does something to change the size of the editor element (window resizes are already listened for), or unhides it,
you should probably follow up by calling this method to ensure CodeMirror is still looking as intended. */
- refresh();
+ refresh(): void;
/** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */
@@ -285,11 +285,11 @@ declare module CodeMirror {
"smart" Use the mode's smart indentation if available, behave like "prev" otherwise.
"add" Increase the indentation of the line by one indent unit.
"subtract" Reduce the indentation of the line. */
- indentLine(line: number, dir?: string);
+ indentLine(line: number, dir?: string): void;
/** Give the editor focus. */
- focus();
+ focus(): void;
/** Returns the hidden textarea used to read input. */
getInputField(): HTMLTextAreaElement;
@@ -308,61 +308,61 @@ declare module CodeMirror {
/** Events are registered with the on method (and removed with the off method).
These are the events that fire on the instance object. The name of the event is followed by the arguments that will be passed to the handler.
The instance argument always refers to the editor instance. */
- on(eventName: string, handler: (instance: CodeMirror.Editor) => void );
- off(eventName: string, handler: (instance: CodeMirror.Editor) => void );
+ on(eventName: string, handler: (instance: CodeMirror.Editor) => void ): void;
+ off(eventName: string, handler: (instance: CodeMirror.Editor) => void ): void;
/** Fires every time the content of the editor is changed. */
- on(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void );
- off(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void );
+ on(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void;
+ off(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void;
/** This event is fired before a change is applied, and its handler may choose to modify or cancel the change.
The changeObj never has a next property, since this is fired for each individual change, and not batched per operation.
Note: you may not do anything from a "beforeChange" handler that would cause changes to the document or its visualization.
Doing so will, since this handler is called directly from the bowels of the CodeMirror implementation,
probably cause the editor to become corrupted. */
- on(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void );
- off(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void );
+ on(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ): void;
+ off(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ): void;
/** Will be fired when the cursor or selection moves, or any change is made to the editor content. */
- on(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void );
- off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void );
+ on(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void;
+ off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void;
/** This event is fired before the selection is moved. Its handler may modify the resulting selection head and anchor.
Handlers for this event have the same restriction as "beforeChange" handlers � they should not do anything to directly update the state of the editor. */
- on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void );
- off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void );
+ on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void;
+ off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void;
/** Fires whenever the view port of the editor changes (due to scrolling, editing, or any other factor).
The from and to arguments give the new start and end of the viewport. */
- on(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void );
- off(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void );
+ on(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ): void;
+ off(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ): void;
/** Fires when the editor gutter (the line-number area) is clicked. Will pass the editor instance as first argument,
the (zero-based) number of the line that was clicked as second argument, the CSS class of the gutter that was clicked as third argument,
and the raw mousedown event object as fourth argument. */
- on(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void );
- off(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void );
+ on(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ): void;
+ off(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ): void;
/** Fires whenever the editor is focused. */
- on(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void );
- off(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void );
+ on(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ): void;
+ off(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ): void;
/** Fires whenever the editor is unfocused. */
- on(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void );
- off(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void );
+ on(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ): void;
+ off(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ): void;
/** Fires when the editor is scrolled. */
- on(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void );
- off(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void );
+ on(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ): void;
+ off(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ): void;
/** Will be fired whenever CodeMirror updates its DOM display. */
- on(eventName: 'update', handler: (instance: CodeMirror.Editor) => void );
- off(eventName: 'update', handler: (instance: CodeMirror.Editor) => void );
+ on(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ): void;
+ off(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ): void;
/** Fired whenever a line is (re-)rendered to the DOM. Fired right after the DOM element is built, before it is added to the document.
The handler may mess with the style of the resulting element, or add event handlers, but should not try to change the state of the editor. */
- on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void );
- off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void );
+ on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
+ off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
}
class Doc {
@@ -372,7 +372,7 @@ declare module CodeMirror {
getValue(seperator?: string): string;
/** Set the editor content. */
- setValue(content: string);
+ setValue(content: string): void;
/** Get the text between the given points in the editor, which should be {line, ch} objects.
An optional third argument can be given to indicate the line separator string to use (defaults to "\n"). */
@@ -380,16 +380,16 @@ declare module CodeMirror {
/** Replace the part of the document between from and to with the given string.
from and to must be {line, ch} objects. to can be left off to simply insert the string at position from. */
- replaceRange(replacement: string, from: CodeMirror.Position, to: CodeMirror.Position);
+ replaceRange(replacement: string, from: CodeMirror.Position, to: CodeMirror.Position): void;
/** Get the content of line n. */
getLine(n: number): string;
/** Set the content of line n. */
- setLine(n: number, text: string);
+ setLine(n: number, text: string): void;
/** Remove the given line from the document. */
- removeLine(n: number);
+ removeLine(n: number): void;
/** Get the number of lines in the editor. */
lineCount(): number;
@@ -410,16 +410,16 @@ declare module CodeMirror {
/** Iterate over the whole document, and call f for each line, passing the line handle.
This is a faster way to visit a range of line handlers than calling getLineHandle for each of them.
Note that line handles have a text property containing the line's content (as a string). */
- eachLine(f: (line: CodeMirror.LineHandle) => void );
+ eachLine(f: (line: CodeMirror.LineHandle) => void ): void;
/** Iterate over the range from start up to (not including) end, and call f for each line, passing the line handle.
This is a faster way to visit a range of line handlers than calling getLineHandle for each of them.
Note that line handles have a text property containing the line's content (as a string). */
- eachLine(start: number, end: number, f: (line: CodeMirror.LineHandle) => void );
+ eachLine(start: number, end: number, f: (line: CodeMirror.LineHandle) => void ): void;
/** Set the editor content as 'clean', a flag that it will retain until it is edited, and which will be set again when such an edit is undone again.
Useful to track whether the content needs to be saved. */
- markClean();
+ markClean(): void;
/** Returns whether the document is currently clean (not modified since initialization or the last call to markClean). */
isClean(): boolean;
@@ -431,7 +431,7 @@ declare module CodeMirror {
/** Replace the selection with the given string. By default, the new selection will span the inserted text.
The optional collapse argument can be used to change this � passing "start" or "end" will collapse the selection to the start or end of the inserted text. */
- replaceSelection(replacement: string, collapse?: string)
+ replaceSelection(replacement: string, collapse?: string): void;
/** start is a an optional string indicating which end of the selection to return.
It may be "start" , "end" , "head"(the side of the selection that moves when you press shift + arrow),
@@ -442,20 +442,20 @@ declare module CodeMirror {
somethingSelected(): boolean;
/** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */
- setCursor(pos: CodeMirror.Position);
+ setCursor(pos: CodeMirror.Position): void;
/** Set the selection range.anchor and head should be { line , ch } objects.head defaults to anchor when not given. */
- setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position);
+ setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position): void;
/** Similar to setSelection , but will, if shift is held or the extending flag is set,
move the head of the selection while leaving the anchor at its current place.
pos2 is optional , and can be passed to ensure a region (for example a word or paragraph) will end up selected
(in addition to whatever lies between that region and the current anchor). */
- extendSelection(from: CodeMirror.Position, to?: CodeMirror.Position);
+ extendSelection(from: CodeMirror.Position, to?: CodeMirror.Position): void;
/** Sets or clears the 'extending' flag , which acts similar to the shift key,
in that it will cause cursor movement and calls to extendSelection to leave the selection anchor in place. */
- setExtending(value: boolean);
+ setExtending(value: boolean): void;
/** Retrieve the editor associated with a document. May return null. */
@@ -481,30 +481,30 @@ declare module CodeMirror {
/** Break the link between two documents. After calling this , changes will no longer propagate between the documents,
and, if they had a shared history, the history will become separate. */
- unlinkDoc(doc: CodeMirror.Doc);
+ unlinkDoc(doc: CodeMirror.Doc): void;
/** Will call the given function for all documents linked to the target document. It will be passed two arguments,
the linked document and a boolean indicating whether that document shares history with the target. */
- iterLinkedDocs(fn: (doc: CodeMirror.Doc, sharedHist: boolean) => void );
+ iterLinkedDocs(fn: (doc: CodeMirror.Doc, sharedHist: boolean) => void ): void;
/** Undo one edit (if any undo events are stored). */
- undo();
+ undo(): void;
/** Redo one undone edit. */
- redo();
+ redo(): void;
/** Returns an object with {undo, redo } properties , both of which hold integers , indicating the amount of stored undo and redo operations. */
historySize(): { undo: number; redo: number; };
/** Clears the editor's undo history. */
- clearHistory();
+ clearHistory(): void;
/** Get a(JSON - serializeable) representation of the undo history. */
getHistory(): any;
/** Replace the editor's undo history with the one provided, which must be a value as returned by getHistory.
Note that this will have entirely undefined results if the editor content isn't also the same as it was when getHistory was called. */
- setHistory(history: any);
+ setHistory(history: any): void;
/** Can be used to mark a range of text with a specific CSS class name. from and to should be { line , ch } objects. */
@@ -548,7 +548,7 @@ declare module CodeMirror {
interface TextMarker {
/** Remove the mark. */
- clear();
+ clear(): void;
/** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range,
or undefined if the marker is no longer in the document. */
@@ -564,7 +564,7 @@ declare module CodeMirror {
/** Call this if you made some change to the widget's DOM node that might affect its height.
It'll force CodeMirror to update the height of the line that contains the widget. */
- changed();
+ changed(): void;
}
interface EditorChange {
@@ -585,9 +585,9 @@ declare module CodeMirror {
interface EditorChangeCancellable extends CodeMirror.EditorChange {
/** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */
- update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string);
+ update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string): void;
- cancel();
+ cancel(): void;
}
interface Position {
diff --git a/ember/ember-tests.ts b/ember/ember-tests.ts
index eaf0bff05..254e1682c 100644
--- a/ember/ember-tests.ts
+++ b/ember/ember-tests.ts
@@ -1,20 +1,21 @@
///
///
+
var App;
App = Em.Application.create();
App.president = Em.Object.create({
- name: "Barack Obama"
+ name: 'Barack Obama'
});
App.country = Em.Object.create({
presidentNameBinding: 'MyApp.president.name'
});
App.country.get('presidentName');
App.president = Em.Object.create({
- firstName: "Barack",
- lastName: "Obama",
+ firstName: 'Barack',
+ lastName: 'Obama',
fullName: function () {
return this.get('firstName') + ' ' + this.get('lastName');
}.property()
@@ -24,47 +25,51 @@ App.president.get('fullName');
declare class MyPerson extends Em.Object {
static createMan(): MyPerson;
}
-var Person = Em.Object.extend({
+
+var Person1 = Em.Object.extend({
say: (thing) => {
alert(thing);
}
});
+
declare class MyPerson2 extends Em.Object {
helloWorld(): void;
}
-var tom = Person.create({
- name: "Tom Dale",
- helloWorld: () => {
- this.say("Hi my name is " + this.get('name'));
+var tom = Person1.create({
+ name: 'Tom Dale',
+ helloWorld: function() {
+ this.say('Hi my name is ' + this.get('name'));
}
});
tom.helloWorld();
-Person.reopen({ isPerson: true });
-Person.create().get('isPerson');
+Person1.reopen({ isPerson: true });
+Person1.create().get('isPerson');
-Person.reopenClass({
+Person1.reopenClass({
createMan: () => {
- return Person.create({ isMan: true })
+ return Person1.create({ isMan: true });
}
});
-Person.createMan().get('isMan');
+// ReSharper disable once DuplicatingLocalDeclaration
+declare var Person1: typeof MyPerson;
+Person1.createMan().get('isMan');
-var person = Person.create({
- firstName: "Yehuda",
- lastName: "Katz"
+var person = Person1.create({
+ firstName: 'Yehuda',
+ lastName: 'Katz'
});
-person.addObserver('fullName', () => { });
-person.set('firstName', "Brohuda");
+person.addObserver('fullName', null, () => { });
+person.set('firstName', 'Brohuda');
App.todosController = Em.Object.create({
todos: [
Em.Object.create({ isDone: false })
],
- remaining: () => {
+ remaining: (function() {
var todos = this.get('todos');
return todos.filterProperty('isDone', false).get('length');
- }.property('todos.@each.isDone')
+ }).property('todos.@each.isDone')
});
var todos = App.todosController.get('todos');
@@ -86,29 +91,29 @@ App.husband.set('householdIncome', 90000);
App.wife.get('householdIncome');
App.user = Em.Object.create({
- fullName: "Kara Gates"
+ fullName: 'Kara Gates'
});
App.userView = Em.View.create({
userNameBinding: Em.Binding.oneWay('App.user.fullName')
});
-App.user.set('fullName', "Krang Gates");
-App.userView.set('userName', "Truckasaurus Gates");
+App.user.set('fullName', 'Krang Gates');
+App.userView.set('userName', 'Truckasaurus Gates');
App.user.get('fullName');
App = Em.Application.create({
rootElement: '#sidebar'
});
-var view = Em.View.create({
+var view = Em.View.create({
templateName: 'say-hello',
- name: "Bob"
+ name: 'Bob'
});
view.appendTo('#container');
view.append();
view.remove();
App.AlertView = Em.View.extend({
- priority: "p4",
+ priority: 'p4',
isUrgent: true
});
@@ -121,21 +126,21 @@ App.ListingView = Em.View.extend({
App.userController = Em.Object.create({
content: Em.Object.create({
- firstName: "Albert",
- lastName: "Hofmann",
+ firstName: 'Albert',
+ lastName: 'Hofmann',
posts: 25,
- hobbies: "Riding bicycles"
+ hobbies: 'Riding bicycles'
})
});
-Handlebars.registerHelper('highlight', (property, options) => {
+Handlebars.registerHelper('highlight', function(property, options) {
var value = Em.Handlebars.get(this, property, options);
return new Handlebars.SafeString('' + value + '');
});
App.MyText = Em.TextField.extend({
formBlurredBinding: 'App.adminController.formBlurred',
- change: (evt) => {
+ change: function() {
this.set('formBlurred', true);
}
});
@@ -145,26 +150,26 @@ var textArea = Em.TextArea.create({
});
App.ClickableView = Em.View.extend({
- click: (evt) => {
- alert("ClickableView was clicked!");
+ click: () => {
+ alert('ClickableView was clicked!');
}
});
-var container = Em.ContainerView.create();
+var container = Em.ContainerView.create();
container.append();
var coolView = App.CoolView.create(),
childViews = container.get('childViews');
childViews.pushObject(coolView);
-Person = Em.Object.extend({
- sayHello: () => {
- console.log("Hello from " + this.get('name'));
+var Person2 = Em.Object.extend({
+ sayHello: function() {
+ console.log('Hello from ' + this.get('name'));
}
});
var people = [
- Person.create({ name: "Juan" }),
- Person.create({ name: "Charles" }),
- Person.create({ name: "Majd" })
+ Person2.create({ name: 'Juan' }),
+ Person2.create({ name: 'Charles' }),
+ Person2.create({ name: 'Majd' })
];
people.invoke('sayHello');
@@ -172,19 +177,19 @@ var arr = [Em.Object.create(), Em.Object.create()];
arr.setEach('name', 'unknown');
arr.getEach('name');
-Person = Em.Object.extend({
+var Person3 = Em.Object.extend({
name: null,
isHappy: false
});
var people2 = [
- Person.create({ name: 'Yehuda', isHappy: true }),
- Person.create({ name: 'Majd', isHappy: false })
+ Person3.create({ name: 'Yehuda', isHappy: true }),
+ Person3.create({ name: 'Majd', isHappy: false })
];
-people2.every((person, index, self) => {
- if (person.get('isHappy')) { return true; }
+people2.every((person: Em.Object) => {
+ return !!person.get('isHappy');
});
-people2.some((person, index, self) => {
- if (person.get('isHappy')) { return true; }
+people2.some((person: Em.Object) => {
+ return !!person.get('isHappy');
});
people2.everyProperty('isHappy', true);
people2.someProperty('isHappy', true);
diff --git a/ember/ember.d.ts b/ember/ember.d.ts
index 574bb3b9f..4657ac5cb 100644
--- a/ember/ember.d.ts
+++ b/ember/ember.d.ts
@@ -6,6 +6,7 @@
///
///
+declare var Handlebars: HandlebarsStatic;
declare module EmberStates {
@@ -50,7 +51,7 @@ interface String {
dasherize(): string;
decamelize(): string;
fmt(...string): string;
- htmlSafe(): Handlebars.SafeString;
+ htmlSafe(): typeof Handlebars.SafeString;
loc(...string): string;
underscore(): string;
w(): string[];
@@ -58,14 +59,13 @@ interface String {
interface Array {
constructor(arr: any[]);
- constructor(arr: Array);
activate(): void;
- addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): Array;
- addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Array;
+ addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
+ addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Array;
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Array;
+ arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
+ arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: any): boolean;
clear(): any[];
compact(): any[];
@@ -78,10 +78,10 @@ interface Array {
enumerableContentDidChange(removing: Ember.Enumerable, adding: number);
enumerableContentDidChange(removing: number, adding: Ember.Enumerable);
enumerableContentDidChange(removing: Ember.Enumerable, adding: Ember.Enumerable);
- enumerableContentWillChange(removing: number, adding: number): Array;
- enumerableContentWillChange(removing: Ember.Enumerable, adding: number): Array;
- enumerableContentWillChange(removing: number, adding: Ember.Enumerable): Array;
- enumerableContentWillChange(removing: Ember.Enumerable, adding: Ember.Enumerable): Array;
+ enumerableContentWillChange(removing: number, adding: number): any[];
+ enumerableContentWillChange(removing: Ember.Enumerable, adding: number): any[];
+ enumerableContentWillChange(removing: number, adding: Ember.Enumerable): any[];
+ enumerableContentWillChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any[];
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: any): boolean;
@@ -92,7 +92,7 @@ interface Array {
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
- insertAt(idx: number, object: any): Array;
+ insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...any): any[];
lastIndexOf(object: any, startAt: number): number;
mapBy(key: string): any[];
@@ -101,56 +101,56 @@ interface Array {
objectsAt(...number): any[];
popObject(): any;
pushObject(obj: any): any;
- pushObjects(...any): Array;
+ pushObjects(...any): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
- removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): Array;
+ removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
- removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Array;
+ removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
replace(idx: number, amt: number, objects: any[]);
- reverseObjects(): Array;
+ reverseObjects(): any[];
setEach(key: string, value?: any): any;
- setObjects(objects: any[]): Array;
+ setObjects(objects: any[]): any[];
shiftObject(): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
- uniq(): Array;
+ uniq(): any[];
unshiftObject(object: any): any;
- unshiftObjects(objects: any[]): Array;
- without(value: any): Array;
- '[]': Array;
+ unshiftObjects(objects: any[]): any[];
+ without(value: any): any[];
+ '[]': any[];
'@each': Ember.EachProxy;
Boolean: boolean;
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
addObject(object: any): any;
- addObjects(objects: Ember.Enumerable): Array;
+ addObjects(objects: Ember.Enumerable): any[];
removeObject(object: any): any;
- removeObjects(objects: Ember.Enumerable): Array;
+ removeObjects(objects: Ember.Enumerable): any[];
addObserver: ModifyObserver;
- beginPropertyChanges(): Array;
+ beginPropertyChanges(): any[];
cacheFor(keyName: string): any;
decrementProperty(keyName: string, decrement?: number): number;
- endPropertyChanges(): Array;
+ endPropertyChanges(): any[];
get(keyName: string): any;
getProperties(...string): {};
getProperties(keys: string[]): {};
getWithDefault(keyName: string, defaultValue: any): any;
hasObserverFor(key: string): boolean;
incrementProperty(keyName: string, increment?: number): number;
- notifyPropertyChange(keyName: string): Array;
- propertyDidChange(keyName: string): Array;
- propertyWillChange(keyName: string): Array;
+ notifyPropertyChange(keyName: string): any[];
+ propertyDidChange(keyName: string): any[];
+ propertyWillChange(keyName: string): any[];
removeObserver(key: string, target: any, method: string): Ember.Observable;
removeObserver(key: string, target: any, method: Function): Ember.Observable;
- set(keyName: string, value: any): Array;
- setProperties(hash: {}): Array;
+ set(keyName: string, value: any): any[];
+ setProperties(hash: {}): any[];
toggleProperty(keyName: string): any;
- copy(deep: boolean): Array;
- frozenCopy(): Array;
+ copy(deep: boolean): any[];
+ frozenCopy(): any[];
}
interface ApplicationCreateArguments {
@@ -189,20 +189,6 @@ interface CoreObjectArguments {
willDestroy?: Function;
}
-interface ClassMixin {
- extend(arguments?: {}): T;
- create(arguments?: {}): T;
- createWithMixins(arguments?: {}): T;
- detect(obj: any): boolean;
- detectInstance(obj: any): boolean;
- eachComputedProperty(callback: Function, binding: {}): void;
- metaForProperty(key: string): {};
- reopen(arguments?: {}): T;
- reopenClass(arguments?: {}): T;
- isClass: boolean;
- isMethod: boolean;
-}
-
interface EnumerableConfigurationOptions {
willChange? ;
didChange? ;
@@ -254,6 +240,7 @@ declare module Ember {
/**
Alias for jQuery.
**/
+ // ReSharper disable once DuplicatingLocalDeclaration
var $: JQueryStatic;
/**
Creates an Ember.NativeArray from an Array like object. Does not modify the original object.
@@ -266,20 +253,7 @@ declare module Ember {
An instance of Ember.Application is the starting point for every Ember application. It helps to
instantiate, initialize and coordinate the many objects that make up your app.
**/
- class Application extends Namespace implements ClassMixin {
- /**
- Creates a subclass of the Application class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: ApplicationCreateArguments): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: ApplicationCreateArguments): T;
+ class Application extends Namespace {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -292,17 +266,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
static initializer(arguments?: ApplicationInitializerArguments): void;
@@ -389,12 +352,12 @@ declare module Ember {
Array class as well as other controllers, etc. that want to appear to be arrays.
**/
class Array implements Enumerable {
- addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): Array;
+ addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Array;
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Array;
+ arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
+ arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: string): boolean;
compact(): any[];
contains(obj: any): boolean;
@@ -430,7 +393,7 @@ declare module Ember {
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
- removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): Array;
+ removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
setEach(key: string, value?: any): any;
slice(beginIndex?: number, endIndex?: number): any[];
@@ -440,7 +403,7 @@ declare module Ember {
without(value: any): Enumerable;
'@each': EachProxy;
Boolean: boolean;
- '[]': Array;
+ '[]': any[];
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
@@ -450,20 +413,7 @@ declare module Ember {
Provides a way for you to publish a collection of objects so that you can easily bind to the
collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers.
**/
- class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin, ClassMixin {
- /**
- Creates a subclass of the ArrayController class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -476,17 +426,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
lookupItemController(object: any): string;
@@ -514,20 +453,7 @@ declare module Ember {
forwarding all requests. This makes it very useful for a number of binding use cases or other cases
where being able to swap out the underlying array is useful.
**/
- class ArrayProxy extends Object implements MutableArray, ClassMixin {
- /**
- Creates a subclass of the ArrayProxy class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class ArrayProxy extends Object implements MutableArray {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -540,25 +466,14 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
- addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): ArrayProxy;
- addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): ArrayProxy;
+ addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
+ addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): ArrayProxy;
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): ArrayProxy;
+ arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
+ arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: string): boolean;
clear(): any[];
compact(): any[];
@@ -571,10 +486,10 @@ declare module Ember {
enumerableContentDidChange(removing: Enumerable, adding: number);
enumerableContentDidChange(removing: number, adding: Enumerable);
enumerableContentDidChange(removing: Enumerable, adding: Enumerable);
- enumerableContentWillChange(removing: number, adding: number): ArrayProxy;
- enumerableContentWillChange(removing: Enumerable, adding: number): ArrayProxy;
- enumerableContentWillChange(removing: number, adding: Enumerable): ArrayProxy;
- enumerableContentWillChange(removing: Enumerable, adding: Enumerable): ArrayProxy;
+ enumerableContentWillChange(removing: number, adding: number): any[];
+ enumerableContentWillChange(removing: Enumerable, adding: number): any[];
+ enumerableContentWillChange(removing: number, adding: Enumerable): any[];
+ enumerableContentWillChange(removing: Enumerable, adding: Enumerable): any[];
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: string): boolean;
@@ -585,7 +500,7 @@ declare module Ember {
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
- insertAt(idx: number, object: any): ArrayProxy;
+ insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...any): any[];
lastIndexOf(object: any, startAt: number): number;
map: ItemIndexEnumerableCallbackTarget;
@@ -596,27 +511,27 @@ declare module Ember {
objectsAt(...number): any[];
popObject(): any;
pushObject(obj: any): any;
- pushObjects(...any): ArrayProxy;
+ pushObjects(...any): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
- removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): ArrayProxy;
+ removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
- removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): ArrayProxy;
+ removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
replace(idx: number, amt: number, objects: any[]);
replaceContent(idx: number, amt: number, objects: any[]): void;
- reverseObjects(): ArrayProxy;
+ reverseObjects(): any[];
setEach(key: string, value?: any): any;
- setObjects(objects: any[]): ArrayProxy;
+ setObjects(objects: any[]): any[];
shiftObject(): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
- uniq(): ArrayProxy;
+ uniq(): any[];
unshiftObject(object: any): any;
- unshiftObjects(objects: any[]): ArrayProxy;
- without(value: any): ArrayProxy;
- '[]': ArrayProxy;
+ unshiftObjects(objects: any[]): any[];
+ without(value: any): any[];
+ '[]': any[];
'@each': EachProxy;
Boolean: boolean;
firstObject: any;
@@ -624,9 +539,9 @@ declare module Ember {
lastObject: any;
length: number;
addObject(object: any): any;
- addObjects(objects: Enumerable): ArrayProxy;
+ addObjects(objects: Enumerable): any[];
removeObject(object: any): any;
- removeObjects(objects: Enumerable): ArrayProxy;
+ removeObjects(objects: Enumerable): any[];
}
var BOOTED: boolean;
/**
@@ -644,20 +559,7 @@ declare module Ember {
to(pathTuple: any[]): Binding;
toString(): string;
}
- class Button extends View implements TargetActionSupport, ClassMixin {
- /**
- Creates a subclass of the Button class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Button extends View implements TargetActionSupport {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -670,17 +572,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
triggerAction(opts: {}): boolean;
@@ -689,20 +580,7 @@ declare module Ember {
The internal class used to create text inputs when the {{input}} helper is used
with type of checkbox. See Handlebars.helpers.input for usage details.
**/
- class Checkbox extends View implements ClassMixin {
- /**
- Creates a subclass of the Checkbox class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Checkbox extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -715,17 +593,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
@@ -742,7 +609,7 @@ declare module Ember {
destroy(): CollectionView;
init(): void;
static CONTAINER_MAP: {};
- content: Array;
+ content: any[];
emptyView: View;
itemViewClass: View;
}
@@ -758,20 +625,7 @@ declare module Ember {
and actions are targeted at the view object. There is no access to the surrounding context or
outer controller; all contextual information is passed in.
**/
- class Component extends View implements ClassMixin {
- /**
- Creates a subclass of the Component class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Component extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -784,17 +638,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
sendAction(action: string, context: any): void;
@@ -813,7 +656,9 @@ declare module Ember {
property(...string): ComputedProperty;
readOnly(): ComputedProperty;
set(keyName: string, newValue: any, oldValue: string): any;
+ // ReSharper disable UsingOfReservedWord
volatile(): ComputedProperty;
+ // ReSharper restore UsingOfReservedWord
}
class Container {
constructor(parent: Container);
@@ -851,20 +696,7 @@ declare module Ember {
An Ember.View subclass that implements Ember.MutableArray allowing programatic
management of its child views.
**/
- class ContainerView extends View implements ClassMixin {
- /**
- Creates a subclass of the ContainerView class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class ContainerView extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -877,17 +709,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
@@ -912,20 +733,7 @@ declare module Ember {
copy(deep: boolean): Copyable;
frozenCopy(): Copyable;
}
- class CoreObject implements ClassMixin {
- /**
- Creates a subclass of the CoreObject class.
- **/
- static extend(arguments?: CoreObjectArguments): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class CoreObject {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -938,17 +746,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
/**
@@ -986,20 +783,7 @@ declare module Ember {
and other classes like Ember._SimpleMetamorphView that don't need the fully functionaltiy of Ember.View.
Unless you have specific needs for CoreView, you will use Ember.View in your applications.
**/
- class CoreView extends Object implements ClassMixin {
- /**
- Creates a subclass of the CoreView class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class CoreView extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1012,17 +796,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
parentView: CoreView;
@@ -1071,20 +844,7 @@ declare module Ember {
This is the object instance returned when you get the @each property on an array. It uses
the unknownProperty handler to automatically create EachArray instances for property names.
**/
- class EachProxy extends Object implements ClassMixin {
- /**
- Creates a subclass of the EachProxy class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class EachProxy extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1097,20 +857,9 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
- unknownProperty(keyName: string, value: any): Array;
+ unknownProperty(keyName: string, value: any): any[];
}
/**
This mixin defines the common interface implemented by enumerable objects in Ember. Most of these
@@ -1160,7 +909,7 @@ declare module Ember {
toArray(): any[];
uniq(): Enumerable;
without(value: any): Enumerable;
- '[]': Array;
+ '[]': any[];
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
@@ -1169,25 +918,13 @@ declare module Ember {
/**
A subclass of the JavaScript Error object for use in Ember.
**/
+ // ReSharper disable once DuplicatingLocalDeclaration
var Error: typeof Error;
/**
Handles delegating browser events to their corresponding Ember.Views. For example, when you click on
a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called.
**/
- class EventDispatcher extends Object implements ClassMixin {
- /**
- Creates a subclass of the EventDispatcher class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class EventDispatcher extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1200,17 +937,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
events: {};
@@ -1280,20 +1006,7 @@ declare module Ember {
function log(level, str): void;
function compile(environment, options?, context?, asObject?);
}
- class HashLocation extends Object implements ClassMixin {
- /**
- Creates a subclass of the HashLocation class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class HashLocation extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1306,34 +1019,10 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
- class HistoryLocation extends Object implements ClassMixin {
- /**
- Creates a subclass of the HistoryLocation class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class HistoryLocation extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1346,17 +1035,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
rootURL: string;
@@ -1374,20 +1052,7 @@ declare module Ember {
var LOG_BINDINGS: boolean;
var LOG_STACKTRACE_ON_DEPRECATION: boolean;
var LOG_VERSION: boolean;
- class LinkView extends View implements ClassMixin {
- /**
- Creates a subclass of the LinkView class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class LinkView extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1400,17 +1065,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
init(): void;
@@ -1469,12 +1123,12 @@ declare module Ember {
reopen(arguments?: {}): T;
}
class MutableArray implements Array, MutableEnumberable {
- addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): Array;
+ addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Array;
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Array;
+ arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
+ arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: string): boolean;
clear(): any[];
compact(): any[];
@@ -1501,7 +1155,7 @@ declare module Ember {
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
- insertAt(idx: number, object: any): MutableArray;
+ insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...any): any[];
lastIndexOf(object: any, startAt: number): number;
map: ItemIndexEnumerableCallbackTarget;
@@ -1511,26 +1165,26 @@ declare module Ember {
objectsAt(...number): any[];
popObject(): any;
pushObject(obj: any): any;
- pushObjects(...any): MutableArray;
+ pushObjects(...any): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
- removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): Array;
+ removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
replace(idx: number, amt: number, objects: any[]);
- reverseObjects(): Array;
+ reverseObjects(): any[];
setEach(key: string, value?: any): any;
- setObjects(objects: any[]): Array;
+ setObjects(objects: any[]): any[];
shiftObject(): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
uniq(): Enumerable;
unshiftObject(object: any): any;
- unshiftObjects(objects: any[]): Array;
+ unshiftObjects(objects: any[]): any[];
without(value: any): Enumerable;
- '[]': Array;
+ '[]': any[];
'@each': EachProxy;
Boolean: boolean;
firstObject: any;
@@ -1587,26 +1241,13 @@ declare module Ember {
toArray(): any[];
uniq(): Enumerable;
without(value: any): Enumerable;
- '[]': Array;
+ '[]': any[];
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
}
var NAME_KEY: string;
- class Namespace extends Object implements ClassMixin {
- /**
- Creates a subclass of the Namespace class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Namespace extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1619,30 +1260,18 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
class NativeArray implements MutableArray, Observable, Copyable {
constructor(arr: any[]);
- constructor(arr: NativeArray);
static activate(): void;
- addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): NativeArray;
- addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): NativeArray;
+ addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
+ addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): NativeArray;
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): NativeArray;
+ arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
+ arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: any): boolean;
clear(): any[];
compact(): any[];
@@ -1655,10 +1284,10 @@ declare module Ember {
enumerableContentDidChange(removing: Enumerable, adding: number);
enumerableContentDidChange(removing: number, adding: Enumerable);
enumerableContentDidChange(removing: Enumerable, adding: Enumerable);
- enumerableContentWillChange(removing: number, adding: number): NativeArray;
- enumerableContentWillChange(removing: Enumerable, adding: number): NativeArray;
- enumerableContentWillChange(removing: number, adding: Enumerable): NativeArray;
- enumerableContentWillChange(removing: Enumerable, adding: Enumerable): NativeArray;
+ enumerableContentWillChange(removing: number, adding: number): any[];
+ enumerableContentWillChange(removing: Enumerable, adding: number): any[];
+ enumerableContentWillChange(removing: number, adding: Enumerable): any[];
+ enumerableContentWillChange(removing: Enumerable, adding: Enumerable): any[];
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: any): boolean;
@@ -1669,7 +1298,7 @@ declare module Ember {
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
- insertAt(idx: number, object: any): NativeArray;
+ insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...any): any[];
lastIndexOf(object: any, startAt: number): number;
map: ItemIndexEnumerableCallbackTarget;
@@ -1679,26 +1308,26 @@ declare module Ember {
objectsAt(...number): any[];
popObject(): any;
pushObject(obj: any): any;
- pushObjects(...any): NativeArray;
+ pushObjects(...any): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
- removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): NativeArray;
+ removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
- removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): NativeArray;
+ removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
replace(idx: number, amt: number, objects: any[]);
- reverseObjects(): NativeArray;
+ reverseObjects(): any[];
setEach(key: string, value?: any): any;
- setObjects(objects: any[]): NativeArray;
+ setObjects(objects: any[]): any[];
shiftObject(): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
- uniq(): NativeArray;
+ uniq(): any[];
unshiftObject(object: any): any;
- unshiftObjects(objects: any[]): NativeArray;
- without(value: any): NativeArray;
- '[]': Array;
+ unshiftObjects(objects: any[]): any[];
+ without(value: any): any[];
+ '[]': any[];
'@each': EachProxy;
Boolean: boolean;
firstObject: any;
@@ -1706,45 +1335,32 @@ declare module Ember {
lastObject: any;
length: number;
addObject(object: any): any;
- addObjects(objects: Enumerable): NativeArray;
+ addObjects(objects: Enumerable): any[];
removeObject(object: any): any;
- removeObjects(objects: Enumerable): NativeArray;
+ removeObjects(objects: Enumerable): any[];
addObserver: ModifyObserver;
- beginPropertyChanges(): NativeArray;
+ beginPropertyChanges(): any[];
cacheFor(keyName: string): any;
decrementProperty(keyName: string, decrement?: number): number;
- endPropertyChanges(): NativeArray;
+ endPropertyChanges(): any[];
get(keyName: string): any;
getProperties(...string): {};
getProperties(keys: string[]): {};
getWithDefault(keyName: string, defaultValue: any): any;
hasObserverFor(key: string): boolean;
incrementProperty(keyName: string, increment?: number): number;
- notifyPropertyChange(keyName: string): NativeArray;
- propertyDidChange(keyName: string): NativeArray;
- propertyWillChange(keyName: string): NativeArray;
+ notifyPropertyChange(keyName: string): any[];
+ propertyDidChange(keyName: string): any[];
+ propertyWillChange(keyName: string): any[];
removeObserver(key: string, target: any, method: string): Observable;
removeObserver(key: string, target: any, method: Function): Observable;
- set(keyName: string, value: any): NativeArray;
- setProperties(hash: {}): NativeArray;
+ set(keyName: string, value: any): any[];
+ setProperties(hash: {}): any[];
toggleProperty(keyName: string): any;
- copy(deep: boolean): NativeArray;
- frozenCopy(): NativeArray;
+ copy(deep: boolean): any[];
+ frozenCopy(): any[];
}
- class NoneLocation extends Object implements ClassMixin {
- /**
- Creates a subclass of the NoneLocation class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class NoneLocation extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1757,22 +1373,11 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
var ORDER_DEFINITION: string[];
- class Object extends CoreObject implements Observable, ClassMixin {
+ class Object extends CoreObject implements Observable {
/**
Creates a subclass of the Object class.
**/
@@ -1781,11 +1386,11 @@ declare module Ember {
Creates an instance of the class.
@param arguments A hash containing values with which to initialize the newly instantiated object.
**/
- static create(arguments?: {}): T;
+ static create(arguments?: {}): T;
/**
Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
**/
- static createWithMixins(arguments?: {}): T;
+ static createWithMixins(arguments?: {}): T;
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1802,13 +1407,13 @@ declare module Ember {
Augments a constructor's prototype with additional properties and functions.
To add functions and properties to the constructor itself, see reopenClass.
**/
- static reopen(arguments?: {}): T;
+ static reopen(arguments?: {}): T;
/**
Augments a constructor's own properties and functions.
To add functions and properties to instances of a constructor by extending the
constructor's prototype see reopen.
**/
- static reopenClass(arguments?: {}): T;
+ static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
addObserver: ModifyObserver;
@@ -1838,20 +1443,7 @@ declare module Ember {
needs: string[];
target: any;
}
- class ObjectProxy extends Object implements ClassMixin {
- /**
- Creates a subclass of the ObjectProxy class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class ObjectProxy extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1864,17 +1456,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
/**
@@ -1938,20 +1519,7 @@ declare module Ember {
elementTag: string;
parentBuffer: RenderBuffer;
}
- class Route extends Object implements ClassMixin {
- /**
- Creates a subclass of the Route class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Route extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -1964,17 +1532,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
activate: Function;
@@ -1988,27 +1545,16 @@ declare module Ember {
modelFor(name: string): {};
render(name: string, options?: RenderOptions): void;
renderTemplate(controller: Controller, model: {}): void;
+ // ReSharper disable once InconsistentNaming
replaceWith(name: string, ...Object): void;
send(name: string, ...any): void;
serialize(model: {}, params: string[]): string;
setupController(controller: Controller, model: {}): void;
+ // ReSharper disable once InconsistentNaming
transitionTo(name: string, ...Object): void;
actions: ActionsHash;
}
- class Router extends Object implements ClassMixin {
- /**
- Creates a subclass of the Router class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Router extends Object {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2021,37 +1567,13 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
var RouterDSL: Function;
var SHIM_ES5: boolean;
var STRINGS: boolean;
- class Select extends View implements ClassMixin {
- /**
- Creates a subclass of the View class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class Select extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2064,17 +1586,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
content: any[];
@@ -2088,20 +1599,7 @@ declare module Ember {
selection: any;
value: string;
}
- class SelectOption extends View implements ClassMixin {
- /**
- Creates a subclass of the SelectOption class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class SelectOption extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2114,17 +1612,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
}
@@ -2173,7 +1660,7 @@ declare module Ember {
toArray(): any[];
uniq(): Set;
without(value: any): Set;
- '[]': Array;
+ '[]': any[];
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
@@ -2238,7 +1725,7 @@ declare module Ember {
toArray(): any[];
uniq(): Enumerable;
without(value: any): Enumerable;
- '[]': Array;
+ '[]': any[];
arrangedContent: any;
firstObject: any;
hasEnumerableObservers: boolean;
@@ -2247,20 +1734,7 @@ declare module Ember {
sortFunction: Comparable;
sortProperties: any[];
}
- class State extends Object implements Evented, ClassMixin {
- /**
- Creates a subclass of the State class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class State extends Object implements Evented {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2273,17 +1747,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
has(name: string): boolean;
@@ -2304,20 +1767,7 @@ declare module Ember {
exit: Function;
setup: Function;
}
- class StateManager extends State implements ClassMixin {
- /**
- Creates a subclass of the StateManager class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class StateManager extends State {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2330,17 +1780,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
contextFreeTransition(currentState: State, path: string): TransitionsHash;
@@ -2395,20 +1834,7 @@ declare module Ember {
static adapter: Object;
testHelpers: {};
}
- class TextArea extends View implements TextSupport, ClassMixin {
- /**
- Creates a subclass of the TextArea class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class TextArea extends View implements TextSupport {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2421,17 +1847,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
cancel(event: Function): void;
@@ -2443,20 +1858,7 @@ declare module Ember {
bubbles: boolean;
onEvent: string;
}
- class TextField extends View implements TextSupport, ClassMixin {
- /**
- Creates a subclass of the TextField class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class TextField extends View implements TextSupport {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2469,17 +1871,6 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
cancel(event: Function): void;
@@ -2506,20 +1897,7 @@ declare module Ember {
onEvent: string;
}
var VERSION: string;
- class View extends CoreView implements ClassMixin {
- /**
- Creates a subclass of the View class.
- **/
- static extend(arguments?: {}): T;
- /**
- Creates an instance of the class.
- @param arguments A hash containing values with which to initialize the newly instantiated object.
- **/
- static create(arguments?: {}): T;
- /**
- Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
- **/
- static createWithMixins(arguments?: {}): T;
+ class View extends CoreView {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
@@ -2532,24 +1910,15 @@ declare module Ember {
@param key property name
**/
static metaForProperty(key: string): {};
- /**
- Augments a constructor's prototype with additional properties and functions.
- To add functions and properties to the constructor itself, see reopenClass.
- **/
- static reopen(arguments?: {}): T;
- /**
- Augments a constructor's own properties and functions.
- To add functions and properties to instances of a constructor by extending the
- constructor's prototype see reopen.
- **/
- static reopenClass(arguments?: {}): T;
static isClass: boolean;
static isMethod: boolean;
$(): JQuery;
append(): View;
+ // ReSharper disable InconsistentNaming
appendTo(A: string): View;
appendTo(A: HTMLElement): View;
appendTo(A: JQuery): View;
+ // ReSharper restore InconsistentNaming
createChildView(viewClass: {}, attrs?: {}): View;
createChildView(viewClass: string, attrs?: {}): View;
createElement(): View;
@@ -2561,9 +1930,11 @@ declare module Ember {
removeChild(view: View): View;
removeFromParent(): View;
render(buffer: RenderBuffer): void;
+ // ReSharper disable InconsistentNaming
replaceIn(A: string): View;
replaceIn(A: HTMLElement): View;
replaceIn(A: JQuery): View;
+ // ReSharper restore InconsistentNaming
rerender(): void;
ariaRole: string;
attributeBindings: any;
@@ -2616,6 +1987,7 @@ declare module Ember {
function canInvoke(obj: any, methodName: string): boolean;
function changeProperties(callback: Function, binding?: any): void;
function compare(v: any, w: any): number;
+ // ReSharper disable once DuplicatingLocalDeclaration
var computed: {
(callback: Function): ComputedProperty;
alias(dependentKey: string): ComputedProperty;
@@ -2637,7 +2009,9 @@ declare module Ember {
oneWay(dependentKey: string): ComputedProperty;
or(...string): ComputedProperty;
};
+ // ReSharper disable DuplicatingLocalDeclaration
var config: {};
+ // ReSharper restore DuplicatingLocalDeclaration
function controllerFor(container: Container, controllerName: string, lookupOptions?: {}): Controller;
function copy(obj: any, deep: boolean): any;
/**
@@ -2653,8 +2027,10 @@ declare module Ember {
/**
Ember.empty is deprecated. Please use Ember.isEmpty instead.
**/
+ // ReSharper disable once DuplicatingLocalDeclaration
var empty: typeof deprecateFunc;
function endPropertyChanges(): void;
+ // ReSharper disable once DuplicatingLocalDeclaration
var exports: {};
function finishChains(obj: any): void;
function flushPendingChains(): void;
@@ -2687,6 +2063,7 @@ declare module Ember {
function listenersDiff(obj: any, eventName: string, otherActions: any[]): any[];
function listenersFor(obj: any, eventName: string): any[];
function listenersUnion(obj: any, eventName: string, otherActions: any[]): void;
+ // ReSharper disable once DuplicatingLocalDeclaration
var lookup: {}; // TODO: define interface
function makeArray(obj: any): any[];
function merge(original: any, updates: any): any;
@@ -2704,6 +2081,7 @@ declare module Ember {
function oneWay(obj: any, to: string, from: string): Binding;
var onError: Error;
function overrideChains(obj: any, keyName: string, m: any): boolean;
+ // ReSharper disable once DuplicatingLocalDeclaration
var platform: {
addBeforeObserver: ModifyObserver;
addObserver: ModifyObserver;
@@ -2772,6 +2150,7 @@ declare module Ember {
function unwatch(obj: any, keyPath: string): void;
function unwatchKey(obj: any, keyName: string): void;
function unwatchPath(obj: any, keyPath: string): void;
+ // ReSharper disable once DuplicatingLocalDeclaration
var uuid: number;
function valueOf(): {};
function warn(message: string, test?: boolean): void;
@@ -2782,6 +2161,7 @@ declare module Ember {
function wrap(func: Function, superFunc: Function): Function;
}
+// ReSharper disable DuplicatingLocalDeclaration
declare module Em {
/**
Alias for jQuery.
diff --git a/express/express-tests.ts b/express/express-tests.ts
index a0f10f6e9..3efdf19a6 100644
--- a/express/express-tests.ts
+++ b/express/express-tests.ts
@@ -20,7 +20,7 @@ app.use(express.session());
// Session-persisted message middleware
-app.use(function (req, res, next) {
+app.use((req: express.Request, res: express.Response, next) => {
var err = req.session.error
, msg = req.session.success;
delete req.session.error;
@@ -40,7 +40,7 @@ var users = {
// when you create a user, generate a salt
// and hash the password ('foobar' is the pass here)
-hash('foobar', function (err, salt, hash) {
+hash('foobar', (err, salt, hash) => {
if (err) throw err;
// store the salt & hash in the "db"
users.tj.salt = salt;
@@ -58,11 +58,11 @@ function authenticate(name, pass, fn) {
// apply the same algorithm to the POSTed password, applying
// the hash against the pass / salt, if there is a match we
// found the user
- hash(pass, user.salt, function (err, hash) {
+ hash(pass, user.salt, (err, hash) => {
if (err) return fn(err);
if (hash == user.hash) return fn(null, user);
fn(new Error('invalid password'));
- })
+ });
}
function restrict(req: express.Request, res: express.Response, next?: Function) {
@@ -74,32 +74,32 @@ function restrict(req: express.Request, res: express.Response, next?: Function)
}
}
-app.get('/', function (req, res) {
+app.get('/', (req: express.Request, res: express.Response) => {
res.redirect('login');
});
-app.get('/restricted', restrict, function (req, res) {
+app.get('/restricted', restrict, (req: express.Request, res: express.Response) => {
res.send('Wahoo! restricted area, click to logout');
});
-app.get('/logout', function (req, res) {
+app.get('/logout', (req: express.Request, res: express.Response) => {
// destroy the user's session to log them out
// will be re-created next request
- req.session.destroy(function () {
+ req.session.destroy(() => {
res.redirect('/');
});
});
-app.get('/login', function (req, res) {
+app.get('/login', (req: express.Request, res: express.Response) => {
res.render('login');
});
-app.post('/login', function (req, res) {
- authenticate(req.body.username, req.body.password, function (err, user) {
+app.post('/login', (req: express.Request, res: express.Response) => {
+ authenticate(req.body.username, req.body.password, (err, user) => {
if (user) {
// Regenerate session when signing in
// to prevent fixation
- req.session.regenerate(function () {
+ req.session.regenerate(() => {
// Store the user's primary key
// in the session store to be retrieved,
// or in this case the entire user object
@@ -139,7 +139,7 @@ while (n--) {
app.use(express.logger('dev'));
-app.get('/', function (req, res) {
+app.get('/', (req: express.Request, res: express.Response) => {
res.render('pets', { pets: pets });
});
@@ -148,24 +148,24 @@ console.log('Express listening on port 3000');
/////////////
-app.get('/', function (req, res) {
+app.get('/', (req: express.Request, res: express.Response) => {
res.format({
- html: function () {
- res.send('