import type { Environment } from '../config/environments.js'; import { type ApiDeps } from '../http/client.js'; export declare const TRAILER_UPLOAD_URL_PATH = "/api/cli/v1/trailer/upload-url"; export declare const TRAILER_ATTACH_PATH = "/api/cli/v1/trailer/attach"; /** The gallery cap api-server enforces (`MAX_MEDIA_ITEMS` in game-page-edit-rules.ts). */ export declare const MAX_GALLERY_ITEMS = 12; export interface TrailerUploadRequest { gameId: string; /** `video/mp4` or `video/webm` — api-server refuses anything else before minting. */ contentType: string; bytes: number; } /** `cli-trailer.ts`'s upload-url response. */ export interface TrailerUploadTicket { uploadUrl: string; /** Where the video is served from once the PUT lands — what `attach` is given. */ publicUrl: string; path: string; maxBytes: number; /** Echoed by the server: the exact value the PUT's Content-Type must carry. */ contentType: string; } export interface TrailerAttachRequest { gameId: string; url: string; /** The previous trailer's URL, dropped from the gallery so a re-run replaces instead of adding. */ replaceUrl?: string; } /** `cli-trailer.ts`'s attach response. */ export interface TrailerAttachResult { media: unknown[]; pageUrl: string; isPublic: boolean; /** False until the game's first `bitmagic publish` — the page exists but is not live yet. */ published: boolean; } /** Context the 409 message can use: where the creator goes to make room. */ export interface TrailerAttachHints { /** The My games page, from the publish record when there has been a publish. */ manageUrl?: string; } /** * Ask api-server for a signed PUT under `game-media//`. Ownership and the video-only rule * are checked there before anything is minted, so a refusal here has cost nothing. */ export declare function mintTrailerUploadUrl(environment: Environment, accessToken: string, body: TrailerUploadRequest, deps: ApiDeps): Promise; /** * Put the uploaded video at the front of the game page's gallery. api-server drops any item already * pointing at `url` or at `replaceUrl`, so re-running replaces the previous trailer rather than * stacking a new one beside it. */ export declare function attachTrailer(environment: Environment, accessToken: string, body: TrailerAttachRequest, deps: ApiDeps, hints?: TrailerAttachHints): Promise;