import { File, FileStorageDriver } from '@proteinjs/db-file'; import { GoogleCloudStorageConfig } from './DefaultGoogleCloudStorageConfigFactory'; /** * ERRORS: every operation runs inside {@link GoogleCloudStorageDriver.guarded}, so what leaves this * driver on a failure is a `FileStorageError` — a code, a plain message, the HTTP status — and * never the storage client's own error. The client's error holds the request it made (`config`, * `response.request`, `response.config`), and that request holds this driver's access token in its * `Authorization` header: an application that logged the error it caught would write a live * credential. A missing object is the `not-found` code on every read and overwrite. */ export declare class GoogleCloudStorageDriver implements FileStorageDriver { private storage; private bucketName; private objectPrefix; constructor(config?: GoogleCloudStorageConfig); createFile(file: File, fileData: string): Promise; getFileData(fileId: string): Promise; updateFileData(fileId: string, data: string): Promise; updateFile(file: File): Promise; getSignedUrl(fileId: string, options?: { ttlMs?: number; }): Promise; deleteFile(fileId: string): Promise; /** * THE one place an object's name is decided (``): every operation * addresses its object through here, so a configured prefix holds for all of them or none. */ private object; /** * THE one door a storage-client call leaves through. Whatever the client throws is replaced by * this driver's own error; nothing of the client's error object rides on it. */ private guarded; /** * Reads exactly three plain facts off the client's error — an HTTP status, a connection error * code, its message TEXT — and builds the driver's error from them. The client's error itself, * its `config`, `request`, `response` and `errors` are never copied, wrapped or kept as a cause. */ private driverError; /** The client reports the HTTP status as its error's `code`; an upload's error carries it as `status` or on its `response`. */ private httpStatus; private getDefaultConfig; } //# sourceMappingURL=GoogleCloudStorageDriver.d.ts.map