import type { MissCode } from "./contract.js"; import { ProviderMiss } from "./derive.js"; import { type Limits } from "./limits.js"; import type { Part } from "./plan.js"; import type { MadeBy, Provider, ProviderCall, ProviderSource } from "./provider.js"; /** What a probe finds; null for what the file does not say. */ export type VideoFacts = { readonly durationS: number | null; readonly width: number | null; readonly height: number | null; readonly fps: number | null; readonly bytes: number; }; /** A provider of frames and windows that also probes. A provider signals a failure by throwing: a `VideoMiss` for a * typed one, any other error for a failed operation. */ export type VideoProvider = Provider & Required> & { probe(source: ProviderSource, call: ProviderCall): Promise<{ readonly madeBy: MadeBy; readonly facts: VideoFacts; }>; }; /** A typed miss a provider raises, with the text the model reads. */ export declare class VideoMiss extends ProviderMiss { readonly name = "VideoMiss"; } type Failure = { readonly ok: false; readonly code: MissCode; readonly text: string; }; /** What a video operation gives: its result, or the typed miss to tell the model. */ export type VideoOutcome = ({ readonly ok: true; } & T) | Failure; /** The facts of a file nothing could probe: only its size. */ export declare const unprobedVideo: (source: ProviderSource) => VideoFacts; /** The line that tells the model what the file is. */ export declare const describeVideo: (facts: VideoFacts) => string; /** The facts of a video, always usable: what the probe could not say is null, and `miss` says why. */ export declare function probeVideo(provider: VideoProvider, source: ProviderSource, call: ProviderCall): Promise<{ facts: VideoFacts; madeBy?: MadeBy; miss?: { code: MissCode; text: string; }; }>; /** The window `from_s` to `to_s` against what the file says: the window to cut, or the sentence that refuses the * arguments. An end the file does not state must be given. */ export declare function videoWindow(facts: VideoFacts, fromS?: number, toS?: number): { fromS: number; toS: number; } | string; /** The file itself as one part, for a route that takes video and a file within the inline budget. No program runs. */ export declare function videoAsIs(source: ProviderSource, facts: VideoFacts, limits: Limits, call: ProviderCall): Promise>; /** One frame at each time asked, found by seek: at most `imagesPerCall`, each within the image limits and together * within a result's share of the request. `missing` lists the times that gave no frame. */ export declare function videoFrames(provider: VideoProvider, source: ProviderSource, request: { readonly atS: readonly number[]; readonly maxEdge: number; }, limits: Limits, call: ProviderCall): Promise>; /** The window as one video part within the inline budget: stream copy when it fits, else one re-encode, never the whole * file. The file the provider wrote is read back and removed. */ export declare function videoClip(provider: VideoProvider, source: ProviderSource, window: { readonly fromS: number; readonly toS: number; }, limits: Limits, call: ProviderCall): Promise>; export {};