UNPKG

1.16 kBTypeScriptView Raw
1import { ResponseBodyMixin } from '@aws-amplify/core/internals/aws-client-utils';
2export type StorageItem = {
3 /**
4 * Key of the object
5 */
6 key: string;
7 /**
8 * Creation date of the object.
9 */
10 lastModified?: Date;
11 /**
12 * Size of the body in bytes.
13 */
14 size?: number;
15 /**
16 * An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at
17 * a URL.
18 */
19 eTag?: string;
20 /**
21 * The user-defined metadata for the object uploaded to S3.
22 * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#UserMetadata
23 */
24 metadata?: Record<string, string>;
25};
26export type StorageDownloadDataOutput<T extends StorageItem> = T & {
27 body: ResponseBodyMixin;
28};
29export type StorageGetUrlOutput = {
30 /**
31 * presigned URL of the given object.
32 */
33 url: URL;
34 /**
35 * expiresAt is date in which generated URL expires.
36 */
37 expiresAt: Date;
38};
39export type StorageUploadOutput<Item extends StorageItem> = Item;
40export type StorageListOutput<Item extends StorageItem> = {
41 items: Item[];
42};