import { PositionType } from 'roosterjs-editor-types'; import type { NodePosition } from 'roosterjs-editor-types'; /** * Create a range around the given node(s) * @param startNode The start node to create range from * @param endNode The end node to create range from. If specified, the range will start before startNode and * end after endNode, otherwise, the range will start before and end after the start node * @returns A range start before the given node and end after the given node */ export default function createRange(startNode: Node, endNode?: Node): Range; /** * Create a collapsed range at the given node and offset * @param node The container node of the range * @param offset The offset of the range, can be a number or value of PositionType * @returns A range at the given node and offset */ export default function createRange(node: Node, offset: number | PositionType): Range; /** * Create a range with the given start/end container node and offset * @param startNode The start container node of the range * @param startOffset The start offset of the range * @param endNode The end container node of the range * @param endOffset The end offset of the range * @returns A range at the given start/end container node and offset */ export default function createRange(startNode: Node, startOffset: number | PositionType, endNode: Node, endOffset: number | PositionType): Range; /** * Create a range under the given rootNode with start and end selection paths * @param rootNode The root node that the selection paths start from * @param startPath The selection path of the start position of the range * @param endPath The selection path of the end position of the range * @returns A range with the given start and end selection paths */ export default function createRange(rootNode: Node, startPath: number[], endPath?: number[]): Range; /** * Create a range with the start and end position * @param startPosition The start position of the range * @param endPosition The end position of the range, if not specified, the range will be collapsed at start position * @returns A range start at startPosition, end at endPosition, or startPosition when endPosition is not specified */ export default function createRange(startPosition: NodePosition, endPosition?: NodePosition): Range;