bucklescript-tea
Version:
TEA for Bucklescript
91 lines (73 loc) • 2.65 kB
JavaScript
// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE
;
function history(param) {
return window.history;
}
function localStorage(param) {
return window.localStorage;
}
function $$location(param) {
return window.location;
}
function requestAnimationFrame(callback) {
return window.requestAnimationFrame(callback);
}
function cancelAnimationFrame(id) {
return window.cancelAnimationFrame(id);
}
function $$clearTimeout(id) {
return window.clearTimeout(id);
}
function $$setInterval(cb, msTime) {
return window.setInterval(cb, msTime);
}
function $$setTimeout(cb, msTime) {
return window.setTimeout(cb, msTime);
}
function addEventListener(typ, listener, options) {
return window.addEventListener(typ, listener, options);
}
function removeEventListener(typ, listener, options) {
return window.removeEventListener(typ, listener, options);
}
function requestAnimationFrame_polyfill(param) {
return (// requestAnimationFrame polyfill
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}()));
}
var $$History = /* alias */0;
var LocalStorage = /* alias */0;
exports.$$History = $$History;
exports.LocalStorage = LocalStorage;
exports.history = history;
exports.localStorage = localStorage;
exports.$$location = $$location;
exports.requestAnimationFrame = requestAnimationFrame;
exports.cancelAnimationFrame = cancelAnimationFrame;
exports.$$clearTimeout = $$clearTimeout;
exports.$$setInterval = $$setInterval;
exports.$$setTimeout = $$setTimeout;
exports.addEventListener = addEventListener;
exports.removeEventListener = removeEventListener;
exports.requestAnimationFrame_polyfill = requestAnimationFrame_polyfill;
/* No side effect */