react-aws-s3-typescript
Version:
Open source npm package to upload your files into AWS S3 Bucket directly using react(typescript template)
57 lines (56 loc) • 1.4 kB
TypeScript
import { ListObjectsCommandOutput } from '@aws-sdk/client-s3';
export declare type DateISOString = string;
export declare type XAmzDate = string;
export declare type DateYMD = string;
export interface IConfig {
bucketName: string;
dirName?: string;
region: string;
accessKeyId: string;
secretAccessKey: string;
s3Url?: string;
}
declare type GenericType = {
[key: string]: string;
};
declare type Conditions = [
GenericType,
GenericType,
string[],
string[],
string[],
GenericType,
GenericType,
GenericType,
GenericType,
GenericType
];
export declare type Policy = {
conditions: Conditions;
expiration: DateISOString;
};
export declare type UploadFileResponse = {
bucket: string;
key: string;
location: string;
status: number;
};
export declare type DeleteFileResponse = {
ok: boolean;
status: number;
message: string;
fileName: string;
};
export declare type ListFilesResponse = {
message: string;
data: ListObjectsCommandOutput;
};
declare type BaseErrorResponse = {
err: string;
errMessage: string;
data: any;
};
export declare type ListFilesErrorResponse = BaseErrorResponse;
export declare type UploadFileErrorResponse = BaseErrorResponse;
export declare type DeleteFileErrorResponse = BaseErrorResponse;
export {};