UNPKG

ng2-idle-core

Version:

ng-idle for Angular 2+ core module

94 lines 2.57 kB
/* * Represents a base class for types that provide expiry detection for the Idle service. */ var /* * Represents a base class for types that provide expiry detection for the Idle service. */ IdleExpiry = /** @class */ (function () { function IdleExpiry() { this.idValue = new Date(); this.idlingValue = false; } /* * Gets or sets a unique ID for the window * @param id - The id. * @return The current id. */ /* * Gets or sets a unique ID for the window * @param id - The id. * @return The current id. */ IdleExpiry.prototype.id = /* * Gets or sets a unique ID for the window * @param id - The id. * @return The current id. */ function (value) { if (value !== void 0) { if (!value) { throw new Error('A value must be specified for the ID.'); } this.idValue = value; } return this.idValue; }; /* * Gets or sets the idling value. * @param value - The value to set. * @return The idling value. */ /* * Gets or sets the idling value. * @param value - The value to set. * @return The idling value. */ IdleExpiry.prototype.idling = /* * Gets or sets the idling value. * @param value - The value to set. * @return The idling value. */ function (value) { if (value !== void 0) { this.idlingValue = value; } return this.idlingValue; }; /* * Returns the current Date. * @return The current Date. */ /* * Returns the current Date. * @return The current Date. */ IdleExpiry.prototype.now = /* * Returns the current Date. * @return The current Date. */ function () { return new Date(); }; /* * Returns whether or not it is expired. * @return True if expired; otherwise, false. */ /* * Returns whether or not it is expired. * @return True if expired; otherwise, false. */ IdleExpiry.prototype.isExpired = /* * Returns whether or not it is expired. * @return True if expired; otherwise, false. */ function () { var expiry = this.last(); return expiry != null && expiry <= this.now(); }; return IdleExpiry; }()); /* * Represents a base class for types that provide expiry detection for the Idle service. */ export { IdleExpiry }; //# sourceMappingURL=idleexpiry.js.map