import { canUseDOM } from "../../../utils";
export var selectText = function selectText(node) {
    if (!canUseDOM) {
        return;
    }
    setTimeout(function() {
        var body = document.body;
        if (window.getSelection && document.createRange) {
            var range = document.createRange();
            range.selectNodeContents(node);
            var selection = window.getSelection();
            selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
            selection === null || selection === void 0 ? void 0 : selection.addRange(range);
        } else if (body.createTextRange) {
            var range1 = body.createTextRange();
            range1.moveToElementText(node);
            range1.select();
        }
    });
};
