UNPKG

@uploadx/gcs

Version:
22 lines (21 loc) 796 B
import { File, MetaStorage, MetaStorageOptions, UploadList } from '@uploadx/core'; import { GoogleAuth, GoogleAuthOptions } from 'google-auth-library'; export interface GCSMetaStorageOptions extends GoogleAuthOptions, MetaStorageOptions { bucket?: string; } export declare class GCSMetaStorage<T extends File = File> extends MetaStorage<T> { readonly config: GCSMetaStorageOptions; authClient: GoogleAuth; storageBaseURI: string; uploadBaseURI: string; constructor(config?: GCSMetaStorageOptions); /** * Returns metafile url * @param id - upload id */ getMetaPath(id: string): string; save(id: string, file: T): Promise<T>; delete(id: string): Promise<void>; get(id: string): Promise<T>; list(prefix: string): Promise<UploadList>; }