-
Notifications
You must be signed in to change notification settings - Fork 208
/
ChildNodeSpecification.ts
121 lines (106 loc) · 4.5 KB
/
ChildNodeSpecification.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module PresentationRules
*/
import { RelatedInstanceSpecification } from "../RelatedInstanceSpecification";
import { ChildNodeRule } from "./ChildNodeRule";
import { CustomNodeSpecification } from "./CustomNodeSpecification";
import { CustomQueryInstanceNodesSpecification } from "./CustomQueryInstanceNodesSpecification";
import { InstanceNodesOfSpecificClassesSpecification } from "./InstanceNodesOfSpecificClassesSpecification";
import { RelatedInstanceNodesSpecification } from "./RelatedInstanceNodesSpecification";
/**
* Used for serializing array of [[ChildNodeSpecification]]
* @public
*/
export enum ChildNodeSpecificationTypes {
RelatedInstanceNodes = "RelatedInstanceNodes",
InstanceNodesOfSpecificClasses = "InstanceNodesOfSpecificClasses",
CustomQueryInstanceNodes = "CustomQueryInstanceNodes",
CustomNode = "CustomNode",
}
/**
* Base interface for all [[ChildNodeSpecification]] implementations.
*
* @see [Child node specifications reference documentation section]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-specifications)
* @public
*/
export interface ChildNodeSpecificationBase {
/**
* Used for serializing to JSON.
* @see ChildNodeSpecificationTypes
*/
specType: `${ChildNodeSpecificationTypes}`;
/**
* Controls the order in which specifications are handled — specification with higher priority value is
* handled first. If priorities are equal, the specifications are handled in the order they appear in the
* ruleset.
*
* @type integer
*/
priority?: number;
/**
* This attribute allows telling the engine that nodes created by this specification always or never have children.
*/
hasChildren?: "Always" | "Never" | "Unknown";
/**
* When `true`, instances nodes produced by this specification are omitted and their children appear one
* hierarchy level higher.
*/
hideNodesInHierarchy?: boolean;
/**
* Specifies whether nodes created through this specification should be hidden if they have no child nodes.
*/
hideIfNoChildren?: boolean;
/**
* When specified [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#specification) evaluates
* to `true`, nodes produced by this specification are omitted and their children appear one hierarchy level
* higher.
*/
hideExpression?: string;
/**
* Suppress sorting of nodes returned by this specification. With this attribute set to `true`, the order
* of returned nodes is undefined.
*/
doNotSort?: boolean;
/**
* Specifies whether similar ancestor nodes' checking should be suppressed when creating nodes based on this
* specification. See more in [infinite hierarchies prevention page]($docs/presentation/hierarchies/InfiniteHierarchiesPrevention.md).
*/
suppressSimilarAncestorsCheck?: boolean;
/**
* Specifications of [related instances]($docs/presentation/RelatedInstanceSpecification.md) that can be used
* when creating the nodes.
*/
relatedInstances?: RelatedInstanceSpecification[];
/**
* Specifications of [nested child node rules]($docs/presentation/hierarchies/Terminology.md#nested-rule) that
* allow creating child nodes without the need of supplying a condition to match the parent node.
*/
nestedRules?: ChildNodeRule[];
}
/**
* A container of default grouping properties. Used for specifications that support
* default grouping. Not meant to be used directly, see [[ChildNodeSpecification]].
*
* @public
*/
export interface DefaultGroupingPropertiesContainer {
/** Controls whether returned instances should be grouped by ECClass. Defaults to `true`. */
groupByClass?: boolean;
/** Controls whether returned instances should be grouped by label. Defaults to `true`. */
groupByLabel?: boolean;
}
/**
* Hierarchy rule specifications that define what nodes are going to be returned by the rule.
*
* @see [Child node specifications reference documentation section]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-specifications)
* @public
*/
export type ChildNodeSpecification =
| CustomNodeSpecification
| InstanceNodesOfSpecificClassesSpecification
| RelatedInstanceNodesSpecification
| CustomQueryInstanceNodesSpecification;