# API `@deepkit/filesystem-aws-s3`

```shell
npm install @deepkit/filesystem-aws-s3
```

## API reference of @deepkit/filesystem-aws-s3

### FilesystemAwsS3Options (type)

```typescript
interface FilesystemAwsS3Options extends S3ClientConfigType {
    bucket: string;
    path?: string;
    region: string;
    accessKeyId: string;
    secretAccessKey: string;
    endpoint?: string;

    /**
     * Use path-style URLs (http://endpoint/bucket/key) instead of virtual-hosted style.
     * Required for most S3-compatible services (MinIO, S3Mock, ...).
     */
    forcePathStyle?: boolean;

    /**
     * If enabled, the adapter will create directories when writing files.
     *
     * Default: true
     */
    directoryEmulation?: boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/filesystem-aws-s3/src/s3-adapter.ts#L17

### FilesystemAwsS3Adapter (class)

```typescript
export class FilesystemAwsS3Adapter implements FilesystemAdapter {
    client: S3Client;
    constructor(public options: FilesystemAwsS3Options);
    supportsVisibility();
    supportsDirectory();
    publicUrl(path: string): string;
    async makeDirectory(path: string, visibility: FileVisibility): Promise<void>;
    async files(path: string): Promise<FilesystemFile[]>;
    async allFiles(path: string, reporter: Reporter): Promise<FilesystemFile[]>;
    async copy(source: string, destination: string, reporter: Reporter): Promise<void>;
    async delete(paths: string[]): Promise<void>;
    async deleteDirectory(path: string, reporter: Reporter): Promise<void>;
    async exists(paths: string[]): Promise<boolean>;
    async get(path: string): Promise<FilesystemFile | undefined>;
    async move(source: string, destination: string, reporter: Reporter): Promise<void>;
    async read(path: string, reporter: Reporter): Promise<Uint8Array>;
    async write(path: string, contents: Uint8Array, visibility: FileVisibility, reporter: Reporter): Promise<void>;
    async getVisibility(path: string): Promise<FileVisibility>;
    async setVisibility(path: string, visibility: FileVisibility): Promise<void>;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/filesystem-aws-s3/src/s3-adapter.ts#L39
