"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get cancelRaf () {
        return cancelRaf;
    },
    get default () {
        return _default;
    }
});
var _getrect = require("./get-rect");
// 防频
function requestAniFrame() {
    if (_getrect.inBrowser) {
        var _window = window;
        return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
            _window.setTimeout(callback, 1000 / 60);
        };
    }
    return function(callback) {
        setTimeout(callback, 1000 / 60);
    };
}
function cancelRaf(id) {
    if (_getrect.inBrowser) {
        var _window = window;
        (_window.cancelAnimationFrame || _window.webkitCancelAnimationFrame)(id);
    } else {
        clearTimeout(id);
    }
}
var _default = requestAniFrame();
