import { type DeclaredMimeType, type OriginalFilename, type PositiveSeconds, type Result, type SafeDownloadFilename, type SiteScopedStoragePath, type StorageBucketName, type StoragePath } from '@riverbankcms/core';
import { type FileAccessDeniedReason, type ActiveValidatedFileAsset, type FileActor, type FileAssetId, type FileUse } from './fileDomain';
export type FileDownloadDisposition = 'attachment' | 'inline';
export type FileDownloadResolutionError = {
    readonly tag: 'file-use-not-allowed';
    readonly requestedUse: FileUse;
} | {
    readonly tag: 'file-use-kind-mismatch';
    readonly requestedUse: FileUse;
    readonly assetKind: ActiveValidatedFileAsset['kind'];
} | {
    readonly tag: 'access-denied';
    readonly reason: FileAccessDeniedReason;
};
export type FileDownloadResolutionInput = {
    readonly asset: ActiveValidatedFileAsset;
    readonly actor: FileActor;
    readonly requestedUse: FileUse;
    readonly disposition?: FileDownloadDisposition;
};
export type FileDownloadResolutionPlan = (FileDownloadBasePlan & {
    readonly tag: 'public-url';
}) | (FileDownloadBasePlan & {
    readonly tag: 'signed-url';
    readonly expiresInSeconds: PositiveSeconds;
}) | (FileDownloadBasePlan & {
    readonly tag: 'internal-read';
});
type FileDownloadBasePlan = {
    readonly assetId: FileAssetId;
    readonly storageBucket: StorageBucketName;
    readonly storagePath: StoragePath | SiteScopedStoragePath;
    readonly mimeType: DeclaredMimeType;
    readonly originalFilename: OriginalFilename;
    readonly downloadFilename?: SafeDownloadFilename;
    readonly requestedUse: FileUse;
    readonly disposition: FileDownloadDisposition;
};
export declare function resolveFileDownload(input: FileDownloadResolutionInput): Result<FileDownloadResolutionPlan, FileDownloadResolutionError>;
export {};
