use-simple-camera
Version:
Production-ready React Hooks for Camera, Video Recording, QR/Barcode Scanning, Motion Detection, and Audio Analysis. Zero dependencies, fully typed, and easy to use.
24 lines (23 loc) • 792 B
TypeScript
export interface StorageConfig {
dbName?: string;
storeName?: string;
defaultRetentionMs?: number;
}
export interface UploadOptions {
url: string;
method?: "PUT" | "POST";
headers?: Record<string, string>;
withCredentials?: boolean;
timeout?: number;
onProgress?: (progress: number) => void;
}
export declare const useStorage: (config?: StorageConfig) => {
saveToLocal: (blob: Blob, filename: string, options?: {
retentionMs?: number;
}) => Promise<void>;
getFromLocal: (filename: string) => Promise<Blob | null>;
deleteFromLocal: (filename: string) => Promise<void>;
downloadFromLocal: (filename: string) => Promise<void>;
uploadToRemote: (blob: Blob, options: UploadOptions) => Promise<void>;
isUploading: boolean;
};