UNPKG

@itwin/presentation-common

Version:

Common pieces for iModel.js presentation packages

63 lines 2.47 kB
/** @packageDocumentation * @module PresentationRules */ import { ContentRule } from "./content/ContentRule.js"; import { DefaultPropertyCategoryOverride } from "./content/DefaultPropertyCategoryOverride.js"; import { ContentModifier } from "./content/modifiers/ContentModifier.js"; import { CustomizationRule } from "./customization/CustomizationRule.js"; import { NavigationRule } from "./hierarchy/NavigationRule.js"; import { RequiredSchemaSpecification } from "./SchemasSpecification.js"; /** * Base interface for all [[Rule]] implementations. * @public */ export interface RuleBase { /** * Used for serializing to JSON. * @see RuleTypes */ ruleType: `${RuleTypes}`; /** * Defines the order in which rules are handled, higher number means the rule is handled first. If priorities are * equal, the rules are handled in the order they're defined. * * @type integer */ priority?: number; /** * Tells the library that the rule should only be handled if no other rule of the same type was handled previously (based on rule * priorities and definition order). This allows adding fallback rules which can be overriden by higher-priority rules. */ onlyIfNotHandled?: boolean; /** * A list of [ECSchema requirements]($docs/presentation/RequiredSchemaSpecification.md) that need to be met for the rule to be used. */ requiredSchemas?: RequiredSchemaSpecification[]; } /** * A union of all presentation rule types. * @public */ export declare type Rule = CustomizationRule | NavigationRule | ContentRule | ContentModifier | DefaultPropertyCategoryOverride; /** * Used for serializing [[Rule]] objects to JSON. * @public */ export declare enum RuleTypes { RootNodes = "RootNodes", ChildNodes = "ChildNodes", Content = "Content", ContentModifier = "ContentModifier",// eslint-disable-line @typescript-eslint/no-shadow DefaultPropertyCategoryOverride = "DefaultPropertyCategoryOverride",// eslint-disable-line @typescript-eslint/no-shadow Grouping = "Grouping", PropertySorting = "PropertySorting", DisabledSorting = "DisabledSorting", NodeArtifacts = "NodeArtifacts", InstanceLabelOverride = "InstanceLabelOverride", LabelOverride = "LabelOverride", CheckBox = "CheckBox", ImageIdOverride = "ImageIdOverride", StyleOverride = "StyleOverride", ExtendedData = "ExtendedData" } //# sourceMappingURL=Rule.d.ts.map