mirror of
https://github.com/docmost/docmost.git
synced 2026-05-08 07:13:06 +08:00
efb0a9317b
* Allow upload of large files * feat: createByteCountingStream utility function. --------- Co-authored-by: gpapp <gergely.papp@itworks.hu>
28 lines
691 B
TypeScript
28 lines
691 B
TypeScript
import { Readable } from 'stream';
|
|
|
|
export interface StorageDriver {
|
|
upload(filePath: string, file: Buffer | Readable): Promise<void>;
|
|
|
|
uploadStream(filePath: string, file: Readable, options?: { recreateClient?: boolean }): Promise<void>;
|
|
|
|
copy(fromFilePath: string, toFilePath: string): Promise<void>;
|
|
|
|
read(filePath: string): Promise<Buffer>;
|
|
|
|
readStream(filePath: string): Promise<Readable>;
|
|
|
|
exists(filePath: string): Promise<boolean>;
|
|
|
|
getUrl(filePath: string): string;
|
|
|
|
getSignedUrl(filePath: string, expireIn: number): Promise<string>;
|
|
|
|
delete(filePath: string): Promise<void>;
|
|
|
|
getDriver(): any;
|
|
|
|
getDriverName(): string;
|
|
|
|
getConfig(): Record<string, any>;
|
|
}
|