UNPKG

@uploadx/gcs

Version:
24 lines (23 loc) 842 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 options: GCSMetaStorageOptions; authClient: GoogleAuth; storageBaseURI: string; uploadBaseURI: string; bucket: string; constructor(options?: 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>; toString(): string; }