mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #829 from georgiosd/master
Added generics to IHttpPromise and some missing properties/overloads
This commit is contained in:
Vendored
+11
-8
@@ -537,21 +537,21 @@ declare module ng {
|
||||
transformResponse?: any;
|
||||
}
|
||||
|
||||
interface IHttpPromiseCallback {
|
||||
(data: any, status: number, headers: (headerName: string) => string, config: IRequestConfig): any;
|
||||
interface IHttpPromiseCallback<T> {
|
||||
(data: T, status: number, headers: (headerName: string) => string, config: IRequestConfig): any;
|
||||
}
|
||||
|
||||
interface IHttpPromiseCallbackArg {
|
||||
data?: any;
|
||||
interface IHttpPromiseCallbackArg<T> {
|
||||
data?: T;
|
||||
status?: number;
|
||||
headers?: (headerName: string) => string;
|
||||
config?: IRequestConfig;
|
||||
}
|
||||
|
||||
interface IHttpPromise extends IPromise {
|
||||
success(callback: IHttpPromiseCallback): IHttpPromise;
|
||||
error(callback: IHttpPromiseCallback): IHttpPromise;
|
||||
then(successCallback: (response: IHttpPromiseCallbackArg) => any, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise;
|
||||
interface IHttpPromise<T> extends IPromise {
|
||||
success(callback: IHttpPromiseCallback<T>): IHttpPromise;
|
||||
error(callback: IHttpPromiseCallback<T>): IHttpPromise;
|
||||
then(successCallback: (response: IHttpPromiseCallbackArg<T>) => any, errorCallback?: (response: IHttpPromiseCallbackArg<T>) => any): IPromise;
|
||||
}
|
||||
|
||||
interface IHttpProvider extends IServiceProvider {
|
||||
@@ -640,6 +640,8 @@ declare module ng {
|
||||
$scope: IScope;
|
||||
$template: string;
|
||||
};
|
||||
|
||||
params: any;
|
||||
}
|
||||
|
||||
interface IRouteProvider extends IServiceProvider {
|
||||
@@ -694,6 +696,7 @@ declare module ng {
|
||||
constant(name: string, value: any): void;
|
||||
|
||||
decorator(name: string, decorator: Function): void;
|
||||
decorator(name: string, decoratorInline: any[]): void;
|
||||
factory(name: string, serviceFactoryFunction: Function): ng.IServiceProvider;
|
||||
provider(name: string, provider: ng.IServiceProvider): ng.IServiceProvider;
|
||||
provider(name: string, serviceProviderConstructor: Function): ng.IServiceProvider;
|
||||
|
||||
Reference in New Issue
Block a user