import '../../../../assert/js/assert.js';
import '../../../../globals.js';
import Pool from '../../../../phet-core/js/Pool.js';
import { Display, Node, PDOMPeer, Trail, TransformTracker } from '../../imports.js';
declare class PDOMInstance {
    private id;
    parent: PDOMInstance | null;
    private display;
    trail: Trail | null;
    isRootInstance: boolean;
    node: Node | null;
    children: PDOMInstance[];
    peer: PDOMPeer | null;
    private invisibleCount;
    private relativeNodes;
    private relativeVisibilities;
    private relativeListeners;
    transformTracker: TransformTracker | null;
    private isDisposed;
    /**
     * Constructor for PDOMInstance, uses an initialize method for pooling.
     *
     * @param parent - parent of this instance, null if root of PDOMInstance tree
     * @param display
     * @param trail - trail to the node for this PDOMInstance
     */
    constructor(parent: PDOMInstance | null, display: Display, trail: Trail);
    /**
     * Initializes a PDOMInstance, implements construction for pooling.
     *
     * @param parent - null if this PDOMInstance is root of PDOMInstance tree
     * @param display
     * @param trail - trail to node for this PDOMInstance
     * @returns - Returns 'this' reference, for chaining
     */
    initializePDOMInstance(parent: PDOMInstance | null, display: Display, trail: Trail): PDOMInstance;
    /**
     * Adds a series of (sorted) accessible instances as children.
     */
    addConsecutiveInstances(pdomInstances: PDOMInstance[]): void;
    /**
     * Removes any child instances that are based on the provided trail.
     */
    removeInstancesForTrail(trail: Trail): void;
    /**
     * Removes all of the children.
     */
    removeAllChildren(): void;
    /**
     * Returns a PDOMInstance child (if one exists with the given Trail), or null otherwise.
     */
    findChildWithTrail(trail: Trail): PDOMInstance | null;
    /**
     * Remove a subtree of PDOMInstances from this PDOMInstance
     *
     * @param trail - children of this PDOMInstance will be removed if the child trails are extensions
     *                        of the trail.
     * (scenery-internal)
     */
    removeSubtree(trail: Trail): void;
    /**
     * Checks to see whether our visibility needs an update based on a pdomDisplays change.
     *
     * @param index - Index into the relativeNodes array (which node had the notification)
     */
    private checkAccessibleDisplayVisibility;
    /**
     * Update visibility of this peer's accessible DOM content. The hidden attribute will hide all of the descendant
     * DOM content, so it is not necessary to update the subtree of PDOMInstances since the browser
     * will do this for us.
     */
    private updateVisibility;
    /**
     * Returns whether the parallel DOM for this instance and its ancestors are not hidden.
     */
    isGloballyVisible(): boolean;
    /**
     * Returns what our list of children (after sorting) should be.
     *
     * @param trail - A partial trail, where the root of the trail is either this.node or the display's root
     *                        node (if we are the root PDOMInstance)
     */
    private getChildOrdering;
    /**
     * Sort our child accessible instances in the order they should appear in the parallel DOM. We do this by
     * creating a comparison function between two accessible instances. The function walks along the trails
     * of the children, looking for specified accessible orders that would determine the ordering for the two
     * PDOMInstances.
     *
     * (scenery-internal)
     */
    sortChildren(): void;
    /**
     * Create a new TransformTracker that will observe transforms along the trail of this PDOMInstance OR
     * the provided pdomTransformSourceNode. See ParallelDOM.setPDOMTransformSourceNode(). The The source Node
     * must not use DAG so that its trail is unique.
     */
    updateTransformTracker(pdomTransformSourceNode: Node | null): void;
    /**
     * Depending on what the unique ID strategy is, formulate the correct id for this PDOM instance.
     */
    getPDOMInstanceUniqueId(): string;
    /**
     * Using indices requires updating whenever the PDOMInstance tree changes, so recursively update all descendant
     * ids from such a change. Update peer ids for provided instances and all descendants of provided instances.
     */
    private updateDescendantPeerIds;
    /**
     * @param display
     * @param uniqueId - value returned from PDOMInstance.getPDOMInstanceUniqueId()
     * @returns null if there is no path to the unique id provided.
     */
    static uniqueIdToTrail(display: Display, uniqueId: string): Trail | null;
    /**
     * Recursive disposal, to make eligible for garbage collection.
     *
     * (scenery-internal)
     */
    dispose(): void;
    /**
     * For debugging purposes.
     */
    toString(): string;
    /**
     * For debugging purposes, inspect the tree of PDOMInstances from the root.
     *
     * Only ever called from the _rootPDOMInstance of the display.
     *
     * (scenery-internal)
     */
    auditRoot(): void;
    /**
     * Since a "Trail" on PDOMInstance can have discontinuous jumps (due to pdomOrder), this finds the best
     * actual visual Trail to use, from the trail of a PDOMInstance to the root of a Display.
     *
     * @param trail - trail of the PDOMInstance, which can containe "gaps"
     * @param rootNode - root of a Display
     */
    static guessVisualTrail(trail: Trail, rootNode: Node): Trail;
    /**
     * Creates a fake PDOMInstance-like tree structure (with the equivalent nodes and children structure).
     * For debugging.
     *
     * @returns Type FakePDOMInstance: { node: {Node}, children: {Array.<FakePDOMInstance>} }
     */
    private static createFakePDOMTree;
    freeToPool(): void;
    static readonly pool: Pool<typeof PDOMInstance>;
}
export default PDOMInstance;
//# sourceMappingURL=PDOMInstance.d.ts.map