@tiqian/protocol 0.0.0-stage.1 → 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.
Files changed (228) hide show
  1. package/dist/haxe/crypto/Sha256.d.ts +19 -0
  2. package/dist/haxe/crypto/Sha256.js +194 -0
  3. package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
  4. package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
  5. package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
  6. package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
  7. package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
  8. package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
  9. package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
  10. package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
  11. package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
  12. package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
  13. package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
  14. package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
  15. package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
  16. package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
  17. package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
  18. package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
  19. package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
  20. package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
  21. package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
  22. package/dist/org/tiqian/clreq/GlueSide.js +17 -0
  23. package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
  24. package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
  25. package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
  26. package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
  27. package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
  28. package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
  29. package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
  30. package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
  31. package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
  32. package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
  33. package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
  34. package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
  35. package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
  36. package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
  37. package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
  38. package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
  39. package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
  40. package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
  41. package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
  42. package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
  43. package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
  44. package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
  45. package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
  46. package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
  47. package/dist/org/tiqian/core/Cluster.d.ts +13 -0
  48. package/dist/org/tiqian/core/Cluster.js +24 -0
  49. package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
  50. package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
  51. package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
  52. package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
  53. package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
  54. package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
  55. package/dist/org/tiqian/core/Ic.d.ts +7 -0
  56. package/dist/org/tiqian/core/Ic.js +17 -0
  57. package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
  58. package/dist/org/tiqian/core/IllegalStateException.js +8 -0
  59. package/dist/org/tiqian/core/IntRange.d.ts +12 -0
  60. package/dist/org/tiqian/core/IntRange.js +30 -0
  61. package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
  62. package/dist/org/tiqian/core/LineEndReason.js +17 -0
  63. package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
  64. package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
  65. package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
  66. package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
  67. package/dist/org/tiqian/core/TextRange.d.ts +11 -0
  68. package/dist/org/tiqian/core/TextRange.js +40 -0
  69. package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
  70. package/dist/org/tiqian/core/TextRangeError.js +2 -0
  71. package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
  72. package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
  73. package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
  74. package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
  75. package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
  76. package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
  77. package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
  78. package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
  79. package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
  80. package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
  81. package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
  82. package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
  83. package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
  84. package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
  85. package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
  86. package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
  87. package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
  88. package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
  89. package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
  90. package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
  91. package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
  92. package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
  93. package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
  94. package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
  95. package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
  96. package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
  97. package/dist/org/tiqian/font/FontRole.d.ts +28 -0
  98. package/dist/org/tiqian/font/FontRole.js +26 -0
  99. package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
  100. package/dist/org/tiqian/font/FontRoleContext.js +28 -0
  101. package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
  102. package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
  103. package/dist/org/tiqian/layout/LineOptimization.d.ts +124 -0
  104. package/dist/org/tiqian/layout/LineOptimization.js +298 -0
  105. package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
  106. package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
  107. package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
  108. package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
  109. package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
  110. package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
  111. package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
  112. package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
  113. package/dist/org/tiqian/protocol/Canonical.d.ts +55 -0
  114. package/dist/org/tiqian/protocol/Canonical.js +471 -0
  115. package/dist/org/tiqian/protocol/DecorationInput.d.ts +6 -0
  116. package/dist/org/tiqian/protocol/DecorationInput.js +12 -0
  117. package/dist/org/tiqian/protocol/EncodeResult.d.ts +9 -0
  118. package/dist/org/tiqian/protocol/EncodeResult.js +2 -0
  119. package/dist/org/tiqian/protocol/FaceInfo.d.ts +13 -0
  120. package/dist/org/tiqian/protocol/FaceInfo.js +2 -0
  121. package/dist/org/tiqian/protocol/FontContract.d.ts +25 -0
  122. package/dist/org/tiqian/protocol/FontContract.js +317 -0
  123. package/dist/org/tiqian/protocol/FontFaceRecord.d.ts +6 -0
  124. package/dist/org/tiqian/protocol/FontFaceRecord.js +2 -0
  125. package/dist/org/tiqian/protocol/FontFaceSpec.d.ts +11 -0
  126. package/dist/org/tiqian/protocol/FontFaceSpec.js +2 -0
  127. package/dist/org/tiqian/protocol/FontWeightSpec.d.ts +10 -0
  128. package/dist/org/tiqian/protocol/FontWeightSpec.js +2 -0
  129. package/dist/org/tiqian/protocol/InlineBoxInput.d.ts +7 -0
  130. package/dist/org/tiqian/protocol/InlineBoxInput.js +2 -0
  131. package/dist/org/tiqian/protocol/InlineObjectInput.d.ts +7 -0
  132. package/dist/org/tiqian/protocol/InlineObjectInput.js +2 -0
  133. package/dist/org/tiqian/protocol/JsCoerce.d.ts +19 -0
  134. package/dist/org/tiqian/protocol/JsCoerce.js +394 -0
  135. package/dist/org/tiqian/protocol/LayoutAttribute.d.ts +5 -0
  136. package/dist/org/tiqian/protocol/LayoutAttribute.js +10 -0
  137. package/dist/org/tiqian/protocol/LayoutFloatShape.d.ts +14 -0
  138. package/dist/org/tiqian/protocol/LayoutFloatShape.js +2 -0
  139. package/dist/org/tiqian/protocol/LayoutTree.d.ts +23 -0
  140. package/dist/org/tiqian/protocol/LayoutTree.js +2 -0
  141. package/dist/org/tiqian/protocol/LayoutVertex.d.ts +4 -0
  142. package/dist/org/tiqian/protocol/LayoutVertex.js +2 -0
  143. package/dist/org/tiqian/protocol/LineBreakSpanInput.d.ts +6 -0
  144. package/dist/org/tiqian/protocol/LineBreakSpanInput.js +12 -0
  145. package/dist/org/tiqian/protocol/MetricEntry.d.ts +11 -0
  146. package/dist/org/tiqian/protocol/MetricEntry.js +21 -0
  147. package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
  148. package/dist/org/tiqian/protocol/NamedError.js +71 -0
  149. package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
  150. package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
  151. package/dist/org/tiqian/protocol/ParagraphRequest.d.ts +25 -0
  152. package/dist/org/tiqian/protocol/ParagraphRequest.js +2 -0
  153. package/dist/org/tiqian/protocol/ParagraphRequestChecks.d.ts +8 -0
  154. package/dist/org/tiqian/protocol/ParagraphRequestChecks.js +145 -0
  155. package/dist/org/tiqian/protocol/ParagraphRequestException.d.ts +6 -0
  156. package/dist/org/tiqian/protocol/ParagraphRequestException.js +55 -0
  157. package/dist/org/tiqian/protocol/ParagraphRequestFields.d.ts +3 -0
  158. package/dist/org/tiqian/protocol/ParagraphRequestFields.js +4 -0
  159. package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
  160. package/dist/org/tiqian/protocol/Plan.js +10 -0
  161. package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
  162. package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
  163. package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
  164. package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
  165. package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
  166. package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
  167. package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
  168. package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
  169. package/dist/org/tiqian/protocol/Revision.d.ts +11 -0
  170. package/dist/org/tiqian/protocol/Revision.js +12 -0
  171. package/dist/org/tiqian/protocol/SessionFaceSpec.d.ts +5 -0
  172. package/dist/org/tiqian/protocol/SessionFaceSpec.js +2 -0
  173. package/dist/org/tiqian/protocol/SnapshotTableBinary.d.ts +55 -0
  174. package/dist/org/tiqian/protocol/SnapshotTableBinary.js +657 -0
  175. package/dist/org/tiqian/protocol/SnapshotTypography.d.ts +14 -0
  176. package/dist/org/tiqian/protocol/SnapshotTypography.js +2 -0
  177. package/dist/org/tiqian/protocol/StyleRow.d.ts +8 -0
  178. package/dist/org/tiqian/protocol/StyleRow.js +15 -0
  179. package/dist/org/tiqian/protocol/TableData.d.ts +25 -0
  180. package/dist/org/tiqian/protocol/TableData.js +45 -0
  181. package/dist/org/tiqian/protocol/TableInput.d.ts +13 -0
  182. package/dist/org/tiqian/protocol/TableInput.js +21 -0
  183. package/dist/org/tiqian/protocol/TableMetricRow.d.ts +9 -0
  184. package/dist/org/tiqian/protocol/TableMetricRow.js +17 -0
  185. package/dist/org/tiqian/protocol/TableProbe.d.ts +11 -0
  186. package/dist/org/tiqian/protocol/TableProbe.js +21 -0
  187. package/dist/org/tiqian/protocol/TextSpanInput.d.ts +9 -0
  188. package/dist/org/tiqian/protocol/TextSpanInput.js +2 -0
  189. package/dist/org/tiqian/protocol/ValueRow.d.ts +4 -0
  190. package/dist/org/tiqian/protocol/ValueRow.js +7 -0
  191. package/dist/org/tiqian/protocol/WireField.d.ts +5 -0
  192. package/dist/org/tiqian/protocol/WireField.js +2 -0
  193. package/dist/org/tiqian/protocol/WireValue.d.ts +25 -0
  194. package/dist/org/tiqian/protocol/WireValue.js +2 -0
  195. package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
  196. package/dist/org/tiqian/test/TestHelpers.js +27 -0
  197. package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
  198. package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
  199. package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
  200. package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
  201. package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
  202. package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
  203. package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
  204. package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
  205. package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
  206. package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
  207. package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
  208. package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
  209. package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
  210. package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
  211. package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
  212. package/dist/org/tiqian/test/trace/TraceField.js +10 -0
  213. package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
  214. package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
  215. package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
  216. package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
  217. package/dist/runtime.d.ts +96 -0
  218. package/dist/runtime.js +1612 -0
  219. package/dist/std/FsError.d.ts +48 -0
  220. package/dist/std/FsError.js +2 -0
  221. package/dist/std/FsException.d.ts +6 -0
  222. package/dist/std/FsException.js +45 -0
  223. package/dist/std/UStringException.d.ts +6 -0
  224. package/dist/std/UStringException.js +21 -0
  225. package/dist/std/UStringFault.d.ts +9 -0
  226. package/dist/std/UStringFault.js +2 -0
  227. package/package.json +26 -4
  228. package/README.md +0 -3
