forked from mystiq/hydrogen-web
Fix typescript errors
This commit is contained in:
parent
d6378133d8
commit
e2abc312d3
3 changed files with 5 additions and 4 deletions
|
@ -51,6 +51,7 @@ export interface ILogItem {
|
||||||
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;
|
finish(): void;
|
||||||
|
child(labelOrValues: LabelOrValues, logLevel?: LogLevel, filterCreator?: FilterCreator): ILogItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILogger {
|
export interface ILogger {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import type {IHomeServerRequest} from "./HomeServerRequest";
|
||||||
import type {Reconnector} from "./Reconnector";
|
import type {Reconnector} from "./Reconnector";
|
||||||
import type {EncodedBody} from "./common";
|
import type {EncodedBody} from "./common";
|
||||||
import type {IRequestOptions, RequestFunction} from "../../platform/types/types";
|
import type {IRequestOptions, RequestFunction} from "../../platform/types/types";
|
||||||
import type {LogItem} from "../../logging/LogItem";
|
import type {ILogItem} from "../../logging/types";
|
||||||
|
|
||||||
type RequestMethod = "POST" | "GET" | "PUT";
|
type RequestMethod = "POST" | "GET" | "PUT";
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export class HomeServerApi {
|
||||||
private _baseRequest(method: RequestMethod, url: string, queryParams?: Record<string, any>, body?: Record<string, any>, options?: IRequestOptions, accessToken?: string): IHomeServerRequest {
|
private _baseRequest(method: RequestMethod, url: string, queryParams?: Record<string, any>, body?: Record<string, any>, options?: IRequestOptions, accessToken?: string): IHomeServerRequest {
|
||||||
const queryString = encodeQueryParams(queryParams);
|
const queryString = encodeQueryParams(queryParams);
|
||||||
url = `${url}?${queryString}`;
|
url = `${url}?${queryString}`;
|
||||||
let log: LogItem | undefined;
|
let log: ILogItem | undefined;
|
||||||
if (options?.log) {
|
if (options?.log) {
|
||||||
const parent = options?.log;
|
const parent = options?.log;
|
||||||
log = parent.child({
|
log = parent.child({
|
||||||
|
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
import type {RequestResult} from "../web/dom/request/fetch.js";
|
import type {RequestResult} from "../web/dom/request/fetch.js";
|
||||||
import type {EncodedBody} from "../../matrix/net/common";
|
import type {EncodedBody} from "../../matrix/net/common";
|
||||||
import type {LogItem} from "../../logging/LogItem";
|
import type {ILogItem} from "../../logging/types";
|
||||||
|
|
||||||
export interface IRequestOptions {
|
export interface IRequestOptions {
|
||||||
uploadProgress?: (loadedBytes: number) => void;
|
uploadProgress?: (loadedBytes: number) => void;
|
||||||
|
@ -24,7 +24,7 @@ export interface IRequestOptions {
|
||||||
body?: EncodedBody;
|
body?: EncodedBody;
|
||||||
headers?: Map<string, string|number>;
|
headers?: Map<string, string|number>;
|
||||||
cache?: boolean;
|
cache?: boolean;
|
||||||
log?: LogItem;
|
log?: ILogItem;
|
||||||
prefix?: string;
|
prefix?: string;
|
||||||
method?: string;
|
method?: string;
|
||||||
format?: string;
|
format?: string;
|
||||||
|
|
Loading…
Reference in a new issue