import { Editor } from '../../core/Editor.js';
import { CanContinueReason, CanJoinReason, JoinDirection } from '../../../../../../document-api/src/index.js';
import { ListItemProjection } from './list-item-resolver.js';
import { BlockCandidate } from './node-address-resolver.js';
/**
 * Resolve a paragraph block address to its BlockCandidate.
 * Searches for both 'paragraph' and 'listItem' node types since a paragraph
 * with numbering properties is classified as 'listItem' in the block index.
 */
export declare function resolveBlock(editor: Editor, nodeId: string): BlockCandidate;
/**
 * Resolve a contiguous range of paragraphs between `from` and `to` (inclusive).
 * Returns all paragraph/listItem candidates whose positions fall within the range.
 */
export declare function resolveBlocksInRange(editor: Editor, fromId: string, toId: string): BlockCandidate[];
/**
 * Get the abstractNumId for a given numId from the raw numbering definitions.
 */
export declare function getAbstractNumId(editor: Editor, numId: number): number | undefined;
/**
 * Get all list item projections from the block index, ordered by document position.
 */
export declare function getAllListItemProjections(editor: Editor): ListItemProjection[];
/**
 * Get the full contiguous sequence containing the target item.
 * "Contiguous" means consecutive list items with the same numId —
 * non-list paragraphs don't break continuity, but items with a
 * different numId do.
 */
export declare function getContiguousSequence(editor: Editor, target: ListItemProjection): ListItemProjection[];
/**
 * Get items from the target to the end of its contiguous sequence.
 */
export declare function getSequenceFromTarget(editor: Editor, target: ListItemProjection): ListItemProjection[];
/**
 * Check if the target is the first item in its contiguous sequence.
 */
export declare function isFirstInSequence(editor: Editor, target: ListItemProjection): boolean;
/**
 * Compute the sequence identity for a single list item.
 *
 * Format: `{numId}:{anchorNodeId}` — encodes both the numbering definition
 * and the position anchor (nodeId of the first item in the contiguous
 * sequence). Distinct visual sequences sharing one numId receive different
 * IDs because their anchors differ.
 */
export declare function computeSequenceId(editor: Editor, projection: ListItemProjection): string;
/**
 * Batch-compute sequence IDs for an ordered array of list item projections.
 *
 * Runs in a single O(n) pass — contiguous items sharing the same numId are
 * assigned the same sequence ID, anchored on the first item's nodeId. A
 * different numId (or a null numId) starts a new sequence.
 */
export declare function computeSequenceIdMap(items: ListItemProjection[]): Map<string, string>;
export type AdjacentSequenceResult = {
    sequence: ListItemProjection[];
    numId: number;
    abstractNumId: number | undefined;
};
/**
 * Find the adjacent list sequence in the given direction.
 * Returns null if no adjacent sequence exists.
 */
export declare function findAdjacentSequence(editor: Editor, target: ListItemProjection, direction: JoinDirection): AdjacentSequenceResult | null;
/**
 * Find the nearest previous list sequence that shares the same abstractNumId.
 * Used by continuePrevious to find a compatible sequence to merge with.
 */
export declare function findPreviousCompatibleSequence(editor: Editor, target: ListItemProjection): {
    sequence: ListItemProjection[];
    numId: number;
} | null;
/**
 * Determine canJoin result for the given target and direction.
 */
export declare function evaluateCanJoin(editor: Editor, target: ListItemProjection, direction: JoinDirection): {
    canJoin: boolean;
    reason?: CanJoinReason;
    adjacentListId?: string;
};
/**
 * Determine canContinuePrevious result for the given target.
 */
export declare function evaluateCanContinuePrevious(editor: Editor, target: ListItemProjection): {
    canContinue: boolean;
    reason?: CanContinueReason;
    previousListId?: string;
};
//# sourceMappingURL=list-sequence-helpers.d.ts.map