import type TraversingScoper from './TraversingScoper'; import type { BlockElement, InlineElement } from 'roosterjs-editor-types'; /** * @internal * provides a scope object for traversing the entire editor body starting from the beginning */ export default class BodyScoper implements TraversingScoper { rootNode: Node; private startNode; /** * Construct a new instance of BodyScoper class * @param rootNode Root node of the body * @param startNode The node to start from. If not passed, it will start from the beginning of the body */ constructor(rootNode: Node, startNode?: Node); /** * Get the start block element */ getStartBlockElement(): BlockElement | null; /** * Get the start inline element */ getStartInlineElement(): InlineElement | null; /** * Since the scope is global, all blocks under the root node are in scope */ isBlockInScope(blockElement: BlockElement): boolean; /** * Since we're at body scope, inline elements never need to be trimmed */ trimInlineElement(inlineElement: InlineElement): InlineElement; }