import { Element, Namespace, MemberElement, ObjectElement } from '@swagger-api/apidom-core';
import { ReferenceElement, PathItemElement, LinkElement, ExampleElement, SchemaElement, OpenApi3_2Element } from '@swagger-api/apidom-ns-openapi-3-2';
import Reference from '../../../Reference.ts';
import { AncestorLineage } from '../../util.ts';
import type { ReferenceOptions } from '../../../options/index.ts';
/**
 * Custom mutation replacer.
 * @public
 */
export declare const mutationReplacer: (newElement: Element, oldElement: Element, key: string | number, parent: Element | undefined) => void;
/**
 * @public
 */
export interface OpenAPI3_2DereferenceVisitorOptions {
    readonly namespace: Namespace;
    readonly reference: Reference;
    readonly options: ReferenceOptions;
    readonly indirections?: Element[];
    readonly ancestors?: AncestorLineage<Element>;
    readonly refractCache?: Map<string, Element>;
    readonly allOfDiscriminatorMapping?: Map<string, Element[]>;
    readonly $selfValue?: string;
}
/**
 * @public
 */
declare class OpenAPI3_2DereferenceVisitor {
    protected readonly indirections: Element[];
    protected readonly namespace: Namespace;
    protected readonly reference: Reference;
    protected readonly options: ReferenceOptions;
    protected readonly ancestors: AncestorLineage<Element>;
    protected readonly refractCache: Map<string, Element>;
    protected readonly allOfDiscriminatorMapping: Map<string, Element[]>;
    protected $selfValue: string | undefined;
    constructor({ reference, namespace, options, indirections, ancestors, refractCache, allOfDiscriminatorMapping, $selfValue, }: OpenAPI3_2DereferenceVisitorOptions);
    protected handleDereferenceError(error: unknown, refEl: Element, directAncestors?: Set<Element>): undefined;
    protected getNestedVisitorOptions(referencingElement: ObjectElement): ReferenceOptions;
    protected toBaseURI(uri: string): string;
    protected toReference(uri: string): Promise<Reference>;
    protected toAncestorLineage(ancestors: (Element | Element[] | undefined)[]): [AncestorLineage<Element>, Set<Element>];
    /**
     * Extract $self value from a Reference's root OpenAPI 3.2 document.
     * Returns the $self value if present and valid, otherwise undefined.
     */
    protected extractSelfFromReference(reference: Reference): string | undefined;
    readonly OpenApi3_2Element: {
        enter: (openApi3_2Element: OpenApi3_2Element) => undefined;
        leave: (openApi3_2Element: OpenApi3_2Element, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
            replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
        }) => OpenApi3_2Element | undefined;
    };
    ReferenceElement(referencingElement: ReferenceElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
        replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
    }): Promise<any>;
    PathItemElement(referencingElement: PathItemElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
        replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
    }): Promise<any>;
    LinkElement(linkElement: LinkElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
        replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
    }): Promise<LinkElement | undefined>;
    ExampleElement(exampleElement: ExampleElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
        replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
    }): Promise<ExampleElement | undefined>;
    MemberElement(memberElement: MemberElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
        replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
    }): Promise<false | MemberElement | undefined>;
    SchemaElement(referencingElement: SchemaElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
        replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
    }): Promise<any>;
}
export default OpenAPI3_2DereferenceVisitor;
