1 |
|
2 | import type { Bucket } from './bucket';
|
3 |
|
4 | /////////////////////
|
5 | // Those are the common types to avoid uncessary cyclic module reference. (best practice)
|
6 | ////
|
7 |
|
8 | export type BucketType = 's3' | 'gs';
|
9 |
|
10 | export interface BucketFile {
|
11 | bucket: Bucket;
|
12 | path: string;
|
13 | size?: number;
|
14 | updated?: string;
|
15 | contentType?: string;
|
16 | local?: string; // optional local file path
|
17 | }
|
18 |
|
19 | export type BucketFileDeleted = BucketFile & { deleted: boolean };
|
20 |
|
21 | /** Interface used for the bucket.list */
|
22 | export interface ListOptions {
|
23 | prefix?: string; // the prefix or glob
|
24 | delimiter?: boolean; // if true, the '/' delimiter will be set (might allow to set specific char later)
|
25 | }
|
26 |
|
27 | /** Argument type for listing a set of bucket item for .list and .download
|
28 | * - when string means it is the prefix (which can be of glob format)
|
29 | * - when ListOptions prefix can be specified as property.
|
30 | */
|
31 | export type ListArg = ListOptions | string;
|
32 |
|