import { IFsError } from '../types.Error'; import { t } from '../common'; declare type EmptyObject = Record; declare type FileUri = string; declare type FilePath = string; declare type FileAddress = FileUri | FilePath; export declare type FsType = FsTypeLocal | FsTypeS3; export declare type FsTypeLocal = 'LOCAL'; export declare type FsTypeS3 = 'S3'; export declare type FsS3Permission = 'private' | 'public-read'; export declare type FsDriver = FsDriverS3 | FsDriverLocal; export declare type FsDriverLocal = IFsMembers; export declare type FsDriverS3 = IFsMembers & { bucket: string; endpoint: t.S3Endpoint; }; export declare type IFsWriteOptions = IFsWriteOptionsLocal | IFsWriteOptionsS3; export declare type IFsWriteOptionsLocal = { filename?: string; }; export declare type IFsWriteOptionsS3 = { filename?: string; permission?: FsS3Permission; }; export declare type IFsCopyOptions = IFsCopyOptionsLocal | IFsCopyOptionsS3; export declare type IFsCopyOptionsLocal = EmptyObject; export declare type IFsCopyOptionsS3 = { permission?: FsS3Permission; }; declare type IFsMembers = { type: Type; dir: string; resolve: FsPathResolver; info: FsInfoMethod; read: FsReadMethod; write: FsWriteMethod; copy: FsCopyMethod; delete: FsDeleteMethod; }; export declare type FsPathResolver = (uri: string, options?: O) => IFsLocation; export declare type FsInfoMethod = (address: FileAddress) => Promise; export declare type FsReadMethod = (address: FileAddress) => Promise; export declare type FsWriteMethod = (address: FileAddress, data: Uint8Array | ReadableStream, options?: WriteOptions) => Promise; export declare type FsCopyMethod = (source: FileAddress, target: FileAddress, options?: CopyOptions) => Promise; export declare type FsDeleteMethod = (address: FileAddress | FileAddress[]) => Promise; export declare type IFsLocation = { path: string; props: { [key: string]: string; }; }; export declare type IFsResolveOptions = IFsResolveOptionsLocal | IFsResolveOptionsS3; export declare type IFsResolveOptionsLocal = IFsResolveOptionsS3; export declare type IFsResolveOptionsS3 = IFsResolveDefaultOptionsS3 | IFsResolveSignedGetOptionsS3 | IFsResolveSignedPutOptionsS3 | IFsResolveSignedPostOptionsS3; export declare type IFsResolveDefaultOptionsS3 = { type: 'DEFAULT'; endpoint?: t.S3EndpointKind; }; export declare type IFsResolveSignedGetOptionsS3 = t.S3SignedUrlGetObjectOptions & { type: 'SIGNED/get'; endpoint?: t.S3EndpointKind; }; export declare type IFsResolveSignedPutOptionsS3 = t.S3SignedUrlPutObjectOptions & { type: 'SIGNED/put'; }; export declare type IFsResolveSignedPostOptionsS3 = t.S3SignedPostOptions & { type: 'SIGNED/post'; }; declare type IFsMetaCommon = { path: string; location: string; hash: string; bytes: number; }; export declare type IFsMeta = IFsMetaLocal | IFsMetaS3; export declare type IFsMetaLocal = IFsMetaCommon; export declare type IFsMetaS3 = IFsMetaCommon & { 's3:etag'?: string; 's3:permission'?: t.FsS3Permission; }; export declare type IFsFileData = I & { data: Uint8Array; }; declare type IFsInfoCommon = { uri: string; exists: boolean; }; declare type IFsReadCommon = { uri: string; ok: boolean; status: number; error?: IFsError; }; declare type IFsWriteCommon = { uri: string; ok: boolean; status: number; error?: IFsError; }; declare type IFsDeleteCommon = { ok: boolean; status: number; uris: string[]; locations: string[]; error?: IFsError; }; declare type IFsCopyCommon = { ok: boolean; status: number; error?: IFsError; source: string; target: string; }; export declare type IFsInfo = IFsInfoLocal | IFsInfoS3; export declare type IFsRead = IFsReadLocal | IFsReadS3; export declare type IFsWrite = IFsWriteLocal | IFsWriteS3; export declare type IFsDelete = IFsDeleteLocal | IFsDeleteS3; export declare type IFsCopy = IFsCopyLocal | IFsCopyS3; export declare type IFsInfoLocal = IFsInfoCommon & IFsMetaLocal & { kind: 'file' | 'dir' | 'unknown'; }; export declare type IFsReadLocal = IFsReadCommon & { file?: IFsFileData; }; export declare type IFsWriteLocal = IFsWriteCommon & { file: IFsFileData; }; export declare type IFsDeleteLocal = IFsDeleteCommon; export declare type IFsCopyLocal = IFsCopyCommon; export declare type IFsInfoS3 = IFsInfoCommon & IFsMetaS3; export declare type IFsReadS3 = IFsReadCommon & { file?: IFsFileData; 's3:etag'?: string; 's3:permission'?: t.FsS3Permission; }; export declare type IFsWriteS3 = IFsWriteCommon & { file: IFsFileData; 's3:etag'?: string; 's3:permission'?: t.FsS3Permission; }; export declare type IFsDeleteS3 = IFsDeleteCommon; export declare type IFsCopyS3 = IFsCopyCommon; export {};