@itwin/presentation-testing 3.4.0-dev.44 → 3.4.0-dev.46

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.
@@ -1,64 +1,64 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module Hierarchies
7
- */
8
- import { using } from "@itwin/core-bentley";
9
- import { PRESENTATION_TREE_NODE_KEY, PresentationTreeDataProvider } from "@itwin/presentation-components";
10
- import { Presentation } from "@itwin/presentation-frontend";
11
- /**
12
- * Default [[NodeMappingFunc]] implementation that outputs the whole `TreeNodeItem` object.
13
- * @public
14
- */
15
- export const defaultNodeMappingFunc = (node) => {
16
- // Skip properties 'id', 'parentId' as they contain internal stuff
17
- // that callers are most likely not interested in. Otherwise they can supply
18
- // a custom `NodeMappingFunc` that does return those properties as well.
19
- const { id, parentId, ...resultNode } = node; // eslint-disable-line @typescript-eslint/no-unused-vars
20
- return resultNode;
21
- };
22
- /**
23
- * A class that constructs simple node hierarchy from specified
24
- * imodel and ruleset.
25
- *
26
- * @public
27
- */
28
- export class HierarchyBuilder {
29
- /** Constructor */
30
- constructor(props) {
31
- var _a;
32
- this._iModel = props.imodel;
33
- this._nodeMappingFunc = (_a = props.nodeMappingFunc) !== null && _a !== void 0 ? _a : defaultNodeMappingFunc;
34
- }
35
- async createSubHierarchy(nodes, dataProvider) {
36
- const hierarchy = [];
37
- for (const node of nodes) {
38
- // istanbul ignore next: for some reason coverage tool thinks the below statement is conditional and one of branches is not covered...
39
- const { [PRESENTATION_TREE_NODE_KEY]: key, ...nodeNoKey } = node; // eslint-disable-line @typescript-eslint/no-unused-vars
40
- const nodeIndex = hierarchy.push(this._nodeMappingFunc(nodeNoKey)) - 1;
41
- const childNodes = await dataProvider.getNodes(node);
42
- if (childNodes.length > 0)
43
- hierarchy[nodeIndex].children = await this.createSubHierarchy(childNodes, dataProvider);
44
- }
45
- return hierarchy;
46
- }
47
- async doCreateHierarchy(rulesetId) {
48
- const dataProvider = new PresentationTreeDataProvider({ imodel: this._iModel, ruleset: rulesetId });
49
- const rootNodes = await dataProvider.getNodes();
50
- return this.createSubHierarchy(rootNodes, dataProvider);
51
- }
52
- /**
53
- * Create a hierarchy using the supplied presentation ruleset.
54
- * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.
55
- */
56
- async createHierarchy(rulesetOrId) {
57
- if (typeof rulesetOrId === "string")
58
- return this.doCreateHierarchy(rulesetOrId);
59
- return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset) => {
60
- return this.doCreateHierarchy(ruleset.id);
61
- });
62
- }
63
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Hierarchies
7
+ */
8
+ import { using } from "@itwin/core-bentley";
9
+ import { PRESENTATION_TREE_NODE_KEY, PresentationTreeDataProvider } from "@itwin/presentation-components";
10
+ import { Presentation } from "@itwin/presentation-frontend";
11
+ /**
12
+ * Default [[NodeMappingFunc]] implementation that outputs the whole `TreeNodeItem` object.
13
+ * @public
14
+ */
15
+ export const defaultNodeMappingFunc = (node) => {
16
+ // Skip properties 'id', 'parentId' as they contain internal stuff
17
+ // that callers are most likely not interested in. Otherwise they can supply
18
+ // a custom `NodeMappingFunc` that does return those properties as well.
19
+ const { id, parentId, ...resultNode } = node; // eslint-disable-line @typescript-eslint/no-unused-vars
20
+ return resultNode;
21
+ };
22
+ /**
23
+ * A class that constructs simple node hierarchy from specified
24
+ * imodel and ruleset.
25
+ *
26
+ * @public
27
+ */
28
+ export class HierarchyBuilder {
29
+ /** Constructor */
30
+ constructor(props) {
31
+ var _a;
32
+ this._iModel = props.imodel;
33
+ this._nodeMappingFunc = (_a = props.nodeMappingFunc) !== null && _a !== void 0 ? _a : defaultNodeMappingFunc;
34
+ }
35
+ async createSubHierarchy(nodes, dataProvider) {
36
+ const hierarchy = [];
37
+ for (const node of nodes) {
38
+ // istanbul ignore next: for some reason coverage tool thinks the below statement is conditional and one of branches is not covered...
39
+ const { [PRESENTATION_TREE_NODE_KEY]: key, ...nodeNoKey } = node; // eslint-disable-line @typescript-eslint/no-unused-vars
40
+ const nodeIndex = hierarchy.push(this._nodeMappingFunc(nodeNoKey)) - 1;
41
+ const childNodes = await dataProvider.getNodes(node);
42
+ if (childNodes.length > 0)
43
+ hierarchy[nodeIndex].children = await this.createSubHierarchy(childNodes, dataProvider);
44
+ }
45
+ return hierarchy;
46
+ }
47
+ async doCreateHierarchy(rulesetId) {
48
+ const dataProvider = new PresentationTreeDataProvider({ imodel: this._iModel, ruleset: rulesetId });
49
+ const rootNodes = await dataProvider.getNodes();
50
+ return this.createSubHierarchy(rootNodes, dataProvider);
51
+ }
52
+ /**
53
+ * Create a hierarchy using the supplied presentation ruleset.
54
+ * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.
55
+ */
56
+ async createHierarchy(rulesetOrId) {
57
+ if (typeof rulesetOrId === "string")
58
+ return this.doCreateHierarchy(rulesetOrId);
59
+ return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset) => {
60
+ return this.doCreateHierarchy(ruleset.id);
61
+ });
62
+ }
63
+ }
64
64
  //# sourceMappingURL=HierarchyBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyBuilder.js","sourceRoot":"","sources":["../../../src/presentation-testing/HierarchyBuilder.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,M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AE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;QACpG,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,WAA6B;QACxD,IAAI,OAAO,WAAW,KAAK,QAAQ;YACjC,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAE7C,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,OAA0B,EAAE,EAAE;YAC7G,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;CACF","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 Hierarchies\n */\nimport { using } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { Omit, RegisteredRuleset, Ruleset } from \"@itwin/presentation-common\";\nimport { PRESENTATION_TREE_NODE_KEY, PresentationTreeDataProvider } from \"@itwin/presentation-components\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { TreeNodeItem } from \"@itwin/components-react\";\n\n/**\n * Structure that describes a Node with any indexed properties\n * except `children`.\n *\n * @public\n */\nexport interface MappedNode {\n /** Indexer for all properties in this data structure */\n [index: string]: any;\n /** Prohibited property */\n children?: never;\n}\n\n/**\n * Node in a hierarchy.\n * @public\n */\nexport interface HierarchyNode extends Omit<MappedNode, \"children\"> {\n /** Children of this node */\n children?: HierarchyNode[];\n}\n\n/**\n * A function that converts `TreeNodeItem` into a new custom object.\n * @public\n */\nexport type NodeMappingFunc = (node: TreeNodeItem) => MappedNode;\n\n/**\n * Default [[NodeMappingFunc]] implementation that outputs the whole `TreeNodeItem` object.\n * @public\n */\nexport const defaultNodeMappingFunc: NodeMappingFunc = (node: TreeNodeItem) => {\n // Skip properties 'id', 'parentId' as they contain internal stuff\n // that callers are most likely not interested in. Otherwise they can supply\n // a custom `NodeMappingFunc` that does return those properties as well.\n const { id, parentId, ...resultNode } = node; // eslint-disable-line @typescript-eslint/no-unused-vars\n return resultNode;\n};\n\n/**\n * Properties for creating a `HierarchyBuilder` instance.\n * @public\n */\nexport interface HierarchyBuilderProps {\n /** The iModel to pull data from */\n imodel: IModelConnection;\n /**\n * A function that maps node to something that the user of\n * this API is interested in. E.g. custom implementation may skip some unimportant\n * node properties to make resulting object smaller and easier to read.\n */\n nodeMappingFunc?: NodeMappingFunc;\n}\n\n/**\n * A class that constructs simple node hierarchy from specified\n * imodel and ruleset.\n *\n * @public\n */\nexport class HierarchyBuilder {\n private readonly _iModel: IModelConnection;\n private readonly _nodeMappingFunc: NodeMappingFunc;\n\n /** Constructor */\n constructor(props: HierarchyBuilderProps) {\n this._iModel = props.imodel;\n this._nodeMappingFunc = props.nodeMappingFunc ?? defaultNodeMappingFunc;\n }\n\n private async createSubHierarchy(nodes: TreeNodeItem[], dataProvider: PresentationTreeDataProvider) {\n const hierarchy: HierarchyNode[] = [];\n for (const node of nodes) {\n // istanbul ignore next: for some reason coverage tool thinks the below statement is conditional and one of branches is not covered...\n const { [PRESENTATION_TREE_NODE_KEY]: key, ...nodeNoKey } = (node as TreeNodeItem & { [PRESENTATION_TREE_NODE_KEY]: any }); // eslint-disable-line @typescript-eslint/no-unused-vars\n const nodeIndex = hierarchy.push(this._nodeMappingFunc(nodeNoKey)) - 1;\n const childNodes = await dataProvider.getNodes(node);\n if (childNodes.length > 0)\n hierarchy[nodeIndex].children = await this.createSubHierarchy(childNodes, dataProvider);\n }\n return hierarchy;\n }\n\n private async doCreateHierarchy(rulesetId: string): Promise<HierarchyNode[]> {\n const dataProvider = new PresentationTreeDataProvider({ imodel: this._iModel, ruleset: rulesetId });\n const rootNodes = await dataProvider.getNodes();\n return this.createSubHierarchy(rootNodes, dataProvider);\n }\n\n /**\n * Create a hierarchy using the supplied presentation ruleset.\n * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.\n */\n public async createHierarchy(rulesetOrId: Ruleset | string): Promise<HierarchyNode[]> {\n if (typeof rulesetOrId === \"string\")\n return this.doCreateHierarchy(rulesetOrId);\n\n return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset: RegisteredRuleset) => {\n return this.doCreateHierarchy(ruleset.id);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"HierarchyBuilder.js","sourceRoot":"","sources":["../../../src/presentation-testing/HierarchyBuilder.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA+B5D;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAoB,CAAC,IAAkB,EAAE,EAAE;IAC5E,mEAAmE;IACnE,4EAA4E;IAC5E,wEAAwE;IACxE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC,wDAAwD;IACtG,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAiBF;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAI3B,kBAAkB;IAClB,YAAY,KAA4B;;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,MAAA,KAAK,CAAC,eAAe,mCAAI,sBAAsB,CA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,EAAE;YAC7G,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Hierarchies\r\n */\r\nimport { using } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { Omit, RegisteredRuleset, Ruleset } from \"@itwin/presentation-common\";\r\nimport { PRESENTATION_TREE_NODE_KEY, PresentationTreeDataProvider } from \"@itwin/presentation-components\";\r\nimport { Presentation } from \"@itwin/presentation-frontend\";\r\nimport { TreeNodeItem } from \"@itwin/components-react\";\r\n\r\n/**\r\n * Structure that describes a Node with any indexed properties\r\n * except `children`.\r\n *\r\n * @public\r\n */\r\nexport interface MappedNode {\r\n /** Indexer for all properties in this data structure */\r\n [index: string]: any;\r\n /** Prohibited property */\r\n children?: never;\r\n}\r\n\r\n/**\r\n * Node in a hierarchy.\r\n * @public\r\n */\r\nexport interface HierarchyNode extends Omit<MappedNode, \"children\"> {\r\n /** Children of this node */\r\n children?: HierarchyNode[];\r\n}\r\n\r\n/**\r\n * A function that converts `TreeNodeItem` into a new custom object.\r\n * @public\r\n */\r\nexport type NodeMappingFunc = (node: TreeNodeItem) => MappedNode;\r\n\r\n/**\r\n * Default [[NodeMappingFunc]] implementation that outputs the whole `TreeNodeItem` object.\r\n * @public\r\n */\r\nexport const defaultNodeMappingFunc: NodeMappingFunc = (node: TreeNodeItem) => {\r\n // Skip properties 'id', 'parentId' as they contain internal stuff\r\n // that callers are most likely not interested in. Otherwise they can supply\r\n // a custom `NodeMappingFunc` that does return those properties as well.\r\n const { id, parentId, ...resultNode } = node; // eslint-disable-line @typescript-eslint/no-unused-vars\r\n return resultNode;\r\n};\r\n\r\n/**\r\n * Properties for creating a `HierarchyBuilder` instance.\r\n * @public\r\n */\r\nexport interface HierarchyBuilderProps {\r\n /** The iModel to pull data from */\r\n imodel: IModelConnection;\r\n /**\r\n * A function that maps node to something that the user of\r\n * this API is interested in. E.g. custom implementation may skip some unimportant\r\n * node properties to make resulting object smaller and easier to read.\r\n */\r\n nodeMappingFunc?: NodeMappingFunc;\r\n}\r\n\r\n/**\r\n * A class that constructs simple node hierarchy from specified\r\n * imodel and ruleset.\r\n *\r\n * @public\r\n */\r\nexport class HierarchyBuilder {\r\n private readonly _iModel: IModelConnection;\r\n private readonly _nodeMappingFunc: NodeMappingFunc;\r\n\r\n /** Constructor */\r\n constructor(props: HierarchyBuilderProps) {\r\n this._iModel = props.imodel;\r\n this._nodeMappingFunc = props.nodeMappingFunc ?? defaultNodeMappingFunc;\r\n }\r\n\r\n private async createSubHierarchy(nodes: TreeNodeItem[], dataProvider: PresentationTreeDataProvider) {\r\n const hierarchy: HierarchyNode[] = [];\r\n for (const node of nodes) {\r\n // istanbul ignore next: for some reason coverage tool thinks the below statement is conditional and one of branches is not covered...\r\n const { [PRESENTATION_TREE_NODE_KEY]: key, ...nodeNoKey } = (node as TreeNodeItem & { [PRESENTATION_TREE_NODE_KEY]: any }); // eslint-disable-line @typescript-eslint/no-unused-vars\r\n const nodeIndex = hierarchy.push(this._nodeMappingFunc(nodeNoKey)) - 1;\r\n const childNodes = await dataProvider.getNodes(node);\r\n if (childNodes.length > 0)\r\n hierarchy[nodeIndex].children = await this.createSubHierarchy(childNodes, dataProvider);\r\n }\r\n return hierarchy;\r\n }\r\n\r\n private async doCreateHierarchy(rulesetId: string): Promise<HierarchyNode[]> {\r\n const dataProvider = new PresentationTreeDataProvider({ imodel: this._iModel, ruleset: rulesetId });\r\n const rootNodes = await dataProvider.getNodes();\r\n return this.createSubHierarchy(rootNodes, dataProvider);\r\n }\r\n\r\n /**\r\n * Create a hierarchy using the supplied presentation ruleset.\r\n * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.\r\n */\r\n public async createHierarchy(rulesetOrId: Ruleset | string): Promise<HierarchyNode[]> {\r\n if (typeof rulesetOrId === \"string\")\r\n return this.doCreateHierarchy(rulesetOrId);\r\n\r\n return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset: RegisteredRuleset) => {\r\n return this.doCreateHierarchy(ruleset.id);\r\n });\r\n }\r\n}\r\n"]}
