export declare const TEXT_LIKE_FILE_EXTENSIONS: readonly [".txt", ".text", ".log", ".md", ".markdown", ".csv", ".tsv", ".json", ".jsonl", ".ndjson", ".xml", ".yaml", ".yml", ".toml", ".ini", ".cfg", ".conf", ".env", ".sh", ".bash", ".zsh", ".js", ".jsx", ".ts", ".tsx", ".mts", ".cts", ".py", ".go", ".java", ".rb", ".php", ".sql", ".css", ".scss", ".html", ".htm"];
type UploadAttachmentDataLike = {
    data: string;
    mimeType?: string | null;
    name?: string;
    fileName?: string;
};
type UploadImageAttachmentLike = {
    type: 'image';
    image: string;
    fileName: string;
};
type UploadPdfAttachmentLike = {
    type: 'pdf';
    data: string;
    fileName: string;
};
type UploadTextAttachmentLike = {
    type: 'csv' | 'css' | 'json' | 'txt' | 'yaml';
    content: string;
    fileName: string;
    mimeType?: string | null;
};
type UploadUnsupportedAttachmentLike = {
    type: 'uploaded';
};
export type AttachmentUploadSourceLike = Blob | File | UploadAttachmentDataLike | UploadImageAttachmentLike | UploadPdfAttachmentLike | UploadTextAttachmentLike | UploadUnsupportedAttachmentLike;
export interface AttachmentUploadDescriptor {
    blob: Blob;
    fileName: string;
    mimeType: string;
}
export type AttachmentUploadScopeType = 'app' | 'org';
export type AttachmentUploadPurpose = 'attachment' | 'context';
export interface AppContextUploadDto {
    applicationId: string;
    branchName?: string;
    commitId?: string;
    purpose: 'context';
    scopeType: 'app';
    uploaded: true;
}
export interface AttachmentUploadDto {
    applicationId?: string;
    attachmentId: string;
    contentUrl: string;
    fileName: string;
    mimeType: string | null;
    purpose: AttachmentUploadPurpose;
    scopeType: AttachmentUploadScopeType;
    signedUrl: string;
    signedUrlExpiresAt: string;
    storageKey: string;
}
export type UploadBodyDto = AppContextUploadDto | AttachmentUploadDto;
export type AttachmentUploadServerDto = AttachmentUploadDto;
export interface UploadedAttachmentLike {
    type: 'uploaded';
    url: string;
    signedUrl: string;
    mediaType: string;
    fileName: string;
    label?: string;
    insight?: string;
    storageKey?: string;
    signedUrlExpiresAt: string;
    scopeType?: AttachmentUploadScopeType;
    applicationId?: string;
}
export interface AttachmentUploadMetadata {
    label?: string;
    insight?: string;
}
export declare function buildAttachmentUploadMetadata(params: AttachmentUploadMetadata): AttachmentUploadMetadata | undefined;
export declare function isTextLikeMimeType(mimeType: string): boolean;
export declare function isOfficeXml(params: {
    fileName?: string;
    mimeType?: string | null;
}): boolean;
export declare function getTextAttachmentType(params: {
    fileName?: string;
    mimeType?: string | null;
}): 'csv' | 'css' | 'json' | 'txt' | 'yaml' | null;
export declare function normalizeAttachmentMimeType(params: {
    fileName?: string;
    mimeType?: string | null;
    fallbackMimeType?: string | null;
}): string | undefined;
export declare function toAttachmentUploadDescriptor(source: AttachmentUploadSourceLike, options?: {
    fallbackFileName?: string;
    fallbackMimeType?: string;
}): AttachmentUploadDescriptor | null;
export declare function buildAttachmentUploadFormData(params: {
    descriptor: AttachmentUploadDescriptor;
    prefix: string;
    fieldName?: string;
    branchId?: string;
    commitId?: string;
    metadata?: AttachmentUploadMetadata;
}): FormData;
export declare function createUploadedAttachmentFromServer(params: {
    response: AttachmentUploadServerDto;
    fallbackFileName: string;
    fallbackMimeType: string;
    label?: string;
    insight?: string;
}): UploadedAttachmentLike;
/**
 * Shared transport for POST /api/v1/files/upload. Builds form-data, URL with query params,
 * fetches, and returns the raw server DTO. Callers map to their own types (e.g. Attachment,
 * AttachmentUploadResult).
 */
export declare function uploadAttachmentToServerApi(params: {
    baseUrl: string;
    authorization: string;
    descriptor: AttachmentUploadDescriptor;
    scopeType: AttachmentUploadScopeType;
    purpose: AttachmentUploadPurpose;
    applicationId?: string;
    branchName?: string;
    commitId?: string;
    prefix?: string;
    metadata?: AttachmentUploadMetadata;
}): Promise<AttachmentUploadServerDto>;
export {};
//# sourceMappingURL=attachment-upload.d.ts.map