Hiyve Components - v1.0.0
    Preparing search index...

    File cache context value

    interface FileCacheContextValue {
        _isProvided?: boolean;
        cacheError: string | null;
        cacheState: CacheState;
        createFolder: (name: string, parentPath?: string) => Promise<boolean>;
        deleteFile: (fileId: string) => Promise<boolean>;
        deleteFolder: (path: string) => Promise<boolean>;
        getFilesByType: (types: string[]) => Promise<FileEntry[]>;
        getFileTree: (path?: string) => Promise<FileTree | null>;
        getFileUrl: (file: FileEntry) => Promise<string | null>;
        isReady: boolean;
        isSwitching: boolean;
        loadFolder: (path: string) => Promise<FileTree | null>;
        moveFile: (fileId: string, newPath: string) => Promise<boolean>;
        refreshCache: () => Promise<void>;
        renameFile: (fileId: string, newName: string) => Promise<boolean>;
        resourceTypes: string[];
        shareFile: (files: FileEntry[], userIds: string[]) => Promise<boolean>;
        syncWithServer: () => Promise<void>;
        uploadFile: (file: File, path?: string) => Promise<FileEntry | null>;
    }
    Index

    Properties

    _isProvided?: boolean

    Sentinel to distinguish a real provider from the default context value.

    cacheError: string | null
    cacheState: CacheState
    createFolder: (name: string, parentPath?: string) => Promise<boolean>
    deleteFile: (fileId: string) => Promise<boolean>
    deleteFolder: (path: string) => Promise<boolean>
    getFilesByType: (types: string[]) => Promise<FileEntry[]>
    getFileTree: (path?: string) => Promise<FileTree | null>
    getFileUrl: (file: FileEntry) => Promise<string | null>

    Get a URL for viewing/downloading a file. Uses client API methods for different resource types:

    • Regular files: client.getFileURL
    • Recordings: client.getRecordingUrls
    • Compositions: client.getCompositionUrl
    isReady: boolean
    isSwitching: boolean
    loadFolder: (path: string) => Promise<FileTree | null>
    moveFile: (fileId: string, newPath: string) => Promise<boolean>
    refreshCache: () => Promise<void>
    renameFile: (fileId: string, newName: string) => Promise<boolean>
    resourceTypes: string[]

    All distinct resource types present in the cached files

    shareFile: (files: FileEntry[], userIds: string[]) => Promise<boolean>

    Share files with specified users.

    Accepts FileEntry[] (not just fileIds) because cascade resolution needs the resourceType to determine which files contain references to other files (e.g. clip-compositions referencing audio clips).

    Sharing is two-phase:

    1. Share the explicitly selected files
    2. Best-effort cascade: discover and share referenced files (failures in cascade do not fail the overall operation)
    syncWithServer: () => Promise<void>
    uploadFile: (file: File, path?: string) => Promise<FileEntry | null>