@@ -1,22 +1,22 @@
1
- /**
2
- * @module Hierarchies
3
- *
4
- * @docs-group-description Hierarchies
5
- * Types for testing hierarchies.
6
- */
7
- export * from "./presentation-testing/HierarchyBuilder";
8
- /**
9
- * @module Content
10
- *
11
- * @docs-group-description Content
12
- * Types for testing content.
13
- */
14
- export * from "./presentation-testing/ContentBuilder";
15
- /**
16
- * @module Helpers
17
- *
18
- * @docs-group-description Helpers
19
- * Various test helpers.
20
- */
21
- export * from "./presentation-testing/Helpers";
1
+ /**
2
+ * @module Hierarchies
3
+ *
4
+ * @docs-group-description Hierarchies
5
+ * Types for testing hierarchies.
6
+ */
7
+ export * from "./presentation-testing/HierarchyBuilder";
8
+ /**
9
+ * @module Content
10
+ *
11
+ * @docs-group-description Content
12
+ * Types for testing content.
13
+ */
14
+ export * from "./presentation-testing/ContentBuilder";
15
+ /**
16
+ * @module Helpers
17
+ *
18
+ * @docs-group-description Helpers
19
+ * Various test helpers.
20
+ */
21
+ export * from "./presentation-testing/Helpers";
22
22
  //# sourceMappingURL=presentation-testing.d.ts.map
