@adonis-agora/media
Version:
Media-library for AdonisJS — owner collections (MIME whitelist, single-file replace, ordering), image conversions (eager/lazy), pluggable content transformers (HLS video via mediabunny, metadata probe, image blur-up placeholder), and column attachments, a
22 lines • 1.12 kB
TypeScript
import type { Readable } from 'node:stream';
import type { Disk, DiskMetaData } from './types.js';
/**
* Open an object for streaming and read its metadata in ONE round-trip's worth of latency: the
* `HEAD` (`getMetaData`) and the `GET` (`getStream`) are independent, so they are issued together
* instead of one after the other — on S3 that halves the time to first byte of every proxied file
* and HLS/DASH segment.
*
* Errors keep the sequential order's precedence: a metadata failure wins (and the stream that did
* open is destroyed, so no socket is leaked); otherwise a stream failure is thrown.
*
* @internal
*/
export declare function openWithMetadata(disk: Disk, key: string): Promise<{
metadata: DiskMetaData;
stream: Readable;
}>;
/** Decode disk bytes as UTF-8 without copying them into a fresh `Buffer` first. @internal */
export declare function utf8Of(bytes: Uint8Array): string;
/** A plain `Uint8Array` over the same memory as `bytes` (a Buffer), without copying it. @internal */
export declare function uint8View(bytes: Uint8Array): Uint8Array;
//# sourceMappingURL=disk_read.d.ts.map