"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    cancelRaf: function() {
        return cancelRaf;
    },
    default: function() {
        return _default;
    },
    inBrowser: function() {
        return inBrowser;
    }
});
var inBrowser = typeof window !== 'undefined';
// 防频
function requestAniFrame() {
    if (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 (inBrowser) {
        var _window = window;
        (_window.cancelAnimationFrame || _window.webkitCancelAnimationFrame)(id);
    } else {
        clearTimeout(id);
    }
}
var _default = requestAniFrame();