@@ -1,26 +1,26 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /**
6
- * @module Hierarchies
7
- *
8
- * @docs-group-description Hierarchies
9
- * Types for testing hierarchies.
10
- */
11
- export * from "./presentation-testing/HierarchyBuilder";
12
- /**
13
- * @module Content
14
- *
15
- * @docs-group-description Content
16
- * Types for testing content.
17
- */
18
- export * from "./presentation-testing/ContentBuilder";
19
- /**
20
- * @module Helpers
21
- *
22
- * @docs-group-description Helpers
23
- * Various test helpers.
24
- */
25
- export * from "./presentation-testing/Helpers";
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @module Hierarchies
7
+ *
8
+ * @docs-group-description Hierarchies
9
+ * Types for testing hierarchies.
10
+ */
11
+ export * from "./presentation-testing/HierarchyBuilder";
12
+ /**
13
+ * @module Content
14
+ *
15
+ * @docs-group-description Content
16
+ * Types for testing content.
17
+ */
18
+ export * from "./presentation-testing/ContentBuilder";
19
+ /**
20
+ * @module Helpers
21
+ *
22
+ * @docs-group-description Helpers
23
+ * Various test helpers.
24
+ */
25
+ export * from "./presentation-testing/Helpers";
26
26
  //# sourceMappingURL=presentation-testing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-testing.js","sourceRoot":"","sources":["../../src/presentation-testing.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,cAAc,yCAAyC,CAAC;AAExD;;;;;GAKG;AACH,cAAc,uCAAuC,CAAC;AAEtD;;;;;GAKG;AACH,cAAc,gCAAgC,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/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types for testing hierarchies.\n */\nexport * from \"./presentation-testing/HierarchyBuilder\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types for testing content.\n */\nexport * from \"./presentation-testing/ContentBuilder\";\n\n/**\n * @module Helpers\n *\n * @docs-group-description Helpers\n * Various test helpers.\n */\nexport * from \"./presentation-testing/Helpers\";\n"]}
