import type { Region, ServerSize, ServerConfig, ServerResult, SnapshotInfo, ServerMode } from "../types/index.js";
/** Default timeout for provider API calls (15 seconds) */
export declare const API_TIMEOUT_MS = 15000;
/** Pre-configured axios instance with timeout for all provider API calls */
export declare const apiClient: import("axios").AxiosInstance;
export interface CloudProvider {
    name: string;
    displayName: string;
    validateToken(token: string): Promise<boolean>;
    getRegions(): Region[];
    getServerSizes(): ServerSize[];
    getAvailableLocations(): Promise<Region[]>;
    getAvailableServerTypes(location: string, mode?: ServerMode): Promise<ServerSize[]>;
    uploadSshKey(name: string, publicKey: string): Promise<string>;
    createServer(config: ServerConfig): Promise<ServerResult>;
    getServerStatus(serverId: string): Promise<string>;
    getServerDetails(serverId: string): Promise<ServerResult>;
    destroyServer(serverId: string): Promise<void>;
    rebootServer(serverId: string): Promise<void>;
    createSnapshot(serverId: string, name: string): Promise<SnapshotInfo>;
    listSnapshots(serverId: string): Promise<SnapshotInfo[]>;
    deleteSnapshot(snapshotId: string): Promise<void>;
    restoreSnapshot(serverId: string, snapshotId: string): Promise<void>;
    getSnapshotCostEstimate(serverId: string): Promise<string>;
    findServerByIp(ip: string): Promise<string | null>;
}
/**
 * Sanitize axios response data — whitelist-only approach.
 * Preserves known error message fields, strips everything else
 * to prevent API tokens or sensitive data from leaking via error cause chains.
 */
export declare function sanitizeResponseData(data: unknown): unknown;
/**
 * Higher-order function for standard provider error handling.
 * Wraps an async operation with stripSensitiveData + consistent error formatting.
 * Use for methods with the standard try/catch pattern. Methods with custom error
 * handling (e.g., uploadSshKey with 409) should NOT use this.
 *
 * @param extractApiMessage - Optional function to extract provider-specific error
 *   messages from axios response data (e.g., Hetzner's `data.error.message`,
 *   Linode's `data.errors[].reason`). When provided and the error is an AxiosError,
 *   the extracted message takes priority over `error.message`.
 */
export declare function withProviderErrorHandling<T>(operation: string, fn: () => Promise<T>, extractApiMessage?: (data: unknown) => string | undefined): Promise<T>;
/** Assert serverId is safe for API URLs (alphanumeric, hyphens, slashes for Linode image IDs) */
export declare function assertValidServerId(serverId: string): void;
/**
 * Shared SSH key upload with conflict recovery.
 * All providers follow the same pattern: POST to create, catch conflict status,
 * GET list to find existing key by matching public key.
 */
export interface SshKeyUploadConfig {
    apiToken: string;
    baseUrl: string;
    /** POST endpoint path (e.g., "/ssh_keys", "/account/keys") */
    createPath: string;
    /** POST body key name for the public key (e.g., "public_key", "ssh_key") */
    bodyKeyField: string;
    /** POST body key for the name field (default: "name", Linode uses "label") */
    nameField?: string;
    /** GET endpoint path for listing keys */
    listPath: string;
    /** Response array field (e.g., "ssh_keys", "data") */
    listArrayField: string;
    /** Key field in list response items (e.g., "public_key", "ssh_key") */
    listKeyField: string;
    /** HTTP status codes that indicate key conflict (e.g., [409], [422], [400]) */
    conflictStatuses: number[];
    /** Whether to call .toString() on the returned ID */
    idToString?: boolean;
}
export declare function uploadSshKeyWithConflict(name: string, publicKey: string, config: SshKeyUploadConfig): Promise<string>;
export declare function stripSensitiveData(error: unknown): void;
//# sourceMappingURL=base.d.ts.map