import type { B2CInstance } from '../../instance/index.js'; import type { CartridgeMapping } from './cartridges.js'; /** * Represents a file to upload or delete, with source and destination paths. */ export interface FileChange { /** Absolute path to the file on disk */ src: string; /** Cartridge-relative destination path (e.g. "cartridgeName/path/to/file.js") */ dest: string; } /** * Callbacks for file upload/delete operations. */ export interface UploadFilesOptions { /** Called after files are successfully uploaded */ onUpload?: (files: string[]) => void; /** Called after files are successfully deleted */ onDelete?: (files: string[]) => void; /** Called when an error occurs */ onError?: (error: Error) => void; } /** * Maps an absolute file path to its cartridge-relative destination. * * @param absolutePath - The absolute path to a file * @param cartridges - The list of discovered cartridge mappings * @returns The file change with src and dest, or undefined if the path is not inside any cartridge */ export declare function fileToCartridgePath(absolutePath: string, cartridges: CartridgeMapping[]): FileChange | undefined; /** * Uploads and deletes files on an instance via WebDAV. * * This is the core batch-upload pipeline used by both `watchCartridges` and * the VS Code extension. It: * 1. Filters out non-existent upload files * 2. Creates a ZIP archive of upload files * 3. Uploads via WebDAV PUT and unzips on server * 4. Deletes files (skipping any that were also uploaded in the same batch) * * @param instance - B2C instance to sync to * @param codeVersion - Code version to deploy to * @param uploads - Files to upload * @param deletes - Files to delete * @param options - Callbacks for upload/delete/error events * @returns Resolves when uploads and deletes complete */ export declare function uploadFiles(instance: B2CInstance, codeVersion: string, uploads: FileChange[], deletes: FileChange[], options?: UploadFilesOptions): Promise;