1
+ {"version":3,"file":"presentation-testing.js","sourceRoot":"","sources":["../../src/presentation-testing.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,cAAc,yCAAyC,CAAC;AAExD;;;;;GAKG;AACH,cAAc,uCAAuC,CAAC;AAEtD;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/**\r\n * @module Hierarchies\r\n *\r\n * @docs-group-description Hierarchies\r\n * Types for testing hierarchies.\r\n */\r\nexport * from \"./presentation-testing/HierarchyBuilder\";\r\n\r\n/**\r\n * @module Content\r\n *\r\n * @docs-group-description Content\r\n * Types for testing content.\r\n */\r\nexport * from \"./presentation-testing/ContentBuilder\";\r\n\r\n/**\r\n * @module Helpers\r\n *\r\n * @docs-group-description Helpers\r\n * Various test helpers.\r\n */\r\nexport * from \"./presentation-testing/Helpers\";\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/presentation-testing",
3
- "version": "3.4.0-dev.44",
3
+ "version": "3.4.0-dev.46",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,18 +25,18 @@
25
25
  "ignore-styles": "^5.0.1"
26
26
  },
27
27
  "dependencies": {
28
- "@itwin/appui-abstract": "3.4.0-dev.44",
29
- "@itwin/build-tools": "3.4.0-dev.44",
30
- "@itwin/components-react": "3.4.0-dev.44",
31
- "@itwin/core-backend": "3.4.0-dev.44",
32
- "@itwin/core-bentley": "3.4.0-dev.44",
33
- "@itwin/core-common": "3.4.0-dev.44",
34
- "@itwin/core-frontend": "3.4.0-dev.44",
35
- "@itwin/eslint-plugin": "3.4.0-dev.44",
36
- "@itwin/presentation-backend": "3.4.0-dev.44",
37
- "@itwin/presentation-common": "3.4.0-dev.44",
38
- "@itwin/presentation-components": "3.4.0-dev.44",
39
- "@itwin/presentation-frontend": "3.4.0-dev.44",
28
+ "@itwin/appui-abstract": "3.4.0-dev.46",
29
+ "@itwin/build-tools": "3.4.0-dev.46",
30
+ "@itwin/components-react": "3.4.0-dev.46",
31
+ "@itwin/core-backend": "3.4.0-dev.46",
32
+ "@itwin/core-bentley": "3.4.0-dev.46",
33
+ "@itwin/core-common": "3.4.0-dev.46",
34
+ "@itwin/core-frontend": "3.4.0-dev.46",
35
+ "@itwin/eslint-plugin": "3.4.0-dev.46",
36
+ "@itwin/presentation-backend": "3.4.0-dev.46",
37
+ "@itwin/presentation-common": "3.4.0-dev.46",
38
+ "@itwin/presentation-components": "3.4.0-dev.46",
39
+ "@itwin/presentation-frontend": "3.4.0-dev.46",
40
40
  "@types/chai": "4.3.1",
41
41
  "@types/chai-as-promised": "^7",
42
42
  "@types/chai-jest-snapshot": "^1.3.0",