import type { Container } from "../container/contract.js";
import type { Frame, FrameOptions } from "../frames/contract.js";
import type { Track } from "../tracks.js";
import type { Bytes } from "../vocabulary.js";
import type { SubtitleFile, SubtitleFormat, SubtitlePiece } from "./contract.js";
export interface SubtitleOptions extends FrameOptions {
    /**
     * The formats written out, unless named: the text ones, or every one when `tracks` is named.
     *
     * An unknown one is a TypeError.
     */
    formats?: readonly SubtitleFormat[];
    /**
     * The tracks written out, every one `container.tracks` lists unless named.
     *
     * A track the container does not list is a TypeError.
     */
    tracks?: readonly Track[];
}
/**
 * The format `subtitleFile` writes a track in: ASS, SSA, SubRip, WebVTT, or a PGS track's .sup.
 *
 * Null for any other track:
 * VobSub, a codec it does not know, or a SubStation track whose `codecPrivate` is null.
 */
export declare function subtitleFormat(track: Track): SubtitleFormat | null;
/**
 * Writes a track out as a file, from frames read for it that may hold other tracks' too.
 *
 * It answers null where `subtitleFormat` does.
 *
 * @example
 * const frames = await Array.fromAsync(container.frames([track]));
 * use(frames);
 * const sub = subtitleFile(track, frames);
 * if (sub !== null) use(track, sub.format, sub.bytes);
 */
export declare function subtitleFile(track: Track, frames: readonly Frame[]): SubtitleFile | null;
/**
 * Writes out every track of `tracks` whose format `formats` names and that `readable` answers true for, from one read.
 *
 * It writes nothing where that read is refused.
 *
 * @example
 * for (const { track, format, bytes } of await subtitleFiles(container)) use(track, format, bytes);
 */
export declare function subtitleFiles(container: Container, options?: SubtitleOptions): Promise<SubtitleFile[]>;
/**
 * Writes a track out as its frames come, for a file too large to hold whole.
 *
 * Null where `subtitleFormat` is.
 *
 * - It may hold a frame's bytes until the frames end, so the frame's buffer stays as given until then.
 *
 * @example
 * const sub = subtitleStream(track, container.frames([track], { via: "walk" }));
 * if (sub !== null) {
 *   await pipeline(sub.bytes, createWriteStream(`${track.index}.${sub.format}`));
 * }
 */
export declare function subtitleStream(track: Track, frames: AsyncIterable<Frame>): SubtitleFile<AsyncIterable<Bytes>> | null;
/**
 * Writes out the tracks `subtitleFiles` would, in pieces as `subtitleStream` does, from one read.
 *
 * A track's pieces come in order, between other tracks' pieces.
 *
 * @example
 * for await (const { track, format, bytes } of subtitleStreams(container)) use(track, format, bytes);
 */
export declare function subtitleStreams(container: Container, options?: SubtitleOptions): AsyncIterable<SubtitlePiece>;
