/// <reference types="node" />
import type { S3Client as ClientType } from "@aws-sdk/client-s3";
import type { RequestPresigningArguments } from "@smithy/types";
import { FileData } from "./types";
export declare const MEDIA_BUCKET: string;
export declare const r2Config: {
    readonly credentials: {
        readonly accessKeyId: string;
        readonly secretAccessKey: string;
    };
    readonly endpoint: string;
    readonly region: string;
};
export declare function getR2(): Promise<ClientType>;
export declare function isR2(): string;
export declare function isExistingInR2(file: FileData): Promise<boolean>;
export declare function saveToR2(file: FileData, contents: Buffer | Blob): Promise<Partial<FileData>>;
export interface SignedUrlOptions extends RequestPresigningArguments {
    method?: "get" | "put" | "post" | string;
    extension?: string;
    key?: string;
    url?: string;
    redirect?: string;
}
export declare function getR2URLFileData(url: string | URL): FileData;
export declare function getSignedUrl(options: SignedUrlOptions): Promise<string>;
export interface R2SignedURL {
    url: string;
    fields?: Record<string, string>;
}
export declare function getSigned(options: SignedUrlOptions): Promise<R2SignedURL>;
export declare function readFileFromR2(file: FileData): Promise<Buffer>;
export declare function unlinkFromR2(file: FileData): Promise<void>;
