import { DomUniverse } from '@ephox/boss'; import type { Optional } from '@ephox/katamari'; import type { SpotPoint } from '@ephox/phoenix'; import type { SugarElement } from '@ephox/sugar'; import type { CharPos } from '../../textdata/TextSearch'; import type { TextSeekerOutcome, TextSeekerPhaseProcessor } from '../../textdata/TextSeeker'; import { TextSearch, type TextSearchSeeker } from '../general/TextSearch'; const universe = DomUniverse(); const previousChar = (text: string, offset: Optional): Optional => { return TextSearch.previousChar(text, offset); }; const nextChar = (text: string, offset: Optional): Optional => { return TextSearch.nextChar(text, offset); }; const repeatLeft = (item: SugarElement, offset: number, process: TextSeekerPhaseProcessor): TextSeekerOutcome => { return TextSearch.repeatLeft(universe, item, offset, process); }; const repeatRight = (item: SugarElement, offset: number, process: TextSeekerPhaseProcessor): TextSeekerOutcome => { return TextSearch.repeatRight(universe, item, offset, process); }; const expandLeft = (item: SugarElement, offset: number, rawSeeker: TextSearchSeeker): TextSeekerOutcome => { return TextSearch.expandLeft(universe, item, offset, rawSeeker); }; const expandRight = (item: SugarElement, offset: number, rawSeeker: TextSearchSeeker): TextSeekerOutcome => { return TextSearch.expandRight(universe, item, offset, rawSeeker); }; const scanRight = (item: SugarElement, offset: number): Optional> => { return TextSearch.scanRight(universe, item, offset); }; export { previousChar, nextChar, repeatLeft, repeatRight, expandLeft, expandRight, scanRight };