import { z } from "zod"; import { StorageMediaData } from '../../index'; import { MediaInfo } from "../ffmpeg/types/FFmpeg.types"; /** * Zod schema for the serialized library media record stored in projects. */ export declare const MediaDataSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodString; name: z.ZodOptional; filename: z.ZodString; permanentUrl: z.ZodOptional; hash: z.ZodOptional; mimeType: z.ZodOptional; customData: z.ZodOptional, "many">>; placeholderClipIds: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type: string; id: string; filename: string; name?: string | undefined; permanentUrl?: string | undefined; hash?: string | undefined; mimeType?: string | undefined; customData?: [string, unknown][] | undefined; placeholderClipIds?: string[] | undefined; }, { type: string; id: string; filename: string; name?: string | undefined; permanentUrl?: string | undefined; hash?: string | undefined; mimeType?: string | undefined; customData?: [string, unknown][] | undefined; placeholderClipIds?: string[] | undefined; }>; /** * Single filmstrip frame and its timeline timestamp. */ export interface IFilmstripData { data: Uint8Array; timestamp: number; } /** * Processing state used for secondary derived media artifacts such as filmstrips and sample data. */ export declare enum MediaProcessStatusEnum { NONE = "none", PARTIAL = "partial", DONE = "done", ERROR = "error" } /** * High-level lifecycle state of a library media item. */ export declare enum MediaDataStatus { NONE = "none", ERROR = "error", LOADING = "loading", TRANSCODING = "transcoding", /** @deprecated Use MediaData::filmstripState instead */ FILMSTRIP = "filmstrip", READY = "ready", DESTROYED = "destroyed" } /** * Library record representing one imported media asset and all of its derived runtime metadata. * * A `MediaData` instance tracks the original payload, FFmpeg-mountable source, derived previews, * placeholder-clip resolution, storage sync, and hash/metadata information needed across the editor. */ export declare class MediaData { private id; status: MediaDataStatus; thumbnail?: string; /** This is an url for a filmstrip placeholder */ filmstrip?: string; type: string; private name; filename: string; width?: number; height?: number; duration?: number; blobUrl?: string; /** Media payload used by previews, playback, object URLs, and FFmpeg mounts. Preserves File instances when available. */ mediaSource?: Blob | File; size: number; metadata?: MediaInfo; storePath?: string; permanentUrl?: string; hash?: string; mimeType?: string; customData?: Map; placeholderClipIds: string[]; private sampleData; private filmstripData; private filmstripState; private workerFSMountPoint?; private workerFSFilePath?; private fetchAbortController; audioSplit?: string; private static lockMediaInfo; private waitForMediaInfoUnlock; static unlockMediaInfo(): void; constructor(id?: string); init(): Promise; destroy(): Promise; private getFetchSignal; private isAbortError; /** * Returns the stable library media id. * * @returns Media id. */ getId(): string; /** * Returns the current display name of the media asset. * * @returns Media name. */ getName(): string; /** Returns the media payload, preserving File identity when available. */ getMediaSource(): File | Blob | undefined; hasName(): boolean; setName(name: string): void; /** * Builds the normalized storage payload used by storage providers. * * The method only succeeds once the media is fully ready and has a content hash plus a source payload. * * @returns Storage payload, or `null` when the media is not ready for persistence. */ getStorageMediaData(): Promise; store(): Promise; restore(): Promise; addPlaceholderClip(clipId: string): Promise; /** * Returns the ids of placeholder clips currently waiting for this media to finish loading. * * @returns Read-only placeholder clip id list. */ getPlaceholderClips(): ReadonlyArray; removePlaceholderClip(clipId: string): void; removeAllPlaceholderClips(): void; prepareFilmstrip(): void; setFilmstripState(state: MediaProcessStatusEnum): void; addFilmstripFrame(filmstripData: IFilmstripData | null): void; private extractFilmstrip; getFilmstripState(): MediaProcessStatusEnum; getFilmstripData(): IFilmstripData[]; getFilmstripDataRange(start: number, end: number): IFilmstripData[]; private hasSvgXmlSignature; private normalizeSvgMetadata; private isWorkerFSMountedPath; private buildWritableStorePath; private ensureWorkerFSRoot; private cleanupWorkerFSMount; private mountInputToWorkerFS; private doExtractAudioSamples; getAudioSamples(startTime: number, duration?: number): Float32Array[] | null; private checkPlaceholderClips; setCustomData(key: string, value: unknown, overwrite?: boolean): boolean; getCustomData(key: string): unknown; hasCustomData(key: string): boolean; removeCustomData(key: string): boolean; clearAllCustomData(): void; setAllCustomData(data: Map): void; getAllCustomData(): Map | undefined; hookM3U8(file: File | string | Uint8Array, mimeType: string | undefined): Promise<{ status: boolean; data?: undefined; filePath?: undefined; mimeType?: undefined; } | { status: boolean; data: Uint8Array; filePath: string; mimeType: string; }>; hookMKV(file: File | string | Uint8Array, mimeType: string | undefined): Promise<{ status: boolean; data?: undefined; filePath?: undefined; mimeType?: undefined; } | { status: boolean; data: Uint8Array; filePath: string; mimeType: string; }>; hookRawData(file: File | string | Uint8Array, mimeType: string | undefined): Promise<{ status: boolean; data?: undefined; filePath?: undefined; mimeType?: undefined; } | { status: boolean; data: Uint8Array; filePath: string; mimeType: string; }>; load(file: File | string | Uint8Array, mimeType?: string, filename?: string): Promise; checkForSvgThumbnail(): Promise; setPermanentUrl(url: string | null): void; getHash(): string | undefined; waitForStatus(status: MediaDataStatus, checkIntervalMS?: number, timeoutMS?: number): Promise; /** * Serializes the media record into project-safe data. * * @returns Serialized media record payload. */ serialize(): { type: string; id: string; filename: string; name?: string | undefined; permanentUrl?: string | undefined; hash?: string | undefined; mimeType?: string | undefined; customData?: [string, unknown][] | undefined; placeholderClipIds?: string[] | undefined; }; /** * Reconstructs a media record shell from serialized project data. * * Runtime-only fields such as thumbnails, FFmpeg paths, and loaded blob URLs are intentionally not restored here. * * @param data Serialized media payload. * @returns Deserialized media record. */ static deserialize(data: object): MediaData; }