import type { IValidation, TypeGuardError } from 'typia';
import type { LogLevel } from './log/index.ts';
/**
 * Base error class for all Keeta Anchor errors
 */
export declare class KeetaAnchorError extends Error {
    #private;
    static readonly name: string;
    private readonly keetaAnchorErrorObjectTypeID;
    private static readonly keetaAnchorErrorObjectTypeID;
    protected userError: boolean;
    readonly logLevel: LogLevel;
    get name(): string;
    protected set name(value: string);
    get statusCode(): number;
    protected set statusCode(value: number);
    get retryable(): boolean;
    protected set retryable(value: boolean);
    constructor(message: string);
    /**
     * Protected method to restore error properties from JSON
     * This allows subclasses to properly restore properties without using any
     */
    protected restoreFromJSON(other: {
        [key: string]: unknown;
    }): void;
    static isInstance(input: unknown): input is KeetaAnchorError;
    asErrorResponse(contentType: 'text/plain' | 'application/json', message?: string): {
        error: string;
        statusCode: number;
        contentType: string;
    };
    toJSON(): {
        ok: false;
        retryable: boolean;
        error: string;
        name: string;
        statusCode: number;
    };
    protected static hasPropWithValue<PROP extends string, VALUE extends string | number | boolean>(input: unknown, prop: PROP, value: VALUE): input is {
        [key in PROP]: VALUE;
    };
    /**
     * Extract common error properties from JSON input
     * This validates the structure and extracts properties needed for construction
     */
    protected static extractErrorProperties(input: unknown, expectedClass?: {
        name: string;
    }): {
        message: string;
        other: {
            [key: string]: unknown;
        };
    };
    static fromJSON(input: unknown): Promise<KeetaAnchorError>;
}
/**
 * User-facing error class that extends KeetaAnchorError
 */
export declare class KeetaAnchorUserError extends KeetaAnchorError {
    static readonly name: string;
    private readonly keetaAnchorUserErrorObjectTypeID;
    private static readonly keetaAnchorUserErrorObjectTypeID;
    protected userError: boolean;
    static isInstance(input: unknown): input is KeetaAnchorUserError;
    constructor(message: string);
    asErrorResponse(contentType: 'text/plain' | 'application/json'): {
        error: string;
        statusCode: number;
        contentType: string;
    };
    static fromJSON(input: unknown): Promise<InstanceType<typeof this>>;
}
interface KeetaAnchorUserValidationErrorDetails {
    fields: {
        path?: string | undefined;
        message: string;
        allowedValues?: string[];
        expected?: string;
        receivedValue?: unknown;
        valueRules?: {
            minimum?: string | undefined;
            maximum?: string | undefined;
        };
    }[];
}
type KeetaAnchorUserValidationErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAnchorUserValidationErrorDetails;
type TypeGuardErrorLike = Pick<TypeGuardError.IProps | IValidation.IError, 'path' | 'expected' | 'value'>;
declare const isTypeGuardErrorLike: (error: unknown) => error is TypeGuardErrorLike;
export declare class KeetaAnchorUserValidationError extends KeetaAnchorUserError implements KeetaAnchorUserValidationErrorDetails {
    static readonly isTypeGuardErrorLike: typeof isTypeGuardErrorLike;
    static readonly name: string;
    private readonly KeetaAnchorUserValidationErrorObjectTypeID;
    private static readonly KeetaAnchorUserValidationErrorObjectTypeID;
    protected userError: boolean;
    readonly fields: KeetaAnchorUserValidationErrorDetails['fields'];
    static isInstance(input: unknown): input is KeetaAnchorUserValidationError;
    constructor(args: KeetaAnchorUserValidationErrorDetails, message?: string);
    get statusCode(): number;
    asErrorResponse(contentType: 'text/plain' | 'application/json'): {
        error: string;
        statusCode: number;
        contentType: string;
    };
    toJSON(): KeetaAnchorUserValidationErrorJSON;
    static fromJSON(input: unknown): Promise<KeetaAnchorUserValidationError>;
    static fromTypeGuardError(input: TypeGuardErrorLike | TypeGuardErrorLike[], message?: string): KeetaAnchorUserValidationError;
}
/**
 * Failure mode for the certificate-chain gate.
 */
export type KeetaAnchorCertificateRequiredKind = 'missing' | 'untrusted';
export interface KeetaAnchorCertificateRequiredErrorJSONProperties {
    /**
     * Outer array: any-of (OR). Inner array: all-of (AND).
     */
    acceptedIssuers: {
        name: string;
        value: string;
    }[][];
    kind: KeetaAnchorCertificateRequiredKind;
}
type KeetaAnchorCertificateRequiredErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaAnchorCertificateRequiredErrorJSONProperties;
export declare class KeetaAnchorCertificateRequiredError extends KeetaAnchorUserError implements KeetaAnchorCertificateRequiredErrorJSONProperties {
    static readonly name: string;
    private readonly KeetaAnchorCertificateRequiredErrorObjectTypeID;
    private static readonly KeetaAnchorCertificateRequiredErrorObjectTypeID;
    readonly acceptedIssuers: {
        name: string;
        value: string;
    }[][];
    readonly kind: KeetaAnchorCertificateRequiredKind;
    constructor(args: KeetaAnchorCertificateRequiredErrorJSONProperties, message?: string);
    private static defaultMessage;
    static isInstance(input: unknown): input is KeetaAnchorCertificateRequiredError;
    asErrorResponse(contentType: 'text/plain' | 'application/json'): {
        error: string;
        statusCode: number;
        contentType: string;
    };
    toJSON(): KeetaAnchorCertificateRequiredErrorJSON;
    static fromJSON(input: unknown): Promise<KeetaAnchorCertificateRequiredError>;
}
export {};
//# sourceMappingURL=error.d.ts.map