build: enable TSLint on the packages folder

This commit is contained in:
Victor Berchet
2017-07-27 16:13:16 -07:00
committed by Alex Rickabaugh
parent e64b54b67b
commit 9479a106bb
50 changed files with 146 additions and 125 deletions

View File

@ -15,8 +15,11 @@ import {HttpParams} from './params';
* All values are optional and will override default values if provided.
*/
interface HttpRequestInit {
headers?: HttpHeaders, reportProgress?: boolean, params?: HttpParams,
responseType?: 'arraybuffer'|'blob'|'json'|'text', withCredentials?: boolean,
headers?: HttpHeaders;
reportProgress?: boolean;
params?: HttpParams;
responseType?: 'arraybuffer'|'blob'|'json'|'text';
withCredentials?: boolean;
}
/**

View File

@ -120,7 +120,10 @@ export interface HttpUserEvent<T> { type: HttpEventType.User; }
*
* @experimental
*/
export interface HttpJsonParseError { error: Error, text: string, }
export interface HttpJsonParseError {
error: Error;
text: string;
}
/**
* Union type for all possible events on the response stream.
@ -233,7 +236,7 @@ export class HttpHeaderResponse extends HttpResponseBase {
status: update.status !== undefined ? update.status : this.status,
statusText: update.statusText || this.statusText,
url: update.url || this.url || undefined,
})
});
}
}

View File

@ -268,27 +268,26 @@ export class HttpXhrBackend implements HttpBackend {
// The upload progress event handler, which is only registered if
// progress events are enabled.
const onUpProgress =
(event: ProgressEvent) => {
// Upload progress events are simpler. Begin building the progress
// event.
let progress: HttpUploadProgressEvent = {
type: HttpEventType.UploadProgress,
loaded: event.loaded,
};
const onUpProgress = (event: ProgressEvent) => {
// Upload progress events are simpler. Begin building the progress
// event.
let progress: HttpUploadProgressEvent = {
type: HttpEventType.UploadProgress,
loaded: event.loaded,
};
// If the total number of bytes being uploaded is available, include
// it.
if (event.lengthComputable) {
progress.total = event.total;
}
// If the total number of bytes being uploaded is available, include
// it.
if (event.lengthComputable) {
progress.total = event.total;
}
// Send the event.
observer.next(progress);
}
// Send the event.
observer.next(progress);
};
// By default, register for load and error events.
xhr.addEventListener('load', onLoad);
// By default, register for load and error events.
xhr.addEventListener('load', onLoad);
xhr.addEventListener('error', onError);
// Progress events are only enabled if requested.