import { Selection } from 'prosemirror-state';
export function isGapCursorSelection(selection) {
    return selection instanceof GapCursorSelection;
}
// @ts-expect-error // TODO: implements toJSON
export class GapCursorSelection extends Selection {
    #_$pos;
    meta;
    selectionName = 'GapCursorSelection';
    get $pos() {
        return this.#_$pos;
    }
    get pos() {
        return this.#_$pos.pos;
    }
    constructor($pos, params) {
        super($pos, $pos);
        this.#_$pos = $pos;
        this.meta = params?.meta;
    }
    eq(other) {
        return (isGapCursorSelection(other) &&
            this.pos === other.pos &&
            this.$pos.doc.eq(other.$pos.doc));
    }
    map(doc, mapping) {
        const $pos = doc.resolve(mapping.map(this.head));
        return Selection.near($pos);
    }
}
//# sourceMappingURL=GapCursorSelection.js.map
