UNPKG

igniteui-react-core

Version:
65 lines (64 loc) 2.49 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { Base, markType } from "./type"; import { IExecutionContext_$type } from "./IExecutionContext"; import { dateNow } from "./date"; /** * @hidden */ var DOMExecutionContext = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DOMExecutionContext, _super); function DOMExecutionContext(a) { var _this = _super.call(this) || this; _this.c = 0; _this._requestAnimationFrame = null; _this._setTimeout = null; _this.requestAnimationFrame = a.getRequestAnimationFrame(); _this.setTimeout = a.getSetTimeout(); _this.c = dateNow().getTime(); return _this; } Object.defineProperty(DOMExecutionContext.prototype, "requestAnimationFrame", { get: function () { return this._requestAnimationFrame; }, set: function (a) { this._requestAnimationFrame = a; }, enumerable: false, configurable: true }); Object.defineProperty(DOMExecutionContext.prototype, "setTimeout", { get: function () { return this._setTimeout; }, set: function (a) { this._setTimeout = a; }, enumerable: false, configurable: true }); DOMExecutionContext.prototype.execute = function (a) { a(); }; DOMExecutionContext.prototype.enqueueAction = function (a) { this.setTimeout(a, 0); }; DOMExecutionContext.prototype.enqueueAnimationAction = function (a) { this.requestAnimationFrame(a); }; DOMExecutionContext.prototype.executeDelayed = function (a, b) { this.setTimeout(a, b); }; DOMExecutionContext.prototype.getCurrentRelativeTime = function () { return dateNow().getTime() - this.c; }; DOMExecutionContext.$t = markType(DOMExecutionContext, 'DOMExecutionContext', Base.$, [IExecutionContext_$type]); return DOMExecutionContext; }(Base)); export { DOMExecutionContext };