packageDocumentation module import { Id64String } from "@itwin/core-bentley" ; import { DefinitionElement , IModelDb } from "@itwin/core-backend" ; import { Code } from "@itwin/core-common" ; import { Ruleset as PresentationRuleset } from "@itwin/presentation-common" ; import { normalizeVersion } from "../Utils" ; import { PresentationRules } from "./PresentationRulesDomain" ; internal export class Ruleset extends DefinitionElement { /**
     * Name of the `Ruleset` element class.
     */ public static override get className ( ) : string { return "Ruleset" ; } param iModelDb param modelId param ruleset public static createRulesetCode ( iModelDb , modelId , ruleset ) { let codeValue = ruleset . id ; if ( ruleset . version ) codeValue += `@${ normalizeVersion ( ruleset . version ) }` ; return new Code ( { spec : iModelDb . codeSpecs . getByName ( PresentationRules . CodeSpec . Ruleset ) . id , scope : modelId . toString ( ) , value : codeValue } ) ; } }