-
Notifications
You must be signed in to change notification settings - Fork 208
/
ContentSpecification.ts
73 lines (65 loc) · 2.84 KB
/
ContentSpecification.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
/*---------------------------------------------------------------------------------------------
* 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 { ContentInstancesOfSpecificClassesSpecification } from "./ContentInstancesOfSpecificClassesSpecification";
import { ContentRelatedInstancesSpecification } from "./ContentRelatedInstancesSpecification";
import { ContentModifiersList } from "./modifiers/ContentModifier";
import { SelectedNodeInstancesSpecification } from "./SelectedNodeInstancesSpecification";
/**
* Used for serializing array of [[ContentSpecification]]
* @public
*/
export enum ContentSpecificationTypes {
ContentInstancesOfSpecificClasses = "ContentInstancesOfSpecificClasses",
ContentRelatedInstances = "ContentRelatedInstances",
SelectedNodeInstances = "SelectedNodeInstances",
}
/**
* Base interface for all [[ContentSpecification]] implementations. Not
* meant to be used directly, see `ContentSpecification`.
*
* @public
*/
export interface ContentSpecificationBase extends ContentModifiersList {
/**
* Used for serializing to JSON.
* @see [[ContentSpecificationTypes]]
*/
specType: `${ContentSpecificationTypes}`;
/**
* 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;
/**
* Should image IDs be calculated for the returned instances. When `true`, [[ImageIdOverride]] rules get applied when
* creating the content.
*
* @deprecated in 3.x. Use [[ExtendedDataRule]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
*/
showImages?: boolean;
/** Specifications of [related instances]($docs/presentation/RelatedInstanceSpecification.md) that can be used when creating the content. */
relatedInstances?: RelatedInstanceSpecification[];
/**
* Specifies whether this specification should be ignored if another specification was handled before as
* determined by rule and specification priorities. This provides a mechanism for defining a fallback specification.
*/
onlyIfNotHandled?: boolean;
}
/**
* Content rule specifications which define what content is returned
* when rule is used.
*
* @public
*/
export declare type ContentSpecification =
| ContentInstancesOfSpecificClassesSpecification
| ContentRelatedInstancesSpecification
| SelectedNodeInstancesSpecification;