UNPKG

react-firehooks

Version:

Lightweight dependency-free collection of React hooks for Firebase

13 lines (12 loc) 764 B
import { StorageError, StorageReference } from "firebase/storage"; import { ValueHookResult } from "../common/index.js"; export type UseDownloadURLResult = ValueHookResult<string, StorageError>; /** * Returns the download URL of a Google Cloud Storage object * @param reference Reference to a Google Cloud Storage object * @returns Download URL, loading state, and error * - value: Download URL; `undefined` if download URL is currently being fetched, or an error occurred * - loading: `true` while fetching the download URL; `false` if the download URL was fetched successfully or an error occurred * - error: `undefined` if no error occurred */ export declare function useDownloadURL(reference: StorageReference | undefined | null): UseDownloadURLResult;