@gravitywelluk/aws
Version:
Library of commonly used AWS wrapper functions to communicate with the AWS SDK
22 lines (21 loc) • 891 B
TypeScript
/// <reference types="node" />
import type stream from "stream";
import { PromiseResult } from "aws-sdk/lib/request";
import type AWSModule from "aws-sdk";
interface GetObjectFromS3 {
(asStream: true, getObjectParams: GetS3ObjectParams, awsS3ConfigOverrides?: AWSModule.S3.ClientConfiguration): Promise<stream.Readable>;
(asStream: false, getObjectParams: GetS3ObjectParams, awsS3ConfigOverrides?: AWSModule.S3.ClientConfiguration): Promise<PromiseResult<AWSModule.S3.GetObjectOutput, AWSModule.AWSError>>;
}
export interface GetS3ObjectParams {
path: string;
bucket: string;
}
/**
* Gets an object from AWS S3
*
* @param asStream - Whether to return a stream
* @param getObjectParams - The parameters required to get the object from S3
* @param awsS3ConfigOverrides - Configuration option overrides
*/
export declare const getObjectFromS3: GetObjectFromS3;
export {};