Returns {
clearError: () => void;
connectUserFiles: (getStreamUrl: string | (() => Promise<string>)) => void;
createFolder: (location: string, roomName?: string) => Promise<void>;
deleteFile: (fileId: string) => Promise<void>;
deleteFolder: (location: string) => Promise<void>;
disconnectUserFiles: () => void;
error: string | null;
fetchUserFiles: (
userId: string,
opts?: { brandOrgId?: string; hasPublicFilesRole?: boolean },
) => Promise<UserFile[]>;
files: UserFile[];
getFileUrl: (
fileId: string,
options?: { stream?: boolean },
) => Promise<string>;
getFolderMigrationState: (
userId?: string,
) => Promise<{ eligible: boolean; state: "pending" | "complete" }>;
isConnected: boolean;
isLoading: boolean;
lastFetchedAt: number | null;
moveFile: (fileId: string, newLocation: string) => Promise<void>;
removeUserFileLocal: (fileId: string) => void;
renameFile: (fileId: string, newFilename: string) => Promise<void>;
renameFolder: (
folderId: string,
name: string,
) => Promise<{ location: string }>;
setFolderMigrationState: (
enable: boolean,
userId?: string,
) => Promise<
{
state: "pending"
| "complete";
stats: Record<string, number> | null;
violations: string[];
},
>;
shareFile: (
fileId: string,
userIds: string[],
sharedRoom?: string,
allowReshare?: boolean,
) => Promise<void>;
updateFileAppData: (
fileId: string,
appData: Record<string, unknown>,
) => Promise<void>;
uploadFile: (
file: File,
location: string,
resourceType?: string,
userIdOverride?: string,
) => Promise<{ fileId: string }>;
upsertUserFileLocal: (file: UserFile) => void;
}
Object containing user files state and actions
Access all user files across all rooms, with optional real-time updates and management actions.