@tiqian/protocol 0.0.0-stage → 0.1.0-alpha.9
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/dist/haxe/crypto/Sha256.d.ts +19 -0
- package/dist/haxe/crypto/Sha256.js +194 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
- package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
- package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
- package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
- package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
- package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
- package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
- package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
- package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
- package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
- package/dist/org/tiqian/clreq/GlueSide.js +17 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
- package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
- package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
- package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
- package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
- package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
- package/dist/org/tiqian/core/Cluster.d.ts +13 -0
- package/dist/org/tiqian/core/Cluster.js +24 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
- package/dist/org/tiqian/core/Ic.d.ts +7 -0
- package/dist/org/tiqian/core/Ic.js +17 -0
- package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
- package/dist/org/tiqian/core/IllegalStateException.js +8 -0
- package/dist/org/tiqian/core/IntRange.d.ts +12 -0
- package/dist/org/tiqian/core/IntRange.js +30 -0
- package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
- package/dist/org/tiqian/core/LineEndReason.js +17 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
- package/dist/org/tiqian/core/TextRange.d.ts +11 -0
- package/dist/org/tiqian/core/TextRange.js +40 -0
- package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
- package/dist/org/tiqian/core/TextRangeError.js +2 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
- package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
- package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
- package/dist/org/tiqian/font/FontRole.d.ts +28 -0
- package/dist/org/tiqian/font/FontRole.js +26 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +124 -0
- package/dist/org/tiqian/layout/LineOptimization.js +298 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/protocol/Canonical.d.ts +55 -0
- package/dist/org/tiqian/protocol/Canonical.js +471 -0
- package/dist/org/tiqian/protocol/DecorationInput.d.ts +6 -0
- package/dist/org/tiqian/protocol/DecorationInput.js +12 -0
- package/dist/org/tiqian/protocol/EncodeResult.d.ts +9 -0
- package/dist/org/tiqian/protocol/EncodeResult.js +2 -0
- package/dist/org/tiqian/protocol/FaceInfo.d.ts +13 -0
- package/dist/org/tiqian/protocol/FaceInfo.js +2 -0
- package/dist/org/tiqian/protocol/FontContract.d.ts +25 -0
- package/dist/org/tiqian/protocol/FontContract.js +317 -0
- package/dist/org/tiqian/protocol/FontFaceRecord.d.ts +6 -0
- package/dist/org/tiqian/protocol/FontFaceRecord.js +2 -0
- package/dist/org/tiqian/protocol/FontFaceSpec.d.ts +11 -0
- package/dist/org/tiqian/protocol/FontFaceSpec.js +2 -0
- package/dist/org/tiqian/protocol/FontWeightSpec.d.ts +10 -0
- package/dist/org/tiqian/protocol/FontWeightSpec.js +2 -0
- package/dist/org/tiqian/protocol/InlineBoxInput.d.ts +7 -0
- package/dist/org/tiqian/protocol/InlineBoxInput.js +2 -0
- package/dist/org/tiqian/protocol/InlineObjectInput.d.ts +7 -0
- package/dist/org/tiqian/protocol/InlineObjectInput.js +2 -0
- package/dist/org/tiqian/protocol/JsCoerce.d.ts +19 -0
- package/dist/org/tiqian/protocol/JsCoerce.js +394 -0
- package/dist/org/tiqian/protocol/LayoutAttribute.d.ts +5 -0
- package/dist/org/tiqian/protocol/LayoutAttribute.js +10 -0
- package/dist/org/tiqian/protocol/LayoutFloatShape.d.ts +14 -0
- package/dist/org/tiqian/protocol/LayoutFloatShape.js +2 -0
- package/dist/org/tiqian/protocol/LayoutTree.d.ts +23 -0
- package/dist/org/tiqian/protocol/LayoutTree.js +2 -0
- package/dist/org/tiqian/protocol/LayoutVertex.d.ts +4 -0
- package/dist/org/tiqian/protocol/LayoutVertex.js +2 -0
- package/dist/org/tiqian/protocol/LineBreakSpanInput.d.ts +6 -0
- package/dist/org/tiqian/protocol/LineBreakSpanInput.js +12 -0
- package/dist/org/tiqian/protocol/MetricEntry.d.ts +11 -0
- package/dist/org/tiqian/protocol/MetricEntry.js +21 -0
- package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
- package/dist/org/tiqian/protocol/NamedError.js +71 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
- package/dist/org/tiqian/protocol/ParagraphRequest.d.ts +25 -0
- package/dist/org/tiqian/protocol/ParagraphRequest.js +2 -0
- package/dist/org/tiqian/protocol/ParagraphRequestChecks.d.ts +8 -0
- package/dist/org/tiqian/protocol/ParagraphRequestChecks.js +145 -0
- package/dist/org/tiqian/protocol/ParagraphRequestException.d.ts +6 -0
- package/dist/org/tiqian/protocol/ParagraphRequestException.js +55 -0
- package/dist/org/tiqian/protocol/ParagraphRequestFields.d.ts +3 -0
- package/dist/org/tiqian/protocol/ParagraphRequestFields.js +4 -0
- package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
- package/dist/org/tiqian/protocol/Plan.js +10 -0
- package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
- package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
- package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
- package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
- package/dist/org/tiqian/protocol/Revision.d.ts +11 -0
- package/dist/org/tiqian/protocol/Revision.js +12 -0
- package/dist/org/tiqian/protocol/SessionFaceSpec.d.ts +5 -0
- package/dist/org/tiqian/protocol/SessionFaceSpec.js +2 -0
- package/dist/org/tiqian/protocol/SnapshotTableBinary.d.ts +55 -0
- package/dist/org/tiqian/protocol/SnapshotTableBinary.js +657 -0
- package/dist/org/tiqian/protocol/SnapshotTypography.d.ts +14 -0
- package/dist/org/tiqian/protocol/SnapshotTypography.js +2 -0
- package/dist/org/tiqian/protocol/StyleRow.d.ts +8 -0
- package/dist/org/tiqian/protocol/StyleRow.js +15 -0
- package/dist/org/tiqian/protocol/TableData.d.ts +25 -0
- package/dist/org/tiqian/protocol/TableData.js +45 -0
- package/dist/org/tiqian/protocol/TableInput.d.ts +13 -0
- package/dist/org/tiqian/protocol/TableInput.js +21 -0
- package/dist/org/tiqian/protocol/TableMetricRow.d.ts +9 -0
- package/dist/org/tiqian/protocol/TableMetricRow.js +17 -0
- package/dist/org/tiqian/protocol/TableProbe.d.ts +11 -0
- package/dist/org/tiqian/protocol/TableProbe.js +21 -0
- package/dist/org/tiqian/protocol/TextSpanInput.d.ts +9 -0
- package/dist/org/tiqian/protocol/TextSpanInput.js +2 -0
- package/dist/org/tiqian/protocol/ValueRow.d.ts +4 -0
- package/dist/org/tiqian/protocol/ValueRow.js +7 -0
- package/dist/org/tiqian/protocol/WireField.d.ts +5 -0
- package/dist/org/tiqian/protocol/WireField.js +2 -0
- package/dist/org/tiqian/protocol/WireValue.d.ts +25 -0
- package/dist/org/tiqian/protocol/WireValue.js +2 -0
- package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
- package/dist/org/tiqian/test/TestHelpers.js +27 -0
- package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
- package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceField.js +10 -0
- package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
- package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
- package/dist/runtime.d.ts +96 -0
- package/dist/runtime.js +1612 -0
- package/dist/std/FsError.d.ts +48 -0
- package/dist/std/FsError.js +2 -0
- package/dist/std/FsException.d.ts +6 -0
- package/dist/std/FsException.js +45 -0
- package/dist/std/UStringException.d.ts +6 -0
- package/dist/std/UStringException.js +21 -0
- package/dist/std/UStringFault.d.ts +9 -0
- package/dist/std/UStringFault.js +2 -0
- package/package.json +26 -4
- package/README.md +0 -3
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { formatFloatRuntime, readUnit } from "../../../runtime.js";
|
|
3
|
+
export class JsCoerce {
|
|
4
|
+
static toNumber(value) {
|
|
5
|
+
switch (value.kind) {
|
|
6
|
+
case "WNull":
|
|
7
|
+
return 0.0;
|
|
8
|
+
case "WBool":
|
|
9
|
+
{
|
|
10
|
+
return (value.value ? 1.0 : 0.0);
|
|
11
|
+
}
|
|
12
|
+
case "WNum":
|
|
13
|
+
{
|
|
14
|
+
return value.value;
|
|
15
|
+
}
|
|
16
|
+
case "WStr":
|
|
17
|
+
{
|
|
18
|
+
return JsCoerce.toNumberFromString(value.value);
|
|
19
|
+
}
|
|
20
|
+
case "WArr":
|
|
21
|
+
return JsCoerce.toNumberFromString(JsCoerce.toString(value));
|
|
22
|
+
case "WObj":
|
|
23
|
+
return JsCoerce.toNumberFromString(JsCoerce.toString(value));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
static toString(value) {
|
|
27
|
+
switch (value.kind) {
|
|
28
|
+
case "WNull":
|
|
29
|
+
return "null";
|
|
30
|
+
case "WBool":
|
|
31
|
+
{
|
|
32
|
+
return (value.value ? "true" : "false");
|
|
33
|
+
}
|
|
34
|
+
case "WNum":
|
|
35
|
+
{
|
|
36
|
+
return JsCoerce.numberToString(value.value);
|
|
37
|
+
}
|
|
38
|
+
case "WStr":
|
|
39
|
+
{
|
|
40
|
+
return value.value;
|
|
41
|
+
}
|
|
42
|
+
case "WArr":
|
|
43
|
+
{
|
|
44
|
+
return JsCoerce.joinItems(value.items);
|
|
45
|
+
}
|
|
46
|
+
case "WObj":
|
|
47
|
+
return "[object Object]";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
static joinItems(items) {
|
|
51
|
+
const parts = new Array();
|
|
52
|
+
let itemIndexIdx = 0;
|
|
53
|
+
while (itemIndexIdx < items.length) {
|
|
54
|
+
const item = items[itemIndexIdx];
|
|
55
|
+
parts.push(JsCoerce.itemText(item));
|
|
56
|
+
itemIndexIdx++;
|
|
57
|
+
}
|
|
58
|
+
return parts.join(",");
|
|
59
|
+
}
|
|
60
|
+
static itemText(item) {
|
|
61
|
+
switch (item.kind) {
|
|
62
|
+
case "WNull":
|
|
63
|
+
return "";
|
|
64
|
+
case "WBool":
|
|
65
|
+
return JsCoerce.toString(item);
|
|
66
|
+
case "WNum":
|
|
67
|
+
return JsCoerce.toString(item);
|
|
68
|
+
case "WStr":
|
|
69
|
+
return JsCoerce.toString(item);
|
|
70
|
+
case "WArr":
|
|
71
|
+
return JsCoerce.toString(item);
|
|
72
|
+
case "WObj":
|
|
73
|
+
return JsCoerce.toString(item);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
static numberToString(value) {
|
|
77
|
+
if (Number.isNaN(value)) {
|
|
78
|
+
return "NaN";
|
|
79
|
+
}
|
|
80
|
+
if (value === Infinity) {
|
|
81
|
+
return "Infinity";
|
|
82
|
+
}
|
|
83
|
+
if (value === -Infinity) {
|
|
84
|
+
return "-Infinity";
|
|
85
|
+
}
|
|
86
|
+
if (value === 0.0) {
|
|
87
|
+
return "0";
|
|
88
|
+
}
|
|
89
|
+
if (value === Math.floor(value) && Math.abs(value) < 1e21) {
|
|
90
|
+
let rest = Math.abs(value);
|
|
91
|
+
let digits = "";
|
|
92
|
+
while (rest >= 10) {
|
|
93
|
+
const digit = Math.floor(rest % 10);
|
|
94
|
+
digits = String.fromCodePoint(48 + digit) + digits;
|
|
95
|
+
rest = Math.floor(rest / 10);
|
|
96
|
+
}
|
|
97
|
+
digits = String.fromCodePoint(48 + Math.floor(rest)) + digits;
|
|
98
|
+
return (value < 0 ? `-${digits}` : digits);
|
|
99
|
+
}
|
|
100
|
+
return formatFloatRuntime(value);
|
|
101
|
+
}
|
|
102
|
+
static toNumberFromString(text) {
|
|
103
|
+
const trimmed = JsCoerce.jsTrim(text);
|
|
104
|
+
if (trimmed.length === 0) {
|
|
105
|
+
return 0.0;
|
|
106
|
+
}
|
|
107
|
+
let negative = false;
|
|
108
|
+
let body = trimmed;
|
|
109
|
+
const first = body.charAt(0);
|
|
110
|
+
if (first === "-") {
|
|
111
|
+
negative = true;
|
|
112
|
+
body = body.substr(1);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
if (first === "+") {
|
|
116
|
+
body = body.substr(1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (body === "Infinity") {
|
|
120
|
+
return (negative ? -Infinity : Infinity);
|
|
121
|
+
}
|
|
122
|
+
if (body === "NaN") {
|
|
123
|
+
return Number.NaN;
|
|
124
|
+
}
|
|
125
|
+
const radix = JsCoerce.radixPrefix(body);
|
|
126
|
+
if (radix > 0) {
|
|
127
|
+
const digits = body.substr(2);
|
|
128
|
+
let value = 0.0;
|
|
129
|
+
let indexIdx = 0;
|
|
130
|
+
while (indexIdx < digits.length) {
|
|
131
|
+
const digit = JsCoerce.hexDigit((Number.isNaN(digits.charCodeAt(indexIdx)) ? null : digits.charCodeAt(indexIdx)));
|
|
132
|
+
if (digit < 0) {
|
|
133
|
+
return Number.NaN;
|
|
134
|
+
}
|
|
135
|
+
value = value * radix + digit;
|
|
136
|
+
indexIdx++;
|
|
137
|
+
}
|
|
138
|
+
return (negative ? -value : value);
|
|
139
|
+
}
|
|
140
|
+
if (!JsCoerce.isStrictDecimal(body)) {
|
|
141
|
+
return Number.NaN;
|
|
142
|
+
}
|
|
143
|
+
const parsed = ((s) => { let a = 0, z = s.length; while (a < z) {
|
|
144
|
+
const c = s.charCodeAt(a);
|
|
145
|
+
if (c === 32 || (c >= 9 && c <= 13)) {
|
|
146
|
+
a++;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
} while (z > a) {
|
|
152
|
+
const c = s.charCodeAt(z - 1);
|
|
153
|
+
if (c === 32 || (c >= 9 && c <= 13)) {
|
|
154
|
+
z--;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
} let i = a; const c0 = s.charCodeAt(i); if (c0 === 43 || c0 === 45) {
|
|
160
|
+
i++;
|
|
161
|
+
} let before = 0; while (i < z) {
|
|
162
|
+
const c = s.charCodeAt(i);
|
|
163
|
+
if (c >= 48 && c <= 57) {
|
|
164
|
+
i++;
|
|
165
|
+
before++;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
} let after = 0; if (i < z && s.charCodeAt(i) === 46) {
|
|
171
|
+
i++;
|
|
172
|
+
while (i < z) {
|
|
173
|
+
const c = s.charCodeAt(i);
|
|
174
|
+
if (c >= 48 && c <= 57) {
|
|
175
|
+
i++;
|
|
176
|
+
after++;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
} let ok = before > 0 || after > 0; if (ok && i < z) {
|
|
183
|
+
const e = s.charCodeAt(i);
|
|
184
|
+
if (e === 101 || e === 69) {
|
|
185
|
+
i++;
|
|
186
|
+
const c1 = s.charCodeAt(i);
|
|
187
|
+
if (c1 === 43 || c1 === 45) {
|
|
188
|
+
i++;
|
|
189
|
+
}
|
|
190
|
+
let m = 0;
|
|
191
|
+
while (i < z) {
|
|
192
|
+
const c = s.charCodeAt(i);
|
|
193
|
+
if (c >= 48 && c <= 57) {
|
|
194
|
+
i++;
|
|
195
|
+
m++;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
ok = m > 0;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
ok = false;
|
|
205
|
+
}
|
|
206
|
+
} return ok && i === z ? Number.parseFloat(s.substring(a, z)) : Number.NaN; })(body);
|
|
207
|
+
return (negative ? -parsed : parsed);
|
|
208
|
+
}
|
|
209
|
+
static radixPrefix(body) {
|
|
210
|
+
if (body.length < 3) {
|
|
211
|
+
return 0;
|
|
212
|
+
}
|
|
213
|
+
const marker = body.substr(0, 2);
|
|
214
|
+
if (marker === "0x" || marker === "0X") {
|
|
215
|
+
return 16;
|
|
216
|
+
}
|
|
217
|
+
if (marker === "0o" || marker === "0O") {
|
|
218
|
+
return 8;
|
|
219
|
+
}
|
|
220
|
+
if (marker === "0b" || marker === "0B") {
|
|
221
|
+
return 2;
|
|
222
|
+
}
|
|
223
|
+
return 0;
|
|
224
|
+
}
|
|
225
|
+
static hexDigit(code) {
|
|
226
|
+
if (code >= 48 && code <= 57) {
|
|
227
|
+
return code - 48;
|
|
228
|
+
}
|
|
229
|
+
if (code >= 65 && code <= 70) {
|
|
230
|
+
return code - 55;
|
|
231
|
+
}
|
|
232
|
+
if (code >= 97 && code <= 102) {
|
|
233
|
+
return code - 87;
|
|
234
|
+
}
|
|
235
|
+
return -1;
|
|
236
|
+
}
|
|
237
|
+
static isStrictDecimal(body) {
|
|
238
|
+
let index = 0;
|
|
239
|
+
let seenDigit = false;
|
|
240
|
+
while (index < body.length && JsCoerce.isDecimalDigit((Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)))) {
|
|
241
|
+
index++;
|
|
242
|
+
seenDigit = true;
|
|
243
|
+
}
|
|
244
|
+
if (index < body.length && (Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)) === 46) {
|
|
245
|
+
index++;
|
|
246
|
+
while (index < body.length && JsCoerce.isDecimalDigit((Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)))) {
|
|
247
|
+
index++;
|
|
248
|
+
seenDigit = true;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (!seenDigit) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
if (index < body.length && ((Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)) === 101 || (Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)) === 69)) {
|
|
255
|
+
index++;
|
|
256
|
+
if (index < body.length && ((Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)) === 43 || (Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)) === 45)) {
|
|
257
|
+
index++;
|
|
258
|
+
}
|
|
259
|
+
let exponentDigits = false;
|
|
260
|
+
while (index < body.length && JsCoerce.isDecimalDigit((Number.isNaN(body.charCodeAt(index)) ? null : body.charCodeAt(index)))) {
|
|
261
|
+
index++;
|
|
262
|
+
exponentDigits = true;
|
|
263
|
+
}
|
|
264
|
+
if (!exponentDigits) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return index === body.length;
|
|
269
|
+
}
|
|
270
|
+
static isDecimalDigit(code) {
|
|
271
|
+
return code >= 48 && code <= 57;
|
|
272
|
+
}
|
|
273
|
+
static jsTrim(text) {
|
|
274
|
+
let start = 0;
|
|
275
|
+
let end = text.length;
|
|
276
|
+
while (start < end && JsCoerce.isJsWhitespace((Number.isNaN(text.charCodeAt(start)) ? null : text.charCodeAt(start)))) {
|
|
277
|
+
start++;
|
|
278
|
+
}
|
|
279
|
+
while (end > start && JsCoerce.isJsWhitespace(readUnit(text, end - 1))) {
|
|
280
|
+
end--;
|
|
281
|
+
}
|
|
282
|
+
return (start === 0 && end === text.length ? text : text.substr(start, end - start));
|
|
283
|
+
}
|
|
284
|
+
static isJsWhitespace(code) {
|
|
285
|
+
return code === 32 || code === 9 || code === 10 || code === 13 || code === 12 || code === 11 || code === 160;
|
|
286
|
+
}
|
|
287
|
+
static renderJson(value) {
|
|
288
|
+
switch (value.kind) {
|
|
289
|
+
case "WNull":
|
|
290
|
+
return "null";
|
|
291
|
+
case "WBool":
|
|
292
|
+
{
|
|
293
|
+
return (value.value ? "true" : "false");
|
|
294
|
+
}
|
|
295
|
+
case "WNum":
|
|
296
|
+
{
|
|
297
|
+
return JsCoerce.numberToString(value.value);
|
|
298
|
+
}
|
|
299
|
+
case "WStr":
|
|
300
|
+
{
|
|
301
|
+
return JsCoerce.quoteJson(value.value);
|
|
302
|
+
}
|
|
303
|
+
case "WArr":
|
|
304
|
+
{
|
|
305
|
+
return JsCoerce.renderArray(value.items);
|
|
306
|
+
}
|
|
307
|
+
case "WObj":
|
|
308
|
+
{
|
|
309
|
+
return JsCoerce.renderObject(value.fields);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
static renderArray(items) {
|
|
314
|
+
const parts = new Array();
|
|
315
|
+
let itemIndexIdx = 0;
|
|
316
|
+
while (itemIndexIdx < items.length) {
|
|
317
|
+
const item = items[itemIndexIdx];
|
|
318
|
+
parts.push(JsCoerce.renderJson(item));
|
|
319
|
+
itemIndexIdx++;
|
|
320
|
+
}
|
|
321
|
+
return `[${parts.join(",")}]`;
|
|
322
|
+
}
|
|
323
|
+
static renderObject(fields) {
|
|
324
|
+
const parts = new Array();
|
|
325
|
+
let fieldIndexIdx = 0;
|
|
326
|
+
while (fieldIndexIdx < fields.length) {
|
|
327
|
+
const field = fields[fieldIndexIdx];
|
|
328
|
+
parts.push(JsCoerce.quoteJson(field.name) + ":" + JsCoerce.renderJson(field.value));
|
|
329
|
+
fieldIndexIdx++;
|
|
330
|
+
}
|
|
331
|
+
return `{${parts.join(",")}}`;
|
|
332
|
+
}
|
|
333
|
+
static quoteJson(text) {
|
|
334
|
+
let out_b = "";
|
|
335
|
+
out_b += "\"";
|
|
336
|
+
let indexIdx = 0;
|
|
337
|
+
while (indexIdx < text.length) {
|
|
338
|
+
const code = (Number.isNaN(text.charCodeAt(indexIdx)) ? null : text.charCodeAt(indexIdx));
|
|
339
|
+
if (code === 34) {
|
|
340
|
+
out_b += "\\\"";
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
if (code === 92) {
|
|
344
|
+
out_b += "\\\\";
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
if (code === 8) {
|
|
348
|
+
out_b += "\\b";
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
if (code === 12) {
|
|
352
|
+
out_b += "\\f";
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
if (code === 10) {
|
|
356
|
+
out_b += "\\n";
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
if (code === 13) {
|
|
360
|
+
out_b += "\\r";
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
if (code === 9) {
|
|
364
|
+
out_b += "\\t";
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
if (code < 32) {
|
|
368
|
+
out_b += "\\u00";
|
|
369
|
+
{
|
|
370
|
+
const x = "0123456789abcdef".charAt((code >> 4) & 15);
|
|
371
|
+
out_b += x;
|
|
372
|
+
}
|
|
373
|
+
{
|
|
374
|
+
const x2 = "0123456789abcdef".charAt(code & 15);
|
|
375
|
+
out_b += x2;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
const c = code;
|
|
380
|
+
out_b += String.fromCodePoint(c);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
indexIdx++;
|
|
390
|
+
}
|
|
391
|
+
out_b += "\"";
|
|
392
|
+
return out_b;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export function compareLayoutAttribute(a, b) {
|
|
3
|
+
if (a === b)
|
|
4
|
+
return 0;
|
|
5
|
+
if (a.name !== b.name)
|
|
6
|
+
return a.name < b.name ? -1 : 1;
|
|
7
|
+
if (a.value !== b.value)
|
|
8
|
+
return a.value < b.value ? -1 : 1;
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type LayoutVertex } from "./LayoutVertex.js";
|
|
2
|
+
export interface Circle {
|
|
3
|
+
readonly kind: "Circle";
|
|
4
|
+
readonly radius: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Square {
|
|
7
|
+
readonly kind: "Square";
|
|
8
|
+
readonly side: number;
|
|
9
|
+
}
|
|
10
|
+
export interface Polygon {
|
|
11
|
+
readonly kind: "Polygon";
|
|
12
|
+
readonly vertices: LayoutVertex[];
|
|
13
|
+
}
|
|
14
|
+
export type LayoutFloatShape = Circle | Square | Polygon;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type LayoutAttribute } from "./LayoutAttribute.js";
|
|
2
|
+
import { type LayoutFloatShape } from "./LayoutFloatShape.js";
|
|
3
|
+
export interface Block {
|
|
4
|
+
readonly kind: "Block";
|
|
5
|
+
readonly children: LayoutTree[];
|
|
6
|
+
}
|
|
7
|
+
export interface Inline {
|
|
8
|
+
readonly kind: "Inline";
|
|
9
|
+
readonly tagName: string | null;
|
|
10
|
+
readonly attributes: LayoutAttribute[];
|
|
11
|
+
readonly continueAdjacent: boolean;
|
|
12
|
+
readonly wordBreakable: boolean;
|
|
13
|
+
readonly lineBreakable: boolean;
|
|
14
|
+
readonly text: string;
|
|
15
|
+
readonly children: LayoutTree[];
|
|
16
|
+
}
|
|
17
|
+
export interface Float {
|
|
18
|
+
readonly kind: "Float";
|
|
19
|
+
readonly x: number;
|
|
20
|
+
readonly y: number;
|
|
21
|
+
readonly shape: LayoutFloatShape;
|
|
22
|
+
}
|
|
23
|
+
export type LayoutTree = Block | Inline | Float;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export function compareLineBreakSpanInput(a, b) {
|
|
3
|
+
if (a === b)
|
|
4
|
+
return 0;
|
|
5
|
+
if (a.start !== b.start)
|
|
6
|
+
return a.start - b.start;
|
|
7
|
+
if (a.end !== b.end)
|
|
8
|
+
return a.end - b.end;
|
|
9
|
+
if (a.policy !== b.policy)
|
|
10
|
+
return a.policy < b.policy ? -1 : 1;
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class MetricEntry {
|
|
2
|
+
familiesRef: number;
|
|
3
|
+
weight: number;
|
|
4
|
+
italic: number;
|
|
5
|
+
roleRef: number;
|
|
6
|
+
faceSelectionRef: number;
|
|
7
|
+
valuePoolRef: number;
|
|
8
|
+
valuesEm: (number | null)[];
|
|
9
|
+
stored: boolean;
|
|
10
|
+
constructor(familiesRef: number, weight: number, italic: number, roleRef: number, faceSelectionRef: number, valuePoolRef: number);
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export class MetricEntry {
|
|
3
|
+
familiesRef;
|
|
4
|
+
weight;
|
|
5
|
+
italic;
|
|
6
|
+
roleRef;
|
|
7
|
+
faceSelectionRef;
|
|
8
|
+
valuePoolRef;
|
|
9
|
+
valuesEm;
|
|
10
|
+
stored;
|
|
11
|
+
constructor(familiesRef, weight, italic, roleRef, faceSelectionRef, valuePoolRef) {
|
|
12
|
+
this.familiesRef = familiesRef;
|
|
13
|
+
this.weight = weight;
|
|
14
|
+
this.italic = italic;
|
|
15
|
+
this.roleRef = roleRef;
|
|
16
|
+
this.faceSelectionRef = faceSelectionRef;
|
|
17
|
+
this.valuePoolRef = valuePoolRef;
|
|
18
|
+
this.valuesEm = [];
|
|
19
|
+
this.stored = false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface EmptyParagraph {
|
|
2
|
+
readonly kind: "EmptyParagraph";
|
|
3
|
+
}
|
|
4
|
+
export interface InvalidMaximumMeasure {
|
|
5
|
+
readonly kind: "InvalidMaximumMeasure";
|
|
6
|
+
}
|
|
7
|
+
export interface InvalidFontSize {
|
|
8
|
+
readonly kind: "InvalidFontSize";
|
|
9
|
+
}
|
|
10
|
+
export interface InvalidLineHeight {
|
|
11
|
+
readonly kind: "InvalidLineHeight";
|
|
12
|
+
}
|
|
13
|
+
export interface InvalidFirstLineIndent {
|
|
14
|
+
readonly kind: "InvalidFirstLineIndent";
|
|
15
|
+
}
|
|
16
|
+
export interface InvalidFontWeight {
|
|
17
|
+
readonly kind: "InvalidFontWeight";
|
|
18
|
+
}
|
|
19
|
+
export interface InvalidEmphasisDotGapEm {
|
|
20
|
+
readonly kind: "InvalidEmphasisDotGapEm";
|
|
21
|
+
}
|
|
22
|
+
export interface MissingExplicitFontFamilies {
|
|
23
|
+
readonly kind: "MissingExplicitFontFamilies";
|
|
24
|
+
}
|
|
25
|
+
export interface InvalidTextSpanRange {
|
|
26
|
+
readonly kind: "InvalidTextSpanRange";
|
|
27
|
+
}
|
|
28
|
+
export interface MissingTextSpanFontFamilies {
|
|
29
|
+
readonly kind: "MissingTextSpanFontFamilies";
|
|
30
|
+
}
|
|
31
|
+
export interface InvalidTextSpanFontSize {
|
|
32
|
+
readonly kind: "InvalidTextSpanFontSize";
|
|
33
|
+
}
|
|
34
|
+
export interface InvalidTextSpanFontWeight {
|
|
35
|
+
readonly kind: "InvalidTextSpanFontWeight";
|
|
36
|
+
}
|
|
37
|
+
export interface InvalidTextSpanBaselineShift {
|
|
38
|
+
readonly kind: "InvalidTextSpanBaselineShift";
|
|
39
|
+
}
|
|
40
|
+
export interface InvalidSourceBoundary {
|
|
41
|
+
readonly kind: "InvalidSourceBoundary";
|
|
42
|
+
}
|
|
43
|
+
export interface InvalidLineBreakSpanRange {
|
|
44
|
+
readonly kind: "InvalidLineBreakSpanRange";
|
|
45
|
+
}
|
|
46
|
+
export interface InvalidInlineBoxRange {
|
|
47
|
+
readonly kind: "InvalidInlineBoxRange";
|
|
48
|
+
}
|
|
49
|
+
export interface InvalidInlineBoxGeometry {
|
|
50
|
+
readonly kind: "InvalidInlineBoxGeometry";
|
|
51
|
+
}
|
|
52
|
+
export interface InvalidInlineObjectRange {
|
|
53
|
+
readonly kind: "InvalidInlineObjectRange";
|
|
54
|
+
}
|
|
55
|
+
export interface InvalidInlineObjectAdvance {
|
|
56
|
+
readonly kind: "InvalidInlineObjectAdvance";
|
|
57
|
+
}
|
|
58
|
+
export interface InvalidInlineObjectVerticalGeometry {
|
|
59
|
+
readonly kind: "InvalidInlineObjectVerticalGeometry";
|
|
60
|
+
}
|
|
61
|
+
export interface InvalidDecorationRange {
|
|
62
|
+
readonly kind: "InvalidDecorationRange";
|
|
63
|
+
}
|
|
64
|
+
export type NamedError = EmptyParagraph | InvalidMaximumMeasure | InvalidFontSize | InvalidLineHeight | InvalidFirstLineIndent | InvalidFontWeight | InvalidEmphasisDotGapEm | MissingExplicitFontFamilies | InvalidTextSpanRange | MissingTextSpanFontFamilies | InvalidTextSpanFontSize | InvalidTextSpanFontWeight | InvalidTextSpanBaselineShift | InvalidSourceBoundary | InvalidLineBreakSpanRange | InvalidInlineBoxRange | InvalidInlineBoxGeometry | InvalidInlineObjectRange | InvalidInlineObjectAdvance | InvalidInlineObjectVerticalGeometry | InvalidDecorationRange;
|
|
65
|
+
export declare const NamedError: Readonly<{
|
|
66
|
+
EmptyParagraph: Readonly<EmptyParagraph>;
|
|
67
|
+
InvalidMaximumMeasure: Readonly<InvalidMaximumMeasure>;
|
|
68
|
+
InvalidFontSize: Readonly<InvalidFontSize>;
|
|
69
|
+
InvalidLineHeight: Readonly<InvalidLineHeight>;
|
|
70
|
+
InvalidFirstLineIndent: Readonly<InvalidFirstLineIndent>;
|
|
71
|
+
InvalidFontWeight: Readonly<InvalidFontWeight>;
|
|
72
|
+
InvalidEmphasisDotGapEm: Readonly<InvalidEmphasisDotGapEm>;
|
|
73
|
+
MissingExplicitFontFamilies: Readonly<MissingExplicitFontFamilies>;
|
|
74
|
+
InvalidTextSpanRange: Readonly<InvalidTextSpanRange>;
|
|
75
|
+
MissingTextSpanFontFamilies: Readonly<MissingTextSpanFontFamilies>;
|
|
76
|
+
InvalidTextSpanFontSize: Readonly<InvalidTextSpanFontSize>;
|
|
77
|
+
InvalidTextSpanFontWeight: Readonly<InvalidTextSpanFontWeight>;
|
|
78
|
+
InvalidTextSpanBaselineShift: Readonly<InvalidTextSpanBaselineShift>;
|
|
79
|
+
InvalidSourceBoundary: Readonly<InvalidSourceBoundary>;
|
|
80
|
+
InvalidLineBreakSpanRange: Readonly<InvalidLineBreakSpanRange>;
|
|
81
|
+
InvalidInlineBoxRange: Readonly<InvalidInlineBoxRange>;
|
|
82
|
+
InvalidInlineBoxGeometry: Readonly<InvalidInlineBoxGeometry>;
|
|
83
|
+
InvalidInlineObjectRange: Readonly<InvalidInlineObjectRange>;
|
|
84
|
+
InvalidInlineObjectAdvance: Readonly<InvalidInlineObjectAdvance>;
|
|
85
|
+
InvalidInlineObjectVerticalGeometry: Readonly<InvalidInlineObjectVerticalGeometry>;
|
|
86
|
+
InvalidDecorationRange: Readonly<InvalidDecorationRange>;
|
|
87
|
+
}>;
|
|
88
|
+
export declare function compareNamedError(a: NamedError, b: NamedError): number;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const NamedError = Object.freeze({
|
|
3
|
+
EmptyParagraph: Object.freeze({ kind: "EmptyParagraph" }),
|
|
4
|
+
InvalidMaximumMeasure: Object.freeze({ kind: "InvalidMaximumMeasure" }),
|
|
5
|
+
InvalidFontSize: Object.freeze({ kind: "InvalidFontSize" }),
|
|
6
|
+
InvalidLineHeight: Object.freeze({ kind: "InvalidLineHeight" }),
|
|
7
|
+
InvalidFirstLineIndent: Object.freeze({ kind: "InvalidFirstLineIndent" }),
|
|
8
|
+
InvalidFontWeight: Object.freeze({ kind: "InvalidFontWeight" }),
|
|
9
|
+
InvalidEmphasisDotGapEm: Object.freeze({ kind: "InvalidEmphasisDotGapEm" }),
|
|
10
|
+
MissingExplicitFontFamilies: Object.freeze({ kind: "MissingExplicitFontFamilies" }),
|
|
11
|
+
InvalidTextSpanRange: Object.freeze({ kind: "InvalidTextSpanRange" }),
|
|
12
|
+
MissingTextSpanFontFamilies: Object.freeze({ kind: "MissingTextSpanFontFamilies" }),
|
|
13
|
+
InvalidTextSpanFontSize: Object.freeze({ kind: "InvalidTextSpanFontSize" }),
|
|
14
|
+
InvalidTextSpanFontWeight: Object.freeze({ kind: "InvalidTextSpanFontWeight" }),
|
|
15
|
+
InvalidTextSpanBaselineShift: Object.freeze({ kind: "InvalidTextSpanBaselineShift" }),
|
|
16
|
+
InvalidSourceBoundary: Object.freeze({ kind: "InvalidSourceBoundary" }),
|
|
17
|
+
InvalidLineBreakSpanRange: Object.freeze({ kind: "InvalidLineBreakSpanRange" }),
|
|
18
|
+
InvalidInlineBoxRange: Object.freeze({ kind: "InvalidInlineBoxRange" }),
|
|
19
|
+
InvalidInlineBoxGeometry: Object.freeze({ kind: "InvalidInlineBoxGeometry" }),
|
|
20
|
+
InvalidInlineObjectRange: Object.freeze({ kind: "InvalidInlineObjectRange" }),
|
|
21
|
+
InvalidInlineObjectAdvance: Object.freeze({ kind: "InvalidInlineObjectAdvance" }),
|
|
22
|
+
InvalidInlineObjectVerticalGeometry: Object.freeze({ kind: "InvalidInlineObjectVerticalGeometry" }),
|
|
23
|
+
InvalidDecorationRange: Object.freeze({ kind: "InvalidDecorationRange" })
|
|
24
|
+
});
|
|
25
|
+
export function compareNamedError(a, b) {
|
|
26
|
+
if (a === b)
|
|
27
|
+
return 0;
|
|
28
|
+
if (a.kind === "EmptyParagraph")
|
|
29
|
+
return 0 - (b.kind === "EmptyParagraph" ? 0 : 0);
|
|
30
|
+
if (a.kind === "InvalidMaximumMeasure")
|
|
31
|
+
return 1 - (b.kind === "InvalidMaximumMeasure" ? 1 : 0);
|
|
32
|
+
if (a.kind === "InvalidFontSize")
|
|
33
|
+
return 2 - (b.kind === "InvalidFontSize" ? 2 : 0);
|
|
34
|
+
if (a.kind === "InvalidLineHeight")
|
|
35
|
+
return 3 - (b.kind === "InvalidLineHeight" ? 3 : 0);
|
|
36
|
+
if (a.kind === "InvalidFirstLineIndent")
|
|
37
|
+
return 4 - (b.kind === "InvalidFirstLineIndent" ? 4 : 0);
|
|
38
|
+
if (a.kind === "InvalidFontWeight")
|
|
39
|
+
return 5 - (b.kind === "InvalidFontWeight" ? 5 : 0);
|
|
40
|
+
if (a.kind === "InvalidEmphasisDotGapEm")
|
|
41
|
+
return 6 - (b.kind === "InvalidEmphasisDotGapEm" ? 6 : 0);
|
|
42
|
+
if (a.kind === "MissingExplicitFontFamilies")
|
|
43
|
+
return 7 - (b.kind === "MissingExplicitFontFamilies" ? 7 : 0);
|
|
44
|
+
if (a.kind === "InvalidTextSpanRange")
|
|
45
|
+
return 8 - (b.kind === "InvalidTextSpanRange" ? 8 : 0);
|
|
46
|
+
if (a.kind === "MissingTextSpanFontFamilies")
|
|
47
|
+
return 9 - (b.kind === "MissingTextSpanFontFamilies" ? 9 : 0);
|
|
48
|
+
if (a.kind === "InvalidTextSpanFontSize")
|
|
49
|
+
return 10 - (b.kind === "InvalidTextSpanFontSize" ? 10 : 0);
|
|
50
|
+
if (a.kind === "InvalidTextSpanFontWeight")
|
|
51
|
+
return 11 - (b.kind === "InvalidTextSpanFontWeight" ? 11 : 0);
|
|
52
|
+
if (a.kind === "InvalidTextSpanBaselineShift")
|
|
53
|
+
return 12 - (b.kind === "InvalidTextSpanBaselineShift" ? 12 : 0);
|
|
54
|
+
if (a.kind === "InvalidSourceBoundary")
|
|
55
|
+
return 13 - (b.kind === "InvalidSourceBoundary" ? 13 : 0);
|
|
56
|
+
if (a.kind === "InvalidLineBreakSpanRange")
|
|
57
|
+
return 14 - (b.kind === "InvalidLineBreakSpanRange" ? 14 : 0);
|
|
58
|
+
if (a.kind === "InvalidInlineBoxRange")
|
|
59
|
+
return 15 - (b.kind === "InvalidInlineBoxRange" ? 15 : 0);
|
|
60
|
+
if (a.kind === "InvalidInlineBoxGeometry")
|
|
61
|
+
return 16 - (b.kind === "InvalidInlineBoxGeometry" ? 16 : 0);
|
|
62
|
+
if (a.kind === "InvalidInlineObjectRange")
|
|
63
|
+
return 17 - (b.kind === "InvalidInlineObjectRange" ? 17 : 0);
|
|
64
|
+
if (a.kind === "InvalidInlineObjectAdvance")
|
|
65
|
+
return 18 - (b.kind === "InvalidInlineObjectAdvance" ? 18 : 0);
|
|
66
|
+
if (a.kind === "InvalidInlineObjectVerticalGeometry")
|
|
67
|
+
return 19 - (b.kind === "InvalidInlineObjectVerticalGeometry" ? 19 : 0);
|
|
68
|
+
if (a.kind === "InvalidDecorationRange")
|
|
69
|
+
return 20 - (b.kind === "InvalidDecorationRange" ? 20 : 0);
|
|
70
|
+
return 0;
|
|
71
|
+
}
|