UNPKG

3.54 kBTypeScriptView Raw
1import { DownloadTask, StorageDownloadDataOutput, StorageGetUrlOutput, StorageItemWithKey, StorageItemWithPath, StorageListOutput, UploadTask } from '../../../types';
2/**
3 * Base type for an S3 item.
4 */
5export interface ItemBase {
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 * @deprecated Use {@link ListOutputItemWithPath} instead.
17 * type for S3 list item with key.
18 */
19export type ListOutputItem = Omit<ItemWithKey, 'metadata'>;
20/**
21 * type for S3 list item with path.
22 */
23export type ListOutputItemWithPath = Omit<ItemWithPath, 'metadata'>;
24/**
25 * @deprecated Use {@link ItemWithPath} instead.
26 */
27export type ItemWithKey = ItemBase & StorageItemWithKey;
28/**
29 * type for S3 list item with path.
30 */
31export type ItemWithPath = ItemBase & StorageItemWithPath;
32/**
33 * Output type for S3 downloadData API.
34 * @deprecated Use {@link DownloadDataWithPathOutput} instead.
35 */
36export type DownloadDataOutput = DownloadTask<StorageDownloadDataOutput<ItemWithKey>>;
37/**
38 * Output type with path for S3 downloadData API.
39 */
40export type DownloadDataWithPathOutput = DownloadTask<StorageDownloadDataOutput<ItemWithPath>>;
41/**
42 * Output type for S3 getUrl API.
43 * @deprecated Use {@link GetUrlWithPathOutput} instead.
44 */
45export type GetUrlOutput = StorageGetUrlOutput;
46/**
47 * Output type with path for S3 getUrl API.
48 * */
49export type GetUrlWithPathOutput = StorageGetUrlOutput;
50/**
51 * Output type for S3 uploadData API.
52 * @deprecated Use {@link UploadDataWithPathOutput} instead.
53 */
54export type UploadDataOutput = UploadTask<ItemWithKey>;
55/**
56 * Output type with path for S3 uploadData API.
57 * */
58export type UploadDataWithPathOutput = UploadTask<ItemWithPath>;
59/**
60 * Output type for S3 getProperties API.
61 * @deprecated Use {@link GetPropertiesWithPathOutput} instead.
62 * */
63export type GetPropertiesOutput = ItemBase & StorageItemWithKey;
64/**
65 * Output type with path for S3 getProperties API.
66 * */
67export type GetPropertiesWithPathOutput = ItemBase & StorageItemWithPath;
68/**
69 * @deprecated Use {@link ListAllWithPathOutput} instead.
70 * Output type for S3 list API. Lists all bucket objects.
71 */
72export type ListAllOutput = Omit<StorageListOutput<ListOutputItem>, 'excludedSubpaths'>;
73/**
74 * Output type with path for S3 list API. Lists all bucket objects.
75 */
76export type ListAllWithPathOutput = StorageListOutput<ListOutputItemWithPath>;
77/**
78 * @deprecated Use {@link ListPaginateWithPathOutput} instead.
79 * Output type for S3 list API. Lists bucket objects with pagination.
80 */
81export type ListPaginateOutput = Omit<StorageListOutput<ListOutputItem>, 'excludedSubpaths'> & {
82 nextToken?: string;
83};
84/**
85 * Output type with path for S3 list API. Lists bucket objects with pagination.
86 */
87export type ListPaginateWithPathOutput = StorageListOutput<ListOutputItemWithPath> & {
88 nextToken?: string;
89};
90/**
91 * Output type with path for S3 copy API.
92 * @deprecated Use {@link CopyWithPathOutput} instead.
93 */
94export type CopyOutput = Pick<ItemWithKey, 'key'>;
95/**
96 * Output type with path for S3 copy API.
97 */
98export type CopyWithPathOutput = Pick<ItemWithPath, 'path'>;
99/**
100 * @deprecated Use {@link RemoveWithPathOutput} instead.
101 * Output type with key for S3 remove API.
102 */
103export type RemoveOutput = Pick<ItemWithKey, 'key'>;
104/**
105 * Output type with path for S3 remove API.
106 */
107export type RemoveWithPathOutput = Pick<ItemWithPath, 'path'>;