import { Bucket } from "./blob/bucket.js";
import { ErrNotFound, NotFoundError } from "./blob/driver.js";
import { File } from "./file.js";
export { ErrNotFound, NotFoundError };
export type Attributes = {
    Size: number;
    ModTime: Date;
    ContentType: string;
    Metadata: Record<string, string>;
};
export type ListObject = {
    Key: string;
    ModTime: Date;
    Size: number;
};
export declare const metadataOriginalName = "original-filename";
export declare const ThumbSizeRegex: RegExp;
export declare class System {
    #private;
    constructor(bucket: Bucket);
    static NewLocal(dirPath: string): System;
    static NewLocalAsync(dirPath: string): Promise<System>;
    static NewS3(bucketName: string, region: string, endpoint: string, accessKey: string, secret: string, s3ForcePathStyle: boolean): System;
    SetContext(ctx: unknown): void;
    Close(): Promise<void>;
    [Symbol.asyncDispose](): Promise<void>;
    Exists(fileKey: string): Promise<boolean>;
    Attributes(fileKey: string): Promise<Attributes>;
    GetReader(fileKey: string): Promise<SystemReader>;
    GetReaderAsync(fileKey: string): Promise<SystemAsyncReader>;
    GetFile(fileKey: string): Promise<SystemReader>;
    GetReuploadableFile(fileKey: string, preserveName: boolean): Promise<File>;
    Copy(srcKey: string, dstKey: string): Promise<void>;
    List(prefix: string): Promise<ListObject[]>;
    Upload(content: Uint8Array, fileKey: string): Promise<void>;
    UploadFile(file: File, fileKey: string): Promise<void>;
    UploadMultipart(header: {
        filename: string;
        size: number;
        buffer: Uint8Array;
    }, fileKey: string): Promise<void>;
    Delete(fileKey: string): Promise<void>;
    DeletePrefix(prefix: string): Promise<Error[]>;
    IsEmptyDir(dir: string): Promise<boolean>;
    Serve(res: {
        statusCode?: number;
        setHeader: (k: string, v: string) => void;
        getHeader: (k: string) => string | undefined;
        write?: (body: Uint8Array) => void;
        end: (body?: Uint8Array) => void;
    }, req: {
        headers?: Record<string, string | string[]>;
        url?: string;
    }, fileKey: string, name: string): Promise<Error | null>;
    ServeResponse(initialHeaders: Headers, req: {
        headers?: Record<string, string | string[]>;
        url?: string;
    }, fileKey: string, name: string, onClose?: () => void | Promise<void>): Promise<Response | Error>;
    CreateThumb(originalKey: string, thumbKey: string, thumbSize: string): Promise<Error | null>;
    private prepareServePlan;
}
export declare function NewLocal(dirPath: string): System;
export declare function NewLocalAsync(dirPath: string): Promise<System>;
export declare function NewS3(bucketName: string, region: string, endpoint: string, accessKey: string, secret: string, s3ForcePathStyle: boolean): System;
export declare class SystemReader {
    #private;
    constructor(buffer: Uint8Array, attrs: Attributes);
    read(size?: number): Uint8Array | null;
    readAll(): Uint8Array;
    seek(offset: number, whence?: number): number;
    close(): void;
    [Symbol.dispose](): void;
    ContentType(): string;
    ModTime(): Date;
    Size(): number;
    size(): number;
}
export declare class SystemAsyncReader {
    #private;
    constructor(reader: Awaited<ReturnType<Bucket["NewReader"]>>);
    read(size?: number): Promise<Uint8Array | null>;
    readAll(): Promise<Uint8Array>;
    seek(offset: number, whence?: number): number;
    close(): void;
    [Symbol.dispose](): void;
    ContentType(): string;
    ModTime(): Date;
    Size(): number;
    size(): number;
}
