VidStudio SDK reference
    Preparing search index...

    Interface StorageProvider

    interface StorageProvider {
        clearDirectory(...segments: string[]): Promise<void>;
        commit(path: string): Promise<void>;
        createWritable(
            ...segments: string[],
        ): Promise<{ path: string; writable: FileSystemWritableFileStream | null }>;
        delete(path: string): Promise<void>;
        deleteDirectoryTree(...segments: string[]): Promise<void>;
        describe?(): StorageDescription;
        list(...segments: string[]): Promise<StoredEntry[]>;
        read(path: string): Promise<File>;
        write(projectId: string, assetId: string, file: File): Promise<string>;
    }

    Implemented by

    Index
    • Delete all files in a directory/namespace. Idempotent.

      Parameters

      • ...segments: string[]

      Returns Promise<void>

    • Mark a file written via createWritable() as ready for reliable reads. Providers that mirror to a secondary backend (e.g. Cache API) use this to backfill from the primary write target. No-op for OPFS-only. Best-effort — failures are logged but do not throw.

      Parameters

      • path: string

      Returns Promise<void>

    • Open a seekable writable stream for large outputs (export MP4, proxy). Returns writable: null if backend doesn't support streaming writes. Callers MUST check null and fall back to buffer mode (ArrayBufferTarget).

      Parameters

      • ...segments: string[]

      Returns Promise<{ path: string; writable: FileSystemWritableFileStream | null }>

    • Delete a file by path token. Idempotent (no-op if missing).

      Parameters

      • path: string

      Returns Promise<void>

    • Delete a directory and everything under it, the directory itself included. Idempotent. Use this (not clearDirectory) when the directory will never be written to again, so no empty directory is left occupying storage.

      Parameters

      • ...segments: string[]

      Returns Promise<void>

    • Absent when a worker cannot reach this storage (memory storage); exports then stay on the page.

      Returns StorageDescription

    • List the entries directly inside a directory, files and subdirectories alike. Returns an empty array when the directory does not exist, and never creates it. Needed to find stored files that no database row points at.

      Parameters

      • ...segments: string[]

      Returns Promise<StoredEntry[]>

    • Retrieve a File by its path token

      Parameters

      • path: string

      Returns Promise<File>

    • Persist a File, return an opaque path token stored in MediaAsset.file_path

      Parameters

      • projectId: string
      • assetId: string
      • file: File

      Returns Promise<string>