fix(ui): fix typescript errors

This commit is contained in:
Łukasz Mierzwa
2022-05-25 11:05:53 +01:00
committed by Łukasz Mierzwa
parent 02bc037fca
commit 512d271039
3 changed files with 12 additions and 3 deletions

View File

@@ -382,7 +382,10 @@ describe("useFetchAny", () => {
});
return "ok";
};
const fetcher = jest.fn((_: RequestInfo) => Promise.resolve(resp));
const fetcher = jest.fn(
(input: RequestInfo | URL, init?: RequestInit | undefined) =>
Promise.resolve(resp)
);
const upstreams = [{ uri: "http://localhost/slow/body", options: {} }];
const Component = () => {

View File

@@ -9,7 +9,10 @@ export interface UpstreamT {
options: RequestInit;
}
export type FetchFunctionT = (request: RequestInfo) => Promise<Response>;
export type FetchFunctionT = (
input: RequestInfo | URL,
init?: RequestInit | undefined
) => Promise<Response>;
export interface FetchAnyOptionsT {
fetcher?: null | FetchFunctionT;

View File

@@ -6,7 +6,10 @@ import promiseRetry from "promise-retry";
import { CommonOptions, FetchRetryConfig } from "Common/Fetch";
export type FetchFunctionT = (request: RequestInfo) => Promise<Response>;
export type FetchFunctionT = (
input: RequestInfo | URL,
init?: RequestInit | undefined
) => Promise<Response>;
export interface FetchGetOptionsT {
autorun?: boolean;