UNPKG

909 BPlain TextView Raw
1
2import type { Bucket } from './bucket';
3
4/////////////////////
5// Those are the common types to avoid uncessary cyclic module reference. (best practice)
6////
7
8export type BucketType = 's3' | 'gs';
9
10export 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
19export type BucketFileDeleted = BucketFile & { deleted: boolean };
20
21/** Interface used for the bucket.list */
22export 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 */
31export type ListArg = ListOptions | string;
32