UNPKG

1.41 kBTypeScriptView Raw
1import { StorageDownloadDataOutput, StorageGetUrlOutput, StorageItem, StorageListOutput, DownloadTask, UploadTask } from '../../../types';
2/**
3 * type for S3 item.
4 */
5export interface Item extends StorageItem {
6 /**
7 * VersionId used to reference a specific version of the object.
8 */
9 versionId?: string;
10 /**
11 * A standard MIME type describing the format of the object data.
12 */
13 contentType?: string;
14}
15/**
16 * type for S3 list item.
17 */
18export type ListOutputItem = Omit<StorageItem, 'metadata'>;
19/**
20 * Output type for S3 downloadData API.
21 */
22export type DownloadDataOutput = DownloadTask<StorageDownloadDataOutput<Item>>;
23/**
24 * Output type for S3 getUrl API.
25 */
26export type GetUrlOutput = StorageGetUrlOutput;
27/**
28 * Output type for S3 uploadData API.
29 */
30export type UploadDataOutput = UploadTask<Item>;
31/**
32 * Output type for S3 getProperties API.
33 */
34export type GetPropertiesOutput = Item;
35/**
36 * Output type for S3 list API. Lists all bucket objects.
37 */
38export type ListAllOutput = StorageListOutput<ListOutputItem>;
39/**
40 * Output type for S3 list API. Lists bucket objects with pagination.
41 */
42export type ListPaginateOutput = StorageListOutput<ListOutputItem> & {
43 nextToken?: string;
44};
45/**
46 * Output type for S3 copy API.
47 */
48export type CopyOutput = Pick<Item, 'key'>;
49/**
50 * Output type for S3 remove API.
51 */
52export type RemoveOutput = Pick<Item, 'key'>;