diff --git a/app/utils/stream.ts b/app/utils/stream.ts index 900abb6e4..323e540bc 100644 --- a/app/utils/stream.ts +++ b/app/utils/stream.ts @@ -30,8 +30,8 @@ export function fetch(url: string, options?: RequestInit): Promise { headers: _headers = {}, body = [], } = options || {}; - let unlisten: Function | undefined; - let setRequestId: Function | undefined; + let unlisten: (() => void) | undefined; + let setRequestId: ((value: number) => void) | undefined; const requestIdPromise = new Promise((resolve) => (setRequestId = resolve)); const ts = new TransformStream(); const writer = ts.writable.getWriter(); @@ -66,7 +66,7 @@ export function fetch(url: string, options?: RequestInit): Promise { close(); } }), - ).then((u: Function) => (unlisten = u)); + ).then((u: () => void) => (unlisten = u)); const headers: Record = { Accept: "application/json, text/plain, */*",