import { B2CInstance } from '../../instance/index.js';
import { type JobExecution, type WaitForJobOptions } from '../jobs/run.js';
import { type CommerceAppManifest } from './validate.js';
/**
 * Options for CAP installation.
 */
export interface CommerceAppInstallOptions {
    /** Target site ID to install the app on. */
    siteId: string;
    /** Keep the uploaded zip on the instance after install (default: false). */
    keepArchive?: boolean;
    /** Wait options for job completion. */
    waitOptions?: WaitForJobOptions;
}
/**
 * Result of a CAP installation.
 */
export interface CommerceAppInstallResult {
    /** Job execution details. */
    execution: JobExecution;
    /** App name (id from commerce-app.json). */
    appName: string;
    /** App version. */
    appVersion: string;
    /** Uploaded archive filename. */
    archiveFilename: string;
    /** Whether the archive was kept on the instance. */
    archiveKept: boolean;
}
/**
 * Installs a Commerce App Package (CAP) on a B2C Commerce instance.
 *
 * Accepts a local directory or zip file. Reads the commerce-app.json manifest
 * to determine app name, version, and domain. Uploads the zip to WebDAV and
 * executes the sfcc-install-commerce-app system job.
 *
 * @param instance - B2C instance to install to
 * @param target - Path to a CAP directory or .zip file
 * @param options - Install options including required siteId
 * @returns Install result with job execution details
 * @throws JobExecutionError if the install job fails
 *
 * @example
 * ```typescript
 * const result = await commerceAppInstall(instance, './commerce-avalara-tax-app-v0.2.5', {
 *   siteId: 'RefArch',
 * });
 * ```
 */
export declare function commerceAppInstall(instance: B2CInstance, target: string, options: CommerceAppInstallOptions): Promise<CommerceAppInstallResult>;
export declare function readManifest(capDir: string): CommerceAppManifest;
/** Prefix site ID with "Sites-" if not already present. */
export declare function normalizeSiteId(siteId: string): string;
