import type { MediaReader } from "../contracts/media_reader"; /** * Resolver tag for the in-memory media reader handle. The locator inlines the bytes as base64 because an * in-memory reader owns its buffer outright — there is no external store to point at. */ export declare const MEDIA_READER_TAG_IN_MEMORY = "media:in-memory"; /** * Resolver tag for the fetch-backed media reader handle. The locator captures the URL (and any fetch * init) so decode can re-issue the request — no live binding to re-inject. */ export declare const MEDIA_READER_TAG_FETCH = "media:fetch"; /** * Constructs a {@link @nhtio/adk!MediaReader} backed by an in-memory `Uint8Array`. * * @remarks * Each `stream()` call returns a fresh single-chunk `ReadableStream` over the same buffer. The * reader is re-openable by construction — call `stream()` as many times as needed. * * @param bytes - The buffer to serve. * @returns A {@link @nhtio/adk!MediaReader} that re-reads `bytes` on every call. */ export declare const inMemoryMediaReader: (bytes: Uint8Array) => MediaReader; /** * Constructs a {@link @nhtio/adk!MediaReader} backed by a fetch call. * * @remarks * Each `stream()` call re-issues the fetch. Tool authors whose underlying source is rate-limited * or expensive must cache locally before constructing the reader — the framework cannot make * that decision for them. * * `byteLength()` returns `undefined` because most remote sources do not promise it without an * extra HEAD request; consumers that need a byte size should resolve it out-of-band. * * @param url - The URL to fetch on each call. * @param init - Optional `fetch` init forwarded verbatim. * @returns A {@link @nhtio/adk!MediaReader} that re-issues `fetch(url, init)` on every call. */ export declare const fromFetch: (url: string | URL, init?: RequestInit) => MediaReader; /** * Constructs a {@link @nhtio/adk!MediaReader} backed by a browser `File` or `Blob`. * * @remarks * Each `stream()` call re-streams the underlying File via `File.stream()`. `byteLength()` * resolves from `file.size`. * * @remarks * **Not describable / not encodable.** A browser `Blob` is not re-openable across a serialisation * boundary (it has no stable locator), and draining its bytes requires `await` — which the encoder's * synchronous `[ENCODE_METHOD]()` cannot do. So this reader intentionally omits `describe()`, and * `encode()`-ing a {@link @nhtio/adk!Media} backed by it throws {@link @nhtio/adk!E_READER_NOT_DESCRIBABLE}. * To serialise such media, persist the bytes to a media/spool store and wrap them in a describable * reader first. * * @param file - The browser `File` or `Blob` to stream. * @returns A {@link @nhtio/adk!MediaReader} that re-streams `file` on every call. */ export declare const fromWebFile: (file: Blob) => MediaReader;