import { type DeclaredMimeType, type OriginalFilename, type Result, type SafeDownloadFilename, type UploadSessionId, type UtcIsoDateTimeString } from '@riverbankcms/core';
import { type FileActor, type UploadIntent, type UploadPolicyError } from './fileDomain';
import type { FileUploadSessionRecord } from './filePersistence';
import { FILE_STORAGE_BUCKETS, type FileStoragePathError } from './fileStorage';
export type CreateFileUploadSessionPlanInput = {
    readonly uploadSessionId: UploadSessionId;
    readonly actor: FileActor;
    readonly intent: UploadIntent;
    readonly originalFilename: OriginalFilename;
    readonly safeDownloadFilename: SafeDownloadFilename;
    readonly declaredMimeType?: DeclaredMimeType;
    readonly now: UtcIsoDateTimeString;
    readonly expiresAt: UtcIsoDateTimeString;
};
export type CreateFileUploadSessionPlan = {
    readonly uploadSession: FileUploadSessionRecord;
    /**
     * Staged uploads always enter the temporary bucket; finalization derives the
     * durable bucket from the upload policy once bytes and MIME type are known.
     */
    readonly stagedUpload: {
        readonly bucket: typeof FILE_STORAGE_BUCKETS.temporary;
        readonly path: FileUploadSessionRecord['stagedStoragePath'];
    };
};
export type CreateFileUploadSessionPlanError = {
    readonly tag: 'upload-policy-rejected';
    readonly error: UploadPolicyError;
} | {
    readonly tag: 'unsupported-staged-upload-actor';
    readonly actor: FileActor['tag'];
} | {
    readonly tag: 'invalid-staged-storage-path';
    readonly error: FileStoragePathError;
};
/**
 * Purely creates a pending upload-session record and its staged storage target.
 * New upload entry points should use this before requesting a signed upload URL,
 * so path ownership and upload policy are derived once at the boundary.
 */
export declare function planFileUploadSessionCreation(input: CreateFileUploadSessionPlanInput): Result<CreateFileUploadSessionPlan, CreateFileUploadSessionPlanError>;
