@itwin/presentation-common 5.2.0-dev.8 → 5.3.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -1
- package/Ruleset.schema.json +18 -0
- package/lib/cjs/presentation-common/KeySet.d.ts +22 -7
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +28 -37
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts +2 -0
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +2 -2
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +9 -7
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +10 -0
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +8 -0
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +1 -2
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +2 -16
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +16 -0
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +1 -0
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +2 -0
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +14 -10
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +6 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +2 -0
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts +23 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +8 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -0
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +4 -0
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js +1 -0
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +1 -0
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +18 -0
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +5 -0
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +8 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +12 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +4 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +22 -7
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +29 -38
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts +2 -0
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +2 -2
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +9 -7
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +10 -0
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +8 -0
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +1 -2
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +2 -16
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +16 -0
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +1 -0
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +2 -0
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +14 -10
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +6 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +2 -0
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -0
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts +23 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +8 -1
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -0
- package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js +1 -0
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +4 -0
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -0
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js +1 -0
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +1 -0
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +18 -0
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +5 -0
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +8 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +12 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +4 -0
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KoqPropertyValueFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA6C;AAC7C,wDAAqI;AACrI,gEAA8J;AAiE9J;;;GAGG;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C,CAAC,EAC9C,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,GAOR;IACC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACjD,sBAAsB;IACtB,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC;IAClD,sBAAsB;IACtB,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,qBAAqB,GAAG,eAAe,YAAY,gCAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC;IACjJ,MAAM,UAAU,GAAG,MAAM,qBAAqB,EAAE,UAAU,CAAC;IAC3D,IAAI,UAAU,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC5D,MAAM,wBAAwB,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3E,KAAK,MAAM,uBAAuB,IAAI,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC;YAC3E,CAAC,CAAC,oBAAoB,CAAC,wBAAwB;YAC/C,CAAC,CAAC,CAAC,wBAAwB,CAAC,EAAE,CAAC;YAC/B,IAAI,uBAAuB,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC7D,OAAO,uBAAuB,CAAC,MAAM,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Format, FormatProps, FormatsProvider, FormatterSpec, ParserSpec, UnitsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport { InvertedUnit, KindOfQuantity, SchemaContext, SchemaFormatsProvider, SchemaKey, SchemaMatchType, SchemaUnitProvider } from \"@itwin/ecschema-metadata\";\n\n/**\n * A data structure that associates unit systems with property value formatting props. The associations are used for\n * assigning formatting props for specific phenomenon and unit system combinations (see [[FormatsMap]]).\n *\n * @public\n *\n * @deprecated in 5.1 - will not be removed until after 2026-08-08. `FormatsMap` and related APIs have been deprecated in favor of [FormatsProvider]($core-quantity).\n */\nexport interface UnitSystemFormat {\n unitSystems: UnitSystemKey[];\n format: FormatProps;\n}\n\n/**\n * A data structure that associates specific phenomenon with one or more formatting props for specific unit system.\n *\n * Example:\n * ```json\n * {\n * length: [{\n * unitSystems: [\"metric\"],\n * format: formatForCentimeters,\n * }, {\n * unitSystems: [\"imperial\", \"usCustomary\"],\n * format: formatForInches,\n * }, {\n * unitSystems: [\"usSurvey\"],\n * format: formatForUsSurveyInches,\n * }]\n * }\n * ```\n *\n * @public\n *\n * @deprecated in 5.1 - will not be removed until after 2026-08-08. `FormatsMap` and related APIs have been deprecated in favor of [FormatsProvider]($core-quantity).\n */\nexport interface FormatsMap {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n [phenomenon: string]: UnitSystemFormat | UnitSystemFormat[];\n}\n\n/**\n * Options for finding a formatter spec to use in [[KoqPropertyValueFormatter]].\n * @public\n */\nexport interface FormatOptions {\n /** Full name of the `KindOfQuantity`, e.g. `SchemaName:KoqName`. */\n koqName: string;\n /** Unit system to use for formatting. */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Props for creating [[KoqPropertyValueFormatter]].\n * @public\n */\ninterface KoqPropertyValueFormatterProps {\n /** Schema context to use for locating units, formats, etc. Generally retrieved through the `schemaContext` getter on an iModel. */\n schemaContext: SchemaContext;\n /** Formats provider to use for finding formatting props. Defaults to [SchemaFormatsProvider]($ecschema-metadata) when not supplied. */\n formatsProvider?: FormatsProvider;\n}\n\n/**\n * An utility for formatting property values based on `KindOfQuantity` and unit system.\n * @public\n */\nexport class KoqPropertyValueFormatter {\n private _schemaContext: SchemaContext;\n private _unitsProvider: UnitsProvider;\n private _formatsProvider?: FormatsProvider;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _defaultFormats?: FormatsMap;\n\n /** @deprecated in 5.1 - will not be removed until after 2026-08-08. Use the overload that takes a props object. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(schemaContext: SchemaContext, defaultFormats?: FormatsMap, formatsProvider?: FormatsProvider);\n constructor(props: KoqPropertyValueFormatterProps);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(schemaContextOrProps: SchemaContext | KoqPropertyValueFormatterProps, defaultFormats?: FormatsMap, formatsProvider?: FormatsProvider) {\n if (schemaContextOrProps instanceof SchemaContext) {\n this._schemaContext = schemaContextOrProps;\n this._formatsProvider = formatsProvider;\n this.defaultFormats = defaultFormats;\n } else {\n this._schemaContext = schemaContextOrProps.schemaContext;\n this._formatsProvider = schemaContextOrProps.formatsProvider;\n }\n this._unitsProvider = new SchemaUnitProvider(this._schemaContext);\n }\n\n /* c8 ignore start */\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public get defaultFormats(): FormatsMap | undefined {\n return this._defaultFormats;\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public set defaultFormats(value: FormatsMap | undefined) {\n this._defaultFormats = value\n ? Object.entries(value).reduce((acc, [phenomenon, unitSystemFormats]) => ({ ...acc, [phenomenon.toUpperCase()]: unitSystemFormats }), {})\n : undefined;\n }\n /* c8 ignore end */\n\n public async format(value: number, options: FormatOptions) {\n const formatterSpec = await this.getFormatterSpec(options);\n if (!formatterSpec) {\n return undefined;\n }\n return formatterSpec.applyFormatting(value);\n }\n\n public async getFormatterSpec(options: FormatOptions) {\n const formattingProps = await this.#getFormattingProps(options);\n if (!formattingProps) {\n return undefined;\n }\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\n }\n\n public async getParserSpec(options: FormatOptions) {\n const formattingProps = await this.#getFormattingProps(options);\n if (!formattingProps) {\n return undefined;\n }\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\n }\n\n async #getFormattingProps(options: FormatOptions): Promise<FormattingProps | undefined> {\n const { koqName } = options;\n const koq = await getKoq(this._schemaContext, koqName);\n if (!koq) {\n return undefined;\n }\n const persistenceUnit = await koq.persistenceUnit;\n assert(!!persistenceUnit);\n\n // default to metric as it's the persistence unit system\n const unitSystem = options.unitSystem ?? \"metric\";\n\n const formatsProvider = this._formatsProvider ?? new SchemaFormatsProvider(this._schemaContext, unitSystem);\n const formatProps = await formatsProvider.getFormat(koqName);\n\n // `SchemaFormatsProvider` will fall back to default presentation format, but we want to fall back\n // to default formats' map first, and only then to the default presentation format. All of this can\n // be removed with the removal of default formats map.\n if (this._defaultFormats && (!formatProps || (await getUnitSystemKey(this._unitsProvider, formatProps)) !== unitSystem)) {\n const defaultFormatProps = await getFormatPropsFromDefaultFormats({\n schemaContext: this._schemaContext,\n formatsMap: this._defaultFormats,\n unitSystem,\n koqName,\n });\n if (defaultFormatProps) {\n return { formatProps: defaultFormatProps, persistenceUnitName: persistenceUnit.fullName };\n }\n }\n\n if (formatProps) {\n return { formatProps, persistenceUnitName: persistenceUnit.fullName };\n }\n\n return undefined;\n }\n}\n\ninterface FormattingProps {\n formatProps: FormatProps;\n persistenceUnitName: string;\n}\n\nasync function getKoq(schemaLocater: SchemaContext, fullName: string) {\n const [schemaName, propKoqName] = fullName.split(\":\");\n const schema = await schemaLocater.getSchema(new SchemaKey(schemaName), SchemaMatchType.Latest);\n if (!schema) {\n return undefined;\n }\n return schema.getItem(propKoqName, KindOfQuantity);\n}\n\nasync function getUnitSystemKey(unitsProvider: UnitsProvider, formatProps: FormatProps): Promise<UnitSystemKey | undefined> {\n const unitName = formatProps.composite?.units[0].name;\n assert(!!unitName);\n const unit = await unitsProvider.findUnitByName(unitName);\n assert(!!unit);\n const [_, unitSystemName] = unit.system.split(/[\\.:]/);\n switch (unitSystemName.toUpperCase()) {\n case \"METRIC\":\n return \"metric\";\n case \"IMPERIAL\":\n return \"imperial\";\n case \"USCUSTOM\":\n return \"usCustomary\";\n case \"USSURVEY\":\n return \"usSurvey\";\n /* c8 ignore next 2 */\n default:\n return undefined;\n }\n}\n\nasync function getFormatPropsFromDefaultFormats({\n schemaContext,\n formatsMap,\n unitSystem,\n koqName,\n}: {\n schemaContext: SchemaContext;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n formatsMap: FormatsMap;\n unitSystem: UnitSystemKey;\n koqName: string;\n}): Promise<FormatProps | undefined> {\n const koq = await getKoq(schemaContext, koqName);\n /* c8 ignore next 3 */\n if (!koq) {\n return undefined;\n }\n\n const persistenceUnit = await koq.persistenceUnit;\n /* c8 ignore next 3 */\n if (!persistenceUnit) {\n return undefined;\n }\n const actualPersistenceUnit = persistenceUnit instanceof InvertedUnit ? /* c8 ignore next */ await persistenceUnit.invertsUnit : persistenceUnit;\n const phenomenon = await actualPersistenceUnit?.phenomenon;\n if (phenomenon && formatsMap[phenomenon.name.toUpperCase()]) {\n const defaultPhenomenonFormats = formatsMap[phenomenon.name.toUpperCase()];\n for (const defaultUnitSystemFormat of Array.isArray(defaultPhenomenonFormats)\n ? /* c8 ignore next */ defaultPhenomenonFormats\n : [defaultPhenomenonFormats]) {\n if (defaultUnitSystemFormat.unitSystems.includes(unitSystem)) {\n return defaultUnitSystemFormat.format;\n }\n }\n }\n return undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"KoqPropertyValueFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA6C;AAC7C,wDAAqI;AACrI,gEAA8J;AAmE9J;;;GAGG;AACH,MAAa,yBAAyB;IAC5B,cAAc,CAAgB;IAC9B,cAAc,CAAgB;IAC9B,gBAAgB,CAAmB;IAC3C,4DAA4D;IACpD,eAAe,CAAc;IAMrC,4DAA4D;IAC5D,YAAY,oBAAoE,EAAE,cAA2B,EAAE,eAAiC;QAC9I,IAAI,oBAAoB,YAAY,iCAAa,EAAE,CAAC;YAClD,IAAI,CAAC,cAAc,GAAG,oBAAoB,CAAC;YAC3C,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;YACxC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,cAAc,GAAG,oBAAoB,CAAC,aAAa,CAAC;YACzD,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC,eAAe,CAAC;QAC/D,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,IAAI,sCAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpE,CAAC;IAED,qBAAqB;IACrB,gBAAgB;IAChB,4DAA4D;IAC5D,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IACD,4DAA4D;IAC5D,IAAW,cAAc,CAAC,KAA6B;QACrD,IAAI,CAAC,eAAe,GAAG,KAAK;YAC1B,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,EAAE,iBAAiB,EAAE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AC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC7D,OAAO,uBAAuB,CAAC,MAAM,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Format, FormatProps, FormatsProvider, FormatterSpec, ParserSpec, UnitsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport { InvertedUnit, KindOfQuantity, SchemaContext, SchemaFormatsProvider, SchemaKey, SchemaMatchType, SchemaUnitProvider } from \"@itwin/ecschema-metadata\";\n\n/**\n * A data structure that associates unit systems with property value formatting props. The associations are used for\n * assigning formatting props for specific phenomenon and unit system combinations (see [[FormatsMap]]).\n *\n * @public\n *\n * @deprecated in 5.1 - will not be removed until after 2026-08-08. `FormatsMap` and related APIs have been deprecated in favor of [FormatsProvider]($core-quantity).\n */\nexport interface UnitSystemFormat {\n unitSystems: UnitSystemKey[];\n format: FormatProps;\n}\n\n/**\n * A data structure that associates specific phenomenon with one or more formatting props for specific unit system.\n *\n * Example:\n * ```json\n * {\n * length: [{\n * unitSystems: [\"metric\"],\n * format: formatForCentimeters,\n * }, {\n * unitSystems: [\"imperial\", \"usCustomary\"],\n * format: formatForInches,\n * }, {\n * unitSystems: [\"usSurvey\"],\n * format: formatForUsSurveyInches,\n * }]\n * }\n * ```\n *\n * @public\n *\n * @deprecated in 5.1 - will not be removed until after 2026-08-08. `FormatsMap` and related APIs have been deprecated in favor of [FormatsProvider]($core-quantity).\n */\nexport interface FormatsMap {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n [phenomenon: string]: UnitSystemFormat | UnitSystemFormat[];\n}\n\n/**\n * Options for finding a formatter spec to use in [[KoqPropertyValueFormatter]].\n * @public\n */\nexport interface FormatOptions {\n /** Full name of the `KindOfQuantity`, e.g. `SchemaName:KoqName`. */\n koqName: string;\n /** Unit system to use for formatting. */\n unitSystem?: UnitSystemKey;\n /** Optional overrides for the format used to parse or format values. */\n formatOverride?: Partial<Omit<FormatProps, \"type\">>;\n}\n\n/**\n * Props for creating [[KoqPropertyValueFormatter]].\n * @public\n */\ninterface KoqPropertyValueFormatterProps {\n /** Schema context to use for locating units, formats, etc. Generally retrieved through the `schemaContext` getter on an iModel. */\n schemaContext: SchemaContext;\n /** Formats provider to use for finding formatting props. Defaults to [SchemaFormatsProvider]($ecschema-metadata) when not supplied. */\n formatsProvider?: FormatsProvider;\n}\n\n/**\n * An utility for formatting property values based on `KindOfQuantity` and unit system.\n * @public\n */\nexport class KoqPropertyValueFormatter {\n private _schemaContext: SchemaContext;\n private _unitsProvider: UnitsProvider;\n private _formatsProvider?: FormatsProvider;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _defaultFormats?: FormatsMap;\n\n /** @deprecated in 5.1 - will not be removed until after 2026-08-08. Use the overload that takes a props object. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(schemaContext: SchemaContext, defaultFormats?: FormatsMap, formatsProvider?: FormatsProvider);\n constructor(props: KoqPropertyValueFormatterProps);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(schemaContextOrProps: SchemaContext | KoqPropertyValueFormatterProps, defaultFormats?: FormatsMap, formatsProvider?: FormatsProvider) {\n if (schemaContextOrProps instanceof SchemaContext) {\n this._schemaContext = schemaContextOrProps;\n this._formatsProvider = formatsProvider;\n this.defaultFormats = defaultFormats;\n } else {\n this._schemaContext = schemaContextOrProps.schemaContext;\n this._formatsProvider = schemaContextOrProps.formatsProvider;\n }\n this._unitsProvider = new SchemaUnitProvider(this._schemaContext);\n }\n\n /* c8 ignore start */\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public get defaultFormats(): FormatsMap | undefined {\n return this._defaultFormats;\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public set defaultFormats(value: FormatsMap | undefined) {\n this._defaultFormats = value\n ? Object.entries(value).reduce((acc, [phenomenon, unitSystemFormats]) => ({ ...acc, [phenomenon.toUpperCase()]: unitSystemFormats }), {})\n : undefined;\n }\n /* c8 ignore end */\n\n public async format(value: number, options: FormatOptions) {\n const formatterSpec = await this.getFormatterSpec(options);\n if (!formatterSpec) {\n return undefined;\n }\n return formatterSpec.applyFormatting(value);\n }\n\n public async getFormatterSpec(options: FormatOptions) {\n const formattingProps = await this.#getFormattingProps(options);\n if (!formattingProps) {\n return undefined;\n }\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, { ...formatProps, ...options.formatOverride });\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\n }\n\n public async getParserSpec(options: FormatOptions) {\n const formattingProps = await this.#getFormattingProps(options);\n if (!formattingProps) {\n return undefined;\n }\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, { ...formatProps, ...options.formatOverride });\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\n }\n\n async #getFormattingProps(options: FormatOptions): Promise<FormattingProps | undefined> {\n const { koqName } = options;\n const koq = await getKoq(this._schemaContext, koqName);\n if (!koq) {\n return undefined;\n }\n const persistenceUnit = await koq.persistenceUnit;\n assert(!!persistenceUnit);\n\n // default to metric as it's the persistence unit system\n const unitSystem = options.unitSystem ?? \"metric\";\n\n const formatsProvider = this._formatsProvider ?? new SchemaFormatsProvider(this._schemaContext, unitSystem);\n const formatProps = await formatsProvider.getFormat(koqName);\n\n // `SchemaFormatsProvider` will fall back to default presentation format, but we want to fall back\n // to default formats' map first, and only then to the default presentation format. All of this can\n // be removed with the removal of default formats map.\n if (this._defaultFormats && (!formatProps || (await getUnitSystemKey(this._unitsProvider, formatProps)) !== unitSystem)) {\n const defaultFormatProps = await getFormatPropsFromDefaultFormats({\n schemaContext: this._schemaContext,\n formatsMap: this._defaultFormats,\n unitSystem,\n koqName,\n });\n if (defaultFormatProps) {\n return { formatProps: defaultFormatProps, persistenceUnitName: persistenceUnit.fullName };\n }\n }\n\n if (formatProps) {\n return { formatProps, persistenceUnitName: persistenceUnit.fullName };\n }\n\n return undefined;\n }\n}\n\ninterface FormattingProps {\n formatProps: FormatProps;\n persistenceUnitName: string;\n}\n\nasync function getKoq(schemaLocater: SchemaContext, fullName: string) {\n const [schemaName, propKoqName] = fullName.split(\":\");\n const schema = await schemaLocater.getSchema(new SchemaKey(schemaName), SchemaMatchType.Latest);\n if (!schema) {\n return undefined;\n }\n return schema.getItem(propKoqName, KindOfQuantity);\n}\n\nasync function getUnitSystemKey(unitsProvider: UnitsProvider, formatProps: FormatProps): Promise<UnitSystemKey | undefined> {\n const unitName = formatProps.composite?.units[0].name;\n assert(!!unitName);\n const unit = await unitsProvider.findUnitByName(unitName);\n assert(!!unit);\n const [_, unitSystemName] = unit.system.split(/[\\.:]/);\n switch (unitSystemName.toUpperCase()) {\n case \"METRIC\":\n return \"metric\";\n case \"IMPERIAL\":\n return \"imperial\";\n case \"USCUSTOM\":\n return \"usCustomary\";\n case \"USSURVEY\":\n return \"usSurvey\";\n /* c8 ignore next 2 */\n default:\n return undefined;\n }\n}\n\nasync function getFormatPropsFromDefaultFormats({\n schemaContext,\n formatsMap,\n unitSystem,\n koqName,\n}: {\n schemaContext: SchemaContext;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n formatsMap: FormatsMap;\n unitSystem: UnitSystemKey;\n koqName: string;\n}): Promise<FormatProps | undefined> {\n const koq = await getKoq(schemaContext, koqName);\n /* c8 ignore next 3 */\n if (!koq) {\n return undefined;\n }\n\n const persistenceUnit = await koq.persistenceUnit;\n /* c8 ignore next 3 */\n if (!persistenceUnit) {\n return undefined;\n }\n const actualPersistenceUnit = persistenceUnit instanceof InvertedUnit ? /* c8 ignore next */ await persistenceUnit.invertsUnit : persistenceUnit;\n const phenomenon = await actualPersistenceUnit?.phenomenon;\n if (phenomenon && formatsMap[phenomenon.name.toUpperCase()]) {\n const defaultPhenomenonFormats = formatsMap[phenomenon.name.toUpperCase()];\n for (const defaultUnitSystemFormat of Array.isArray(defaultPhenomenonFormats)\n ? /* c8 ignore next */ defaultPhenomenonFormats\n : [defaultPhenomenonFormats]) {\n if (defaultUnitSystemFormat.unitSystems.includes(unitSystem)) {\n return defaultUnitSystemFormat.format;\n }\n }\n }\n return undefined;\n}\n"]}
|
|
@@ -18,6 +18,7 @@ export declare class LocalizationHelper {
|
|
|
18
18
|
constructor(props: LocalizationHelperProps);
|
|
19
19
|
getLocalizedString(text: string): string;
|
|
20
20
|
getLocalizedNodes(nodes: Node[]): Node[];
|
|
21
|
+
getLocalizedNode(node: Node): Node;
|
|
21
22
|
getLocalizedNodePathElement(npe: NodePathElement): NodePathElement;
|
|
22
23
|
getLocalizedDisplayValueGroup(group: DisplayValueGroup): DisplayValueGroup;
|
|
23
24
|
getLocalizedLabelDefinition(labelDefinition: LabelDefinition): LabelDefinition;
|
|
@@ -30,7 +31,6 @@ export declare class LocalizationHelper {
|
|
|
30
31
|
private getLocalizedRawValue;
|
|
31
32
|
private getLocalizedContentField;
|
|
32
33
|
private getLocalizedCategoryDescription;
|
|
33
|
-
getLocalizedNode(node: Node): Node;
|
|
34
34
|
private getLocalizedDisplayValue;
|
|
35
35
|
}
|
|
36
36
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE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,EAAE,uBAAuB;IAInC,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAK/B,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE;IAIxC,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAQlC,2BAA2B,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe;IASlE,6BAA6B,CAAC,KAAK,EAAE,iBAAiB,GAAG,iBAAiB;IAO1E,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,eAAe;IAsB9E,4BAA4B,CAAC,gBAAgB,EAAE,eAAe,EAAE;IAIhE,6BAA6B,CAAC,UAAU,EAAE,UAAU;IAOpD,wBAAwB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE;IAI/C,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAI9C,6BAA6B,CAAC,IAAI,EAAE,iBAAiB,GAAG,iBAAiB;IAQhF,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,wBAAwB;IAehC,OAAO,CAAC,+BAA+B;IAMvC,OAAO,CAAC,wBAAwB;CAYjC"}
|
|
@@ -22,9 +22,17 @@ class LocalizationHelper {
|
|
|
22
22
|
getLocalizedString(text) {
|
|
23
23
|
return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, "")));
|
|
24
24
|
}
|
|
25
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
25
26
|
getLocalizedNodes(nodes) {
|
|
26
27
|
return nodes.map((n) => this.getLocalizedNode(n));
|
|
27
28
|
}
|
|
29
|
+
getLocalizedNode(node) {
|
|
30
|
+
return {
|
|
31
|
+
...node,
|
|
32
|
+
label: this.getLocalizedLabelDefinition(node.label),
|
|
33
|
+
...(node.description ? { description: this.getLocalizedString(node.description) } : undefined),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
28
36
|
getLocalizedNodePathElement(npe) {
|
|
29
37
|
return {
|
|
30
38
|
...npe,
|
|
@@ -32,6 +40,7 @@ class LocalizationHelper {
|
|
|
32
40
|
children: npe.children.map((c) => this.getLocalizedNodePathElement(c)),
|
|
33
41
|
};
|
|
34
42
|
}
|
|
43
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
35
44
|
getLocalizedDisplayValueGroup(group) {
|
|
36
45
|
return {
|
|
37
46
|
...group,
|
|
@@ -133,13 +142,6 @@ class LocalizationHelper {
|
|
|
133
142
|
category.description = this.getLocalizedString(category.description);
|
|
134
143
|
return category;
|
|
135
144
|
}
|
|
136
|
-
getLocalizedNode(node) {
|
|
137
|
-
return {
|
|
138
|
-
...node,
|
|
139
|
-
label: this.getLocalizedLabelDefinition(node.label),
|
|
140
|
-
...(node.description ? { description: this.getLocalizedString(node.description) } : undefined),
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
145
|
getLocalizedDisplayValue(value) {
|
|
144
146
|
if (typeof value === "undefined") {
|
|
145
147
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationHelper.js","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,qDAA+C;AAC/C,2DAAqD;AAGrD,iDAA4E;AAI5E,6DAAiH;AAEjH,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAMlD,gBAAgB;AAChB,MAAa,kBAAkB;IACrB,mBAAmB,CAA0B;IAErD,YAAY,KAA8B;QACxC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,kBAAkB,CAAC;IACtD,CAAC;IAEM,kBAAkB,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;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B,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,uBAAY,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AA1JD,gDA0JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { CategoryDescription } from \"./content/Category.js\";\nimport { Content } from \"./content/Content.js\";\nimport { Descriptor } from \"./content/Descriptor.js\";\nimport { Field } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { DisplayValue, DisplayValueGroup, Value } from \"./content/Value.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { COMPOSITE_LABEL_DEFINITION_TYPENAME, LabelCompositeValue, LabelDefinition } from \"./LabelDefinition.js\";\n\nconst KEY_PATTERN = /@[\\w\\d\\-_]+:[\\w\\d\\-\\._]+?@/g;\n\ninterface LocalizationHelperProps {\n getLocalizedString: (key: string) => string;\n}\n\n/** @internal */\nexport class LocalizationHelper {\n private _getLocalizedString: (key: string) => string;\n\n constructor(props: LocalizationHelperProps) {\n this._getLocalizedString = props.getLocalizedString;\n }\n\n public getLocalizedString(text: string) {\n return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, \"\")));\n }\n\n public getLocalizedNodes(nodes: Node[]): Node[] {\n return nodes.map((n) => this.getLocalizedNode(n));\n }\n\n public getLocalizedNodePathElement(npe: NodePathElement): NodePathElement {\n return {\n ...npe,\n node: this.getLocalizedNode(npe.node),\n children: npe.children.map((c) => this.getLocalizedNodePathElement(c)),\n };\n }\n\n public getLocalizedDisplayValueGroup(group: DisplayValueGroup): DisplayValueGroup {\n return {\n ...group,\n displayValue: this.getLocalizedDisplayValue(group.displayValue),\n };\n }\n\n public getLocalizedLabelDefinition(labelDefinition: LabelDefinition): LabelDefinition {\n const getLocalizedComposite = (compositeValue: LabelCompositeValue) => ({\n ...compositeValue,\n values: compositeValue.values.map((value) => this.getLocalizedLabelDefinition(value)),\n });\n\n if (labelDefinition.typeName === COMPOSITE_LABEL_DEFINITION_TYPENAME) {\n return {\n ...labelDefinition,\n rawValue: getLocalizedComposite(labelDefinition.rawValue as LabelCompositeValue),\n };\n }\n if (labelDefinition.typeName === \"string\") {\n return {\n ...labelDefinition,\n rawValue: this.getLocalizedString(labelDefinition.rawValue as string),\n displayValue: this.getLocalizedString(labelDefinition.displayValue),\n };\n }\n return labelDefinition;\n }\n\n public getLocalizedLabelDefinitions(labelDefinitions: LabelDefinition[]) {\n return labelDefinitions.map((labelDefinition) => this.getLocalizedLabelDefinition(labelDefinition));\n }\n\n public getLocalizedContentDescriptor(descriptor: Descriptor) {\n const clone = new Descriptor(descriptor);\n clone.fields.forEach((field) => this.getLocalizedContentField(field));\n clone.categories.forEach((category) => this.getLocalizedCategoryDescription(category));\n return clone;\n }\n\n public getLocalizedContentItems(items: Item[]): Item[] {\n return items.map((item) => this.getLocalizedContentItem(item));\n }\n\n public getLocalizedContent(content: Content): Content {\n return new Content(this.getLocalizedContentDescriptor(content.descriptor), this.getLocalizedContentItems(content.contentSet));\n }\n\n public getLocalizedElementProperties(elem: ElementProperties): ElementProperties {\n return {\n ...elem,\n label: this.getLocalizedString(elem.label),\n };\n }\n\n // warning: this function mutates the item\n private getLocalizedContentItem(item: Item): Item {\n item.label = this.getLocalizedLabelDefinition(item.label);\n item.values = Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\n item.displayValues = Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\n return item;\n }\n\n private getLocalizedRawValue(value: Value): Value {\n if (typeof value === \"string\") {\n return this.getLocalizedString(value);\n }\n if (Value.isNavigationValue(value)) {\n return {\n ...value,\n label: this.getLocalizedLabelDefinition(value.label),\n };\n }\n if (Value.isNestedContent(value)) {\n return value.map((item) => ({\n ...item,\n values: Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {}),\n displayValues: Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {}),\n }));\n }\n if (Value.isArray(value)) {\n return value.map((v) => this.getLocalizedRawValue(v));\n }\n if (Value.isMap(value)) {\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\n }\n return value;\n }\n\n // warning: this function mutates the field\n private getLocalizedContentField<TField extends Field>(field: TField) {\n field.label = this.getLocalizedString(field.label);\n if (field.isPropertiesField()) {\n if (field.isStructPropertiesField()) {\n field.memberFields = field.memberFields.map((m) => this.getLocalizedContentField(m));\n } else if (field.isArrayPropertiesField()) {\n field.itemsField = this.getLocalizedContentField(field.itemsField);\n }\n } else if (field.isNestedContentField()) {\n field.nestedFields = field.nestedFields.map((m) => this.getLocalizedContentField(m));\n }\n return field;\n }\n\n // warning: this function mutates the category\n private getLocalizedCategoryDescription(category: CategoryDescription) {\n category.label = this.getLocalizedString(category.label);\n category.description = this.getLocalizedString(category.description);\n return category;\n }\n\n public getLocalizedNode(node: Node): Node {\n return {\n ...node,\n label: this.getLocalizedLabelDefinition(node.label),\n ...(node.description ? { description: this.getLocalizedString(node.description) } : undefined),\n };\n }\n\n private getLocalizedDisplayValue(value: DisplayValue): DisplayValue {\n if (typeof value === \"undefined\") {\n return undefined;\n }\n if (typeof value === \"string\") {\n return this.getLocalizedString(value);\n }\n if (DisplayValue.isArray(value)) {\n return value.map((v) => this.getLocalizedDisplayValue(v));\n }\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LocalizationHelper.js","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,qDAA+C;AAC/C,2DAAqD;AAGrD,iDAA4E;AAI5E,6DAAiH;AAEjH,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAMlD,gBAAgB;AAChB,MAAa,kBAAkB;IACrB,mBAAmB,CAA0B;IAErD,YAAY,KAA8B;QACxC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,kBAAkB,CAAC;IACtD,CAAC;IAEM,kBAAkB,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;IAED,qDAAqD;IAC9C,iBAAiB,CAAC,KAAa;QACpC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAEM,gBAAgB,CAAC,IAAU;QAChC,OAAO;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,CAAC;YAChC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AA5JD,gDA4JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { CategoryDescription } from \"./content/Category.js\";\nimport { Content } from \"./content/Content.js\";\nimport { Descriptor } from \"./content/Descriptor.js\";\nimport { Field } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { DisplayValue, DisplayValueGroup, Value } from \"./content/Value.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { COMPOSITE_LABEL_DEFINITION_TYPENAME, LabelCompositeValue, LabelDefinition } from \"./LabelDefinition.js\";\n\nconst KEY_PATTERN = /@[\\w\\d\\-_]+:[\\w\\d\\-\\._]+?@/g;\n\ninterface LocalizationHelperProps {\n getLocalizedString: (key: string) => string;\n}\n\n/** @internal */\nexport class LocalizationHelper {\n private _getLocalizedString: (key: string) => string;\n\n constructor(props: LocalizationHelperProps) {\n this._getLocalizedString = props.getLocalizedString;\n }\n\n public getLocalizedString(text: string) {\n return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, \"\")));\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n public getLocalizedNodes(nodes: Node[]): Node[] {\n return nodes.map((n) => this.getLocalizedNode(n));\n }\n\n public getLocalizedNode(node: Node): Node {\n return {\n ...node,\n label: this.getLocalizedLabelDefinition(node.label),\n ...(node.description ? { description: this.getLocalizedString(node.description) } : undefined),\n };\n }\n\n public getLocalizedNodePathElement(npe: NodePathElement): NodePathElement {\n return {\n ...npe,\n node: this.getLocalizedNode(npe.node),\n children: npe.children.map((c) => this.getLocalizedNodePathElement(c)),\n };\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n\n public getLocalizedDisplayValueGroup(group: DisplayValueGroup): DisplayValueGroup {\n return {\n ...group,\n displayValue: this.getLocalizedDisplayValue(group.displayValue),\n };\n }\n\n public getLocalizedLabelDefinition(labelDefinition: LabelDefinition): LabelDefinition {\n const getLocalizedComposite = (compositeValue: LabelCompositeValue) => ({\n ...compositeValue,\n values: compositeValue.values.map((value) => this.getLocalizedLabelDefinition(value)),\n });\n\n if (labelDefinition.typeName === COMPOSITE_LABEL_DEFINITION_TYPENAME) {\n return {\n ...labelDefinition,\n rawValue: getLocalizedComposite(labelDefinition.rawValue as LabelCompositeValue),\n };\n }\n if (labelDefinition.typeName === \"string\") {\n return {\n ...labelDefinition,\n rawValue: this.getLocalizedString(labelDefinition.rawValue as string),\n displayValue: this.getLocalizedString(labelDefinition.displayValue),\n };\n }\n return labelDefinition;\n }\n\n public getLocalizedLabelDefinitions(labelDefinitions: LabelDefinition[]) {\n return labelDefinitions.map((labelDefinition) => this.getLocalizedLabelDefinition(labelDefinition));\n }\n\n public getLocalizedContentDescriptor(descriptor: Descriptor) {\n const clone = new Descriptor(descriptor);\n clone.fields.forEach((field) => this.getLocalizedContentField(field));\n clone.categories.forEach((category) => this.getLocalizedCategoryDescription(category));\n return clone;\n }\n\n public getLocalizedContentItems(items: Item[]): Item[] {\n return items.map((item) => this.getLocalizedContentItem(item));\n }\n\n public getLocalizedContent(content: Content): Content {\n return new Content(this.getLocalizedContentDescriptor(content.descriptor), this.getLocalizedContentItems(content.contentSet));\n }\n\n public getLocalizedElementProperties(elem: ElementProperties): ElementProperties {\n return {\n ...elem,\n label: this.getLocalizedString(elem.label),\n };\n }\n\n // warning: this function mutates the item\n private getLocalizedContentItem(item: Item): Item {\n item.label = this.getLocalizedLabelDefinition(item.label);\n item.values = Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\n item.displayValues = Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\n return item;\n }\n\n private getLocalizedRawValue(value: Value): Value {\n if (typeof value === \"string\") {\n return this.getLocalizedString(value);\n }\n if (Value.isNavigationValue(value)) {\n return {\n ...value,\n label: this.getLocalizedLabelDefinition(value.label),\n };\n }\n if (Value.isNestedContent(value)) {\n return value.map((item) => ({\n ...item,\n values: Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {}),\n displayValues: Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {}),\n }));\n }\n if (Value.isArray(value)) {\n return value.map((v) => this.getLocalizedRawValue(v));\n }\n if (Value.isMap(value)) {\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\n }\n return value;\n }\n\n // warning: this function mutates the field\n private getLocalizedContentField<TField extends Field>(field: TField) {\n field.label = this.getLocalizedString(field.label);\n if (field.isPropertiesField()) {\n if (field.isStructPropertiesField()) {\n field.memberFields = field.memberFields.map((m) => this.getLocalizedContentField(m));\n } else if (field.isArrayPropertiesField()) {\n field.itemsField = this.getLocalizedContentField(field.itemsField);\n }\n } else if (field.isNestedContentField()) {\n field.nestedFields = field.nestedFields.map((m) => this.getLocalizedContentField(m));\n }\n return field;\n }\n\n // warning: this function mutates the category\n private getLocalizedCategoryDescription(category: CategoryDescription) {\n category.label = this.getLocalizedString(category.label);\n category.description = this.getLocalizedString(category.description);\n return category;\n }\n\n private getLocalizedDisplayValue(value: DisplayValue): DisplayValue {\n if (typeof value === \"undefined\") {\n return undefined;\n }\n if (typeof value === \"string\") {\n return this.getLocalizedString(value);\n }\n if (DisplayValue.isArray(value)) {\n return value.map((v) => this.getLocalizedDisplayValue(v));\n }\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\n }\n}\n"]}
|
|
@@ -42,6 +42,8 @@ export interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVa
|
|
|
42
42
|
/**
|
|
43
43
|
* Request type for hierarchy requests.
|
|
44
44
|
* @public
|
|
45
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
46
|
+
* package for creating hierarchies.
|
|
45
47
|
*/
|
|
46
48
|
export interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
|
|
47
49
|
/** Key of the parent node to get children for */
|
|
@@ -68,6 +70,8 @@ export interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = R
|
|
|
68
70
|
/**
|
|
69
71
|
* Params for hierarchy level descriptor requests.
|
|
70
72
|
* @public
|
|
73
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
74
|
+
* package for creating hierarchies.
|
|
71
75
|
*/
|
|
72
76
|
export interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
|
|
73
77
|
/** Key of the parent node to get hierarchy level descriptor for. */
|
|
@@ -76,6 +80,8 @@ export interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRule
|
|
|
76
80
|
/**
|
|
77
81
|
* Request type of filtering hierarchies by given ECInstance paths.
|
|
78
82
|
* @public
|
|
83
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
84
|
+
* package for creating hierarchies.
|
|
79
85
|
*/
|
|
80
86
|
export interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
|
|
81
87
|
/** A list of paths from root ECInstance to target ECInstance. */
|
|
@@ -89,6 +95,8 @@ export interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetV
|
|
|
89
95
|
/**
|
|
90
96
|
* Request type of filtering hierarchies by given text.
|
|
91
97
|
* @public
|
|
98
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
99
|
+
* package for creating hierarchies.
|
|
92
100
|
*/
|
|
93
101
|
export interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
|
|
94
102
|
/** Text to filter the hierarchy by. */
|
|
@@ -260,6 +268,8 @@ export interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<
|
|
|
260
268
|
/**
|
|
261
269
|
* Data structure for comparing a hierarchy after ruleset or ruleset variable changes.
|
|
262
270
|
* @public
|
|
271
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
272
|
+
* package for creating hierarchies.
|
|
263
273
|
*/
|
|
264
274
|
export interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {
|
|
265
275
|
prev: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManagerOptions.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,OAAO;IACrC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAEhB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAAE,SAAQ,cAAc,CAAC,OAAO,CAAC;IACrH,+DAA+D;IAC/D,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC;IAE9B,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED
|
|
1
|
+
{"version":3,"file":"PresentationManagerOptions.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EA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OAAO,EAAE,qCAAqC,CAAC,OAAO,CAAC,GAAG,oCAAoC,CAAC,OAAO,EAAE,cAAc,CAAC,GACtH,OAAO,IAAI,qCAAqC,CAAC,OAAO,CAAC,CAE3D;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,MAAM,IAAI,QAAQ,GAAG;IAChE,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManagerOptions.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AA2VH,0FAIC;AARD;;;GAGG;AACH,SAAgB,uCAAuC,CACrD,OAAuH;IAEvH,OAAQ,OAA0D,CAAC,SAAS,KAAK,SAAS,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent, Id64String } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { Descriptor, SelectionInfo } from \"./content/Descriptor.js\";\nimport { FieldDescriptor } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { InstanceKey } from \"./EC.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { InstanceFilterDefinition } from \"./InstanceFilterDefinition.js\";\nimport { Ruleset } from \"./rules/Ruleset.js\";\nimport { RulesetVariable } from \"./RulesetVariables.js\";\nimport { SelectionScopeProps } from \"./selection/SelectionScope.js\";\n\n/**\n * A generic request options type used for both hierarchy and content requests.\n * @public\n */\nexport interface RequestOptions<TIModel> {\n /** iModel to request data from */\n imodel: TIModel;\n\n /** Optional locale to use when formatting / localizing data */\n locale?: string;\n\n /**\n * Unit system to use when formatting property values with units. Default presentation\n * unit is used if unit system is not specified.\n */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Options for requests that require presentation ruleset. Not\n * meant to be used directly, see one of the subclasses.\n *\n * @public\n */\nexport interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptions<TIModel> {\n /** Ruleset or id of the ruleset to use when requesting data */\n rulesetOrId: Ruleset | string;\n\n /** Ruleset variables to use when requesting data */\n rulesetVariables?: TRulesetVariable[];\n}\n\n/**\n * Request type for hierarchy requests.\n * @public\n */\nexport interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get children for */\n parentKey?: TNodeKey;\n\n /**\n * An instance filter that should be applied for this hierarchy level.\n *\n * **Note:** May only be used on hierarchy levels that support filtering - check [[NavNode.supportsFiltering]] before\n * requesting filtered children.\n */\n instanceFilter?: InstanceFilterDefinition;\n\n /**\n * A limit to how many instances at most should be loaded for a hierarchy level. If the limit is exceeded,\n * the request fails with [[PresentationError]] having [[PresentationStatus.ResultSetTooLarge]] error number.\n *\n * Specifying the limit is useful when creating unlimited size result sets is not meaningful - this allows the library\n * to return early as soon as the limit is reached, instead of creating a very large result that's possibly too large to\n * be useful to be displayed to end users.\n *\n * @see [Hierarchies' filtering and limiting]($docs/presentation/hierarchies/FilteringLimiting.md)\n */\n sizeLimit?: number;\n}\n\n/**\n * Params for hierarchy level descriptor requests.\n * @public\n */\nexport interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get hierarchy level descriptor for. */\n parentKey?: TNodeKey;\n}\n\n/**\n * Request type of filtering hierarchies by given ECInstance paths.\n * @public\n */\nexport interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** A list of paths from root ECInstance to target ECInstance. */\n instancePaths: InstanceKey[][];\n\n /**\n * An optional index (`0 <= markedIndex < instancePaths.length`) to mark one of the instance paths. The\n * path is marked using `NodePathElement.isMarked` flag in the result.\n */\n markedIndex?: number;\n}\n\n/**\n * Request type of filtering hierarchies by given text.\n * @public\n */\nexport interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Text to filter the hierarchy by. */\n filterText: string;\n}\n\n/**\n * Request type for content sources requests.\n * @public\n */\nexport interface ContentSourcesRequestOptions<TIModel> extends RequestOptions<TIModel> {\n /** Full names of classes to get content sources for. Format for a full class name: `SchemaName:ClassName`. */\n classes: string[];\n}\n\n/**\n * Request type for content descriptor requests.\n * @public\n */\nexport interface ContentDescriptorRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType: string;\n /**\n * Content flags used for content customization.\n * @see [[ContentFlags]]\n */\n contentFlags?: number;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Information about the selection event that was the cause of this content request */\n selection?: SelectionInfo;\n}\n\n/**\n * Request type for content requests.\n * @public\n */\nexport interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /**\n * Flag that specifies whether value formatting should be omitted or not.\n * Content is returned without `displayValues` when this is set to `true`.\n */\n omitFormattedValues?: boolean;\n}\n\n/**\n * Request type for distinct values' requests.\n * @public\n */\nexport interface DistinctValuesRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Descriptor for a field distinct values are requested for */\n fieldDescriptor: FieldDescriptor;\n}\n\n/**\n * Request type for element properties requests\n * @public\n * @deprecated in 4.4.0 - will not be removed until after 2026-06-13. Use [[SingleElementPropertiesRequestOptions]] or [[MultiElementPropertiesRequestOptions]] directly.\n */\nexport type ElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | SingleElementPropertiesRequestOptions<TIModel>\n | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for single element properties requests.\n * @public\n */\nexport interface SingleElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /** ID of the element to get properties for. */\n elementId: Id64String;\n\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n}\n\n/**\n * Base request type for multiple elements properties requests.\n * @public\n */\nexport interface MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n\n /**\n * The properties of multiple elements are going to be retrieved and returned in batches. Depending on the batch\n * size load on CPU vs MEMORY load may vary, so changing this attribute allows to fine tune the performance.\n * Defaults to `1000`.\n */\n batchSize?: number;\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by class.\n * @public\n */\nexport interface MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes\n * are used. Classes should be specified in one of these formats: \"<schema name or alias>.<class_name>\" or\n * \"<schema name or alias>:<class_name>\".\n */\n elementClasses?: string[];\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by element id.\n * @public\n */\nexport interface MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * A list of `bis.Element` IDs to get properties for.\n */\n elementIds?: Id64String[];\n}\n/**\n * Request type for multiple elements properties requests.\n * @public\n */\nexport type MultiElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent>\n | MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for content instance keys' requests.\n * @public\n */\nexport interface ContentInstanceKeysRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType?: string;\n /** Input keys for getting the content. */\n keys: TKeySet;\n}\n\n/**\n * Request type for label requests\n * @public\n */\nexport interface DisplayLabelRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Key of ECInstance to get label for */\n key: TInstanceKey;\n}\n\n/**\n * Request type for labels requests\n * @public\n */\nexport interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Keys of ECInstances to get labels for */\n keys: TInstanceKey[];\n}\n\n/**\n * Request options used for selection scope related requests\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * Request options used for calculating selection based on given instance keys and selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {\n elementIds: Id64String[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scope: SelectionScopeProps;\n}\n\n/**\n * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.\n * @public\n */\nexport interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n prev: {\n rulesetOrId?: Ruleset | string;\n rulesetVariables?: TRulesetVariable[];\n };\n expandedNodeKeys?: TNodeKey[];\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n resultSetSize?: number;\n}\n\n/**\n * Paging options\n * @public\n */\nexport interface PageOptions {\n /** Inclusive start 0-based index of the page */\n start?: number;\n /** Maximum size of the page */\n size?: number;\n}\n\n/**\n * A wrapper type that injects [[PageOptions]] into supplied type\n * @public\n */\nexport type Paged<TOptions extends object> = TOptions & {\n /** Optional paging parameters */\n paging?: PageOptions;\n};\n\n/**\n * A wrapper type that injects priority into supplied type.\n * @public\n */\nexport type Prioritized<TOptions extends object> = TOptions & {\n /** Optional priority */\n priority?: number;\n};\n\n/**\n * Checks if supplied request options are for single or multiple element properties.\n * @internal\n */\nexport function isSingleElementPropertiesRequestOptions<TIModel, TParsedContent = any>(\n options: SingleElementPropertiesRequestOptions<TIModel> | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>,\n): options is SingleElementPropertiesRequestOptions<TIModel> {\n return (options as SingleElementPropertiesRequestOptions<TIModel>).elementId !== undefined;\n}\n\n/**\n * A wrapper type that injects cancelEvent into supplied type.\n * @public\n */\nexport type WithCancelEvent<TOptions extends object> = TOptions & {\n /** Event which is triggered when the request is canceled */\n cancelEvent?: BeEvent<() => void>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"PresentationManagerOptions.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AAqWH,0FAIC;AARD;;;GAGG;AACH,SAAgB,uCAAuC,CACrD,OAAuH;IAEvH,OAAQ,OAA0D,CAAC,SAAS,KAAK,SAAS,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { BeEvent, Id64String } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { Descriptor, SelectionInfo } from \"./content/Descriptor.js\";\nimport { FieldDescriptor } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { InstanceKey } from \"./EC.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { InstanceFilterDefinition } from \"./InstanceFilterDefinition.js\";\nimport { Ruleset } from \"./rules/Ruleset.js\";\nimport { RulesetVariable } from \"./RulesetVariables.js\";\nimport { SelectionScopeProps } from \"./selection/SelectionScope.js\";\n\n/**\n * A generic request options type used for both hierarchy and content requests.\n * @public\n */\nexport interface RequestOptions<TIModel> {\n /** iModel to request data from */\n imodel: TIModel;\n\n /** Optional locale to use when formatting / localizing data */\n locale?: string;\n\n /**\n * Unit system to use when formatting property values with units. Default presentation\n * unit is used if unit system is not specified.\n */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Options for requests that require presentation ruleset. Not\n * meant to be used directly, see one of the subclasses.\n *\n * @public\n */\nexport interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptions<TIModel> {\n /** Ruleset or id of the ruleset to use when requesting data */\n rulesetOrId: Ruleset | string;\n\n /** Ruleset variables to use when requesting data */\n rulesetVariables?: TRulesetVariable[];\n}\n\n/**\n * Request type for hierarchy requests.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get children for */\n parentKey?: TNodeKey;\n\n /**\n * An instance filter that should be applied for this hierarchy level.\n *\n * **Note:** May only be used on hierarchy levels that support filtering - check [[NavNode.supportsFiltering]] before\n * requesting filtered children.\n */\n instanceFilter?: InstanceFilterDefinition;\n\n /**\n * A limit to how many instances at most should be loaded for a hierarchy level. If the limit is exceeded,\n * the request fails with [[PresentationError]] having [[PresentationStatus.ResultSetTooLarge]] error number.\n *\n * Specifying the limit is useful when creating unlimited size result sets is not meaningful - this allows the library\n * to return early as soon as the limit is reached, instead of creating a very large result that's possibly too large to\n * be useful to be displayed to end users.\n *\n * @see [Hierarchies' filtering and limiting]($docs/presentation/hierarchies/FilteringLimiting.md)\n */\n sizeLimit?: number;\n}\n\n/**\n * Params for hierarchy level descriptor requests.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Key of the parent node to get hierarchy level descriptor for. */\n parentKey?: TNodeKey;\n}\n\n/**\n * Request type of filtering hierarchies by given ECInstance paths.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** A list of paths from root ECInstance to target ECInstance. */\n instancePaths: InstanceKey[][];\n\n /**\n * An optional index (`0 <= markedIndex < instancePaths.length`) to mark one of the instance paths. The\n * path is marked using `NodePathElement.isMarked` flag in the result.\n */\n markedIndex?: number;\n}\n\n/**\n * Request type of filtering hierarchies by given text.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Text to filter the hierarchy by. */\n filterText: string;\n}\n\n/**\n * Request type for content sources requests.\n * @public\n */\nexport interface ContentSourcesRequestOptions<TIModel> extends RequestOptions<TIModel> {\n /** Full names of classes to get content sources for. Format for a full class name: `SchemaName:ClassName`. */\n classes: string[];\n}\n\n/**\n * Request type for content descriptor requests.\n * @public\n */\nexport interface ContentDescriptorRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType: string;\n /**\n * Content flags used for content customization.\n * @see [[ContentFlags]]\n */\n contentFlags?: number;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Information about the selection event that was the cause of this content request */\n selection?: SelectionInfo;\n}\n\n/**\n * Request type for content requests.\n * @public\n */\nexport interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /**\n * Flag that specifies whether value formatting should be omitted or not.\n * Content is returned without `displayValues` when this is set to `true`.\n */\n omitFormattedValues?: boolean;\n}\n\n/**\n * Request type for distinct values' requests.\n * @public\n */\nexport interface DistinctValuesRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /** Content descriptor for customizing the returned content */\n descriptor: TDescriptor;\n /** Input keys for getting the content */\n keys: TKeySet;\n /** Descriptor for a field distinct values are requested for */\n fieldDescriptor: FieldDescriptor;\n}\n\n/**\n * Request type for element properties requests\n * @public\n * @deprecated in 4.4.0 - will not be removed until after 2026-06-13. Use [[SingleElementPropertiesRequestOptions]] or [[MultiElementPropertiesRequestOptions]] directly.\n */\nexport type ElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | SingleElementPropertiesRequestOptions<TIModel>\n | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for single element properties requests.\n * @public\n */\nexport interface SingleElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /** ID of the element to get properties for. */\n elementId: Id64String;\n\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n}\n\n/**\n * Base request type for multiple elements properties requests.\n * @public\n */\nexport interface MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {\n /**\n * Content parser that creates a result item based on given content descriptor and content item. Defaults\n * to a parser that creates [[ElementProperties]] objects.\n */\n contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;\n\n /**\n * The properties of multiple elements are going to be retrieved and returned in batches. Depending on the batch\n * size load on CPU vs MEMORY load may vary, so changing this attribute allows to fine tune the performance.\n * Defaults to `1000`.\n */\n batchSize?: number;\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by class.\n * @public\n */\nexport interface MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes\n * are used. Classes should be specified in one of these formats: \"<schema name or alias>.<class_name>\" or\n * \"<schema name or alias>:<class_name>\".\n */\n elementClasses?: string[];\n}\n/**\n * Request type for multiple elements properties requests, where elements are specified by element id.\n * @public\n */\nexport interface MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent = ElementProperties>\n extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {\n /**\n * A list of `bis.Element` IDs to get properties for.\n */\n elementIds?: Id64String[];\n}\n/**\n * Request type for multiple elements properties requests.\n * @public\n */\nexport type MultiElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> =\n | MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent>\n | MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent>;\n\n/**\n * Request type for content instance keys' requests.\n * @public\n */\nexport interface ContentInstanceKeysRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable>\n extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\n /**\n * Content display type.\n * @see [[DefaultContentDisplayTypes]]\n */\n displayType?: string;\n /** Input keys for getting the content. */\n keys: TKeySet;\n}\n\n/**\n * Request type for label requests\n * @public\n */\nexport interface DisplayLabelRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Key of ECInstance to get label for */\n key: TInstanceKey;\n}\n\n/**\n * Request type for labels requests\n * @public\n */\nexport interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\n /** Keys of ECInstances to get labels for */\n keys: TInstanceKey[];\n}\n\n/**\n * Request options used for selection scope related requests\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * Request options used for calculating selection based on given instance keys and selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {\n elementIds: Id64String[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scope: SelectionScopeProps;\n}\n\n/**\n * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\n prev: {\n rulesetOrId?: Ruleset | string;\n rulesetVariables?: TRulesetVariable[];\n };\n expandedNodeKeys?: TNodeKey[];\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n resultSetSize?: number;\n}\n\n/**\n * Paging options\n * @public\n */\nexport interface PageOptions {\n /** Inclusive start 0-based index of the page */\n start?: number;\n /** Maximum size of the page */\n size?: number;\n}\n\n/**\n * A wrapper type that injects [[PageOptions]] into supplied type\n * @public\n */\nexport type Paged<TOptions extends object> = TOptions & {\n /** Optional paging parameters */\n paging?: PageOptions;\n};\n\n/**\n * A wrapper type that injects priority into supplied type.\n * @public\n */\nexport type Prioritized<TOptions extends object> = TOptions & {\n /** Optional priority */\n priority?: number;\n};\n\n/**\n * Checks if supplied request options are for single or multiple element properties.\n * @internal\n */\nexport function isSingleElementPropertiesRequestOptions<TIModel, TParsedContent = any>(\n options: SingleElementPropertiesRequestOptions<TIModel> | MultiElementPropertiesRequestOptions<TIModel, TParsedContent>,\n): options is SingleElementPropertiesRequestOptions<TIModel> {\n return (options as SingleElementPropertiesRequestOptions<TIModel>).elementId !== undefined;\n}\n\n/**\n * A wrapper type that injects cancelEvent into supplied type.\n * @public\n */\nexport type WithCancelEvent<TOptions extends object> = TOptions & {\n /** Event which is triggered when the request is canceled */\n cancelEvent?: BeEvent<() => void>;\n};\n"]}
|
|
@@ -56,21 +56,29 @@ export type PresentationRpcResponse<TResult = undefined> = Promise<PresentationR
|
|
|
56
56
|
/**
|
|
57
57
|
* Data structure for hierarchy request options.
|
|
58
58
|
* @public
|
|
59
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
60
|
+
* package for creating hierarchies.
|
|
59
61
|
*/
|
|
60
62
|
export type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;
|
|
61
63
|
/**
|
|
62
64
|
* Data structure for hierarchy level descriptor RPC request options.
|
|
63
65
|
* @public
|
|
66
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
67
|
+
* package for creating hierarchies.
|
|
64
68
|
*/
|
|
65
69
|
export type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>>;
|
|
66
70
|
/**
|
|
67
71
|
* Data structure for filtering hierarchy by ECInstance paths request options.
|
|
68
72
|
* @public
|
|
73
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
74
|
+
* package for creating hierarchies.
|
|
69
75
|
*/
|
|
70
76
|
export type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>>;
|
|
71
77
|
/**
|
|
72
78
|
* Data structure for filtering hierarchy by text request options.
|
|
73
79
|
* @public
|
|
80
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
81
|
+
* package for creating hierarchies.
|
|
74
82
|
*/
|
|
75
83
|
export type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;
|
|
76
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationRpcInterface.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PresentationRpcInterface.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAgB,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,iCAAiC,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AK,EAAE,UAAU,CAAA;KAAE,CAAC;IAIhE,yKAAyK;IAC5J,yBAAyB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,6BAA6B,GAAG,uBAAuB,CAAC,eAAe,CAAC;IAIjJ,yKAAyK;IAC5J,+BAA+B,CAC1C,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,8BAA8B,GACvC,uBAAuB,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAI1D,yKAAyK;IAC5J,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,+BAA+B,GAAG,uBAAuB,CAAC,cAAc,EAAE,CAAC;IAI7I,yKAAyK;IAC5J,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,iCAAiC,GAAG,uBAAuB,CAAC,UAAU,CAAC;CAGxI"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
6
7
|
/** @packageDocumentation
|
|
7
8
|
* @module RPC
|
|
8
9
|
*/
|
|
@@ -102,12 +103,10 @@ let PresentationRpcInterface = class PresentationRpcInterface extends core_commo
|
|
|
102
103
|
return (0, Utils_js_1.deepReplaceNullsToUndefined)(await this.forward(arguments));
|
|
103
104
|
}
|
|
104
105
|
/** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
106
106
|
async getSelectionScopes(_token, _options) {
|
|
107
107
|
return this.forward(arguments);
|
|
108
108
|
}
|
|
109
109
|
/** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
111
110
|
async computeSelection(_token, _options) {
|
|
112
111
|
return this.forward(arguments);
|
|
113
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationRpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;AAGH,oDAAgF;AAgChF,yCAA8E;AAgJ9E;;;GAGG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,0BAAY;IACxD,2CAA2C;IACpC,MAAM,CAAU,aAAa,GAAG,0BAA0B,CAAC;IAElE,6CAA6C;IACtC,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAEzC;;;iGAG6F;IAE7F,yKAAyK;IAClK,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAAoC;QACrF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,yKAAyK;IAClK,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAA2C;QAC5F,OAAO,IAAA,sCAA2B,EAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,yKAAyK;IAClK,KAAK,CAAC,kBAAkB,CAC7B,MAAsB,EACtB,QAAmD;QAEnD,OAAO,IAAA,sCAA2B,EAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,yKAAyK;IACzK,4CAA4C;IACrC,KAAK,CAAC,YAAY,CAAC,MAAsB,EAAE,QAAyD;QACzG,OAAO,IAAA,sCAA2B,EAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,yKAAyK;IACzK,4CAA4C;IACrC,KAAK,CAAC,oBAAoB,CAAC,MAAsB,EAAE,QAAgD;QACxG,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C,0BAAY,CAAC,gBAAgB,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;GAC7C,wBAAwB,CAgIpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcInterface, RpcOperation } from \"@itwin/core-common\";\nimport { DescriptorJSON, DescriptorOverrides, SelectClassInfoJSON } from \"./content/Descriptor.js\";\nimport { ItemJSON } from \"./content/Item.js\";\nimport { DisplayValueGroup } from \"./content/Value.js\";\nimport { ClientDiagnostics, ClientDiagnosticsOptions } from \"./Diagnostics.js\";\nimport { CompressedClassInfoJSON, InstanceKey } from \"./EC.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { PresentationStatus } from \"./Error.js\";\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { KeySetJSON } from \"./KeySet.js\";\nimport { LabelDefinition } from \"./LabelDefinition.js\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions.js\";\nimport { RulesetVariableJSON } from \"./RulesetVariables.js\";\nimport { SelectionScope } from \"./selection/SelectionScope.js\";\nimport { deepReplaceNullsToUndefined, Omit, PagedResponse } from \"./Utils.js\";\n\n/**\n * Base options for all presentation RPC requests.\n * @public\n */\nexport type PresentationRpcRequestOptions<TManagerRequestOptions> = Omit<TManagerRequestOptions, \"imodel\" | \"diagnostics\"> & {\n /** @internal ID of the client requesting data */\n clientId?: string;\n /** RPC request diagnostics options. */\n diagnostics?: RpcDiagnosticsOptions;\n};\n\n/**\n * Data structure for presentation RPC responses\n * @public\n */\nexport interface PresentationRpcResponseData<TResult = undefined> {\n /** Response status code */\n statusCode: PresentationStatus;\n /** In case of an error response, the error message */\n errorMessage?: string;\n /** In case of a success response, the result */\n result?: TResult;\n /** Diagnostics response. */\n diagnostics?: ClientDiagnostics;\n}\n\n/**\n * Data structure for RPC diagnostics options.\n * @public\n */\nexport type RpcDiagnosticsOptions = Omit<ClientDiagnosticsOptions, \"handler\">;\n\n/**\n * A promise of [[PresentationRpcResponseData]].\n * @public\n */\nexport type PresentationRpcResponse<TResult = undefined> = Promise<PresentationRpcResponseData<TResult>>;\n\n/**\n * Data structure for hierarchy request options.\n * @public\n */\nexport type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;\n\n/**\n * Data structure for hierarchy level descriptor RPC request options.\n * @public\n */\nexport type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<\n HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by ECInstance paths request options.\n * @public\n */\nexport type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<\n FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by text request options.\n * @public\n */\nexport type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;\n\n/**\n * Data structure for content sources RPC request options.\n * @public\n */\nexport type ContentSourcesRpcRequestOptions = PresentationRpcRequestOptions<ContentSourcesRequestOptions<never>>;\n/**\n * Data structure for content sources RPC response.\n * @public\n */\nexport interface ContentSourcesRpcResult {\n /** A list of objects containing content source information. */\n sources: SelectClassInfoJSON<Id64String>[];\n /** An `ECClassId` => [[CompressedClassInfoJSON]] map for deserializing [[sources]]. */\n classesMap: { [id: string]: CompressedClassInfoJSON };\n}\n\n/**\n * Data structure for content descriptor RPC request options.\n * @public\n */\nexport type ContentDescriptorRpcRequestOptions = PresentationRpcRequestOptions<ContentDescriptorRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for content RPC request options.\n * @public\n */\nexport type ContentRpcRequestOptions = PresentationRpcRequestOptions<ContentRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for single element properties RPC request options.\n * @public\n */\nexport type SingleElementPropertiesRpcRequestOptions = PresentationRpcRequestOptions<\n Omit<SingleElementPropertiesRequestOptions<never, never>, \"contentParser\">\n>;\n\n/**\n * Data structure for distinct values' request options.\n * @public\n */\nexport type DistinctValuesRpcRequestOptions = PresentationRpcRequestOptions<\n DistinctValuesRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for content instance keys' request options.\n * @public\n */\nexport type ContentInstanceKeysRpcRequestOptions = PresentationRpcRequestOptions<ContentInstanceKeysRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for label request options.\n * @public\n */\nexport type DisplayLabelRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for labels request options.\n * @public\n */\nexport type DisplayLabelsRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelsRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for selection scope request options.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type SelectionScopeRpcRequestOptions = PresentationRpcRequestOptions<SelectionScopeRequestOptions<never>>;\n\n/**\n * Request options data structure for computing selection based on given selection scope and element IDs.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type ComputeSelectionRpcRequestOptions = PresentationRpcRequestOptions<ComputeSelectionRequestOptions<never>>;\n\n/**\n * Interface used for communication between Presentation backend and frontend.\n * @public\n */\n@RpcOperation.setDefaultPolicy({ retryInterval: () => 0 })\nexport class PresentationRpcInterface extends RpcInterface {\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"PresentationRpcInterface\";\n\n /** The semantic version of the interface. */\n public static interfaceVersion = \"5.0.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.\n ===========================================================================================*/\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getNodesCount(_token: IModelRpcProps, _options: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedNodes(_token: IModelRpcProps, _options: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<Node>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getNodesDescriptor(\n _token: IModelRpcProps,\n _options: HierarchyLevelDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // TODO: add paged version of this (#387280)\n public async getNodePaths(_token: IModelRpcProps, _options: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // TODO: add paged version of this (#387280)\n public async getFilteredNodePaths(_token: IModelRpcProps, _options: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentSources(_token: IModelRpcProps, _options: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentDescriptor(_token: IModelRpcProps, _options: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined> {\n const response: PresentationRpcResponseData<string | undefined> = await this.forward(arguments);\n return {\n ...response,\n ...(response.result ? { result: JSON.parse(response.result) } : {}),\n };\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentSetSize(_token: IModelRpcProps, _options: ContentRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedContent(\n _token: IModelRpcProps,\n _options: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\n const rpcResponse = await this.forward(arguments);\n return {\n ...rpcResponse,\n ...(rpcResponse.result\n ? /* c8 ignore next */ { result: { ...rpcResponse.result, contentSet: deepReplaceNullsToUndefined(rpcResponse.result.contentSet) } }\n : {}),\n };\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedContentSet(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getElementProperties(\n _token: IModelRpcProps,\n _options: SingleElementPropertiesRpcRequestOptions,\n ): PresentationRpcResponse<ElementProperties | undefined> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedDistinctValues(\n _token: IModelRpcProps,\n _options: DistinctValuesRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroup>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentInstanceKeys(\n _token: IModelRpcProps,\n _options: ContentInstanceKeysRpcRequestOptions,\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getDisplayLabelDefinition(_token: IModelRpcProps, _options: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedDisplayLabelDefinitions(\n _token: IModelRpcProps,\n _options: DisplayLabelsRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async getSelectionScopes(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON> {\n return this.forward(arguments);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PresentationRpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationRpcInterface.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG;;;;;;;;;AAGH,oDAAgF;AAgChF,yCAA8E;AAwJ9E;;;GAGG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,0BAAY;IACxD,2CAA2C;IACpC,MAAM,CAAU,aAAa,GAAG,0BAA0B,CAAC;IAElE,6CAA6C;IACtC,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAEzC;;;iGAG6F;IAE7F,yKAAyK;IAClK,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAAoC;QACrF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,yKAAyK;IAClK,KAAK,CAAC,aAAa,CAAC,MAAsB,EAAE,QAA2C;QAC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AC,CAAC,CAAC;IACpE,CAAC;IAED,yKAAyK;IAClK,KAAK,CAAC,+BAA+B,CAC1C,MAAsB,EACtB,QAAwC;QAExC,OAAO,IAAA,sCAA2B,EAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,yKAAyK;IAClK,KAAK,CAAC,kBAAkB,CAAC,MAAsB,EAAE,QAAyC;QAC/F,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,yKAAyK;IAClK,KAAK,CAAC,gBAAgB,CAAC,MAAsB,EAAE,QAA2C;QAC/F,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;;AA7HU,4DAAwB;mCAAxB,wBAAwB;IADpC,0BAAY,CAAC,gBAAgB,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;GAC7C,wBAAwB,CA8HpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcInterface, RpcOperation } from \"@itwin/core-common\";\nimport { DescriptorJSON, DescriptorOverrides, SelectClassInfoJSON } from \"./content/Descriptor.js\";\nimport { ItemJSON } from \"./content/Item.js\";\nimport { DisplayValueGroup } from \"./content/Value.js\";\nimport { ClientDiagnostics, ClientDiagnosticsOptions } from \"./Diagnostics.js\";\nimport { CompressedClassInfoJSON, InstanceKey } from \"./EC.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { PresentationStatus } from \"./Error.js\";\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { KeySetJSON } from \"./KeySet.js\";\nimport { LabelDefinition } from \"./LabelDefinition.js\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n SelectionScopeRequestOptions,\n SingleElementPropertiesRequestOptions,\n} from \"./PresentationManagerOptions.js\";\nimport { RulesetVariableJSON } from \"./RulesetVariables.js\";\nimport { SelectionScope } from \"./selection/SelectionScope.js\";\nimport { deepReplaceNullsToUndefined, Omit, PagedResponse } from \"./Utils.js\";\n\n/**\n * Base options for all presentation RPC requests.\n * @public\n */\nexport type PresentationRpcRequestOptions<TManagerRequestOptions> = Omit<TManagerRequestOptions, \"imodel\" | \"diagnostics\"> & {\n /** @internal ID of the client requesting data */\n clientId?: string;\n /** RPC request diagnostics options. */\n diagnostics?: RpcDiagnosticsOptions;\n};\n\n/**\n * Data structure for presentation RPC responses\n * @public\n */\nexport interface PresentationRpcResponseData<TResult = undefined> {\n /** Response status code */\n statusCode: PresentationStatus;\n /** In case of an error response, the error message */\n errorMessage?: string;\n /** In case of a success response, the result */\n result?: TResult;\n /** Diagnostics response. */\n diagnostics?: ClientDiagnostics;\n}\n\n/**\n * Data structure for RPC diagnostics options.\n * @public\n */\nexport type RpcDiagnosticsOptions = Omit<ClientDiagnosticsOptions, \"handler\">;\n\n/**\n * A promise of [[PresentationRpcResponseData]].\n * @public\n */\nexport type PresentationRpcResponse<TResult = undefined> = Promise<PresentationRpcResponseData<TResult>>;\n\n/**\n * Data structure for hierarchy request options.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type HierarchyRpcRequestOptions = PresentationRpcRequestOptions<HierarchyRequestOptions<never, NodeKey, RulesetVariableJSON>>;\n\n/**\n * Data structure for hierarchy level descriptor RPC request options.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type HierarchyLevelDescriptorRpcRequestOptions = PresentationRpcRequestOptions<\n HierarchyLevelDescriptorRequestOptions<never, NodeKey, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by ECInstance paths request options.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type FilterByInstancePathsHierarchyRpcRequestOptions = PresentationRpcRequestOptions<\n FilterByInstancePathsHierarchyRequestOptions<never, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for filtering hierarchy by text request options.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type FilterByTextHierarchyRpcRequestOptions = PresentationRpcRequestOptions<FilterByTextHierarchyRequestOptions<never, RulesetVariableJSON>>;\n\n/**\n * Data structure for content sources RPC request options.\n * @public\n */\nexport type ContentSourcesRpcRequestOptions = PresentationRpcRequestOptions<ContentSourcesRequestOptions<never>>;\n/**\n * Data structure for content sources RPC response.\n * @public\n */\nexport interface ContentSourcesRpcResult {\n /** A list of objects containing content source information. */\n sources: SelectClassInfoJSON<Id64String>[];\n /** An `ECClassId` => [[CompressedClassInfoJSON]] map for deserializing [[sources]]. */\n classesMap: { [id: string]: CompressedClassInfoJSON };\n}\n\n/**\n * Data structure for content descriptor RPC request options.\n * @public\n */\nexport type ContentDescriptorRpcRequestOptions = PresentationRpcRequestOptions<ContentDescriptorRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for content RPC request options.\n * @public\n */\nexport type ContentRpcRequestOptions = PresentationRpcRequestOptions<ContentRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for single element properties RPC request options.\n * @public\n */\nexport type SingleElementPropertiesRpcRequestOptions = PresentationRpcRequestOptions<\n Omit<SingleElementPropertiesRequestOptions<never, never>, \"contentParser\">\n>;\n\n/**\n * Data structure for distinct values' request options.\n * @public\n */\nexport type DistinctValuesRpcRequestOptions = PresentationRpcRequestOptions<\n DistinctValuesRequestOptions<never, DescriptorOverrides, KeySetJSON, RulesetVariableJSON>\n>;\n\n/**\n * Data structure for content instance keys' request options.\n * @public\n */\nexport type ContentInstanceKeysRpcRequestOptions = PresentationRpcRequestOptions<ContentInstanceKeysRequestOptions<never, KeySetJSON, RulesetVariableJSON>>;\n\n/**\n * Data structure for label request options.\n * @public\n */\nexport type DisplayLabelRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for labels request options.\n * @public\n */\nexport type DisplayLabelsRpcRequestOptions = PresentationRpcRequestOptions<DisplayLabelsRequestOptions<never, InstanceKey>>;\n\n/**\n * Data structure for selection scope request options.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type SelectionScopeRpcRequestOptions = PresentationRpcRequestOptions<SelectionScopeRequestOptions<never>>;\n\n/**\n * Request options data structure for computing selection based on given selection scope and element IDs.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type ComputeSelectionRpcRequestOptions = PresentationRpcRequestOptions<ComputeSelectionRequestOptions<never>>;\n\n/**\n * Interface used for communication between Presentation backend and frontend.\n * @public\n */\n@RpcOperation.setDefaultPolicy({ retryInterval: () => 0 })\nexport class PresentationRpcInterface extends RpcInterface {\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"PresentationRpcInterface\";\n\n /** The semantic version of the interface. */\n public static interfaceVersion = \"5.0.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.\n ===========================================================================================*/\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getNodesCount(_token: IModelRpcProps, _options: HierarchyRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedNodes(_token: IModelRpcProps, _options: Paged<HierarchyRpcRequestOptions>): PresentationRpcResponse<PagedResponse<Node>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getNodesDescriptor(\n _token: IModelRpcProps,\n _options: HierarchyLevelDescriptorRpcRequestOptions,\n ): PresentationRpcResponse<string | DescriptorJSON | undefined> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // TODO: add paged version of this (#387280)\n public async getNodePaths(_token: IModelRpcProps, _options: FilterByInstancePathsHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n // TODO: add paged version of this (#387280)\n public async getFilteredNodePaths(_token: IModelRpcProps, _options: FilterByTextHierarchyRpcRequestOptions): PresentationRpcResponse<NodePathElement[]> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentSources(_token: IModelRpcProps, _options: ContentSourcesRpcRequestOptions): PresentationRpcResponse<ContentSourcesRpcResult> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentDescriptor(_token: IModelRpcProps, _options: ContentDescriptorRpcRequestOptions): PresentationRpcResponse<DescriptorJSON | undefined> {\n const response: PresentationRpcResponseData<string | undefined> = await this.forward(arguments);\n return {\n ...response,\n ...(response.result ? { result: JSON.parse(response.result) } : {}),\n };\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentSetSize(_token: IModelRpcProps, _options: ContentRpcRequestOptions): PresentationRpcResponse<number> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedContent(\n _token: IModelRpcProps,\n _options: Paged<ContentRpcRequestOptions>,\n ): PresentationRpcResponse<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined> {\n const rpcResponse = await this.forward(arguments);\n return {\n ...rpcResponse,\n ...(rpcResponse.result\n ? /* c8 ignore next */ { result: { ...rpcResponse.result, contentSet: deepReplaceNullsToUndefined(rpcResponse.result.contentSet) } }\n : {}),\n };\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedContentSet(_token: IModelRpcProps, _options: Paged<ContentRpcRequestOptions>): PresentationRpcResponse<PagedResponse<ItemJSON>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getElementProperties(\n _token: IModelRpcProps,\n _options: SingleElementPropertiesRpcRequestOptions,\n ): PresentationRpcResponse<ElementProperties | undefined> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedDistinctValues(\n _token: IModelRpcProps,\n _options: DistinctValuesRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<DisplayValueGroup>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getContentInstanceKeys(\n _token: IModelRpcProps,\n _options: ContentInstanceKeysRpcRequestOptions,\n ): PresentationRpcResponse<{ total: number; items: KeySetJSON }> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getDisplayLabelDefinition(_token: IModelRpcProps, _options: DisplayLabelRpcRequestOptions): PresentationRpcResponse<LabelDefinition> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getPagedDisplayLabelDefinitions(\n _token: IModelRpcProps,\n _options: DisplayLabelsRpcRequestOptions,\n ): PresentationRpcResponse<PagedResponse<LabelDefinition>> {\n return deepReplaceNullsToUndefined(await this.forward(arguments));\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async getSelectionScopes(_token: IModelRpcProps, _options: SelectionScopeRpcRequestOptions): PresentationRpcResponse<SelectionScope[]> {\n return this.forward(arguments);\n }\n\n /** @deprecated in 4.10 - will not be removed until after 2026-06-13. Use [PresentationManager]($presentation-frontend) instead of calling the RPC interface directly. */\n public async computeSelection(_token: IModelRpcProps, _options: ComputeSelectionRpcRequestOptions): PresentationRpcResponse<KeySetJSON> {\n return this.forward(arguments);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcRequestsHandler.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RpcRequestsHandler.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":"AAKA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAA0B,MAAM,oBAAoB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAqB,0BAA0B,EAA4B,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,iCAAiC,EACjC,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,4CAA4C,EAC5C,mCAAmC,EACnC,sCAAsC,EACtC,uBAAuB,EACvB,KAAK,EACL,cAAc,EAEd,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC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