import type { B2CInstance } from '../../instance/index.js';
import { type OcapiComponents } from '../../clients/index.js';
/** Code version type from OCAPI */
export type CodeVersion = OcapiComponents['schemas']['code_version'];
/** Result of listing code versions */
export type CodeVersionResult = OcapiComponents['schemas']['code_version_result'];
/**
 * Lists all code versions on an instance.
 *
 * @param instance - B2C instance to query
 * @returns Array of code versions
 * @throws Error if the request fails
 *
 * @example
 * ```typescript
 * const versions = await listCodeVersions(instance);
 * for (const v of versions) {
 *   console.log(v.id, v.active ? '(active)' : '');
 * }
 * ```
 */
export declare function listCodeVersions(instance: B2CInstance): Promise<CodeVersion[]>;
/**
 * Gets the currently active code version.
 *
 * @param instance - B2C instance to query
 * @returns The active code version, or undefined if none is active
 *
 * @example
 * ```typescript
 * const active = await getActiveCodeVersion(instance);
 * if (active) {
 *   console.log(`Active version: ${active.id}`);
 * }
 * ```
 */
export declare function getActiveCodeVersion(instance: B2CInstance): Promise<CodeVersion | undefined>;
/**
 * Activates a code version on an instance.
 *
 * @param instance - B2C instance
 * @param codeVersionId - Code version ID to activate
 * @throws Error if activation fails
 *
 * @example
 * ```typescript
 * await activateCodeVersion(instance, 'v2');
 * console.log('Code version v2 is now active');
 * ```
 */
export declare function activateCodeVersion(instance: B2CInstance, codeVersionId: string): Promise<void>;
/**
 * Reloads (re-activates) the current code version.
 *
 * This performs a "toggle" activation - first activating a different code version,
 * then re-activating the target version. This forces the instance to reload the code.
 *
 * @param instance - B2C instance
 * @param codeVersionId - Code version to reload (defaults to current active)
 * @throws Error if reload fails or no alternate version is available
 *
 * @example
 * ```typescript
 * // Reload the currently active code version
 * await reloadCodeVersion(instance);
 *
 * // Reload a specific code version
 * await reloadCodeVersion(instance, 'v1');
 * ```
 */
export declare function reloadCodeVersion(instance: B2CInstance, codeVersionId?: string): Promise<void>;
/**
 * Deletes a code version from an instance.
 *
 * @param instance - B2C instance
 * @param codeVersionId - Code version ID to delete
 * @throws Error if deletion fails (e.g., trying to delete active version)
 *
 * @example
 * ```typescript
 * await deleteCodeVersion(instance, 'old-version');
 * console.log('Code version deleted');
 * ```
 */
export declare function deleteCodeVersion(instance: B2CInstance, codeVersionId: string): Promise<void>;
/**
 * Creates a new code version on an instance.
 *
 * @param instance - B2C instance
 * @param codeVersionId - Code version ID to create
 * @throws Error if creation fails
 *
 * @example
 * ```typescript
 * await createCodeVersion(instance, 'v3');
 * console.log('Code version v3 created');
 * ```
 */
export declare function createCodeVersion(instance: B2CInstance, codeVersionId: string): Promise<void>;
