-
-
Notifications
You must be signed in to change notification settings - Fork 90
Files
/
ambient.d.ts
44 lines (40 loc) · 1.44 KB
/
ambient.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import type Hls from "hls.js";
import type * as KIT from "@sveltejs/kit";
import type { MaybePromise } from "@sveltejs/kit/types/private";
import type { IResponse } from "$lib/types/response";
interface CustomWindow extends Window {
bbAudio: (audio: HTMLAudioElement) => { duration: number; src: string };
bbPlayer: { src: string; duration: number; title: string };
}
type CSSKeys = {[key in keyof CSSStyleDeclaration]: CSSStyleDeclaration[key]}
declare global {
interface IPropertyIndexedKeyFrames extends PropertyIndexedKeyframes, CSSKeys {
}
interface IBody<T> extends Body {
readonly body: ReadableStream<Uint8Array> | null;
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<FormData>;
json<U = any>(): Promise<U extends unknown ? T : U>;
text(): Promise<string>;
}
interface IResponse<T> extends IBody<T> {
readonly headers: Headers;
readonly ok: boolean;
readonly redirected: boolean;
readonly status: number;
readonly statusText: string;
readonly type: ResponseType;
readonly url: string;
clone(): IResponse<T>;
}
function fetch<T = any>(url: URL | RequestInfo, init?: RequestInit): Promise<IResponse<T>>;
interface Window {
bbAudio: (audio: HTMLAudioElement) => { duration: number; src: string };
hls: Hls;
bbPlayer: { src?: string; duration?: number; title?: string };
fetch<T>(url: URL | string, init?: RequestInit): Promise<IResponse<T>>;
}
}
export {};