export default GreedyStitcher;
declare class GreedyStitcher extends Stitcher {
    /**
     * Main stitch entry point, called directly from the backbone or cache. We are modifying our backbone's blocks and
     * their attached drawables.
     * @public
     *
     * The change-interval pair denotes a linked-list of change intervals that we will need to stitch across (they
     * contain drawables that need to be removed and added, and it may affect how we lay out blocks in the stacking
     * order).
     *
     * @param {BackboneDrawable} backbone
     * @param {Drawable|null} firstStitchDrawable
     * @param {Drawable|null} lastStitchDrawable
     * @param {Drawable|null} oldFirstStitchDrawable
     * @param {Drawable|null} oldLastStitchDrawable
     * @param {ChangeInterval} firstChangeInterval
     * @param {ChangeInterval} lastChangeInterval
     */
    public stitch(backbone: BackboneDrawable, firstStitchDrawable: Drawable | null, lastStitchDrawable: Drawable | null, oldFirstStitchDrawable: Drawable | null, oldLastStitchDrawable: Drawable | null, firstChangeInterval: ChangeInterval, lastChangeInterval: ChangeInterval): void;
    blockOrderChanged: boolean | undefined;
    reusableBlocks: any;
    blockWasAdded: boolean | undefined;
    /**
     * Does the main bulk of the work for each change interval.
     * @private
     *
     * @param {BackboneDrawable} backbone
     * @param {ChangeInterval} interval
     * @param {Drawable|null} firstStitchDrawable
     * @param {Drawable|null} lastStitchDrawable
     */
    private processInterval;
    /**
     * @private
     *
     * @param {ChangeInterval} interval
     * @param {Drawable} firstDrawable - for the specific sub-block
     * @param {Drawable} lastDrawable - for the specific sub-block
     * @param {Block} matchedBlock
     * @param {boolean} isFirst
     * @param {boolean} isLast
     */
    private processSubBlock;
    /**
     * firstDrawable and lastDrawable refer to the specific sub-block (if it exists), isLast refers to if it's the
     * last sub-block
     * @private
     *
     * @param {ChangeInterval} interval
     * @param {boolean} openBefore
     * @param {boolean} openAfter
     */
    private processEdgeCases;
    /**
     * Marks all 'external' drawables from the end (drawableAfter) of the {ChangeInterval} interval to either the end
     * of their old block or the drawableAfter of the next interval (whichever is sooner) as being needed to be moved to
     * our {Block} newBlock. The next processInterval will both handle the drawables inside that next interval, and
     * will be responsible for the 'external' drawables after that.
     * @private
     *
     * @param {ChangeInterval} interval
     * @param {Block} newBlock
     */
    private changeExternals;
    /**
     * Given a {Drawable} firstDrawable and {Drawable} lastDrawable, we mark all drawables in-between (inclusively) as
     * needing to be moved to our {Block} newBlock. This should only be called on external drawables, and should only
     * occur as needed with glue/unglue cases in the stitch.
     * @private
     *
     * @param {Block} newBlock
     * @param {Drawable} firstDrawable
     * @param {Drawable} lastDrawable
     */
    private notePendingMoves;
    /**
     * If there is no currentBlock, we create one to match. Otherwise if the currentBlock is marked as 'unused' (i.e.
     * it is in the reusableBlocks array), we mark it as used so it won't me matched elsewhere.
     * @private
     *
     * @param {Block} currentBlock
     * @param {Drawable} someIncludedDrawable
     * @returns {Block}
     */
    private ensureUsedBlock;
    /**
     * Attemps to find an unused block with the same renderer if possible, otherwise creates a
     * compatible block.
     * @private
     *
     * NOTE: this doesn't handle hooking up the block linked list
     *
     * @param {number} renderer
     * @param {Drawable} drawable
     * @returns {Block}
     */
    private getBlockForRenderer;
    /**
     * Marks a block as unused, moving it to the reusableBlocks array.
     * @private
     *
     * @param {Block} block
     */
    private unuseBlock;
    /**
     * Removes a block from the list of reused blocks (done during matching)
     * @private
     *
     * @param {Block} block
     */
    private useBlock;
    /**
     * @private
     *
     * @param {Block} block
     * @param {number} index
     */
    private useBlockAtIndex;
    /**
     * Removes all of our unused blocks from our domElement, and marks them for disposal.
     * @private
     */
    private removeUnusedBlocks;
    /**
     * Links blocks before a drawable (whether it is the first drawable or not)
     * @private
     *
     * @param {Drawable} drawable
     */
    private linkBeforeDrawable;
    /**
     * links blocks after a drawable (whether it is the last drawable or not)
     * @private
     *
     * @param {Drawable} drawable
     */
    private linkAfterDrawable;
    /**
     * Called to mark a boundary between blocks, or at the end of our list of blocks (one block/drawable pair being
     * null notes that it is the start/end, and there is no previous/next block).
     * This updates the block linked-list as necessary (noting changes when they occur) so that we can rebuild an array
     * at the end of the stitch, avoiding O(n^2) issues if we were to do block-array-index lookups during linking
     * operations (this results in linear time for blocks).
     * It also marks block boundaries as dirty when necessary, so that we can make one pass through with
     * updateBlockIntervals() that updates all of the block's boundaries (avoiding more than one update per block per
     * frame).
     * @private
     *
     * @param {Block|null} beforeBlock
     * @param {Block|null} afterBlock
     * @param {Drawable|null} beforeDrawable
     * @param {Drawable|null} afterDrawable
     */
    private linkBlocks;
    /**
     * Rebuilds the backbone's block array from our linked-list data.
     * @private
     *
     * @param {BackboneDrawable} backbone
     * @param {Block|null} firstBlock
     * @param {Block|null} lastBlock
     */
    private processBlockLinkedList;
}
import { Stitcher } from '../imports.js';
import { Drawable } from '../imports.js';
import { ChangeInterval } from '../imports.js';
//# sourceMappingURL=GreedyStitcher.d.ts.map