forked from mystiq/hydrogen-web
LogItem --> ILogItem
This commit is contained in:
parent
0541cf8f2b
commit
66b4f9bfe5
2 changed files with 4 additions and 4 deletions
|
@ -50,6 +50,7 @@ export interface ILogItem {
|
||||||
ensureRefId(): void;
|
ensureRefId(): void;
|
||||||
catch(err: Error): Error;
|
catch(err: Error): Error;
|
||||||
serialize(filter: LogFilter, parentStartTime: number | undefined, forced: boolean): ISerializedItem | undefined;
|
serialize(filter: LogFilter, parentStartTime: number | undefined, forced: boolean): ISerializedItem | undefined;
|
||||||
|
finish(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILogger {
|
export interface ILogger {
|
||||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
|
|
||||||
import {HomeServerError, ConnectionError} from "../error.js";
|
import {HomeServerError, ConnectionError} from "../error.js";
|
||||||
import type {RequestResult} from "../../platform/web/dom/request/fetch.js";
|
import type {RequestResult} from "../../platform/web/dom/request/fetch.js";
|
||||||
import type {LogItem} from "../../logging/LogItem";
|
import type {ILogItem} from "../../logging/types";
|
||||||
|
|
||||||
export interface IHomeServerRequest {
|
export interface IHomeServerRequest {
|
||||||
abort(): void;
|
abort(): void;
|
||||||
|
@ -25,13 +25,12 @@ export interface IHomeServerRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class HomeServerRequest implements IHomeServerRequest {
|
export class HomeServerRequest implements IHomeServerRequest {
|
||||||
// todo: Shouldn't log be of type ILogItem; but ILogItem does not have finish method
|
private readonly _log?: ILogItem;
|
||||||
private readonly _log?: LogItem;
|
|
||||||
private _sourceRequest?: RequestResult;
|
private _sourceRequest?: RequestResult;
|
||||||
// as we add types for expected responses from hs, this could be a generic class instead
|
// as we add types for expected responses from hs, this could be a generic class instead
|
||||||
private readonly _promise: Promise<any>;
|
private readonly _promise: Promise<any>;
|
||||||
|
|
||||||
constructor(method: string, url: string, sourceRequest: RequestResult, log?: LogItem) {
|
constructor(method: string, url: string, sourceRequest: RequestResult, log?: ILogItem) {
|
||||||
this._log = log;
|
this._log = log;
|
||||||
this._sourceRequest = sourceRequest;
|
this._sourceRequest = sourceRequest;
|
||||||
this._promise = sourceRequest.response().then(response => {
|
this._promise = sourceRequest.response().then(response => {
|
||||||
|
|
Loading…
Reference in a new issue