@@ -0,0 +1,193 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { UnicodeCombiningMarkData } from "./UnicodeCombiningMarkData.js";
3
+ import { UnicodeEmojiModifierBaseData } from "./UnicodeEmojiModifierBaseData.js";
4
+ import { UnicodeExtendedPictographicData } from "./UnicodeExtendedPictographicData.js";
5
+ import { readUnit } from "../../../runtime.js";
6
+ export class SourceInteractionBoundaries {
7
+ static HIGH_SURROGATE_START = 55296;
8
+ static HIGH_SURROGATE_END = 56319;
9
+ static LOW_SURROGATE_START = 56320;
10
+ static LOW_SURROGATE_END = 57343;
11
+ static CR = 13;
12
+ static LF = 10;
13
+ static ZWNJ = 8204;
14
+ static ZWJ = 8205;
15
+ static coerceToInteractionBoundary(text, offset, range, bias) {
16
+ const start = SourceInteractionBoundaries.clamp(range.start, 0, text.length);
17
+ const end = SourceInteractionBoundaries.clamp(range.end, start, text.length);
18
+ const target = SourceInteractionBoundaries.clamp(offset, start, end);
19
+ if (target === start || target === end) {
20
+ return target;
21
+ }
22
+ const boundaries = SourceInteractionBoundaries.interactionBoundariesByOffsets(text, start, end);
23
+ let previous = start;
24
+ let next = end;
25
+ let index = 0;
26
+ while (index < boundaries.length) {
27
+ const boundary = boundaries[index];
28
+ if (boundary === target) {
29
+ return target;
30
+ }
31
+ if (boundary < target) {
32
+ previous = boundary;
33
+ }
34
+ else {
35
+ next = boundary;
36
+ break;
37
+ }
38
+ index += 1;
39
+ }
40
+ if (bias.kind === "Backward") {
41
+ return previous;
42
+ }
43
+ if (bias.kind === "Forward") {
44
+ return next;
45
+ }
46
+ return (target - previous < next - target ? previous : next);
47
+ }
48
+ static interactionBoundaries(text, range) {
49
+ const start = SourceInteractionBoundaries.clamp(range.start, 0, text.length);
50
+ const end = SourceInteractionBoundaries.clamp(range.end, start, text.length);
51
+ return SourceInteractionBoundaries.interactionBoundariesByOffsets(text, start, end);
52
+ }
53
+ static sourceGraphemeBoundaries(text, range) {
54
+ return SourceInteractionBoundaries.interactionBoundaries(text, range);
55
+ }
56
+ static codePointAtCompat(text, index, end) {
57
+ const high = (Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index));
58
+ if (high < SourceInteractionBoundaries.HIGH_SURROGATE_START || high > SourceInteractionBoundaries.HIGH_SURROGATE_END || index + 1 >= end) {
59
+ return high;
60
+ }
61
+ const low = readUnit(text, index + 1);
62
+ if (low < SourceInteractionBoundaries.LOW_SURROGATE_START || low > SourceInteractionBoundaries.LOW_SURROGATE_END) {
63
+ return high;
64
+ }
65
+ return 65536 + (high - SourceInteractionBoundaries.HIGH_SURROGATE_START << 10) + (low - SourceInteractionBoundaries.LOW_SURROGATE_START);
66
+ }
67
+ static interactionBoundariesByOffsets(text, start, end) {
68
+ const output = [start];
69
+ let index = start;
70
+ while (index < end) {
71
+ const first = SourceInteractionBoundaries.codePointAtCompat(text, index, end);
72
+ let next = index + SourceInteractionBoundaries.charCount(first);
73
+ let precedingEmojiModifierBase = UnicodeEmojiModifierBaseData.contains(first);
74
+ let precedingExtendedPictographic = UnicodeExtendedPictographicData.contains(first);
75
+ if (first === SourceInteractionBoundaries.CR && next < end && SourceInteractionBoundaries.codePointAtCompat(text, next, end) === SourceInteractionBoundaries.LF) {
76
+ next += 1;
77
+ }
78
+ else {
79
+ if (SourceInteractionBoundaries.isRegionalIndicator(first) && next < end) {
80
+ const following = SourceInteractionBoundaries.codePointAtCompat(text, next, end);
81
+ if (SourceInteractionBoundaries.isRegionalIndicator(following)) {
82
+ next += SourceInteractionBoundaries.charCount(following);
83
+ }
84
+ }
85
+ else {
86
+ if (SourceInteractionBoundaries.isHangulL(first)) {
87
+ while (next < end && SourceInteractionBoundaries.isHangulL(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
88
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
89
+ }
90
+ if (next < end && SourceInteractionBoundaries.isHangulV(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
91
+ while (next < end && SourceInteractionBoundaries.isHangulV(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
92
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
93
+ }
94
+ while (next < end && SourceInteractionBoundaries.isHangulT(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
95
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
96
+ }
97
+ }
98
+ }
99
+ else {
100
+ if (SourceInteractionBoundaries.isHangulLvOrLvt(first)) {
101
+ if (SourceInteractionBoundaries.isHangulLv(first)) {
102
+ while (next < end && SourceInteractionBoundaries.isHangulV(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
103
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
104
+ }
105
+ }
106
+ while (next < end && SourceInteractionBoundaries.isHangulT(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
107
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ next = SourceInteractionBoundaries.consumeExtenders(text, next, end);
114
+ if (precedingEmojiModifierBase && next < end && SourceInteractionBoundaries.isEmojiModifier(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
115
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
116
+ precedingEmojiModifierBase = false;
117
+ next = SourceInteractionBoundaries.consumeExtenders(text, next, end);
118
+ }
119
+ while (next < end && SourceInteractionBoundaries.codePointAtCompat(text, next, end) === SourceInteractionBoundaries.ZWJ) {
120
+ next += 1;
121
+ if (next >= end) {
122
+ break;
123
+ }
124
+ const joined = SourceInteractionBoundaries.codePointAtCompat(text, next, end);
125
+ if (!precedingExtendedPictographic || !UnicodeExtendedPictographicData.contains(joined)) {
126
+ break;
127
+ }
128
+ next += SourceInteractionBoundaries.charCount(joined);
129
+ precedingEmojiModifierBase = UnicodeEmojiModifierBaseData.contains(joined);
130
+ precedingExtendedPictographic = true;
131
+ next = SourceInteractionBoundaries.consumeExtenders(text, next, end);
132
+ if (precedingEmojiModifierBase && next < end && SourceInteractionBoundaries.isEmojiModifier(SourceInteractionBoundaries.codePointAtCompat(text, next, end))) {
133
+ next += SourceInteractionBoundaries.charCount(SourceInteractionBoundaries.codePointAtCompat(text, next, end));
134
+ precedingEmojiModifierBase = false;
135
+ next = SourceInteractionBoundaries.consumeExtenders(text, next, end);
136
+ }
137
+ }
138
+ index = next;
139
+ output.push(index);
140
+ }
141
+ return output;
142
+ }
143
+ static consumeExtenders(text, from, end) {
144
+ let index = from;
145
+ while (index < end) {
146
+ const codePoint = SourceInteractionBoundaries.codePointAtCompat(text, index, end);
147
+ if (!SourceInteractionBoundaries.isInteractionExtender(codePoint)) {
148
+ break;
149
+ }
150
+ index += SourceInteractionBoundaries.charCount(codePoint);
151
+ }
152
+ return index;
153
+ }
154
+ static isInteractionExtender(codePoint) {
155
+ return codePoint === SourceInteractionBoundaries.ZWNJ || codePoint >= 65024 && codePoint <= 65039 || codePoint >= 917760 && codePoint <= 917999 || codePoint >= 917536 && codePoint <= 917631 || SourceInteractionBoundaries.isCombiningMark(codePoint);
156
+ }
157
+ static isCombiningMark(codePoint) {
158
+ return codePoint <= 65535 && UnicodeCombiningMarkData.contains(codePoint);
159
+ }
160
+ static isEmojiModifier(codePoint) {
161
+ return codePoint >= 127995 && codePoint <= 127999;
162
+ }
163
+ static isRegionalIndicator(codePoint) {
164
+ return codePoint >= 127462 && codePoint <= 127487;
165
+ }
166
+ static isHangulL(codePoint) {
167
+ return codePoint >= 4352 && codePoint <= 4447 || codePoint >= 43360 && codePoint <= 43388;
168
+ }
169
+ static isHangulV(codePoint) {
170
+ return codePoint >= 4448 && codePoint <= 4519 || codePoint >= 55216 && codePoint <= 55238;
171
+ }
172
+ static isHangulT(codePoint) {
173
+ return codePoint >= 4520 && codePoint <= 4607 || codePoint >= 55243 && codePoint <= 55291;
174
+ }
175
+ static isHangulLvOrLvt(codePoint) {
176
+ return codePoint >= 44032 && codePoint <= 55203;
177
+ }
178
+ static isHangulLv(codePoint) {
179
+ return SourceInteractionBoundaries.isHangulLvOrLvt(codePoint) && (codePoint - 44032) % 28 === 0;
180
+ }
181
+ static charCount(codePoint) {
182
+ return (codePoint > 65535 ? 2 : 1);
183
+ }
184
+ static clamp(value, low, high) {
185
+ if (value < low) {
186
+ return low;
187
+ }
188
+ if (value > high) {
189
+ return high;
190
+ }
191
+ return value;
192
+ }
193
+ }
@@ -0,0 +1,11 @@
1
+ export declare class TextRange {
2
+ readonly start: number;
3
+ readonly end: number;
4
+ constructor(start: number, end: number);
5
+ get length(): number;
6
+ get_length(): number;
7
+ get isEmpty(): boolean;
8
+ get_isEmpty(): boolean;
9
+ toString(): string;
10
+ }
11
+ export declare function compareTextRange(a: TextRange, b: TextRange): number;
@@ -0,0 +1,40 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { TiqianIllegalArgumentException } from "./TiqianIllegalArgumentException.js";
3
+ export class TextRange {
4
+ start;
5
+ end;
6
+ constructor(start, end) {
7
+ if (start > end) {
8
+ throw new TiqianIllegalArgumentException({ kind: "StartGreaterThanEnd" });
9
+ }
10
+ if (start < 0) {
11
+ throw new TiqianIllegalArgumentException({ kind: "NegativeStart" });
12
+ }
13
+ this.start = start;
14
+ this.end = end;
15
+ }
16
+ get length() {
17
+ return this.get_length();
18
+ }
19
+ get_length() {
20
+ return this.end - this.start;
21
+ }
22
+ get isEmpty() {
23
+ return this.get_isEmpty();
24
+ }
25
+ get_isEmpty() {
26
+ return this.length === 0;
27
+ }
28
+ toString() {
29
+ return `TextRange(start=${this.start}, end=${this.end})`;
30
+ }
31
+ }
32
+ export function compareTextRange(a, b) {
33
+ if (a === b)
34
+ return 0;
35
+ if (a.start !== b.start)
36
+ return a.start - b.start;
37
+ if (a.end !== b.end)
38
+ return a.end - b.end;
39
+ return 0;
40
+ }
@@ -0,0 +1,11 @@
1
+ export interface StartGreaterThanEnd {
2
+ readonly kind: "StartGreaterThanEnd";
3
+ }
4
+ export interface NegativeStart {
5
+ readonly kind: "NegativeStart";
6
+ }
7
+ export interface Message {
8
+ readonly kind: "Message";
9
+ readonly text: string;
10
+ }
11
+ export type TextRangeError = StartGreaterThanEnd | NegativeStart | Message;
@@ -0,0 +1,2 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type TextRangeError } from "./TextRangeError.js";
2
+ export declare class TiqianIllegalArgumentException extends Error {
3
+ readonly error: TextRangeError;
4
+ constructor(error: TextRangeError);
5
+ static describe(error: TextRangeError): string;
6
+ }
@@ -0,0 +1,21 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export class TiqianIllegalArgumentException extends Error {
3
+ error;
4
+ constructor(error) {
5
+ super(TiqianIllegalArgumentException.describe(error));
6
+ this.name = "TiqianIllegalArgumentException";
7
+ this.error = error;
8
+ }
9
+ static describe(error) {
10
+ switch (error.kind) {
11
+ case "StartGreaterThanEnd":
12
+ return "TextRange start must not be greater than end.";
13
+ case "NegativeStart":
14
+ return "TextRange start must be non-negative.";
15
+ case "Message":
16
+ {
17
+ return error.text;
18
+ }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,10 @@
1
+ export declare class TiqianNoSuchElementException extends Error {
2
+ readonly error: NoSuchElementError;
3
+ constructor(error: NoSuchElementError);
4
+ static describe(error: NoSuchElementError): string;
5
+ }
6
+ export interface Message {
7
+ readonly kind: "Message";
8
+ readonly text: string;
9
+ }
10
+ export type NoSuchElementError = Message;
@@ -0,0 +1,16 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export class TiqianNoSuchElementException extends Error {
3
+ error;
4
+ constructor(error) {
5
+ super(TiqianNoSuchElementException.describe(error));
6
+ this.name = "TiqianNoSuchElementException";
7
+ this.error = error;
8
+ }
9
+ static describe(error) {
10
+ return (() => {
11
+ const _g = error.text;
12
+ const text = _g;
13
+ return text;
14
+ })();
15
+ }
16
+ }
@@ -0,0 +1,3 @@
1
+ export declare class UnicodeCombiningMarkData {
2
+ static contains(codePoint: number): boolean;
3
+ }
@@ -0,0 +1,109 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ const RANGES = new Int32Array([
3
+ 0x300, 0x36f, 0x483, 0x489, 0x591, 0x5bd, 0x5bf, 0x5bf,
4
+ 0x5c1, 0x5c2, 0x5c4, 0x5c5, 0x5c7, 0x5c7, 0x610, 0x61a,
5
+ 0x64b, 0x65f, 0x670, 0x670, 0x6d6, 0x6dc, 0x6df, 0x6e4,
6
+ 0x6e7, 0x6e8, 0x6ea, 0x6ed, 0x711, 0x711, 0x730, 0x74a,
7
+ 0x7a6, 0x7b0, 0x7eb, 0x7f3, 0x7fd, 0x7fd, 0x816, 0x819,
8
+ 0x81b, 0x823, 0x825, 0x827, 0x829, 0x82d, 0x859, 0x85b,
9
+ 0x897, 0x89f, 0x8ca, 0x8e1, 0x8e3, 0x903, 0x93a, 0x93c,
10
+ 0x93e, 0x94f, 0x951, 0x957, 0x962, 0x963, 0x981, 0x983,
11
+ 0x9bc, 0x9bc, 0x9be, 0x9c4, 0x9c7, 0x9c8, 0x9cb, 0x9cd,
12
+ 0x9d7, 0x9d7, 0x9e2, 0x9e3, 0x9fe, 0x9fe, 0xa01, 0xa03,
13
+ 0xa3c, 0xa3c, 0xa3e, 0xa42, 0xa47, 0xa48, 0xa4b, 0xa4d,
14
+ 0xa51, 0xa51, 0xa70, 0xa71, 0xa75, 0xa75, 0xa81, 0xa83,
15
+ 0xabc, 0xabc, 0xabe, 0xac5, 0xac7, 0xac9, 0xacb, 0xacd,
16
+ 0xae2, 0xae3, 0xafa, 0xaff, 0xb01, 0xb03, 0xb3c, 0xb3c,
17
+ 0xb3e, 0xb44, 0xb47, 0xb48, 0xb4b, 0xb4d, 0xb55, 0xb57,
18
+ 0xb62, 0xb63, 0xb82, 0xb82, 0xbbe, 0xbc2, 0xbc6, 0xbc8,
19
+ 0xbca, 0xbcd, 0xbd7, 0xbd7, 0xc00, 0xc04, 0xc3c, 0xc3c,
20
+ 0xc3e, 0xc44, 0xc46, 0xc48, 0xc4a, 0xc4d, 0xc55, 0xc56,
21
+ 0xc62, 0xc63, 0xc81, 0xc83, 0xcbc, 0xcbc, 0xcbe, 0xcc4,
22
+ 0xcc6, 0xcc8, 0xcca, 0xccd, 0xcd5, 0xcd6, 0xce2, 0xce3,
23
+ 0xcf3, 0xcf3, 0xd00, 0xd03, 0xd3b, 0xd3c, 0xd3e, 0xd44,
24
+ 0xd46, 0xd48, 0xd4a, 0xd4d, 0xd57, 0xd57, 0xd62, 0xd63,
25
+ 0xd81, 0xd83, 0xdca, 0xdca, 0xdcf, 0xdd4, 0xdd6, 0xdd6,
26
+ 0xdd8, 0xddf, 0xdf2, 0xdf3, 0xe31, 0xe31, 0xe34, 0xe3a,
27
+ 0xe47, 0xe4e, 0xeb1, 0xeb1, 0xeb4, 0xebc, 0xec8, 0xece,
28
+ 0xf18, 0xf19, 0xf35, 0xf35, 0xf37, 0xf37, 0xf39, 0xf39,
29
+ 0xf3e, 0xf3f, 0xf71, 0xf84, 0xf86, 0xf87, 0xf8d, 0xf97,
30
+ 0xf99, 0xfbc, 0xfc6, 0xfc6, 0x102b, 0x103e, 0x1056, 0x1059,
31
+ 0x105e, 0x1060, 0x1062, 0x1064, 0x1067, 0x106d, 0x1071, 0x1074,
32
+ 0x1082, 0x108d, 0x108f, 0x108f, 0x109a, 0x109d, 0x135d, 0x135f,
33
+ 0x1712, 0x1715, 0x1732, 0x1734, 0x1752, 0x1753, 0x1772, 0x1773,
34
+ 0x17b4, 0x17d3, 0x17dd, 0x17dd, 0x180b, 0x180d, 0x180f, 0x180f,
35
+ 0x1885, 0x1886, 0x18a9, 0x18a9, 0x1920, 0x192b, 0x1930, 0x193b,
36
+ 0x1a17, 0x1a1b, 0x1a55, 0x1a5e, 0x1a60, 0x1a7c, 0x1a7f, 0x1a7f,
37
+ 0x1ab0, 0x1add, 0x1ae0, 0x1aeb, 0x1b00, 0x1b04, 0x1b34, 0x1b44,
38
+ 0x1b6b, 0x1b73, 0x1b80, 0x1b82, 0x1ba1, 0x1bad, 0x1be6, 0x1bf3,
39
+ 0x1c24, 0x1c37, 0x1cd0, 0x1cd2, 0x1cd4, 0x1ce8, 0x1ced, 0x1ced,
40
+ 0x1cf4, 0x1cf4, 0x1cf7, 0x1cf9, 0x1dc0, 0x1dff, 0x20d0, 0x20f0,
41
+ 0x2cef, 0x2cf1, 0x2d7f, 0x2d7f, 0x2de0, 0x2dff, 0x302a, 0x302f,
42
+ 0x3099, 0x309a, 0xa66f, 0xa672, 0xa674, 0xa67d, 0xa69e, 0xa69f,
43
+ 0xa6f0, 0xa6f1, 0xa802, 0xa802, 0xa806, 0xa806, 0xa80b, 0xa80b,
44
+ 0xa823, 0xa827, 0xa82c, 0xa82c, 0xa880, 0xa881, 0xa8b4, 0xa8c5,
45
+ 0xa8e0, 0xa8f1, 0xa8ff, 0xa8ff, 0xa926, 0xa92d, 0xa947, 0xa953,
46
+ 0xa980, 0xa983, 0xa9b3, 0xa9c0, 0xa9e5, 0xa9e5, 0xaa29, 0xaa36,
47
+ 0xaa43, 0xaa43, 0xaa4c, 0xaa4d, 0xaa7b, 0xaa7d, 0xaab0, 0xaab0,
48
+ 0xaab2, 0xaab4, 0xaab7, 0xaab8, 0xaabe, 0xaabf, 0xaac1, 0xaac1,
49
+ 0xaaeb, 0xaaef, 0xaaf5, 0xaaf6, 0xabe3, 0xabea, 0xabec, 0xabed,
50
+ 0xfb1e, 0xfb1e, 0xfe00, 0xfe0f, 0xfe20, 0xfe2f, 0x101fd, 0x101fd,
51
+ 0x102e0, 0x102e0, 0x10376, 0x1037a, 0x10a01, 0x10a03, 0x10a05, 0x10a06,
52
+ 0x10a0c, 0x10a0f, 0x10a38, 0x10a3a, 0x10a3f, 0x10a3f, 0x10ae5, 0x10ae6,
53
+ 0x10d24, 0x10d27, 0x10d69, 0x10d6d, 0x10eab, 0x10eac, 0x10efa, 0x10eff,
54
+ 0x10f46, 0x10f50, 0x10f82, 0x10f85, 0x11000, 0x11002, 0x11038, 0x11046,
55
+ 0x11070, 0x11070, 0x11073, 0x11074, 0x1107f, 0x11082, 0x110b0, 0x110ba,
56
+ 0x110c2, 0x110c2, 0x11100, 0x11102, 0x11127, 0x11134, 0x11145, 0x11146,
57
+ 0x11173, 0x11173, 0x11180, 0x11182, 0x111b3, 0x111c0, 0x111c9, 0x111cc,
58
+ 0x111ce, 0x111cf, 0x1122c, 0x11237, 0x1123e, 0x1123e, 0x11241, 0x11241,
59
+ 0x112df, 0x112ea, 0x11300, 0x11303, 0x1133b, 0x1133c, 0x1133e, 0x11344,
60
+ 0x11347, 0x11348, 0x1134b, 0x1134d, 0x11357, 0x11357, 0x11362, 0x11363,
61
+ 0x11366, 0x1136c, 0x11370, 0x11374, 0x113b8, 0x113c0, 0x113c2, 0x113c2,
62
+ 0x113c5, 0x113c5, 0x113c7, 0x113ca, 0x113cc, 0x113d0, 0x113d2, 0x113d2,
63
+ 0x113e1, 0x113e2, 0x11435, 0x11446, 0x1145e, 0x1145e, 0x114b0, 0x114c3,
64
+ 0x115af, 0x115b5, 0x115b8, 0x115c0, 0x115dc, 0x115dd, 0x11630, 0x11640,
65
+ 0x116ab, 0x116b7, 0x1171d, 0x1172b, 0x1182c, 0x1183a, 0x11930, 0x11935,
66
+ 0x11937, 0x11938, 0x1193b, 0x1193e, 0x11940, 0x11940, 0x11942, 0x11943,
67
+ 0x119d1, 0x119d7, 0x119da, 0x119e0, 0x119e4, 0x119e4, 0x11a01, 0x11a0a,
68
+ 0x11a33, 0x11a39, 0x11a3b, 0x11a3e, 0x11a47, 0x11a47, 0x11a51, 0x11a5b,
69
+ 0x11a8a, 0x11a99, 0x11b60, 0x11b67, 0x11c2f, 0x11c36, 0x11c38, 0x11c3f,
70
+ 0x11c92, 0x11ca7, 0x11ca9, 0x11cb6, 0x11d31, 0x11d36, 0x11d3a, 0x11d3a,
71
+ 0x11d3c, 0x11d3d, 0x11d3f, 0x11d45, 0x11d47, 0x11d47, 0x11d8a, 0x11d8e,
72
+ 0x11d90, 0x11d91, 0x11d93, 0x11d97, 0x11ef3, 0x11ef6, 0x11f00, 0x11f01,
73
+ 0x11f03, 0x11f03, 0x11f34, 0x11f3a, 0x11f3e, 0x11f42, 0x11f5a, 0x11f5a,
74
+ 0x13440, 0x13440, 0x13447, 0x13455, 0x1611e, 0x1612f, 0x16af0, 0x16af4,
75
+ 0x16b30, 0x16b36, 0x16f4f, 0x16f4f, 0x16f51, 0x16f87, 0x16f8f, 0x16f92,
76
+ 0x16fe4, 0x16fe4, 0x16ff0, 0x16ff1, 0x1bc9d, 0x1bc9e, 0x1cf00, 0x1cf2d,
77
+ 0x1cf30, 0x1cf46, 0x1d165, 0x1d169, 0x1d16d, 0x1d172, 0x1d17b, 0x1d182,
78
+ 0x1d185, 0x1d18b, 0x1d1aa, 0x1d1ad, 0x1d242, 0x1d244, 0x1da00, 0x1da36,
79
+ 0x1da3b, 0x1da6c, 0x1da75, 0x1da75, 0x1da84, 0x1da84, 0x1da9b, 0x1da9f,
80
+ 0x1daa1, 0x1daaf, 0x1e000, 0x1e006, 0x1e008, 0x1e018, 0x1e01b, 0x1e021,
81
+ 0x1e023, 0x1e024, 0x1e026, 0x1e02a, 0x1e08f, 0x1e08f, 0x1e130, 0x1e136,
82
+ 0x1e2ae, 0x1e2ae, 0x1e2ec, 0x1e2ef, 0x1e4ec, 0x1e4ef, 0x1e5ee, 0x1e5ef,
83
+ 0x1e6e3, 0x1e6e3, 0x1e6e6, 0x1e6e6, 0x1e6ee, 0x1e6ef, 0x1e6f5, 0x1e6f5,
84
+ 0x1e8d0, 0x1e8d6, 0x1e944, 0x1e94a, 0xe0100, 0xe01ef
85
+ ]);
86
+ export class UnicodeCombiningMarkData {
87
+ static contains(codePoint) {
88
+ let low = 0;
89
+ let high = Math.trunc(RANGES.length >> 1) - 1;
90
+ while (low <= high) {
91
+ const middle = low + high >> 1;
92
+ const base = middle * 2;
93
+ const start = RANGES[base];
94
+ const end = RANGES[base + 1];
95
+ if (codePoint < start) {
96
+ high = middle - 1;
97
+ }
98
+ else {
99
+ if (codePoint > end) {
100
+ low = middle + 1;
101
+ }
102
+ else {
103
+ return true;
104
+ }
105
+ }
106
+ }
107
+ return false;
108
+ }
109
+ }
@@ -0,0 +1,16 @@
1
+ import { EastAsianSpacingEdges } from "./EastAsianSpacingEdges.js";
2
+ import { EastAsianSpacingValue } from "./EastAsianSpacingValue.js";
3
+ export declare class UnicodeEastAsianSpacing {
4
+ static readonly DATA_REVISION: string;
5
+ static readonly DATA_SOURCE: string;
6
+ static readonly DATA_SHA256: string;
7
+ static readonly LANGUAGE_REGISTRY_REVISION: string;
8
+ static readonly LANGUAGE_REGISTRY_SOURCE: string;
9
+ static isChineseLanguageContext(locale: string): boolean;
10
+ static propertyOf(codePoint: number): EastAsianSpacingValue;
11
+ static resolvedForGraphemeCluster(graphemeCluster: string, locale: string): EastAsianSpacingValue;
12
+ static resolvedEdges(text: string, locale: string): EastAsianSpacingEdges;
13
+ private static validateScalar;
14
+ private static languageSubtag;
15
+ private static isEnclosingMark;
16
+ }
@@ -0,0 +1,88 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { EastAsianSpacingData } from "./EastAsianSpacingData.js";
3
+ import { EastAsianSpacingEdges } from "./EastAsianSpacingEdges.js";
4
+ import { EastAsianSpacingValue } from "./EastAsianSpacingValue.js";
5
+ import { SourceInteractionBoundaries } from "./SourceInteractionBoundaries.js";
6
+ import { TextRange } from "./TextRange.js";
7
+ import { TiqianIllegalArgumentException } from "./TiqianIllegalArgumentException.js";
8
+ export class UnicodeEastAsianSpacing {
9
+ static DATA_REVISION = "draft-2024-12-16";
10
+ static DATA_SOURCE = "https://www.unicode.org/reports/tr59/east-asian-spacing.txt";
11
+ static DATA_SHA256 = "49fe340a964a6e8e0ebc30099709c665cc6138d444b5c36dc336604047f1010f";
12
+ static LANGUAGE_REGISTRY_REVISION = "2026-06-14";
13
+ static LANGUAGE_REGISTRY_SOURCE = "https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry";
14
+ static isChineseLanguageContext(locale) {
15
+ const language = UnicodeEastAsianSpacing.languageSubtag(locale);
16
+ if (language === "zh") {
17
+ return true;
18
+ }
19
+ return language === "cdo" || language === "cjy" || language === "cmn" || language === "cnp" || language === "cpx" || language === "csp" || language === "czh" || language === "czo" || language === "gan" || language === "hak" || language === "hnm" || language === "hsn" || language === "luh" || language === "lzh" || language === "mnp" || language === "nan" || language === "sjc" || language === "wuu" || language === "yue";
20
+ }
21
+ static propertyOf(codePoint) {
22
+ UnicodeEastAsianSpacing.validateScalar(codePoint);
23
+ return EastAsianSpacingData.lookup(codePoint);
24
+ }
25
+ static resolvedForGraphemeCluster(graphemeCluster, locale) {
26
+ if (graphemeCluster.length === 0) {
27
+ return EastAsianSpacingValue.Other;
28
+ }
29
+ let index = 0;
30
+ while (index < graphemeCluster.length) {
31
+ const codePoint = SourceInteractionBoundaries.codePointAtCompat(graphemeCluster, index, graphemeCluster.length);
32
+ if (UnicodeEastAsianSpacing.isEnclosingMark(codePoint)) {
33
+ return EastAsianSpacingValue.Other;
34
+ }
35
+ const advance = (codePoint > 65535 ? 2 : 1);
36
+ index += advance;
37
+ }
38
+ const property = UnicodeEastAsianSpacing.propertyOf(SourceInteractionBoundaries.codePointAtCompat(graphemeCluster, 0, graphemeCluster.length));
39
+ if (property.kind === "Conditional") {
40
+ return (UnicodeEastAsianSpacing.isChineseLanguageContext(locale) ? EastAsianSpacingValue.Narrow : EastAsianSpacingValue.Other);
41
+ }
42
+ return property;
43
+ }
44
+ static resolvedEdges(text, locale) {
45
+ if (text.length === 0) {
46
+ return new EastAsianSpacingEdges(EastAsianSpacingValue.Other, EastAsianSpacingValue.Other, false);
47
+ }
48
+ const boundaries = SourceInteractionBoundaries.interactionBoundaries(text, new TextRange(0, text.length));
49
+ let index = 0;
50
+ let leading = EastAsianSpacingValue.Other;
51
+ let trailing = EastAsianSpacingValue.Other;
52
+ let containsWide = false;
53
+ while (index + 1 < boundaries.length) {
54
+ const value = UnicodeEastAsianSpacing.resolvedForGraphemeCluster(text.substring(boundaries[index], boundaries[index + 1]), locale);
55
+ if (index === 0) {
56
+ leading = value;
57
+ }
58
+ trailing = value;
59
+ if (value.kind === "Wide") {
60
+ containsWide = true;
61
+ }
62
+ index += 1;
63
+ }
64
+ return new EastAsianSpacingEdges(leading, trailing, containsWide);
65
+ }
66
+ static validateScalar(codePoint) {
67
+ if (codePoint < 0 || codePoint > 1114111) {
68
+ throw new TiqianIllegalArgumentException({ kind: "Message", text: `Not a Unicode scalar value: ${codePoint}` });
69
+ }
70
+ if (codePoint >= 55296 && codePoint <= 57343) {
71
+ throw new TiqianIllegalArgumentException({ kind: "Message", text: `Surrogate is not a Unicode scalar value: ${codePoint}` });
72
+ }
73
+ }
74
+ static languageSubtag(locale) {
75
+ let end = locale.indexOf("-");
76
+ const underscore = locale.indexOf("_");
77
+ if (end < 0 || underscore >= 0 && underscore < end) {
78
+ end = underscore;
79
+ }
80
+ if (end < 0) {
81
+ end = locale.length;
82
+ }
83
+ return locale.substring(0, end).toLowerCase();
84
+ }
85
+ static isEnclosingMark(codePoint) {
86
+ return codePoint === 1160 || codePoint === 1161 || codePoint === 6846 || codePoint >= 8413 && codePoint <= 8416 || codePoint >= 42608 && codePoint <= 42610 || codePoint >= 42612 && codePoint <= 42621;
87
+ }
88
+ }
@@ -0,0 +1,3 @@
1
+ export declare class UnicodeEmojiModifierBaseData {
2
+ static contains(codePoint: number): boolean;
3
+ }
@@ -0,0 +1,35 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ const RANGES = new Int32Array([
3
+ 0x261d, 0x261d, 0x26f9, 0x26f9, 0x270a, 0x270d, 0x1f385, 0x1f385,
4
+ 0x1f3c2, 0x1f3c4, 0x1f3c7, 0x1f3c7, 0x1f3ca, 0x1f3cc, 0x1f442, 0x1f443,
5
+ 0x1f446, 0x1f450, 0x1f466, 0x1f478, 0x1f47c, 0x1f47c, 0x1f481, 0x1f483,
6
+ 0x1f485, 0x1f487, 0x1f48f, 0x1f48f, 0x1f491, 0x1f491, 0x1f4aa, 0x1f4aa,
7
+ 0x1f574, 0x1f575, 0x1f57a, 0x1f57a, 0x1f590, 0x1f590, 0x1f595, 0x1f596,
8
+ 0x1f645, 0x1f647, 0x1f64b, 0x1f64f, 0x1f6a3, 0x1f6a3, 0x1f6b4, 0x1f6b6,
9
+ 0x1f6c0, 0x1f6c0, 0x1f6cc, 0x1f6cc, 0x1f90c, 0x1f90c, 0x1f90f, 0x1f90f,
10
+ 0x1f918, 0x1f91f, 0x1f926, 0x1f926, 0x1f930, 0x1f939, 0x1f93c, 0x1f93e,
11
+ 0x1f977, 0x1f977, 0x1f9b5, 0x1f9b6, 0x1f9b8, 0x1f9b9, 0x1f9bb, 0x1f9bb,
12
+ 0x1f9cd, 0x1f9cf, 0x1f9d1, 0x1f9dd, 0x1fac3, 0x1fac5, 0x1faf0, 0x1faf8
13
+ ]);
14
+ export class UnicodeEmojiModifierBaseData {
15
+ static contains(codePoint) {
16
+ let low = 0;
17
+ let high = Math.trunc(RANGES.length >> 1) - 1;
18
+ while (low <= high) {
19
+ const middle = low + high >> 1;
20
+ const base = middle * 2;
21
+ if (codePoint < RANGES[base]) {
22
+ high = middle - 1;
23
+ }
24
+ else {
25
+ if (codePoint > RANGES[base + 1]) {
26
+ low = middle + 1;
27
+ }
28
+ else {
29
+ return true;
30
+ }
31
+ }
32
+ }
33
+ return false;
34
+ }
35
+ }
@@ -0,0 +1,3 @@
1
+ export declare class UnicodeExtendedPictographicData {
2
+ static contains(codePoint: number): boolean;
3
+ }
@@ -0,0 +1,64 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ const RANGES = new Int32Array([
3
+ 0xa9, 0xa9, 0xae, 0xae, 0x203c, 0x203c, 0x2049, 0x2049,
4
+ 0x2122, 0x2122, 0x2139, 0x2139, 0x2194, 0x2199, 0x21a9, 0x21aa,
5
+ 0x231a, 0x231b, 0x2328, 0x2328, 0x23cf, 0x23cf, 0x23e9, 0x23f3,
6
+ 0x23f8, 0x23fa, 0x24c2, 0x24c2, 0x25aa, 0x25ab, 0x25b6, 0x25b6,
7
+ 0x25c0, 0x25c0, 0x25fb, 0x25fe, 0x2600, 0x2604, 0x260e, 0x260e,
8
+ 0x2611, 0x2611, 0x2614, 0x2615, 0x2618, 0x2618, 0x261d, 0x261d,
9
+ 0x2620, 0x2620, 0x2622, 0x2623, 0x2626, 0x2626, 0x262a, 0x262a,
10
+ 0x262e, 0x262f, 0x2638, 0x263a, 0x2640, 0x2640, 0x2642, 0x2642,
11
+ 0x2648, 0x2653, 0x265f, 0x2660, 0x2663, 0x2663, 0x2665, 0x2666,
12
+ 0x2668, 0x2668, 0x267b, 0x267b, 0x267e, 0x267f, 0x2692, 0x2697,
13
+ 0x2699, 0x2699, 0x269b, 0x269c, 0x26a0, 0x26a1, 0x26a7, 0x26a7,
14
+ 0x26aa, 0x26ab, 0x26b0, 0x26b1, 0x26bd, 0x26be, 0x26c4, 0x26c5,
15
+ 0x26c8, 0x26c8, 0x26ce, 0x26cf, 0x26d1, 0x26d1, 0x26d3, 0x26d4,
16
+ 0x26e9, 0x26ea, 0x26f0, 0x26f5, 0x26f7, 0x26fa, 0x26fd, 0x26fd,
17
+ 0x2702, 0x2702, 0x2705, 0x2705, 0x2708, 0x270d, 0x270f, 0x270f,
18
+ 0x2712, 0x2712, 0x2714, 0x2714, 0x2716, 0x2716, 0x271d, 0x271d,
19
+ 0x2721, 0x2721, 0x2728, 0x2728, 0x2733, 0x2734, 0x2744, 0x2744,
20
+ 0x2747, 0x2747, 0x274c, 0x274c, 0x274e, 0x274e, 0x2753, 0x2755,
21
+ 0x2757, 0x2757, 0x2763, 0x2764, 0x2795, 0x2797, 0x27a1, 0x27a1,
22
+ 0x27b0, 0x27b0, 0x27bf, 0x27bf, 0x2934, 0x2935, 0x2b05, 0x2b07,
23
+ 0x2b1b, 0x2b1c, 0x2b50, 0x2b50, 0x2b55, 0x2b55, 0x3030, 0x3030,
24
+ 0x303d, 0x303d, 0x3297, 0x3297, 0x3299, 0x3299, 0x1f004, 0x1f004,
25
+ 0x1f02c, 0x1f02f, 0x1f094, 0x1f09f, 0x1f0af, 0x1f0b0, 0x1f0c0, 0x1f0c0,
26
+ 0x1f0cf, 0x1f0d0, 0x1f0f6, 0x1f0ff, 0x1f170, 0x1f171, 0x1f17e, 0x1f17f,
27
+ 0x1f18e, 0x1f18e, 0x1f191, 0x1f19a, 0x1f1ae, 0x1f1e5, 0x1f201, 0x1f20f,
28
+ 0x1f21a, 0x1f21a, 0x1f22f, 0x1f22f, 0x1f232, 0x1f23a, 0x1f23c, 0x1f23f,
29
+ 0x1f249, 0x1f25f, 0x1f266, 0x1f321, 0x1f324, 0x1f393, 0x1f396, 0x1f397,
30
+ 0x1f399, 0x1f39b, 0x1f39e, 0x1f3f0, 0x1f3f3, 0x1f3f5, 0x1f3f7, 0x1f3fa,
31
+ 0x1f400, 0x1f4fd, 0x1f4ff, 0x1f53d, 0x1f549, 0x1f54e, 0x1f550, 0x1f567,
32
+ 0x1f56f, 0x1f570, 0x1f573, 0x1f57a, 0x1f587, 0x1f587, 0x1f58a, 0x1f58d,
33
+ 0x1f590, 0x1f590, 0x1f595, 0x1f596, 0x1f5a4, 0x1f5a5, 0x1f5a8, 0x1f5a8,
34
+ 0x1f5b1, 0x1f5b2, 0x1f5bc, 0x1f5bc, 0x1f5c2, 0x1f5c4, 0x1f5d1, 0x1f5d3,
35
+ 0x1f5dc, 0x1f5de, 0x1f5e1, 0x1f5e1, 0x1f5e3, 0x1f5e3, 0x1f5e8, 0x1f5e8,
36
+ 0x1f5ef, 0x1f5ef, 0x1f5f3, 0x1f5f3, 0x1f5fa, 0x1f64f, 0x1f680, 0x1f6c5,
37
+ 0x1f6cb, 0x1f6d2, 0x1f6d5, 0x1f6e5, 0x1f6e9, 0x1f6e9, 0x1f6eb, 0x1f6f0,
38
+ 0x1f6f3, 0x1f6ff, 0x1f7da, 0x1f7ff, 0x1f80c, 0x1f80f, 0x1f848, 0x1f84f,
39
+ 0x1f85a, 0x1f85f, 0x1f888, 0x1f88f, 0x1f8ae, 0x1f8af, 0x1f8bc, 0x1f8bf,
40
+ 0x1f8c2, 0x1f8cf, 0x1f8d9, 0x1f8ff, 0x1f90c, 0x1f93a, 0x1f93c, 0x1f945,
41
+ 0x1f947, 0x1f9ff, 0x1fa58, 0x1fa5f, 0x1fa6e, 0x1faff, 0x1fc00, 0x1fffd
42
+ ]);
43
+ export class UnicodeExtendedPictographicData {
44
+ static contains(codePoint) {
45
+ let low = 0;
46
+ let high = Math.trunc(RANGES.length >> 1) - 1;
47
+ while (low <= high) {
48
+ const middle = low + high >> 1;
49
+ const base = middle * 2;
50
+ if (codePoint < RANGES[base]) {
51
+ high = middle - 1;
52
+ }
53
+ else {
54
+ if (codePoint > RANGES[base + 1]) {
55
+ low = middle + 1;
56
+ }
57
+ else {
58
+ return true;
59
+ }
60
+ }
61
+ }
62
+ return false;
63
+ }
64
+ }
@@ -0,0 +1,3 @@
1
+ export declare class UnicodeNumber {
2
+ static contains(codePoint: number): boolean;
3
+ }