UNPKG

1.17 kBTypeScriptView Raw
1import * as React from 'react';
2import { ReactFireOptions, ObservableStatus } from './';
3import type { UploadTask, UploadTaskSnapshot, StorageReference, FirebaseStorage } from 'firebase/storage';
4/**
5 * Subscribe to the progress of a storage task
6 *
7 * @param task - the task you want to listen to
8 * @param ref - reference to the blob the task is acting on
9 * @param options
10 */
11export declare function useStorageTask<T = unknown>(task: UploadTask, ref: StorageReference, options?: ReactFireOptions<T>): ObservableStatus<UploadTaskSnapshot | T>;
12/**
13 * Subscribe to a storage ref's download URL
14 *
15 * @param ref - reference to the blob you want to download
16 * @param options
17 */
18export declare function useStorageDownloadURL<T = string>(ref: StorageReference, options?: ReactFireOptions<T>): ObservableStatus<string | T>;
19declare type StorageImageProps = {
20 storagePath: string;
21 storage?: FirebaseStorage;
22 suspense?: boolean;
23 placeHolder?: JSX.Element;
24};
25export declare function StorageImage(props: StorageImageProps & React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>): JSX.Element;
26export {};