UNPKG

4.01 kBTypeScriptView Raw
1import { GetObjectRequest, GetObjectCommandOutput, PutObjectRequest, CopyObjectRequest, _Object, DeleteObjectCommandOutput } from '@aws-sdk/client-s3';
2import { StorageOptions, StorageLevel } from './Storage';
3import { CancelTokenSource } from 'axios';
4declare type ListObjectsCommandOutputContent = _Object;
5export interface S3ProviderGetConfig extends StorageOptions {
6 download?: boolean;
7 track?: boolean;
8 expires?: number;
9 provider?: string;
10 progressCallback?: (progress: any) => any;
11 cancelTokenSource?: CancelTokenSource;
12 bucket?: GetObjectRequest['Bucket'];
13 cacheControl?: GetObjectRequest['ResponseCacheControl'];
14 contentDisposition?: GetObjectRequest['ResponseContentDisposition'];
15 contentEncoding?: GetObjectRequest['ResponseContentEncoding'];
16 contentLanguage?: GetObjectRequest['ResponseContentLanguage'];
17 contentType?: GetObjectRequest['ResponseContentType'];
18 SSECustomerAlgorithm?: GetObjectRequest['SSECustomerAlgorithm'];
19 SSECustomerKey?: GetObjectRequest['SSECustomerKey'];
20 SSECustomerKeyMD5?: GetObjectRequest['SSECustomerKeyMD5'];
21}
22export declare type S3ProviderGetOuput<T> = T extends {
23 download: true;
24} ? GetObjectCommandOutput : string;
25export interface S3ProviderPutConfig extends StorageOptions {
26 progressCallback?: (progress: any) => any;
27 track?: boolean;
28 cancelTokenSource?: CancelTokenSource;
29 serverSideEncryption?: PutObjectRequest['ServerSideEncryption'];
30 SSECustomerAlgorithm?: PutObjectRequest['SSECustomerAlgorithm'];
31 SSECustomerKey?: PutObjectRequest['SSECustomerKey'];
32 SSECustomerKeyMD5?: PutObjectRequest['SSECustomerKeyMD5'];
33 SSEKMSKeyId?: PutObjectRequest['SSEKMSKeyId'];
34 acl?: PutObjectRequest['ACL'];
35 bucket?: PutObjectRequest['Bucket'];
36 cacheControl?: PutObjectRequest['CacheControl'];
37 contentDisposition?: PutObjectRequest['ContentDisposition'];
38 contentEncoding?: PutObjectRequest['ContentEncoding'];
39 contentType?: PutObjectRequest['ContentType'];
40 expires?: PutObjectRequest['Expires'];
41 metadata?: PutObjectRequest['Metadata'];
42 tagging?: PutObjectRequest['Tagging'];
43 useAccelerateEndpoint?: boolean;
44}
45export interface S3ProviderPutOutput {
46 key: string;
47}
48export interface S3ProviderRemoveConfig extends StorageOptions {
49 bucket?: string;
50}
51export declare type S3ProviderRemoveOutput = DeleteObjectCommandOutput;
52export interface S3ProviderListConfig extends StorageOptions {
53 bucket?: string;
54 maxKeys?: number;
55}
56export interface S3ProviderListOutputItem {
57 key: ListObjectsCommandOutputContent['Key'];
58 eTag: ListObjectsCommandOutputContent['ETag'];
59 lastModified: ListObjectsCommandOutputContent['LastModified'];
60 size: ListObjectsCommandOutputContent['Size'];
61}
62export declare type S3ProviderListOutput = S3ProviderListOutputItem[];
63export interface S3CopyTarget {
64 key: string;
65 level?: StorageLevel;
66 identityId?: string;
67}
68export declare type S3CopySource = S3CopyTarget;
69export declare type S3CopyDestination = Omit<S3CopyTarget, 'identityId'>;
70export interface S3ProviderCopyConfig extends StorageOptions {
71 cancelTokenSource?: CancelTokenSource;
72 bucket?: CopyObjectRequest['Bucket'];
73 cacheControl?: CopyObjectRequest['CacheControl'];
74 contentDisposition?: CopyObjectRequest['ContentDisposition'];
75 contentLanguage?: CopyObjectRequest['ContentLanguage'];
76 contentType?: CopyObjectRequest['ContentType'];
77 expires?: CopyObjectRequest['Expires'];
78 tagging?: CopyObjectRequest['Tagging'];
79 acl?: CopyObjectRequest['ACL'];
80 metadata?: CopyObjectRequest['Metadata'];
81 serverSideEncryption?: CopyObjectRequest['ServerSideEncryption'];
82 SSECustomerAlgorithm?: CopyObjectRequest['SSECustomerAlgorithm'];
83 SSECustomerKey?: CopyObjectRequest['SSECustomerKey'];
84 SSECustomerKeyMD5?: CopyObjectRequest['SSECustomerKeyMD5'];
85 SSEKMSKeyId?: CopyObjectRequest['SSEKMSKeyId'];
86}
87export declare type S3ProviderCopyOutput = {
88 key: string;
89};
90export {};