forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathangular-httpi.d.ts
42 lines (28 loc) · 1.14 KB
/
angular-httpi.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Type definitions for angular-httpi
// Project: https://github.com/bennadel/httpi
// Definitions by: Andrew Camilleri <https://github.com/Kukks>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module Httpi {
export interface HttpiPayload extends ng.IRequestShortcutConfig {
method?: string;
url?: string;
params?: {};
data?: {};
keepTrailingSlash?: boolean;
}
export interface HttpiFactory {
(config: HttpiPayload): ng.IHttpPromise<{}>;
resource(url: string): HttpiResource;
}
export class HttpiResource {
constructor(http: ng.IHttpService, url: string);
delete<T>(config: HttpiPayload): ng.IHttpPromise<T>;
get<T>(config: HttpiPayload): ng.IHttpPromise<T>;
head<T>(config: HttpiPayload): ng.IHttpPromise<T>;
jsonp<T>(config: HttpiPayload): ng.IHttpPromise<T>;
post<T>(config: HttpiPayload): ng.IHttpPromise<T>;
put<T>(config: HttpiPayload): ng.IHttpPromise<T>;
setKeepTrailingSlash(newKeepTrailingSlash: boolean): HttpiResource;
}
}