Skip to content

Commit 0078004

Browse files
committed
🎨 Add tslint
1 parent 9bc38dd commit 0078004

File tree

11 files changed

+227
-79
lines changed

11 files changed

+227
-79
lines changed

dist/bundle/wretch.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mix.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare const mix: (one: Object, two: Object, mergeArrays?: boolean) => Object;
1+
export declare const mix: (one: object, two: object, mergeArrays?: boolean) => object;

dist/wretcher.d.ts

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export declare class Wretcher {
1111
* Sets the default fetch options used for every subsequent fetch call.
1212
* @param opts New default options
1313
*/
14-
defaults(opts: Object): this;
14+
defaults(opts: object): this;
1515
/**
1616
* Mixins the default fetch options used for every subsequent fetch calls.
1717
* @param opts Options to mixin with the current default options
1818
*/
19-
mixdefaults(opts: Object): this;
19+
mixdefaults(opts: object): this;
2020
/**
2121
* Sets the method (text, json ...) used to parse the data contained in the response body in case of an HTTP error.
2222
*
@@ -39,7 +39,7 @@ export declare class Wretcher {
3939
* Returns a new Wretcher object with the same url and new options.
4040
* @param options New options
4141
*/
42-
options(options: Object): Wretcher;
42+
options(options: object): Wretcher;
4343
/**
4444
* Converts a javascript object to query parameters,
4545
* then appends this query string to the current url.
@@ -51,18 +51,22 @@ export declare class Wretcher {
5151
*
5252
* @param qp An object which will be converted.
5353
*/
54-
query(qp: Object): Wretcher;
54+
query(qp: object): Wretcher;
5555
/**
5656
* Shortcut to set the "Accept" header.
5757
* @param what Header value
5858
*/
5959
accept(what: string): Wretcher;
6060
/**
61-
* Performs a get request.
62-
*/
61+
* Performs a get request.
62+
*/
6363
get(opts?: {}): {
6464
res: <Result = Response>(cb?: (type: void) => Result) => Promise<Result>;
65-
json: <Result = Object>(cb?: (type: Object) => Result) => Promise<Result>;
65+
json: <Result = {
66+
[key: string]: any;
67+
}>(cb?: (type: {
68+
[key: string]: any;
69+
}) => Result) => Promise<Result>;
6670
blob: <Result = Blob>(cb?: (type: Blob) => Result) => Promise<Result>;
6771
formData: <Result = FormData>(cb?: (type: FormData) => Result) => Promise<Result>;
6872
arrayBuffer: <Result = ArrayBuffer>(cb?: (type: ArrayBuffer) => Result) => Promise<Result>;
@@ -106,11 +110,15 @@ export declare class Wretcher {
106110
}) => void) => any;
107111
};
108112
/**
109-
* Performs a delete request.
110-
*/
113+
* Performs a delete request.
114+
*/
111115
delete(opts?: {}): {
112116
res: <Result = Response>(cb?: (type: void) => Result) => Promise<Result>;
113-
json: <Result = Object>(cb?: (type: Object) => Result) => Promise<Result>;
117+
json: <Result = {
118+
[key: string]: any;
119+
}>(cb?: (type: {
120+
[key: string]: any;
121+
}) => Result) => Promise<Result>;
114122
blob: <Result = Blob>(cb?: (type: Blob) => Result) => Promise<Result>;
115123
formData: <Result = FormData>(cb?: (type: FormData) => Result) => Promise<Result>;
116124
arrayBuffer: <Result = ArrayBuffer>(cb?: (type: ArrayBuffer) => Result) => Promise<Result>;
@@ -154,11 +162,15 @@ export declare class Wretcher {
154162
}) => void) => any;
155163
};
156164
/**
157-
* Performs a put request.
158-
*/
165+
* Performs a put request.
166+
*/
159167
put(opts?: {}): {
160168
res: <Result = Response>(cb?: (type: void) => Result) => Promise<Result>;
161-
json: <Result = Object>(cb?: (type: Object) => Result) => Promise<Result>;
169+
json: <Result = {
170+
[key: string]: any;
171+
}>(cb?: (type: {
172+
[key: string]: any;
173+
}) => Result) => Promise<Result>;
162174
blob: <Result = Blob>(cb?: (type: Blob) => Result) => Promise<Result>;
163175
formData: <Result = FormData>(cb?: (type: FormData) => Result) => Promise<Result>;
164176
arrayBuffer: <Result = ArrayBuffer>(cb?: (type: ArrayBuffer) => Result) => Promise<Result>;
@@ -202,11 +214,15 @@ export declare class Wretcher {
202214
}) => void) => any;
203215
};
204216
/**
205-
* Performs a post request.
206-
*/
217+
* Performs a post request.
218+
*/
207219
post(opts?: {}): {
208220
res: <Result = Response>(cb?: (type: void) => Result) => Promise<Result>;
209-
json: <Result = Object>(cb?: (type: Object) => Result) => Promise<Result>;
221+
json: <Result = {
222+
[key: string]: any;
223+
}>(cb?: (type: {
224+
[key: string]: any;
225+
}) => Result) => Promise<Result>;
210226
blob: <Result = Blob>(cb?: (type: Blob) => Result) => Promise<Result>;
211227
formData: <Result = FormData>(cb?: (type: FormData) => Result) => Promise<Result>;
212228
arrayBuffer: <Result = ArrayBuffer>(cb?: (type: ArrayBuffer) => Result) => Promise<Result>;
@@ -250,11 +266,15 @@ export declare class Wretcher {
250266
}) => void) => any;
251267
};
252268
/**
253-
* Performs a patch request.
254-
*/
269+
* Performs a patch request.
270+
*/
255271
patch(opts?: {}): {
256272
res: <Result = Response>(cb?: (type: void) => Result) => Promise<Result>;
257-
json: <Result = Object>(cb?: (type: Object) => Result) => Promise<Result>;
273+
json: <Result = {
274+
[key: string]: any;
275+
}>(cb?: (type: {
276+
[key: string]: any;
277+
}) => Result) => Promise<Result>;
258278
blob: <Result = Blob>(cb?: (type: Blob) => Result) => Promise<Result>;
259279
formData: <Result = FormData>(cb?: (type: FormData) => Result) => Promise<Result>;
260280
arrayBuffer: <Result = ArrayBuffer>(cb?: (type: ArrayBuffer) => Result) => Promise<Result>;
@@ -301,10 +321,10 @@ export declare class Wretcher {
301321
* Sets the content type header, stringifies an object and sets the request body.
302322
* @param jsObject An object
303323
*/
304-
json(jsObject: Object): Wretcher;
324+
json(jsObject: object): Wretcher;
305325
/**
306326
* Converts the javascript object to a FormData and sets the request body.
307327
* @param formObject An object
308328
*/
309-
formData(formObject: Object): Wretcher;
329+
formData(formObject: object): Wretcher;
310330
}

dist/wretcher.js

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)