import '../../../assert/js/assert.js';
import '../../../globals.js';
/**
 * Points to a specific node (with a trail), and whether it is conceptually before or after the node.
 *
 * There are two orderings:
 * - rendering order: the order that node selves would be rendered, matching the Trail implicit order
 * - nesting order:   the order in depth first with entering a node being "before" and exiting a node being "after"
 *
 * TODO: more seamless handling of the orders. or just exclusively use the nesting order https://github.com/phetsims/scenery/issues/1581
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import WithoutNull from '../../../phet-core/js/types/WithoutNull.js';
import { Node, Trail } from '../imports.js';
import { TrailCallback } from './Trail.js';
export type ActiveTrailPointer = WithoutNull<TrailPointer, 'trail'>;
type ActiveTrailPointerCallback = ((trailPointer: ActiveTrailPointer) => boolean) | ((trailPointer: ActiveTrailPointer) => void);
export default class TrailPointer {
    trail: Trail | null;
    isBefore: boolean;
    isAfter: boolean;
    /**
     * @param trail
     * @param isBefore - whether this points to before the node (and its children) have been rendered, or after
     */
    constructor(trail: Trail, isBefore: boolean);
    isActive(): this is ActiveTrailPointer;
    copy(): TrailPointer;
    setBefore(isBefore: boolean): void;
    /**
     * Return the equivalent pointer that swaps before and after (may return null if it doesn't exist)
     */
    getRenderSwappedPointer(): TrailPointer | null;
    getRenderBeforePointer(): TrailPointer | null;
    getRenderAfterPointer(): TrailPointer | null;
    /**
     * In the render order, will return 0 if the pointers are equivalent, -1 if this pointer is before the
     * other pointer, and 1 if this pointer is after the other pointer.
     */
    compareRender(other: TrailPointer): number;
    /**
     * Like compareRender, but for the nested (depth-first) order
     *
     * TODO: optimization? https://github.com/phetsims/scenery/issues/1581
     */
    compareNested(other: TrailPointer): number;
    equalsRender(other: TrailPointer): boolean;
    equalsNested(other: TrailPointer): boolean;
    /**
     * Will return false if this pointer has gone off of the beginning or end of the tree (will be marked with isAfter or
     * isBefore though)
     */
    hasTrail(): boolean;
    /**
     * Moves this pointer forwards one step in the nested order
     *
     * TODO: refactor with "Side"-like handling https://github.com/phetsims/scenery/issues/1581
     */
    nestedForwards(): this | null;
    /**
     * Moves this pointer backwards one step in the nested order
     */
    nestedBackwards(): this | null;
    /**
     * Treats the pointer as render-ordered (includes the start pointer 'before' if applicable, excludes the end pointer
     * 'before' if applicable
     */
    eachNodeBetween(other: TrailPointer, callback: (node: Node) => void): void;
    /**
     * Treats the pointer as render-ordered (includes the start pointer 'before' if applicable, excludes the end pointer
     * 'before' if applicable
     */
    eachTrailBetween(other: TrailPointer, callback: TrailCallback): void;
    /**
     * Recursively (depth-first) iterates over all pointers between this pointer and 'other', calling
     * callback( pointer ) for each pointer. If excludeEndpoints is truthy, the callback will not be
     * called if pointer is equivalent to this pointer or 'other'.
     *
     * If the callback returns a truthy value, the subtree for the current pointer will be skipped
     * (applies only to before-pointers)
     */
    depthFirstUntil(other: TrailPointer, callback: ActiveTrailPointerCallback, excludeEndpoints: boolean): void;
    /**
     * Returns a string form of this object
     */
    toString(): string;
    /**
     * Same as new TrailPointer( trailA, isBeforeA ).compareNested( new TrailPointer( trailB, isBeforeB ) )
     */
    static compareNested(trailA: Trail, isBeforeA: boolean, trailB: Trail, isBeforeB: boolean): number;
}
export {};
//# sourceMappingURL=TrailPointer.d.ts.map