@itwin/presentation-common
Version:
Common pieces for iModel.js presentation packages
54 lines • 1.66 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Core
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegisteredRuleset = void 0;
/**
* A ruleset that is registered in a ruleset manager.
* @public
*/
class RegisteredRuleset {
_ruleset;
_uniqueIdentifier;
_disposeFunc;
/** Create a registered ruleset */
constructor(ruleset, uniqueIdentifier, disposeFunc) {
this._disposeFunc = disposeFunc;
this._ruleset = ruleset;
this._uniqueIdentifier = uniqueIdentifier;
}
/** Dispose registered ruleset. */
[Symbol.dispose]() {
this._disposeFunc(this);
}
/** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */
/* c8 ignore next 3 */
dispose() {
this[Symbol.dispose]();
}
get uniqueIdentifier() {
return this._uniqueIdentifier;
}
get id() {
return this._ruleset.id;
}
get supplementationInfo() {
return this._ruleset.supplementationInfo;
}
get rules() {
return this._ruleset.rules;
}
get vars() {
return this._ruleset.vars;
}
toJSON() {
return this._ruleset;
}
}
exports.RegisteredRuleset = RegisteredRuleset;
//# sourceMappingURL=RegisteredRuleset.js.map