mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
This reverts commit 49375181e4
.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
import ee, { Emitter } from 'event-emitter';
|
||||
import superagent, { Response, SuperAgentRequest } from 'superagent';
|
||||
import { Authentication } from './authentication/authentication';
|
||||
import { RequestOptions, HttpClient, SecurityOptions, Emitters } from './api-clients/http-client.interface';
|
||||
@@ -26,8 +26,6 @@ import { isBrowser, paramToString } from './utils';
|
||||
declare const Blob: any;
|
||||
declare const Buffer: any;
|
||||
|
||||
type EventEmitterInstance = InstanceType<typeof EventEmitter>;
|
||||
|
||||
const isProgressEvent = (event: ProgressEvent | unknown): event is ProgressEvent => (event as ProgressEvent)?.lengthComputable;
|
||||
|
||||
export class SuperagentHttpClient implements HttpClient {
|
||||
@@ -136,7 +134,7 @@ export class SuperagentHttpClient implements HttpClient {
|
||||
contentType: string,
|
||||
accept: string,
|
||||
responseType: string,
|
||||
eventEmitter: EventEmitterInstance,
|
||||
eventEmitter: ee.Emitter,
|
||||
returnType: string,
|
||||
securityOptions: SecurityOptions
|
||||
) {
|
||||
@@ -270,7 +268,7 @@ export class SuperagentHttpClient implements HttpClient {
|
||||
}
|
||||
}
|
||||
|
||||
private progress(event: ProgressEvent | unknown, eventEmitter: EventEmitterInstance): void {
|
||||
private progress(event: ProgressEvent | unknown, eventEmitter: Emitter): void {
|
||||
if (isProgressEvent(event)) {
|
||||
const percent = Math.round((event.loaded / event.total) * 100);
|
||||
|
||||
|
Reference in New Issue
Block a user