@itwin/presentation-common
Version:
Common pieces for iModel.js presentation packages
50 lines • 1.5 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
*/
/**
* A ruleset that is registered in a ruleset manager.
* @public
*/
export 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;
}
}
//# sourceMappingURL=RegisteredRuleset.js.map