import { getMatchHighlights } from 'prosemirror-search';
import { SearchClassName } from "../const.js";
export function getCounter(state) {
    const decoSet = getMatchHighlights(state);
    const searchDecos = decoSet.find(undefined, undefined, () => true);
    const activeIndex = searchDecos.findIndex((deco) => {
        const d = deco;
        return d.type?.attrs?.class === SearchClassName.ActiveMatch;
    });
    return {
        total: searchDecos.length,
        current: activeIndex + 1,
    };
}
//# sourceMappingURL=search-counter.js.map
