import type { Output } from '../output.js'; /** api-server's gallery video cap (`POST_MEDIA_VIDEO_MAX_BYTES`), checked here before any request. */ export declare const MAX_TRAILER_BYTES: number; export interface TrailerPublishDeps { fetch: typeof globalThis.fetch; sleep: (ms: number) => Promise; /** Injected where the record is stamped; production omits it. */ now?: () => number; /** Test-only override; production omits it and the auth store reads ~/.bitmagic. */ baseDir?: string; } export interface TrailerPublishOptions { /** The project root (`loadProjectContext().root`). */ root: string; /** The video to upload; relative paths resolve against the current directory. */ file: string; /** Add it to the game page gallery after the upload. */ attach: boolean; output: Output; deps?: TrailerPublishDeps; } export interface TrailerPublishResult { publicUrl: string; bytes: number; contentType: string; attached: boolean; pageUrl?: string; published?: boolean; isPublic?: boolean; /** The previous trailer this one replaced in the gallery, when there was one. */ replacedUrl?: string; } /** * Does the file start the way its extension promises? An MP4 (and every ISO-BMFF sibling: .m4v, * .mov) carries `ftyp` at byte 4; a WebM is an EBML document and starts `1A 45 DF A3`. A file that * fails this was renamed, or is not finished being written — either way the bucket must not get it. */ export declare function looksLikeVideo(bytes: Uint8Array, contentType: string): boolean; /** The file's bytes and content type, or the refusal — nothing here touches the network. */ export declare function readTrailerFile(file: string): { bytes: Uint8Array; contentType: string; resolved: string; }; export declare function runTrailerPublish(options: TrailerPublishOptions): Promise;