import Taro, { createSelectorQuery } from "@tarojs/taro";
export var getTaroRectById = function(id) {
    return new Promise(function(resolve, reject) {
        if (Taro.getEnv() === Taro.ENV_TYPE.WEB) {
            var t = document ? document.querySelector("#".concat(id)) : '';
            if (t) {
                resolve(t === null || t === void 0 ? void 0 : t.getBoundingClientRect());
            }
            reject();
        } else {
            var query = createSelectorQuery();
            query.select("#".concat(id)).boundingClientRect().exec(function(rect) {
                if (rect[0]) {
                    resolve(rect[0]);
                } else {
                    reject();
                }
            });
        }
    });
};
