import * as _supabase_storage_js from '@supabase/storage-js'; import { StorageClient, FileObject, TransformOptions, FileOptions } from '@supabase/storage-js'; type StorageFileApi = ReturnType; type DecodedStorageKey = { bucketId: string; path: string; }; type StoragePrivacy = 'public' | 'private'; declare const fetchDirectory: (fileApi: StorageFileApi, path: string) => Promise; type URLFetcher = (fileApi: StorageFileApi, path: string) => Promise; type URLFetcherConfig = { expiresIn?: number; ensureExistence?: boolean; download?: string | boolean | undefined; transform?: TransformOptions | undefined; }; declare const createUrlFetcher: (mode: StoragePrivacy, config?: URLFetcherConfig) => URLFetcher; type DirectoryURLsFetcher = (fileApi: StorageFileApi, path: string) => Promise<(FileObject & { url: string; })[]>; declare const createDirectoryUrlsFetcher: (mode: StoragePrivacy, config?: Pick) => DirectoryURLsFetcher; type Cache = { /** * The keys currently present in the cache */ cacheKeys: KeyType[]; /** * Decode a key. Should return null if not a Storage key. */ decode: (k: KeyType) => DecodedStorageKey | null; /** * The mutation function from the cache library */ mutate: (key: KeyType) => Promise; }; declare const mutatePaths: (bucketId: string, paths: string[], { cacheKeys, decode, mutate }: Cache) => Promise; declare const createRemoveDirectoryFetcher: (fileApi: StorageFileApi) => (path: string) => Promise<_supabase_storage_js.FileObject[]>; declare const createRemoveFilesFetcher: (fileApi: StorageFileApi) => (paths: string[]) => Promise<_supabase_storage_js.FileObject[]>; type BuildFileNameFn = ({ path, fileName, }: { path?: string; fileName: string; }) => string; type UploadFetcherConfig = Partial> & { buildFileName?: BuildFileNameFn; }; type UploadFileResponse = Awaited>; type UploadFileInput = { data: Parameters[1]; type?: string; name: string; metadata?: NonNullable[2]>['metadata']; }; type FileInput = File | UploadFileInput; declare const createUploadFetcher: (fileApi: StorageFileApi, config?: UploadFetcherConfig) => (files: FileList | FileInput[], path?: string) => Promise; export { type BuildFileNameFn, type Cache, type DecodedStorageKey, type FileInput, type StorageFileApi, type StoragePrivacy, type URLFetcherConfig, type UploadFetcherConfig, type UploadFileInput, type UploadFileResponse, createDirectoryUrlsFetcher, createRemoveDirectoryFetcher, createRemoveFilesFetcher, createUploadFetcher, createUrlFetcher, fetchDirectory, mutatePaths };