diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 9b5a9c30b9..dba7099dad 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -50,7 +50,7 @@ myApp.config((RestangularProvider: restangular.IProvider) => { }); -interface MyAppScope extends ng.IScope { +interface MyAppScope extends angular.IScope { accounts: string[]; allAccounts: any[]; account: any; diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index b09e4affd0..db17e51cf8 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -16,30 +16,19 @@ declare module 'restangular' { declare module restangular { - interface IPromise extends ng.IPromise { + interface IPromise extends angular.IPromise { call(methodName: string, params?: any): IPromise; get(fieldName: string): IPromise; $object: T; } - interface ICollectionPromise extends ng.IPromise { + interface ICollectionPromise extends angular.IPromise { push(object: any): ICollectionPromise; call(methodName: string, params?: any): ICollectionPromise; get(fieldName: string): ICollectionPromise; $object: T[]; } - interface IRequestConfig { - params?: any; - headers?: any; - cache?: any; - withCredentials?: boolean; - data?: any; - transformRequest?: any; - transformResponse?: any; - timeout?: any; // number | promise - } - interface IResponse { status: number; data: any; @@ -60,14 +49,14 @@ declare module restangular { addElementTransformer(route: string, isCollection: boolean, transformer: Function): void; setTransformOnlyServerElements(active: boolean): void; setOnElemRestangularized(callback: (elem: any, isCollection: boolean, what: string, restangular: IService) => any): void; - setResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: ng.IDeferred) => any): void; - setResponseExtractor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: ng.IDeferred) => any): void; - addResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: ng.IDeferred) => any): void; + setResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + setResponseExtractor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + addResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; setRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; addRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; - setFullRequestInterceptor(fullRequestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: IRequestConfig) => {element: any; headers: any; params: any}): void; - addFullRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: IRequestConfig) => {headers: any; params: any; element: any; httpConfig: IRequestConfig}): void; - setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: ng.IDeferred) => any): void; + setFullRequestInterceptor(fullRequestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {element: any; headers: any; params: any}): void; + addFullRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {headers: any; params: any; element: any; httpConfig: angular.IRequestShortcutConfig}): void; + setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: angular.IDeferred) => any): void; setRestangularFields(fields: {[fieldName: string]: string}): void; setMethodOverriders(overriders: string[]): void; setJsonp(jsonp: boolean): void; @@ -124,7 +113,7 @@ declare module restangular { clone(): IElement; plain(): any; plain(): T; - withHttpConfig(httpConfig: IRequestConfig): IElement; + withHttpConfig(httpConfig: angular.IRequestShortcutConfig): IElement; save(queryParams?: any, headers?: any): IPromise; getRestangularUrl(): string; } @@ -139,7 +128,7 @@ declare module restangular { options(queryParams?: any, headers?: any): IPromise; patch(queryParams?: any, headers?: any): IPromise; putElement(idx: any, params: any, headers: any): IPromise; - withHttpConfig(httpConfig: IRequestConfig): ICollection; + withHttpConfig(httpConfig: angular.IRequestShortcutConfig): ICollection; clone(): ICollection; plain(): any; plain(): T[];