@itwin/core-quantity 4.0.0-dev.52 → 4.0.0-dev.55
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/lib/cjs/Constants.d.ts +27 -27
- package/lib/cjs/Constants.js +52 -52
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Exception.d.ts +26 -26
- package/lib/cjs/Exception.js +38 -38
- package/lib/cjs/Formatter/Format.d.ts +91 -91
- package/lib/cjs/Formatter/Format.js +328 -328
- package/lib/cjs/Formatter/FormatEnums.d.ts +133 -133
- package/lib/cjs/Formatter/FormatEnums.js +318 -318
- package/lib/cjs/Formatter/Formatter.d.ts +44 -44
- package/lib/cjs/Formatter/Formatter.js +371 -371
- package/lib/cjs/Formatter/Formatter.js.map +1 -1
- package/lib/cjs/Formatter/FormatterSpec.d.ts +39 -39
- package/lib/cjs/Formatter/FormatterSpec.js +101 -101
- package/lib/cjs/Formatter/Interfaces.d.ts +62 -62
- package/lib/cjs/Formatter/Interfaces.js +17 -17
- package/lib/cjs/Interfaces.d.ts +86 -86
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js +9 -9
- package/lib/cjs/Parser.d.ts +93 -93
- package/lib/cjs/Parser.d.ts.map +1 -1
- package/lib/cjs/Parser.js +592 -592
- package/lib/cjs/Parser.js.map +1 -1
- package/lib/cjs/ParserSpec.d.ts +34 -34
- package/lib/cjs/ParserSpec.js +47 -47
- package/lib/cjs/Quantity.d.ts +27 -27
- package/lib/cjs/Quantity.js +46 -46
- package/lib/cjs/Quantity.js.map +1 -1
- package/lib/cjs/Unit.d.ts +25 -25
- package/lib/cjs/Unit.js +44 -44
- package/lib/cjs/core-quantity.d.ts +19 -19
- package/lib/cjs/core-quantity.js +39 -35
- package/lib/cjs/core-quantity.js.map +1 -1
- package/lib/esm/Constants.d.ts +27 -27
- package/lib/esm/Constants.js +49 -48
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Exception.d.ts +26 -26
- package/lib/esm/Exception.js +34 -34
- package/lib/esm/Formatter/Format.d.ts +91 -91
- package/lib/esm/Formatter/Format.js +323 -323
- package/lib/esm/Formatter/FormatEnums.d.ts +133 -133
- package/lib/esm/Formatter/FormatEnums.js +302 -302
- package/lib/esm/Formatter/Formatter.d.ts +44 -44
- package/lib/esm/Formatter/Formatter.js +368 -367
- package/lib/esm/Formatter/Formatter.js.map +1 -1
- package/lib/esm/Formatter/FormatterSpec.d.ts +39 -39
- package/lib/esm/Formatter/FormatterSpec.js +97 -97
- package/lib/esm/Formatter/Interfaces.d.ts +62 -62
- package/lib/esm/Formatter/Interfaces.js +13 -13
- package/lib/esm/Interfaces.d.ts +86 -86
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js +8 -8
- package/lib/esm/Parser.d.ts +93 -93
- package/lib/esm/Parser.d.ts.map +1 -1
- package/lib/esm/Parser.js +589 -588
- package/lib/esm/Parser.js.map +1 -1
- package/lib/esm/ParserSpec.d.ts +34 -34
- package/lib/esm/ParserSpec.js +43 -43
- package/lib/esm/Quantity.d.ts +27 -27
- package/lib/esm/Quantity.js +42 -42
- package/lib/esm/Quantity.js.map +1 -1
- package/lib/esm/Unit.d.ts +25 -25
- package/lib/esm/Unit.js +39 -39
- package/lib/esm/core-quantity.d.ts +19 -19
- package/lib/esm/core-quantity.js +23 -23
- package/package.json +6 -6
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Quantity
|
|
3
|
-
*/
|
|
4
|
-
/** The regular expression to parse [format strings]($docs/bis/ec/kindofquantity.md#format-string)
|
|
5
|
-
* provided in serialized formats as well as the full name of an [[OverrideFormat]].
|
|
6
|
-
*
|
|
7
|
-
* `formatName(precision)[unitName|unitLabel][unitName|unitLabel][unitName|unitLabel][unitName|unitLabel]`
|
|
8
|
-
*
|
|
9
|
-
* Explanation of the regex:
|
|
10
|
-
* - ([\w.:]+)
|
|
11
|
-
* - Grabs the format full name
|
|
12
|
-
* - (\(([^\)]+)\))?
|
|
13
|
-
* - Grabs the precision part with and without the `()`.
|
|
14
|
-
* - The parentheses are needed to validate the entire string. (TODO: Need to check if this is true)
|
|
15
|
-
* - (\[([^\|\]]+)([\|])?([^\]]+)?\])?
|
|
16
|
-
* - 4 of these make up the rest of the regex, none of them are required so each end in `?`
|
|
17
|
-
* - Grabs the unit name and label including the `[]`
|
|
18
|
-
* - Grabs the unit name, `|` and label separately
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export declare const formatStringRgx: RegExp;
|
|
22
|
-
/** @internal */
|
|
23
|
-
export declare function getItemNamesFromFormatString(formatString: string): Iterable<string>;
|
|
24
|
-
/** @beta */
|
|
25
|
-
export declare enum FormatTraits {
|
|
26
|
-
Uninitialized = 0,
|
|
27
|
-
/** Show trailing zeroes to requested precision. */
|
|
28
|
-
TrailZeroes = 1,
|
|
29
|
-
/** Indicates that the fractional part of the number is required when the fraction is zero */
|
|
30
|
-
KeepSingleZero = 2,
|
|
31
|
-
/** Zero magnitude returns blank display value */
|
|
32
|
-
ZeroEmpty = 4,
|
|
33
|
-
/** Show decimal point when value to right of decimal is empty */
|
|
34
|
-
KeepDecimalPoint = 8,
|
|
35
|
-
/** Use the rounding factor. Not yet supported */
|
|
36
|
-
ApplyRounding = 16,
|
|
37
|
-
/** Show a dash between whole value and fractional value */
|
|
38
|
-
FractionDash = 32,
|
|
39
|
-
/** Append the quantity's unit label */
|
|
40
|
-
ShowUnitLabel = 64,
|
|
41
|
-
/** Prepend unit label. Not yet supported */
|
|
42
|
-
PrependUnitLabel = 128,
|
|
43
|
-
/** show a grouping in each group of 1000. */
|
|
44
|
-
Use1000Separator = 256,
|
|
45
|
-
/** Indicates that if an exponent value is positive to not include a `+`. By default a sign, `+` or `-`, is always shown. Not yet supported */
|
|
46
|
-
ExponentOnlyNegative = 512
|
|
47
|
-
}
|
|
48
|
-
/** Precision for Fractional formatted value types. Range from Whole (1/1) through 1/256.
|
|
49
|
-
* @beta */
|
|
50
|
-
export declare enum FractionalPrecision {
|
|
51
|
-
One = 1,
|
|
52
|
-
Two = 2,
|
|
53
|
-
Four = 4,
|
|
54
|
-
Eight = 8,
|
|
55
|
-
Sixteen = 16,
|
|
56
|
-
ThirtyTwo = 32,
|
|
57
|
-
SixtyFour = 64,
|
|
58
|
-
OneHundredTwentyEight = 128,
|
|
59
|
-
TwoHundredFiftySix = 256
|
|
60
|
-
}
|
|
61
|
-
/** Precision for Decimal, Scientific, and Station formatted value types. Range from 1/(10^0) through 1/(10^12).
|
|
62
|
-
* @beta */
|
|
63
|
-
export declare enum DecimalPrecision {
|
|
64
|
-
Zero = 0,
|
|
65
|
-
One = 1,
|
|
66
|
-
Two = 2,
|
|
67
|
-
Three = 3,
|
|
68
|
-
Four = 4,
|
|
69
|
-
Five = 5,
|
|
70
|
-
Six = 6,
|
|
71
|
-
Seven = 7,
|
|
72
|
-
Eight = 8,
|
|
73
|
-
Nine = 9,
|
|
74
|
-
Ten = 10,
|
|
75
|
-
Eleven = 11,
|
|
76
|
-
Twelve = 12
|
|
77
|
-
}
|
|
78
|
-
/** Supported format types
|
|
79
|
-
* @beta */
|
|
80
|
-
export declare enum FormatType {
|
|
81
|
-
/** Decimal display (ie 2.125) */
|
|
82
|
-
Decimal = 0,
|
|
83
|
-
/** Fractional display (ie 2-1/8) */
|
|
84
|
-
Fractional = 1,
|
|
85
|
-
/** Scientific Notation (ie 1.04e3) */
|
|
86
|
-
Scientific = 2,
|
|
87
|
-
/** Civil Engineering Stationing (ie 1+00). */
|
|
88
|
-
Station = 3
|
|
89
|
-
}
|
|
90
|
-
/** required if type is scientific
|
|
91
|
-
* @beta */
|
|
92
|
-
export declare enum ScientificType {
|
|
93
|
-
/** Non-zero value left of decimal point (ie 1.2345e3) */
|
|
94
|
-
Normalized = 0,
|
|
95
|
-
/** Zero value left of decimal point (ie 0.12345e4) */
|
|
96
|
-
ZeroNormalized = 1
|
|
97
|
-
}
|
|
98
|
-
/** Determines how the sign of values are displayed
|
|
99
|
-
* @beta */
|
|
100
|
-
export declare enum ShowSignOption {
|
|
101
|
-
/** Never show a sign even if the value is negative. */
|
|
102
|
-
NoSign = 0,
|
|
103
|
-
/** Only show a sign when the value is negative. */
|
|
104
|
-
OnlyNegative = 1,
|
|
105
|
-
/** Always show a sign whether the value is positive or negative. */
|
|
106
|
-
SignAlways = 2,
|
|
107
|
-
/** Only show a sign when the value is negative but use parentheses instead of a negative sign. For example, -10 is formatted as `(10)`. */
|
|
108
|
-
NegativeParentheses = 3
|
|
109
|
-
}
|
|
110
|
-
/** @beta */
|
|
111
|
-
export declare function parseScientificType(scientificType: string, formatName: string): ScientificType;
|
|
112
|
-
/** @beta */
|
|
113
|
-
export declare function scientificTypeToString(scientificType: ScientificType): string;
|
|
114
|
-
/** @beta */
|
|
115
|
-
export declare function parseShowSignOption(showSignOption: string, formatName: string): ShowSignOption;
|
|
116
|
-
/** @beta */
|
|
117
|
-
export declare function showSignOptionToString(showSign: ShowSignOption): string;
|
|
118
|
-
/** @beta */
|
|
119
|
-
export declare function parseFormatTrait(formatTraitsString: string, formatName: string): FormatTraits;
|
|
120
|
-
/** @beta */
|
|
121
|
-
export declare function getTraitString(trait: FormatTraits): "trailZeroes" | "keepSingleZero" | "zeroEmpty" | "keepDecimalPoint" | "applyRounding" | "fractionDash" | "showUnitLabel" | "prependUnitLabel" | "use1000Separator" | "exponentOnlyNegative";
|
|
122
|
-
/** @beta */
|
|
123
|
-
export declare function formatTraitsToArray(currentFormatTrait: FormatTraits): string[];
|
|
124
|
-
/** @beta */
|
|
125
|
-
export declare function parseFormatType(jsonObjType: string, formatName: string): FormatType;
|
|
126
|
-
/** @beta */
|
|
127
|
-
export declare function formatTypeToString(type: FormatType): string;
|
|
128
|
-
/** @beta */
|
|
129
|
-
export declare function parseDecimalPrecision(jsonObjPrecision: number, formatName: string): DecimalPrecision;
|
|
130
|
-
/** @beta validates the input value, that is typically extracted for persisted JSON data, is a valid FractionalPrecision */
|
|
131
|
-
export declare function parseFractionalPrecision(jsonObjPrecision: number, formatName: string): FractionalPrecision;
|
|
132
|
-
/** @beta validates the input value, that is typically extracted for persisted JSON data, is a valid DecimalPrecision or FractionalPrecision. */
|
|
133
|
-
export declare function parsePrecision(precision: number, type: FormatType, formatName: string): DecimalPrecision | FractionalPrecision;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Quantity
|
|
3
|
+
*/
|
|
4
|
+
/** The regular expression to parse [format strings]($docs/bis/ec/kindofquantity.md#format-string)
|
|
5
|
+
* provided in serialized formats as well as the full name of an [[OverrideFormat]].
|
|
6
|
+
*
|
|
7
|
+
* `formatName(precision)[unitName|unitLabel][unitName|unitLabel][unitName|unitLabel][unitName|unitLabel]`
|
|
8
|
+
*
|
|
9
|
+
* Explanation of the regex:
|
|
10
|
+
* - ([\w.:]+)
|
|
11
|
+
* - Grabs the format full name
|
|
12
|
+
* - (\(([^\)]+)\))?
|
|
13
|
+
* - Grabs the precision part with and without the `()`.
|
|
14
|
+
* - The parentheses are needed to validate the entire string. (TODO: Need to check if this is true)
|
|
15
|
+
* - (\[([^\|\]]+)([\|])?([^\]]+)?\])?
|
|
16
|
+
* - 4 of these make up the rest of the regex, none of them are required so each end in `?`
|
|
17
|
+
* - Grabs the unit name and label including the `[]`
|
|
18
|
+
* - Grabs the unit name, `|` and label separately
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const formatStringRgx: RegExp;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export declare function getItemNamesFromFormatString(formatString: string): Iterable<string>;
|
|
24
|
+
/** @beta */
|
|
25
|
+
export declare enum FormatTraits {
|
|
26
|
+
Uninitialized = 0,
|
|
27
|
+
/** Show trailing zeroes to requested precision. */
|
|
28
|
+
TrailZeroes = 1,
|
|
29
|
+
/** Indicates that the fractional part of the number is required when the fraction is zero */
|
|
30
|
+
KeepSingleZero = 2,
|
|
31
|
+
/** Zero magnitude returns blank display value */
|
|
32
|
+
ZeroEmpty = 4,
|
|
33
|
+
/** Show decimal point when value to right of decimal is empty */
|
|
34
|
+
KeepDecimalPoint = 8,
|
|
35
|
+
/** Use the rounding factor. Not yet supported */
|
|
36
|
+
ApplyRounding = 16,
|
|
37
|
+
/** Show a dash between whole value and fractional value */
|
|
38
|
+
FractionDash = 32,
|
|
39
|
+
/** Append the quantity's unit label */
|
|
40
|
+
ShowUnitLabel = 64,
|
|
41
|
+
/** Prepend unit label. Not yet supported */
|
|
42
|
+
PrependUnitLabel = 128,
|
|
43
|
+
/** show a grouping in each group of 1000. */
|
|
44
|
+
Use1000Separator = 256,
|
|
45
|
+
/** Indicates that if an exponent value is positive to not include a `+`. By default a sign, `+` or `-`, is always shown. Not yet supported */
|
|
46
|
+
ExponentOnlyNegative = 512
|
|
47
|
+
}
|
|
48
|
+
/** Precision for Fractional formatted value types. Range from Whole (1/1) through 1/256.
|
|
49
|
+
* @beta */
|
|
50
|
+
export declare enum FractionalPrecision {
|
|
51
|
+
One = 1,
|
|
52
|
+
Two = 2,
|
|
53
|
+
Four = 4,
|
|
54
|
+
Eight = 8,
|
|
55
|
+
Sixteen = 16,
|
|
56
|
+
ThirtyTwo = 32,
|
|
57
|
+
SixtyFour = 64,
|
|
58
|
+
OneHundredTwentyEight = 128,
|
|
59
|
+
TwoHundredFiftySix = 256
|
|
60
|
+
}
|
|
61
|
+
/** Precision for Decimal, Scientific, and Station formatted value types. Range from 1/(10^0) through 1/(10^12).
|
|
62
|
+
* @beta */
|
|
63
|
+
export declare enum DecimalPrecision {
|
|
64
|
+
Zero = 0,
|
|
65
|
+
One = 1,
|
|
66
|
+
Two = 2,
|
|
67
|
+
Three = 3,
|
|
68
|
+
Four = 4,
|
|
69
|
+
Five = 5,
|
|
70
|
+
Six = 6,
|
|
71
|
+
Seven = 7,
|
|
72
|
+
Eight = 8,
|
|
73
|
+
Nine = 9,
|
|
74
|
+
Ten = 10,
|
|
75
|
+
Eleven = 11,
|
|
76
|
+
Twelve = 12
|
|
77
|
+
}
|
|
78
|
+
/** Supported format types
|
|
79
|
+
* @beta */
|
|
80
|
+
export declare enum FormatType {
|
|
81
|
+
/** Decimal display (ie 2.125) */
|
|
82
|
+
Decimal = 0,
|
|
83
|
+
/** Fractional display (ie 2-1/8) */
|
|
84
|
+
Fractional = 1,
|
|
85
|
+
/** Scientific Notation (ie 1.04e3) */
|
|
86
|
+
Scientific = 2,
|
|
87
|
+
/** Civil Engineering Stationing (ie 1+00). */
|
|
88
|
+
Station = 3
|
|
89
|
+
}
|
|
90
|
+
/** required if type is scientific
|
|
91
|
+
* @beta */
|
|
92
|
+
export declare enum ScientificType {
|
|
93
|
+
/** Non-zero value left of decimal point (ie 1.2345e3) */
|
|
94
|
+
Normalized = 0,
|
|
95
|
+
/** Zero value left of decimal point (ie 0.12345e4) */
|
|
96
|
+
ZeroNormalized = 1
|
|
97
|
+
}
|
|
98
|
+
/** Determines how the sign of values are displayed
|
|
99
|
+
* @beta */
|
|
100
|
+
export declare enum ShowSignOption {
|
|
101
|
+
/** Never show a sign even if the value is negative. */
|
|
102
|
+
NoSign = 0,
|
|
103
|
+
/** Only show a sign when the value is negative. */
|
|
104
|
+
OnlyNegative = 1,
|
|
105
|
+
/** Always show a sign whether the value is positive or negative. */
|
|
106
|
+
SignAlways = 2,
|
|
107
|
+
/** Only show a sign when the value is negative but use parentheses instead of a negative sign. For example, -10 is formatted as `(10)`. */
|
|
108
|
+
NegativeParentheses = 3
|
|
109
|
+
}
|
|
110
|
+
/** @beta */
|
|
111
|
+
export declare function parseScientificType(scientificType: string, formatName: string): ScientificType;
|
|
112
|
+
/** @beta */
|
|
113
|
+
export declare function scientificTypeToString(scientificType: ScientificType): string;
|
|
114
|
+
/** @beta */
|
|
115
|
+
export declare function parseShowSignOption(showSignOption: string, formatName: string): ShowSignOption;
|
|
116
|
+
/** @beta */
|
|
117
|
+
export declare function showSignOptionToString(showSign: ShowSignOption): string;
|
|
118
|
+
/** @beta */
|
|
119
|
+
export declare function parseFormatTrait(formatTraitsString: string, formatName: string): FormatTraits;
|
|
120
|
+
/** @beta */
|
|
121
|
+
export declare function getTraitString(trait: FormatTraits): "trailZeroes" | "keepSingleZero" | "zeroEmpty" | "keepDecimalPoint" | "applyRounding" | "fractionDash" | "showUnitLabel" | "prependUnitLabel" | "use1000Separator" | "exponentOnlyNegative";
|
|
122
|
+
/** @beta */
|
|
123
|
+
export declare function formatTraitsToArray(currentFormatTrait: FormatTraits): string[];
|
|
124
|
+
/** @beta */
|
|
125
|
+
export declare function parseFormatType(jsonObjType: string, formatName: string): FormatType;
|
|
126
|
+
/** @beta */
|
|
127
|
+
export declare function formatTypeToString(type: FormatType): string;
|
|
128
|
+
/** @beta */
|
|
129
|
+
export declare function parseDecimalPrecision(jsonObjPrecision: number, formatName: string): DecimalPrecision;
|
|
130
|
+
/** @beta validates the input value, that is typically extracted for persisted JSON data, is a valid FractionalPrecision */
|
|
131
|
+
export declare function parseFractionalPrecision(jsonObjPrecision: number, formatName: string): FractionalPrecision;
|
|
132
|
+
/** @beta validates the input value, that is typically extracted for persisted JSON data, is a valid DecimalPrecision or FractionalPrecision. */
|
|
133
|
+
export declare function parsePrecision(precision: number, type: FormatType, formatName: string): DecimalPrecision | FractionalPrecision;
|
|
134
134
|
//# sourceMappingURL=FormatEnums.d.ts.map
|