@goldstack/template-s3
Version:
Building blocks for linking a package to an AWS S3 bucket.
33 lines • 1.31 kB
TypeScript
import { S3Client } from '@aws-sdk/client-s3';
/**
* Type for the createS3Client function from mock-aws-s3-v3
*/
export type CreateS3ClientSignature = (options: {
localDirectory: string;
s3Client?: S3Client;
bucket: string;
}) => S3Client;
/**
* Gets a mocked S3 client for local development
*/
export declare const getMockedS3: (goldstackConfig: any, bucket?: string) => S3Client;
/**
* Gets the local bucket name for a given configuration
*/
export declare function getLocalBucketName(goldstackConfig: any): string;
/**
* Gets the local bucket URL for a given configuration
*/
export declare function getLocalBucketUrl(goldstackConfig: any): string;
/**
* Connects to S3, using a mocked client for local deployment or a real S3 client for other environments
*/
export declare function connect(goldstackConfig: any, packageSchema: any, bucket?: string): Promise<S3Client>;
export declare const isMocked: (client: S3Client) => boolean;
/**
* Resets all mocked S3 state. Should be called in afterAll to prevent
* state leakage between test suites and to allow Jest to exit cleanly.
*/
export declare function resetMockS3(): void;
export declare function resetMocksIfRequired(deploymentName: string | undefined, goldstackConfig: any): void;
//# sourceMappingURL=connectLocal.d.ts.map