-
Notifications
You must be signed in to change notification settings - Fork 208
/
HierarchyLevel.ts
53 lines (49 loc) · 1.69 KB
/
HierarchyLevel.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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Hierarchies
*/
import { Node, NodeJSON } from "./Node";
/**
* Defines a hierarchy level that consists of an array of nodes and possibly other information.
* @beta
*/
export interface HierarchyLevel {
/** A list of nodes in a hierarchy level. */
nodes: Node[];
/**
* Identifies whether the hierarchy level supports filtering. If not, requesting either a hierarchy level descriptor or
* a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.
*/
supportsFiltering?: boolean;
}
/**
* JSON representation of [[HierarchyLevel]].
* @beta
* @deprecated in 3.x. Use [[HierarchyLevel]]
*/
export interface HierarchyLevelJSON {
// eslint-disable-next-line deprecation/deprecation
nodes: NodeJSON[];
supportsFiltering?: boolean;
}
/**
* Contains helper functions for working with objects of [[HierarchyLevel]] type.
* @beta
*/
export namespace HierarchyLevel {
/**
* Deserialize [[HierarchyLevel]] from JSON
* @deprecated in 3.x. Use [[HierarchyLevel]].
*/
// eslint-disable-next-line deprecation/deprecation
export function fromJSON(json: HierarchyLevelJSON): HierarchyLevel {
return {
...json,
// eslint-disable-next-line deprecation/deprecation
nodes: json.nodes.map(Node.fromJSON),
};
}
}