VidStudio SDK reference
    Preparing search index...

    Class MemoryFileStorage

    The StorageProvider contract held in a Map. Used by Node tests and by anything that wants media files without OPFS.

    Paths have the same shape as the OPFS provider's, so a test can read a MediaAsset.file_path and recognise it.

    Implements

    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>

    • Memory has no directory entries, so removing a tree is removing every path under it — nested paths included, unlike OPFS where a subdirectory remains.

      Parameters

      • ...segments: string[]

      Returns Promise<void>

    • True when a file is stored at this path. For test assertions.

      Parameters

      • path: string

      Returns boolean

    • Memory has no directory entries, so a directory exists exactly while some file is stored under it — the same shape OPFS reports, minus empty folders.

      Parameters

      • ...segments: string[]

      Returns Promise<StoredEntry[]>

    • Every stored path. For test assertions.

      Returns string[]

    • Retrieve a File by its path token

      Parameters

      • path: string

      Returns Promise<File>

    • Re-date a stored file, so a test can age it past a sweep's threshold.

      Parameters

      • path: string
      • lastModified: number

      Returns void

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

      Parameters

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

      Returns Promise<string>