diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts old mode 100755 new mode 100644 index fed501acd..6b79b93cc --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -30,7 +30,7 @@ class AuthService { '$rootScope', '$injector', function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) { var $http: ng.IHttpService; //initialized later because of circular dependency problem function retry(config: ng.IRequestConfig, deferred: ng.IDeferred) { - $http = $http || $injector.get('$http'); + $http = $http || $injector.get('$http'); $http(config).then(function (response) { deferred.resolve(response); }); @@ -285,7 +285,7 @@ test_IAttributes({ $addClass: function (classVal){}, $removeClass: function(classVal){}, $set: function(key, value){}, - $observe: function(name, fn){ + $observe: function(name: any, fn: any){ return fn; }, $attr: {} diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts old mode 100755 new mode 100644 index 11f46b064..4b3702c22 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -237,7 +237,7 @@ declare module angular { forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any; fromJson(json: string): any; - identity(arg?: any): any; + identity(arg?: T): T; injector(modules?: any[], strictDi?: boolean): auto.IInjectorService; isArray(value: any): boolean; isDate(value: any): boolean; @@ -453,7 +453,7 @@ declare module angular { * following compilation. The observer is then invoked whenever the * interpolated value changes. */ - $observe(name: string, fn: (value?: any) => any): Function; + $observe(name: string, fn: (value?: T) => any): Function; /** * A map of DOM element attribute names to the normalized name. This is needed @@ -708,7 +708,6 @@ declare module angular { // see http://docs.angularjs.org/api/ng.$window /////////////////////////////////////////////////////////////////////////// interface IWindowService extends Window { - [key: string]: any; } /////////////////////////////////////////////////////////////////////////// @@ -717,7 +716,6 @@ declare module angular { /////////////////////////////////////////////////////////////////////////// interface IBrowserService { defer: angular.ITimeoutService; - [key: string]: any; } /////////////////////////////////////////////////////////////////////////// @@ -725,7 +723,7 @@ declare module angular { // see http://docs.angularjs.org/api/ng.$timeout /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { - (func: Function, delay?: number, invokeApply?: boolean): IPromise; + (func: (...args: any[]) => T, delay?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -996,8 +994,7 @@ declare module angular { * See http://docs.angularjs.org/api/ng/service/$q */ interface IQService { - new (resolver: (resolve: IQResolveReject) => any): IPromise; - new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject) => any): IPromise; new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; /** @@ -1156,7 +1153,7 @@ declare module angular { * * @param key the key of the data to be retrieved */ - get(key: string): any; + get(key: string): T; /** * Removes an entry from the Cache object. @@ -1587,7 +1584,7 @@ declare module angular { scope: IScope, instanceElement: IAugmentedJQuery, instanceAttributes: IAttributes, - controller: any, + controller: {}, transclude: ITranscludeFunction ): void; } @@ -1607,7 +1604,7 @@ declare module angular { interface IDirective { compile?: IDirectiveCompileFn; - controller?: any; + controller?: {}; controllerAs?: string; bindToController?: boolean|Object; link?: IDirectiveLinkFn | IDirectivePrePost; @@ -1682,9 +1679,9 @@ declare module angular { interface IInjectorService { annotate(fn: Function): string[]; annotate(inlineAnnotatedFunction: any[]): string[]; - get(name: string): any; + get(name: string): T; has(name: string): boolean; - instantiate(typeConstructor: Function, locals?: any): any; + instantiate(typeConstructor: Function, locals?: any): T; invoke(inlineAnnotatedFunction: any[]): any; invoke(func: Function, context?: any, locals?: any): any; }