/**
 * Pluginator Error Types
 *
 * Standardized error types with discriminators for type narrowing,
 * error codes for programmatic handling, and serialization for logging.
 */
/**
 * Error type discriminator
 */
export type ErrorType = 'network' | 'validation' | 'filesystem' | 'source' | 'auth' | 'config' | 'workflow' | 'security';
/**
 * Network error codes
 */
export type NetworkErrorCode = 'TIMEOUT' | 'CONNECTION_FAILED' | 'RATE_LIMITED' | 'SERVER_ERROR' | 'OFFLINE';
/**
 * Validation error codes
 */
export type ValidationErrorCode = 'INVALID_CONFIG' | 'INVALID_PLUGIN' | 'SCHEMA_MISMATCH' | 'MISSING_FIELD';
/**
 * Filesystem error codes
 */
export type FilesystemErrorCode = 'FILE_NOT_FOUND' | 'PERMISSION_DENIED' | 'DISK_FULL' | 'PATH_EXISTS' | 'WRITE_FAILED';
/**
 * Source error codes
 */
export type SourceErrorCode = 'API_ERROR' | 'PLUGIN_NOT_FOUND' | 'VERSION_MISMATCH' | 'UNSUPPORTED_SOURCE';
/**
 * Auth error codes
 */
export type AuthErrorCode = 'NOT_AUTHENTICATED' | 'TOKEN_EXPIRED' | 'INSUFFICIENT_TIER' | 'INVALID_CREDENTIALS';
/**
 * Config error codes
 */
export type ConfigErrorCode = 'PARSE_ERROR' | 'INVALID_VALUE' | 'MISSING_REQUIRED' | 'UNKNOWN_OPTION';
/**
 * Workflow error codes
 */
export type WorkflowErrorCode = 'SYNC_FAILED' | 'DOWNLOAD_FAILED' | 'UPDATE_CHECK_FAILED' | 'BACKUP_FAILED' | 'ROLLBACK_FAILED';
/**
 * Security error codes
 */
export type SecurityErrorCode = 'INTERNAL_ADDRESS' | 'PRIVATE_IP' | 'INVALID_PROTOCOL' | 'INVALID_URL';
/**
 * All error codes union
 */
export type ErrorCode = NetworkErrorCode | ValidationErrorCode | FilesystemErrorCode | SourceErrorCode | AuthErrorCode | ConfigErrorCode | WorkflowErrorCode | SecurityErrorCode;
/**
 * Serialized error format for logging
 */
export interface SerializedError {
    type: ErrorType;
    code: string;
    plgCode: string;
    message: string;
    retryable: boolean;
    context?: Record<string, unknown>;
    stack?: string;
}
/**
 * Base error class for all Pluginator errors
 */
export declare abstract class PluginatorError extends Error {
    abstract readonly type: ErrorType;
    abstract readonly code: string;
    readonly retryable: boolean;
    readonly context?: Record<string, unknown>;
    constructor(message: string, retryable?: boolean, context?: Record<string, unknown>);
    /**
     * Get the PLG-NNNN numeric error code
     */
    get plgCode(): string;
    /**
     * Serialize error for logging
     */
    toJSON(): SerializedError;
    /**
     * Get user-friendly error message
     */
    getUserMessage(): string;
}
/**
 * Network-related errors (HTTP, connectivity)
 */
export declare class NetworkError extends PluginatorError {
    readonly code: NetworkErrorCode;
    readonly statusCode?: number | undefined;
    readonly type: "network";
    readonly name: string;
    constructor(message: string, code: NetworkErrorCode, statusCode?: number | undefined, retryable?: boolean, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Validation errors (config, schema, data)
 */
export declare class ValidationError extends PluginatorError {
    readonly code: ValidationErrorCode;
    readonly field?: string | undefined;
    readonly type: "validation";
    readonly name: string;
    readonly retryable = false;
    constructor(message: string, code: ValidationErrorCode, field?: string | undefined, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Filesystem errors (read/write, permissions)
 */
export declare class FilesystemError extends PluginatorError {
    readonly code: FilesystemErrorCode;
    readonly path?: string | undefined;
    readonly type: "filesystem";
    readonly name: string;
    constructor(message: string, code: FilesystemErrorCode, path?: string | undefined, retryable?: boolean, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Plugin source errors (API, search, versions)
 */
export declare class SourceError extends PluginatorError {
    readonly code: SourceErrorCode;
    readonly source?: string | undefined;
    readonly statusCode?: number | undefined;
    readonly type: "source";
    readonly name: string;
    constructor(message: string, code: SourceErrorCode, source?: string | undefined, statusCode?: number | undefined, retryable?: boolean, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Authentication errors
 */
export declare class AuthError extends PluginatorError {
    readonly code: AuthErrorCode;
    readonly type: "auth";
    readonly name: string;
    readonly retryable = false;
    constructor(message: string, code: AuthErrorCode, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Configuration errors
 */
export declare class ConfigError extends PluginatorError {
    readonly code: ConfigErrorCode;
    readonly setting?: string | undefined;
    readonly type: "config";
    readonly name: string;
    readonly retryable = false;
    constructor(message: string, code: ConfigErrorCode, setting?: string | undefined, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Workflow errors (sync, download, update)
 */
export declare class WorkflowError extends PluginatorError {
    readonly code: WorkflowErrorCode;
    readonly operation?: string | undefined;
    readonly type: "workflow";
    readonly name: string;
    constructor(message: string, code: WorkflowErrorCode, operation?: string | undefined, retryable?: boolean, context?: Record<string, unknown>);
    getUserMessage(): string;
}
/**
 * Security errors (SSRF, URL validation)
 */
export declare class SecurityError extends PluginatorError {
    readonly code: SecurityErrorCode;
    readonly url?: string | undefined;
    readonly type: "security";
    readonly name: string;
    readonly retryable = false;
    constructor(message: string, code: SecurityErrorCode, url?: string | undefined, context?: Record<string, unknown>);
    getUserMessage(): string;
}
//# sourceMappingURL=error-types.d.ts.map