@itwin/presentation-shared 1.0.0 → 1.1.0
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 +15 -0
- package/README.md +2 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/presentation-shared.d.ts +11 -11
- package/lib/cjs/presentation-shared.d.ts.map +1 -1
- package/lib/cjs/presentation-shared.js +29 -29
- package/lib/cjs/presentation-shared.js.map +1 -1
- package/lib/cjs/shared/ConcatenatedValue.d.ts +9 -9
- package/lib/cjs/shared/ConcatenatedValue.d.ts.map +1 -1
- package/lib/cjs/shared/ConcatenatedValue.js +6 -6
- package/lib/cjs/shared/ConcatenatedValue.js.map +1 -1
- package/lib/cjs/shared/ECSqlCore.d.ts +7 -7
- package/lib/cjs/shared/Event.d.ts +1 -1
- package/lib/cjs/shared/Formatting.d.ts +5 -5
- package/lib/cjs/shared/Formatting.d.ts.map +1 -1
- package/lib/cjs/shared/Formatting.js +7 -7
- package/lib/cjs/shared/Formatting.js.map +1 -1
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts +12 -12
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -1
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js +17 -17
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js.map +1 -1
- package/lib/cjs/shared/Logging.d.ts +4 -4
- package/lib/cjs/shared/Logging.js +2 -2
- package/lib/cjs/shared/Logging.js.map +1 -1
- package/lib/cjs/shared/MappedTypes.d.ts +2 -2
- package/lib/cjs/shared/Metadata.d.ts +31 -31
- package/lib/cjs/shared/Metadata.js +4 -4
- package/lib/cjs/shared/Metadata.js.map +1 -1
- package/lib/cjs/shared/Utils.d.ts +11 -6
- package/lib/cjs/shared/Utils.d.ts.map +1 -1
- package/lib/cjs/shared/Utils.js +15 -6
- package/lib/cjs/shared/Utils.js.map +1 -1
- package/lib/cjs/shared/Values.d.ts +13 -13
- package/lib/cjs/shared/Values.d.ts.map +1 -1
- package/lib/cjs/shared/Values.js +7 -7
- package/lib/cjs/shared/Values.js.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +5 -5
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js +18 -20
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +12 -12
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +22 -22
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/index.d.ts +2 -2
- package/lib/cjs/shared/ecsql-snippets/index.d.ts.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/index.js +10 -10
- package/lib/cjs/shared/ecsql-snippets/index.js.map +1 -1
- package/lib/esm/presentation-shared.d.ts +11 -11
- package/lib/esm/presentation-shared.d.ts.map +1 -1
- package/lib/esm/presentation-shared.js +8 -9
- package/lib/esm/presentation-shared.js.map +1 -1
- package/lib/esm/shared/ConcatenatedValue.d.ts +9 -9
- package/lib/esm/shared/ConcatenatedValue.d.ts.map +1 -1
- package/lib/esm/shared/ConcatenatedValue.js +6 -6
- package/lib/esm/shared/ConcatenatedValue.js.map +1 -1
- package/lib/esm/shared/ECSqlCore.d.ts +7 -7
- package/lib/esm/shared/Event.d.ts +1 -1
- package/lib/esm/shared/Formatting.d.ts +5 -5
- package/lib/esm/shared/Formatting.d.ts.map +1 -1
- package/lib/esm/shared/Formatting.js +4 -4
- package/lib/esm/shared/Formatting.js.map +1 -1
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts +12 -12
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -1
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.js +5 -5
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.js.map +1 -1
- package/lib/esm/shared/Logging.d.ts +4 -4
- package/lib/esm/shared/Logging.js +2 -2
- package/lib/esm/shared/Logging.js.map +1 -1
- package/lib/esm/shared/MappedTypes.d.ts +2 -2
- package/lib/esm/shared/Metadata.d.ts +31 -31
- package/lib/esm/shared/Metadata.js +3 -3
- package/lib/esm/shared/Metadata.js.map +1 -1
- package/lib/esm/shared/Utils.d.ts +11 -6
- package/lib/esm/shared/Utils.d.ts.map +1 -1
- package/lib/esm/shared/Utils.js +14 -6
- package/lib/esm/shared/Utils.js.map +1 -1
- package/lib/esm/shared/Values.d.ts +13 -13
- package/lib/esm/shared/Values.d.ts.map +1 -1
- package/lib/esm/shared/Values.js +7 -7
- package/lib/esm/shared/Values.js.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +5 -5
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js +3 -5
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +12 -12
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +15 -15
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
- package/lib/esm/shared/ecsql-snippets/index.d.ts +2 -2
- package/lib/esm/shared/ecsql-snippets/index.d.ts.map +1 -1
- package/lib/esm/shared/ecsql-snippets/index.js +2 -2
- package/lib/esm/shared/ecsql-snippets/index.js.map +1 -1
- package/package.json +20 -12
- package/lib/cjs/shared/InternalUtils.d.ts +0 -3
- package/lib/cjs/shared/InternalUtils.d.ts.map +0 -1
- package/lib/cjs/shared/InternalUtils.js +0 -13
- package/lib/cjs/shared/InternalUtils.js.map +0 -1
- package/lib/esm/shared/InternalUtils.d.ts +0 -3
- package/lib/esm/shared/InternalUtils.d.ts.map +0 -1
- package/lib/esm/shared/InternalUtils.js +0 -10
- package/lib/esm/shared/InternalUtils.js.map +0 -1
|
@@ -8,13 +8,13 @@ exports.parseInstanceLabel = parseInstanceLabel;
|
|
|
8
8
|
exports.createDefaultInstanceLabelSelectClauseFactory = createDefaultInstanceLabelSelectClauseFactory;
|
|
9
9
|
exports.createClassBasedInstanceLabelSelectClauseFactory = createClassBasedInstanceLabelSelectClauseFactory;
|
|
10
10
|
exports.createBisInstanceLabelSelectClauseFactory = createBisInstanceLabelSelectClauseFactory;
|
|
11
|
-
const
|
|
11
|
+
const ECSqlValueSelectorSnippets_js_1 = require("./ecsql-snippets/ECSqlValueSelectorSnippets.js");
|
|
12
12
|
/**
|
|
13
13
|
* Parses an instance label from query result into a string or a `ConcatenatedValue`. The latter type of result
|
|
14
14
|
* is expected when label selector is created using `IInstanceLabelSelectClauseFactory.createSelectClause` with
|
|
15
15
|
* `createConcatenatedValueJsonSelector`.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @public
|
|
18
18
|
*/
|
|
19
19
|
function parseInstanceLabel(value) {
|
|
20
20
|
if (!value) {
|
|
@@ -38,7 +38,7 @@ function parseInstanceLabel(value) {
|
|
|
38
38
|
* - `{local id} = ECInstanceId & (1 << 40 - 1)`
|
|
39
39
|
*
|
|
40
40
|
* @see https://www.itwinjs.org/presentation/advanced/defaultbisrules/#label-overrides
|
|
41
|
-
* @
|
|
41
|
+
* @public
|
|
42
42
|
*/
|
|
43
43
|
function createDefaultInstanceLabelSelectClauseFactory() {
|
|
44
44
|
return {
|
|
@@ -48,21 +48,21 @@ function createDefaultInstanceLabelSelectClauseFactory() {
|
|
|
48
48
|
${concatenate(props, [
|
|
49
49
|
{
|
|
50
50
|
selector: `COALESCE(
|
|
51
|
-
${(0,
|
|
52
|
-
${(0,
|
|
51
|
+
${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)("c", "DisplayLabel")},
|
|
52
|
+
${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)("c", "Name")}
|
|
53
53
|
)`,
|
|
54
54
|
},
|
|
55
55
|
...createECInstanceIdSuffixSelectors(props.classAlias),
|
|
56
56
|
])}
|
|
57
57
|
FROM [meta].[ECClassDef] AS [c]
|
|
58
|
-
WHERE [c].[ECInstanceId] = ${(0,
|
|
58
|
+
WHERE [c].[ECInstanceId] = ${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(props.classAlias, "ECClassId")}
|
|
59
59
|
)`;
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Creates an instance label select clause based on its class.
|
|
65
|
-
* @
|
|
65
|
+
* @public
|
|
66
66
|
*/
|
|
67
67
|
function createClassBasedInstanceLabelSelectClauseFactory(props) {
|
|
68
68
|
const { classHierarchyInspector, clauses: labelClausesByClass } = props;
|
|
@@ -103,7 +103,7 @@ function createClassBasedInstanceLabelSelectClauseFactory(props) {
|
|
|
103
103
|
${labelClauses
|
|
104
104
|
.map(({ className, clause }) => `
|
|
105
105
|
IIF(
|
|
106
|
-
${(0,
|
|
106
|
+
${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(clauseProps.classAlias, "ECClassId")} IS (${className}),
|
|
107
107
|
${clause.trim()},
|
|
108
108
|
NULL
|
|
109
109
|
)
|
|
@@ -117,7 +117,7 @@ function createClassBasedInstanceLabelSelectClauseFactory(props) {
|
|
|
117
117
|
/**
|
|
118
118
|
* Creates a label select clause according to BIS instance label rules.
|
|
119
119
|
* @see https://www.itwinjs.org/presentation/advanced/defaultbisrules/#label-overrides
|
|
120
|
-
* @
|
|
120
|
+
* @public
|
|
121
121
|
*/
|
|
122
122
|
function createBisInstanceLabelSelectClauseFactory(props) {
|
|
123
123
|
const clauses = [];
|
|
@@ -129,16 +129,16 @@ function createBisInstanceLabelSelectClauseFactory(props) {
|
|
|
129
129
|
className: "BisCore.GeometricElement",
|
|
130
130
|
clause: async ({ classAlias, ...rest }) => `
|
|
131
131
|
COALESCE(
|
|
132
|
-
${(0,
|
|
133
|
-
${concatenate(rest, [{ selector: (0,
|
|
132
|
+
${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "CodeValue")},
|
|
133
|
+
${concatenate(rest, [{ selector: (0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "UserLabel") }, ...createECInstanceIdSuffixSelectors(classAlias)], `${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "UserLabel")} IS NOT NULL`)}
|
|
134
134
|
)
|
|
135
135
|
`,
|
|
136
136
|
}, {
|
|
137
137
|
className: "BisCore.Element",
|
|
138
138
|
clause: async ({ classAlias }) => `
|
|
139
139
|
COALESCE(
|
|
140
|
-
${(0,
|
|
141
|
-
${(0,
|
|
140
|
+
${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "UserLabel")},
|
|
141
|
+
${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "CodeValue")}
|
|
142
142
|
)
|
|
143
143
|
`,
|
|
144
144
|
}, {
|
|
@@ -146,7 +146,7 @@ function createBisInstanceLabelSelectClauseFactory(props) {
|
|
|
146
146
|
clause: async ({ classAlias, ...rest }) => `(
|
|
147
147
|
SELECT ${await factory.createSelectClause({ ...rest, classAlias: "e", className: "BisCore.Element" })}
|
|
148
148
|
FROM [bis].[Element] AS [e]
|
|
149
|
-
WHERE [e].[ECInstanceId] = ${(0,
|
|
149
|
+
WHERE [e].[ECInstanceId] = ${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "ModeledElement", "Id")}
|
|
150
150
|
)`,
|
|
151
151
|
});
|
|
152
152
|
return factory;
|
|
@@ -154,13 +154,13 @@ function createBisInstanceLabelSelectClauseFactory(props) {
|
|
|
154
154
|
function createECInstanceIdSuffixSelectors(classAlias) {
|
|
155
155
|
return [
|
|
156
156
|
{ value: ` [`, type: "String" },
|
|
157
|
-
{ selector: `CAST(base36(${(0,
|
|
157
|
+
{ selector: `CAST(base36(${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "ECInstanceId")} >> 40) AS TEXT)` },
|
|
158
158
|
{ value: `-`, type: "String" },
|
|
159
|
-
{ selector: `CAST(base36(${(0,
|
|
159
|
+
{ selector: `CAST(base36(${(0, ECSqlValueSelectorSnippets_js_1.createRawPropertyValueSelector)(classAlias, "ECInstanceId")} & ((1 << 40) - 1)) AS TEXT)` },
|
|
160
160
|
{ value: `]`, type: "String" },
|
|
161
161
|
];
|
|
162
162
|
}
|
|
163
163
|
function concatenate(props, selectors, checkSelector) {
|
|
164
|
-
return (props.selectorsConcatenator ??
|
|
164
|
+
return (props.selectorsConcatenator ?? ECSqlValueSelectorSnippets_js_1.createConcatenatedValueJsonSelector)(selectors, checkSelector);
|
|
165
165
|
}
|
|
166
166
|
//# sourceMappingURL=InstanceLabelSelectClauseFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceLabelSelectClauseFactory.js","sourceRoot":"","sources":["../../../src/shared/InstanceLabelSelectClauseFactory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;
|
|
1
|
+
{"version":3,"file":"InstanceLabelSelectClauseFactory.js","sourceRoot":"","sources":["../../../src/shared/InstanceLabelSelectClauseFactory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAkFhG,gDAaC;AAWD,sGAmBC;AAyCD,4GA0DC;AAeD,8FAuCC;AAnRD,kGAIwD;AAoExD;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,KAAyB;IAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OA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AAE,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC;iBAChC,MAAM,OAAO,CAAC,kBAAkB,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;;qCAExE,IAAA,8DAA8B,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,CAAC;QAC/F;KACH,CACF,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,iCAAiC,CAAC,UAAkB;IAC3D,OAAO;QACL,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/B,EAAE,QAAQ,EAAE,eAAe,IAAA,8DAA8B,EAAC,UAAU,EAAE,cAAc,CAAC,kBAAkB,EAAE;QACzG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,EAAE,QAAQ,EAAE,eAAe,IAAA,8DAA8B,EAAC,UAAU,EAAE,cAAc,CAAC,8BAA8B,EAAE;QACrH,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAClB,KAA+G,EAC/G,SAAwC,EACxC,aAAsB;IAEtB,OAAO,CAAC,KAAK,CAAC,qBAAqB,IAAI,mEAAmC,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines a type for a logging function.
|
|
3
|
-
* @
|
|
3
|
+
* @public
|
|
4
4
|
*/
|
|
5
5
|
export type LogFunction = (category: string, message: string) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Defines logging severities.
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
10
|
export type LogLevel = "error" | "warning" | "info" | "trace";
|
|
11
11
|
/**
|
|
12
12
|
* An interface for a logger used by presentation packages.
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
export interface ILogger {
|
|
16
16
|
isEnabled: (category: string, level: LogLevel) => boolean;
|
|
@@ -21,7 +21,7 @@ export interface ILogger {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* A logger implementation that does nothing.
|
|
24
|
-
* @
|
|
24
|
+
* @public
|
|
25
25
|
*/
|
|
26
26
|
export declare const NOOP_LOGGER: ILogger;
|
|
27
27
|
//# sourceMappingURL=Logging.d.ts.map
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.NOOP_LOGGER = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* A logger implementation that does nothing.
|
|
10
|
-
* @
|
|
10
|
+
* @public
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
/* c8 ignore next 7 */
|
|
13
13
|
exports.NOOP_LOGGER = {
|
|
14
14
|
isEnabled: () => false,
|
|
15
15
|
logError: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/shared/Logging.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA0BhG;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/shared/Logging.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA0BhG;;;GAGG;AACH,sBAAsB;AACT,QAAA,WAAW,GAAY;IAClC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK;IACtB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;CACnB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An utility `Omit` type which works with union types.
|
|
3
|
-
* @
|
|
3
|
+
* @public
|
|
4
4
|
*/
|
|
5
5
|
export type OmitOverUnion<T, K extends PropertyKey> = T extends T ? Omit<T, K> : never;
|
|
6
6
|
/**
|
|
7
7
|
* An utility generic type to get array element's type.
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
10
|
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
11
11
|
//# sourceMappingURL=MappedTypes.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* An interface for an object that knows how to get an ECSchema from an iModel.
|
|
3
3
|
*
|
|
4
4
|
* @see `createECSchemaProvider` in `@itwin/presentation-core-interop`.
|
|
5
|
-
* @
|
|
5
|
+
* @public
|
|
6
6
|
*/
|
|
7
7
|
export interface ECSchemaProvider {
|
|
8
8
|
getSchema(schemaName: string): Promise<EC.Schema | undefined>;
|
|
@@ -10,14 +10,14 @@ export interface ECSchemaProvider {
|
|
|
10
10
|
/**
|
|
11
11
|
* An interface for a class hierarchy inspector that can be used to determine if one class derives from another.
|
|
12
12
|
* @see `createCachingECClassHierarchyInspector`
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
export interface ECClassHierarchyInspector {
|
|
16
16
|
classDerivesFrom(derivedClassFullName: string, candidateBaseClassFullName: string): Promise<boolean> | boolean;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
|
|
20
|
-
* @
|
|
20
|
+
* @public
|
|
21
21
|
*/
|
|
22
22
|
export declare function createCachingECClassHierarchyInspector(props: {
|
|
23
23
|
/** Schema provider used to load schemas and their classes. */
|
|
@@ -27,14 +27,14 @@ export declare function createCachingECClassHierarchyInspector(props: {
|
|
|
27
27
|
}): ECClassHierarchyInspector;
|
|
28
28
|
/**
|
|
29
29
|
* A namespace containing various [EC types](https://www.itwinjs.org/bis/ec/).
|
|
30
|
-
* @
|
|
30
|
+
* @public
|
|
31
31
|
* @see `ECSchemaProvider`
|
|
32
32
|
*/
|
|
33
33
|
export declare namespace EC {
|
|
34
34
|
/**
|
|
35
35
|
* Represents an ECSchema that contains classes, relationships, etc.
|
|
36
36
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/
|
|
37
|
-
* @
|
|
37
|
+
* @public
|
|
38
38
|
*/
|
|
39
39
|
interface Schema {
|
|
40
40
|
name: string;
|
|
@@ -43,7 +43,7 @@ export declare namespace EC {
|
|
|
43
43
|
/**
|
|
44
44
|
* Represents an ECSchema item - a class, relationship, etc.
|
|
45
45
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/
|
|
46
|
-
* @
|
|
46
|
+
* @public
|
|
47
47
|
*/
|
|
48
48
|
interface SchemaItem {
|
|
49
49
|
schema: Schema;
|
|
@@ -54,7 +54,7 @@ export declare namespace EC {
|
|
|
54
54
|
/**
|
|
55
55
|
* Represents an ECClass.
|
|
56
56
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/
|
|
57
|
-
* @
|
|
57
|
+
* @public
|
|
58
58
|
*/
|
|
59
59
|
interface Class extends SchemaItem {
|
|
60
60
|
is(className: string, schemaName: string): Promise<boolean>;
|
|
@@ -69,31 +69,31 @@ export declare namespace EC {
|
|
|
69
69
|
/**
|
|
70
70
|
* Represents an entity class.
|
|
71
71
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/entityclass/
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
74
|
type EntityClass = Class;
|
|
75
75
|
/**
|
|
76
76
|
* Represents a struct class.
|
|
77
77
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structclass/
|
|
78
|
-
* @
|
|
78
|
+
* @public
|
|
79
79
|
*/
|
|
80
80
|
type StructClass = Class;
|
|
81
81
|
/**
|
|
82
82
|
* Represents a mixin.
|
|
83
83
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/mixin/
|
|
84
|
-
* @
|
|
84
|
+
* @public
|
|
85
85
|
*/
|
|
86
86
|
type Mixin = Class;
|
|
87
87
|
/**
|
|
88
88
|
* Represents a kind of quantity.
|
|
89
89
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/kindofquantity/
|
|
90
|
-
* @
|
|
90
|
+
* @public
|
|
91
91
|
*/
|
|
92
92
|
type KindOfQuantity = SchemaItem;
|
|
93
93
|
/**
|
|
94
94
|
* Represents a relationship constraint multiplicity.
|
|
95
95
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipmultiplicity/
|
|
96
|
-
* @
|
|
96
|
+
* @public
|
|
97
97
|
*/
|
|
98
98
|
interface RelationshipConstraintMultiplicity {
|
|
99
99
|
lowerLimit: number;
|
|
@@ -102,7 +102,7 @@ export declare namespace EC {
|
|
|
102
102
|
/**
|
|
103
103
|
* Represents a relationship constraint.
|
|
104
104
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipconstraint/
|
|
105
|
-
* @
|
|
105
|
+
* @public
|
|
106
106
|
*/
|
|
107
107
|
interface RelationshipConstraint {
|
|
108
108
|
multiplicity?: RelationshipConstraintMultiplicity;
|
|
@@ -112,7 +112,7 @@ export declare namespace EC {
|
|
|
112
112
|
/**
|
|
113
113
|
* Represents a relationship class.
|
|
114
114
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipclass/
|
|
115
|
-
* @
|
|
115
|
+
* @public
|
|
116
116
|
*/
|
|
117
117
|
interface RelationshipClass extends Class {
|
|
118
118
|
direction: "Forward" | "Backward";
|
|
@@ -122,7 +122,7 @@ export declare namespace EC {
|
|
|
122
122
|
/**
|
|
123
123
|
* Represents an enumerator.
|
|
124
124
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerator/
|
|
125
|
-
* @
|
|
125
|
+
* @public
|
|
126
126
|
*/
|
|
127
127
|
interface Enumerator<T> {
|
|
128
128
|
name: string;
|
|
@@ -133,7 +133,7 @@ export declare namespace EC {
|
|
|
133
133
|
/**
|
|
134
134
|
* Represents an enumeration.
|
|
135
135
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumeration/
|
|
136
|
-
* @
|
|
136
|
+
* @public
|
|
137
137
|
*/
|
|
138
138
|
interface Enumeration extends SchemaItem {
|
|
139
139
|
enumerators: Array<Enumerator<string | number>>;
|
|
@@ -143,7 +143,7 @@ export declare namespace EC {
|
|
|
143
143
|
/**
|
|
144
144
|
* Represents a property.
|
|
145
145
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/property/
|
|
146
|
-
* @
|
|
146
|
+
* @public
|
|
147
147
|
*/
|
|
148
148
|
interface Property {
|
|
149
149
|
name: string;
|
|
@@ -159,7 +159,7 @@ export declare namespace EC {
|
|
|
159
159
|
/**
|
|
160
160
|
* Defines array property attributes.
|
|
161
161
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/arrayproperty/
|
|
162
|
-
* @
|
|
162
|
+
* @public
|
|
163
163
|
*/
|
|
164
164
|
interface ArrayPropertyAttributes {
|
|
165
165
|
minOccurs: number;
|
|
@@ -168,31 +168,31 @@ export declare namespace EC {
|
|
|
168
168
|
/**
|
|
169
169
|
* Defines a structs array property.
|
|
170
170
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structarrayproperty/
|
|
171
|
-
* @
|
|
171
|
+
* @public
|
|
172
172
|
*/
|
|
173
173
|
type StructArrayProperty = StructProperty & ArrayPropertyAttributes;
|
|
174
174
|
/**
|
|
175
175
|
* Defines an enumerations array property.
|
|
176
176
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerationarrayproperty/
|
|
177
|
-
* @
|
|
177
|
+
* @public
|
|
178
178
|
*/
|
|
179
179
|
type EnumerationArrayProperty = EnumerationProperty & ArrayPropertyAttributes;
|
|
180
180
|
/**
|
|
181
181
|
* Defines a primitives array property.
|
|
182
182
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitivearrayproperty/
|
|
183
|
-
* @
|
|
183
|
+
* @public
|
|
184
184
|
*/
|
|
185
185
|
type PrimitiveArrayProperty = PrimitiveProperty & ArrayPropertyAttributes;
|
|
186
186
|
/**
|
|
187
187
|
* Defines an array property.
|
|
188
188
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/anyarrayproperty/
|
|
189
|
-
* @
|
|
189
|
+
* @public
|
|
190
190
|
*/
|
|
191
191
|
type ArrayProperty = StructArrayProperty | EnumerationArrayProperty | PrimitiveArrayProperty;
|
|
192
192
|
/**
|
|
193
193
|
* Defines a struct property.
|
|
194
194
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structproperty/
|
|
195
|
-
* @
|
|
195
|
+
* @public
|
|
196
196
|
*/
|
|
197
197
|
interface StructProperty extends Property {
|
|
198
198
|
structClass: StructClass;
|
|
@@ -200,7 +200,7 @@ export declare namespace EC {
|
|
|
200
200
|
/**
|
|
201
201
|
* Defines an enumeration property.
|
|
202
202
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerationproperty/
|
|
203
|
-
* @
|
|
203
|
+
* @public
|
|
204
204
|
*/
|
|
205
205
|
interface EnumerationProperty extends Property {
|
|
206
206
|
enumeration: Promise<Enumeration | undefined>;
|
|
@@ -209,7 +209,7 @@ export declare namespace EC {
|
|
|
209
209
|
/**
|
|
210
210
|
* Defines a navigation property.
|
|
211
211
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/navigationproperty/
|
|
212
|
-
* @
|
|
212
|
+
* @public
|
|
213
213
|
*/
|
|
214
214
|
interface NavigationProperty extends Property {
|
|
215
215
|
relationshipClass: Promise<RelationshipClass>;
|
|
@@ -218,13 +218,13 @@ export declare namespace EC {
|
|
|
218
218
|
/**
|
|
219
219
|
* Defines a primitive property type.
|
|
220
220
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitivetype/
|
|
221
|
-
* @
|
|
221
|
+
* @public
|
|
222
222
|
*/
|
|
223
223
|
type PrimitiveType = "Binary" | "Boolean" | "DateTime" | "Double" | "Integer" | "Long" | "Point2d" | "Point3d" | "String" | "IGeometry";
|
|
224
224
|
/**
|
|
225
225
|
* Defines a primitive property.
|
|
226
226
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitiveproperty/
|
|
227
|
-
* @
|
|
227
|
+
* @public
|
|
228
228
|
*/
|
|
229
229
|
interface PrimitiveProperty extends Property {
|
|
230
230
|
primitiveType: PrimitiveType;
|
|
@@ -233,12 +233,12 @@ export declare namespace EC {
|
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* An identifiers' union of all supported primitive value types.
|
|
236
|
-
* @
|
|
236
|
+
* @public
|
|
237
237
|
*/
|
|
238
238
|
export type PrimitiveValueType = "Id" | Exclude<EC.PrimitiveType, "Binary" | "IGeometry">;
|
|
239
239
|
/**
|
|
240
240
|
* Describes a single step through an ECRelationship from source ECClass to target ECClass.
|
|
241
|
-
* @
|
|
241
|
+
* @public
|
|
242
242
|
*/
|
|
243
243
|
export interface RelationshipPathStep {
|
|
244
244
|
/** Full name of the source ECClass */
|
|
@@ -256,13 +256,13 @@ export interface RelationshipPathStep {
|
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* Describes a path from source ECClass to target ECClass through multiple ECRelationships.
|
|
259
|
-
* @
|
|
259
|
+
* @public
|
|
260
260
|
*/
|
|
261
261
|
export type RelationshipPath<TStep extends RelationshipPathStep = RelationshipPathStep> = TStep[];
|
|
262
262
|
/**
|
|
263
263
|
* Finds a class with the specified full class name using the given `ECSchemaProvider`.
|
|
264
264
|
* @throws Error if the schema or class is not found.
|
|
265
|
-
* @
|
|
265
|
+
* @public
|
|
266
266
|
*/
|
|
267
267
|
export declare function getClass(schemaProvider: ECSchemaProvider, fullClassName: string): Promise<EC.Class>;
|
|
268
268
|
//# sourceMappingURL=Metadata.d.ts.map
|
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.createCachingECClassHierarchyInspector = createCachingECClassHierarchyInspector;
|
|
8
8
|
exports.getClass = getClass;
|
|
9
9
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
10
|
-
const
|
|
10
|
+
const Utils_js_1 = require("./Utils.js");
|
|
11
11
|
/**
|
|
12
12
|
* Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
function createCachingECClassHierarchyInspector(props) {
|
|
16
16
|
const map = new core_bentley_1.LRUMap(props.cacheSize ?? 0);
|
|
@@ -36,10 +36,10 @@ function createCachingECClassHierarchyInspector(props) {
|
|
|
36
36
|
/**
|
|
37
37
|
* Finds a class with the specified full class name using the given `ECSchemaProvider`.
|
|
38
38
|
* @throws Error if the schema or class is not found.
|
|
39
|
-
* @
|
|
39
|
+
* @public
|
|
40
40
|
*/
|
|
41
41
|
async function getClass(schemaProvider, fullClassName) {
|
|
42
|
-
const { schemaName, className } = (0,
|
|
42
|
+
const { schemaName, className } = (0, Utils_js_1.parseFullClassName)(fullClassName);
|
|
43
43
|
const schema = await schemaProvider.getSchema(schemaName);
|
|
44
44
|
if (!schema) {
|
|
45
45
|
throw new Error(`Schema "${schemaName}" not found.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../src/shared/Metadata.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AA4BhG,wFA2BC;AAyQD,4BAWC;AAzUD,sDAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../src/shared/Metadata.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AA4BhG,wFA2BC;AAyQD,4BAWC;AAzUD,sDAA6C;AAC7C,yCAAgD;AAqBhD;;;GAGG;AACH,SAAgB,sCAAsC,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IAC1D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,WAAW,UAAU,cAAc,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACrD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,UAAU,SAAS,0BAA0B,UAAU,IAAI,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An utility to parse schema and class names from full class name, where
|
|
3
3
|
* schema and class names are separated by either `:` or `.`.
|
|
4
|
-
* @
|
|
4
|
+
* @public
|
|
5
5
|
*/
|
|
6
6
|
export declare function parseFullClassName(fullClassName: string): {
|
|
7
7
|
schemaName: string;
|
|
@@ -10,24 +10,24 @@ export declare function parseFullClassName(fullClassName: string): {
|
|
|
10
10
|
/**
|
|
11
11
|
* An utility to normalize full class name from either `SchemaName:ClassName` or
|
|
12
12
|
* `SchemaName.ClassName` to always use the dot format.
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
export declare function normalizeFullClassName(fullClassName: string): string;
|
|
16
16
|
/**
|
|
17
17
|
* An utility to remove all extra whitespace from a given string.
|
|
18
|
-
* @
|
|
18
|
+
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare function trimWhitespace(str: string): string;
|
|
21
21
|
/**
|
|
22
22
|
* An utility to remove all extra whitespace from a given string.
|
|
23
|
-
* @
|
|
23
|
+
* @public
|
|
24
24
|
*/
|
|
25
25
|
export declare function trimWhitespace(str: string | undefined): string | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* An utility that returns a promise that immediately resolves. Awaiting on the returned
|
|
28
28
|
* promise releases the main thread and allows other tasks to run.
|
|
29
29
|
*
|
|
30
|
-
* @
|
|
30
|
+
* @public
|
|
31
31
|
*/
|
|
32
32
|
export declare function releaseMainThread(): Promise<void>;
|
|
33
33
|
/**
|
|
@@ -44,7 +44,12 @@ export declare function releaseMainThread(): Promise<void>;
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* @param releaseOnTimePassed The amount of time in milliseconds after which the main thread should be released. Defaults to `40` ms.
|
|
47
|
-
* @
|
|
47
|
+
* @public
|
|
48
48
|
*/
|
|
49
49
|
export declare function createMainThreadReleaseOnTimePassedHandler(releaseOnTimePassed?: number): () => Promise<void> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* An utility to convert a julian day format to `Date`.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export declare function julianToDateTime(julianDate: number): Date;
|
|
50
55
|
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;;;EAIvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACpD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAe5E;;;;;GAKG;AACH,wBAAsB,iBAAiB,kBAEtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0CAA0C,CAAC,mBAAmB,SAAK,SAEtE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CASrC"}
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;;;EAIvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACpD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAe5E;;;;;GAKG;AACH,wBAAsB,iBAAiB,kBAEtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0CAA0C,CAAC,mBAAmB,SAAK,SAEtE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGzD"}
|
package/lib/cjs/shared/Utils.js
CHANGED
|
@@ -9,11 +9,12 @@ exports.normalizeFullClassName = normalizeFullClassName;
|
|
|
9
9
|
exports.trimWhitespace = trimWhitespace;
|
|
10
10
|
exports.releaseMainThread = releaseMainThread;
|
|
11
11
|
exports.createMainThreadReleaseOnTimePassedHandler = createMainThreadReleaseOnTimePassedHandler;
|
|
12
|
+
exports.julianToDateTime = julianToDateTime;
|
|
12
13
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
14
|
/**
|
|
14
15
|
* An utility to parse schema and class names from full class name, where
|
|
15
16
|
* schema and class names are separated by either `:` or `.`.
|
|
16
|
-
* @
|
|
17
|
+
* @public
|
|
17
18
|
*/
|
|
18
19
|
function parseFullClassName(fullClassName) {
|
|
19
20
|
const [schemaName, className] = fullClassName.split(/[\.:]/);
|
|
@@ -23,7 +24,7 @@ function parseFullClassName(fullClassName) {
|
|
|
23
24
|
/**
|
|
24
25
|
* An utility to normalize full class name from either `SchemaName:ClassName` or
|
|
25
26
|
* `SchemaName.ClassName` to always use the dot format.
|
|
26
|
-
* @
|
|
27
|
+
* @public
|
|
27
28
|
*/
|
|
28
29
|
function normalizeFullClassName(fullClassName) {
|
|
29
30
|
const colonPos = fullClassName.indexOf(":");
|
|
@@ -35,9 +36,9 @@ function normalizeFullClassName(fullClassName) {
|
|
|
35
36
|
const className = fullClassName.slice(colonPos + 1);
|
|
36
37
|
return `${schemaName}.${className}`;
|
|
37
38
|
}
|
|
38
|
-
/** @
|
|
39
|
+
/** @public */
|
|
39
40
|
function trimWhitespace(str) {
|
|
40
|
-
|
|
41
|
+
/* c8 ignore next 3 */
|
|
41
42
|
if (!str) {
|
|
42
43
|
return str;
|
|
43
44
|
}
|
|
@@ -52,7 +53,7 @@ function trimWhitespace(str) {
|
|
|
52
53
|
* An utility that returns a promise that immediately resolves. Awaiting on the returned
|
|
53
54
|
* promise releases the main thread and allows other tasks to run.
|
|
54
55
|
*
|
|
55
|
-
* @
|
|
56
|
+
* @public
|
|
56
57
|
*/
|
|
57
58
|
async function releaseMainThread() {
|
|
58
59
|
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
@@ -71,7 +72,7 @@ async function releaseMainThread() {
|
|
|
71
72
|
* ```
|
|
72
73
|
*
|
|
73
74
|
* @param releaseOnTimePassed The amount of time in milliseconds after which the main thread should be released. Defaults to `40` ms.
|
|
74
|
-
* @
|
|
75
|
+
* @public
|
|
75
76
|
*/
|
|
76
77
|
function createMainThreadReleaseOnTimePassedHandler(releaseOnTimePassed = 40) {
|
|
77
78
|
let start = Date.now();
|
|
@@ -85,4 +86,12 @@ function createMainThreadReleaseOnTimePassedHandler(releaseOnTimePassed = 40) {
|
|
|
85
86
|
});
|
|
86
87
|
};
|
|
87
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* An utility to convert a julian day format to `Date`.
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
function julianToDateTime(julianDate) {
|
|
94
|
+
const millis = (julianDate - 2440587.5) * 86400000;
|
|
95
|
+
return new Date(millis);
|
|
96
|
+
}
|
|
88
97
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAShG,gDAIC;AAOD,wDASC;AAaD,wCAWC;AAQD,8CAEC;AAkBD,gGAWC;
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAShG,gDAIC;AAOD,wDASC;AAaD,wCAWC;AAQD,8CAEC;AAkBD,gGAWC;AAMD,4CAGC;AAnGD,sDAA6C;AAE7C;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,aAAqB;IACtD,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7D,IAAA,qBAAM,EAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,aAAqB;IAC1D,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACpB,IAAA,qBAAM,EAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,yBAAyB,CAAC,CAAC;QACrE,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IACpD,OAAO,GAAG,UAAU,IAAI,SAAS,EAAE,CAAC;AACtC,CAAC;AAYD,cAAc;AACd,SAAgB,cAAc,CAAC,GAA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