Spaces:
Sleeping
Sleeping
File size: 1,190 Bytes
19e88d2 | 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 | /**
* WebBlob is a Blob implementation for web resources that supports range requests.
*/
interface WebBlobCreateOptions {
/**
* @default 1_000_000
*
* Objects below that size will immediately be fetched and put in RAM, rather
* than streamed ad-hoc
*/
cacheBelow?: number;
/**
* Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.
*/
fetch?: typeof fetch;
accessToken: string | undefined;
}
export declare class WebBlob extends Blob {
static create(url: URL, opts?: WebBlobCreateOptions): Promise<Blob>;
private url;
private start;
private end;
private contentType;
private full;
private fetch;
private accessToken;
constructor(url: URL, start: number, end: number, contentType: string, full: boolean, customFetch: typeof fetch, accessToken: string | undefined);
get size(): number;
get type(): string;
slice(start?: number, end?: number): WebBlob;
arrayBuffer(): Promise<ArrayBuffer>;
text(): Promise<string>;
stream(): ReturnType<Blob["stream"]>;
private fetchRange;
}
export {};
//# sourceMappingURL=WebBlob.d.ts.map |