@tiqian/protocol 0.0.0-stage.1 → 0.1.0-alpha.10

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,19 @@
1
+ export declare class Sha256 {
2
+ private state;
3
+ private block;
4
+ private blockPos;
5
+ private totalLength;
6
+ constructor();
7
+ update(data: Uint8Array): void;
8
+ digest(): Uint8Array;
9
+ static make(data: Uint8Array): Uint8Array;
10
+ private static processBlock;
11
+ private static rotate;
12
+ private static choose;
13
+ private static majority;
14
+ private static sigma0;
15
+ private static sigma1;
16
+ private static gamma0;
17
+ private static gamma1;
18
+ private static safeAdd;
19
+ }
@@ -0,0 +1,194 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { BytesBuffer } from "../../runtime.js";
3
+ export class Sha256 {
4
+ state;
5
+ block;
6
+ blockPos;
7
+ totalLength;
8
+ constructor() {
9
+ this.state = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225];
10
+ this.block = new Uint8Array(64);
11
+ this.blockPos = 0;
12
+ this.totalLength = 0;
13
+ }
14
+ update(data) {
15
+ let sourcePos = 0;
16
+ while (sourcePos < data.length) {
17
+ this.block[this.blockPos] = data[sourcePos];
18
+ this.blockPos += 1;
19
+ sourcePos += 1;
20
+ this.totalLength += 1;
21
+ if (this.blockPos === 64) {
22
+ Sha256.processBlock(this.state, this.block);
23
+ this.blockPos = 0;
24
+ }
25
+ }
26
+ }
27
+ digest() {
28
+ const finalState = [];
29
+ {
30
+ finalState.push(this.state[0]);
31
+ finalState.push(this.state[1]);
32
+ finalState.push(this.state[2]);
33
+ finalState.push(this.state[3]);
34
+ finalState.push(this.state[4]);
35
+ finalState.push(this.state[5]);
36
+ finalState.push(this.state[6]);
37
+ finalState.push(this.state[7]);
38
+ }
39
+ const finalBlock = new Uint8Array(64);
40
+ for (let i = 0; i < 64; i += 1) {
41
+ finalBlock[i] = 0;
42
+ }
43
+ for (let i2 = 0, count = this.blockPos; i2 < count; i2 += 1) {
44
+ finalBlock[i2] = this.block[i2];
45
+ }
46
+ finalBlock[this.blockPos] = 128;
47
+ const position = this.blockPos + 1;
48
+ if (position > 56) {
49
+ Sha256.processBlock(finalState, finalBlock);
50
+ for (let i3 = 0; i3 < 56; i3 += 1) {
51
+ finalBlock[i3] = 0;
52
+ }
53
+ }
54
+ else {
55
+ for (let i4 = position; i4 < 56; i4 += 1) {
56
+ finalBlock[i4] = 0;
57
+ }
58
+ }
59
+ finalBlock[56] = 0;
60
+ finalBlock[57] = 0;
61
+ finalBlock[58] = 0;
62
+ finalBlock[59] = 0;
63
+ finalBlock[60] = (this.totalLength >>> 21) & 255;
64
+ finalBlock[61] = (this.totalLength >>> 13) & 255;
65
+ finalBlock[62] = (this.totalLength >>> 5) & 255;
66
+ finalBlock[63] = this.totalLength << 3;
67
+ Sha256.processBlock(finalState, finalBlock);
68
+ const output = new BytesBuffer();
69
+ {
70
+ {
71
+ output.addByte(finalState[0] >>> 24);
72
+ output.addByte(finalState[0] >>> 16);
73
+ output.addByte(finalState[0] >>> 8);
74
+ output.addByte(finalState[0]);
75
+ }
76
+ {
77
+ output.addByte(finalState[1] >>> 24);
78
+ output.addByte(finalState[1] >>> 16);
79
+ output.addByte(finalState[1] >>> 8);
80
+ output.addByte(finalState[1]);
81
+ }
82
+ {
83
+ output.addByte(finalState[2] >>> 24);
84
+ output.addByte(finalState[2] >>> 16);
85
+ output.addByte(finalState[2] >>> 8);
86
+ output.addByte(finalState[2]);
87
+ }
88
+ {
89
+ output.addByte(finalState[3] >>> 24);
90
+ output.addByte(finalState[3] >>> 16);
91
+ output.addByte(finalState[3] >>> 8);
92
+ output.addByte(finalState[3]);
93
+ }
94
+ {
95
+ output.addByte(finalState[4] >>> 24);
96
+ output.addByte(finalState[4] >>> 16);
97
+ output.addByte(finalState[4] >>> 8);
98
+ output.addByte(finalState[4]);
99
+ }
100
+ {
101
+ output.addByte(finalState[5] >>> 24);
102
+ output.addByte(finalState[5] >>> 16);
103
+ output.addByte(finalState[5] >>> 8);
104
+ output.addByte(finalState[5]);
105
+ }
106
+ {
107
+ output.addByte(finalState[6] >>> 24);
108
+ output.addByte(finalState[6] >>> 16);
109
+ output.addByte(finalState[6] >>> 8);
110
+ output.addByte(finalState[6]);
111
+ }
112
+ {
113
+ output.addByte(finalState[7] >>> 24);
114
+ output.addByte(finalState[7] >>> 16);
115
+ output.addByte(finalState[7] >>> 8);
116
+ output.addByte(finalState[7]);
117
+ }
118
+ }
119
+ return output.getBytes();
120
+ }
121
+ static make(data) {
122
+ const hash = new Sha256();
123
+ hash.update(data);
124
+ return hash.digest();
125
+ }
126
+ static processBlock(hash, input) {
127
+ const words = [];
128
+ for (let i = 0; i < 64; i += 1) {
129
+ words.push(0);
130
+ }
131
+ for (let i2 = 0; i2 < 16; i2 += 1) {
132
+ const offset = i2 * 4;
133
+ words[i2] = (input[offset] << 24) | (input[offset + 1] << 16) | (input[offset + 2] << 8) | input[offset + 3];
134
+ }
135
+ for (let i3 = 16; i3 < 64; i3 += 1) {
136
+ words[i3] = Sha256.safeAdd(Sha256.safeAdd(Sha256.safeAdd(Sha256.gamma1(words[i3 - 2]), words[i3 - 7]), Sha256.gamma0(words[i3 - 15])), words[i3 - 16]);
137
+ }
138
+ let a = hash[0];
139
+ let b = hash[1];
140
+ let c = hash[2];
141
+ let d = hash[3];
142
+ let e = hash[4];
143
+ let f = hash[5];
144
+ let g = hash[6];
145
+ let h = hash[7];
146
+ const k = [1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998];
147
+ for (let i4 = 0; i4 < 64; i4 += 1) {
148
+ const t1 = Sha256.safeAdd(Sha256.safeAdd(Sha256.safeAdd(Sha256.safeAdd(h, Sha256.sigma1(e)), Sha256.choose(e, f, g)), k[i4]), words[i4]);
149
+ const t2 = Sha256.safeAdd(Sha256.sigma0(a), Sha256.majority(a, b, c));
150
+ h = g;
151
+ g = f;
152
+ f = e;
153
+ e = Sha256.safeAdd(d, t1);
154
+ d = c;
155
+ c = b;
156
+ b = a;
157
+ a = Sha256.safeAdd(t1, t2);
158
+ }
159
+ hash[0] = Sha256.safeAdd(hash[0], a);
160
+ hash[1] = Sha256.safeAdd(hash[1], b);
161
+ hash[2] = Sha256.safeAdd(hash[2], c);
162
+ hash[3] = Sha256.safeAdd(hash[3], d);
163
+ hash[4] = Sha256.safeAdd(hash[4], e);
164
+ hash[5] = Sha256.safeAdd(hash[5], f);
165
+ hash[6] = Sha256.safeAdd(hash[6], g);
166
+ hash[7] = Sha256.safeAdd(hash[7], h);
167
+ }
168
+ static rotate(value, distance) {
169
+ return (value >>> distance) | (value << 32 - distance);
170
+ }
171
+ static choose(x, y, z) {
172
+ return x & y ^ ~x & z;
173
+ }
174
+ static majority(x, y, z) {
175
+ return x & y ^ x & z ^ y & z;
176
+ }
177
+ static sigma0(x) {
178
+ return Sha256.rotate(x, 2) ^ Sha256.rotate(x, 13) ^ Sha256.rotate(x, 22);
179
+ }
180
+ static sigma1(x) {
181
+ return Sha256.rotate(x, 6) ^ Sha256.rotate(x, 11) ^ Sha256.rotate(x, 25);
182
+ }
183
+ static gamma0(x) {
184
+ return Sha256.rotate(x, 7) ^ Sha256.rotate(x, 18) ^ (x >>> 3);
185
+ }
186
+ static gamma1(x) {
187
+ return Sha256.rotate(x, 17) ^ Sha256.rotate(x, 19) ^ (x >>> 10);
188
+ }
189
+ static safeAdd(x, y) {
190
+ const low = (x & 65535) + (y & 65535);
191
+ const high = (x >> 16) + (y >> 16) + (low >> 16);
192
+ return (high << 16) | low & 65535;
193
+ }
194
+ }
@@ -0,0 +1,11 @@
1
+ import { LineAdjustmentStrategy } from "./LineAdjustmentStrategy.js";
2
+ import { LineEndPunctuationStyle } from "./LineEndPunctuationStyle.js";
3
+ export declare class AdjustmentStylePolicy {
4
+ readonly lineEndPunctuation: LineEndPunctuationStyle;
5
+ readonly allowInlineStopCompression: boolean;
6
+ readonly allowSinoWesternGapAdjustment: boolean;
7
+ readonly lineAdjustment: LineAdjustmentStrategy;
8
+ constructor(lineEndPunctuation?: LineEndPunctuationStyle | null, allowInlineStopCompression?: boolean | null, allowSinoWesternGapAdjustment?: boolean | null, lineAdjustment?: LineAdjustmentStrategy | null);
9
+ toString(): string;
10
+ static samePolicy(a: AdjustmentStylePolicy, b: AdjustmentStylePolicy): boolean;
11
+ }
@@ -0,0 +1,21 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { LineAdjustmentStrategy } from "./LineAdjustmentStrategy.js";
3
+ import { LineEndPunctuationStyle } from "./LineEndPunctuationStyle.js";
4
+ export class AdjustmentStylePolicy {
5
+ lineEndPunctuation;
6
+ allowInlineStopCompression;
7
+ allowSinoWesternGapAdjustment;
8
+ lineAdjustment;
9
+ constructor(lineEndPunctuation = null, allowInlineStopCompression = null, allowSinoWesternGapAdjustment = null, lineAdjustment = null) {
10
+ this.lineEndPunctuation = lineEndPunctuation ?? LineEndPunctuationStyle.ForceHalfWidth;
11
+ this.allowInlineStopCompression = allowInlineStopCompression ?? true;
12
+ this.allowSinoWesternGapAdjustment = allowSinoWesternGapAdjustment ?? true;
13
+ this.lineAdjustment = lineAdjustment ?? LineAdjustmentStrategy.PushInFirst;
14
+ }
15
+ toString() {
16
+ return `AdjustmentStylePolicy(lineEndPunctuation=${this.lineEndPunctuation.kind}, allowInlineStopCompression=${this.allowInlineStopCompression}, allowSinoWesternGapAdjustment=${this.allowSinoWesternGapAdjustment}, lineAdjustment=${this.lineAdjustment.kind})`;
17
+ }
18
+ static samePolicy(a, b) {
19
+ return a.lineEndPunctuation === b.lineEndPunctuation && a.allowInlineStopCompression === b.allowInlineStopCompression && a.allowSinoWesternGapAdjustment === b.allowSinoWesternGapAdjustment && a.lineAdjustment === b.lineAdjustment;
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ export interface Disabled {
2
+ readonly kind: "Disabled";
3
+ }
4
+ export interface Replace {
5
+ readonly kind: "Replace";
6
+ }
7
+ export interface Insert {
8
+ readonly kind: "Insert";
9
+ }
10
+ export type AutoSpaceMode = Disabled | Replace | Insert;
11
+ export declare const AutoSpaceMode: Readonly<{
12
+ Disabled: Readonly<Disabled>;
13
+ Replace: Readonly<Replace>;
14
+ Insert: Readonly<Insert>;
15
+ }>;
16
+ export declare function compareAutoSpaceMode(a: AutoSpaceMode, b: AutoSpaceMode): number;
@@ -0,0 +1,17 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export const AutoSpaceMode = Object.freeze({
3
+ Disabled: Object.freeze({ kind: "Disabled" }),
4
+ Replace: Object.freeze({ kind: "Replace" }),
5
+ Insert: Object.freeze({ kind: "Insert" })
6
+ });
7
+ export function compareAutoSpaceMode(a, b) {
8
+ if (a === b)
9
+ return 0;
10
+ if (a.kind === "Disabled")
11
+ return 0 - (b.kind === "Disabled" ? 0 : 0);
12
+ if (a.kind === "Replace")
13
+ return 1 - (b.kind === "Replace" ? 1 : 0);
14
+ if (a.kind === "Insert")
15
+ return 2 - (b.kind === "Insert" ? 2 : 0);
16
+ return 0;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { AutoSpaceMode } from "./AutoSpaceMode.js";
2
+ export declare class AutoSpacePolicy {
3
+ readonly cjkLatin: AutoSpaceMode;
4
+ readonly cjkDigit: AutoSpaceMode;
5
+ readonly gapEm: number;
6
+ readonly stretchMaxEm: number;
7
+ static readonly Default: AutoSpacePolicy;
8
+ static readonly Clreq: AutoSpacePolicy;
9
+ static readonly Disabled: AutoSpacePolicy;
10
+ constructor(cjkLatin?: AutoSpaceMode | null, cjkDigit?: AutoSpaceMode | null, gapEm?: number | null, stretchMaxEm?: number | null);
11
+ toString(): string;
12
+ static samePolicy(a: AutoSpacePolicy, b: AutoSpacePolicy): boolean;
13
+ }
@@ -0,0 +1,23 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { AutoSpaceMode } from "./AutoSpaceMode.js";
3
+ export class AutoSpacePolicy {
4
+ cjkLatin;
5
+ cjkDigit;
6
+ gapEm;
7
+ stretchMaxEm;
8
+ static Default = new AutoSpacePolicy();
9
+ static Clreq = new AutoSpacePolicy(AutoSpaceMode.Insert, AutoSpaceMode.Insert, 0.25, 0.5);
10
+ static Disabled = new AutoSpacePolicy(AutoSpaceMode.Disabled, AutoSpaceMode.Disabled);
11
+ constructor(cjkLatin = null, cjkDigit = null, gapEm = null, stretchMaxEm = null) {
12
+ this.cjkLatin = cjkLatin ?? AutoSpaceMode.Insert;
13
+ this.cjkDigit = cjkDigit ?? AutoSpaceMode.Insert;
14
+ this.gapEm = gapEm ?? 0.125;
15
+ this.stretchMaxEm = stretchMaxEm ?? 1.0 / 3.0;
16
+ }
17
+ toString() {
18
+ return `AutoSpacePolicy(cjkLatin=${this.cjkLatin.kind}, cjkDigit=${this.cjkDigit.kind}, gapEm=${this.gapEm}, stretchMaxEm=${this.stretchMaxEm})`;
19
+ }
20
+ static samePolicy(a, b) {
21
+ return a.cjkLatin === b.cjkLatin && a.cjkDigit === b.cjkDigit && a.gapEm === b.gapEm && a.stretchMaxEm === b.stretchMaxEm;
22
+ }
23
+ }
@@ -0,0 +1,12 @@
1
+ import { type BopomofoTone } from "./BopomofoTone.js";
2
+ export declare class BopomofoReading {
3
+ readonly symbols: readonly string[];
4
+ readonly tone: BopomofoTone;
5
+ constructor(symbols: string[], tone: BopomofoTone);
6
+ copy(): BopomofoReading;
7
+ hashCode(): number;
8
+ private toneIndex;
9
+ toString(): string;
10
+ }
11
+ export declare function BopomofoReadingtoneOrder(v: BopomofoTone): number;
12
+ export declare function compareBopomofoReading(a: BopomofoReading, b: BopomofoReading): number;
@@ -0,0 +1,86 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export class BopomofoReading {
3
+ symbols;
4
+ tone;
5
+ constructor(symbols, tone) {
6
+ this.symbols = symbols;
7
+ this.tone = tone;
8
+ }
9
+ copy() {
10
+ const copiedSymbols = [];
11
+ let index = 0;
12
+ while (index < this.symbols.length) {
13
+ copiedSymbols.push(this.symbols[index]);
14
+ index += 1;
15
+ }
16
+ return new BopomofoReading(copiedSymbols, this.tone);
17
+ }
18
+ hashCode() {
19
+ let hash = 17;
20
+ hash = hash * 31 + this.toneIndex();
21
+ let index = 0;
22
+ while (index < this.symbols.length) {
23
+ const symbol = this.symbols[index];
24
+ let unitIndex = 0;
25
+ while (unitIndex < symbol.length) {
26
+ hash = hash * 31 + (Number.isNaN(symbol.charCodeAt(unitIndex)) ? null : symbol.charCodeAt(unitIndex));
27
+ unitIndex += 1;
28
+ }
29
+ index += 1;
30
+ }
31
+ return hash;
32
+ }
33
+ toneIndex() {
34
+ const value = this.tone;
35
+ switch (value.kind) {
36
+ case "Yinping":
37
+ return 0;
38
+ case "Yangping":
39
+ return 1;
40
+ case "Shang":
41
+ return 2;
42
+ case "Qu":
43
+ return 3;
44
+ case "Neutral":
45
+ return 4;
46
+ case "Ru":
47
+ return 5;
48
+ }
49
+ }
50
+ toString() {
51
+ return `BopomofoReading(symbols=${(() => { let out = "["; const n = this.symbols.length; for (let i = 0; i < n; i += 1) {
52
+ if (i > 0) {
53
+ out += ", ";
54
+ }
55
+ out += this.symbols[i];
56
+ } out += "]"; return out; })()}, tone=${this.tone.kind})`;
57
+ }
58
+ }
59
+ export function BopomofoReadingtoneOrder(v) {
60
+ if (v.kind === "Yinping")
61
+ return 0;
62
+ if (v.kind === "Yangping")
63
+ return 1;
64
+ if (v.kind === "Shang")
65
+ return 2;
66
+ if (v.kind === "Qu")
67
+ return 3;
68
+ if (v.kind === "Neutral")
69
+ return 4;
70
+ if (v.kind === "Ru")
71
+ return 5;
72
+ return 0;
73
+ }
74
+ export function compareBopomofoReading(a, b) {
75
+ if (a === b)
76
+ return 0;
77
+ for (let i0 = 0, n0 = a.symbols.length < b.symbols.length ? a.symbols.length : b.symbols.length; i0 < n0; i0++) {
78
+ if (a.symbols[i0] !== b.symbols[i0])
79
+ return a.symbols[i0] < b.symbols[i0] ? -1 : 1;
80
+ }
81
+ if (a.symbols.length !== b.symbols.length)
82
+ return a.symbols.length - b.symbols.length;
83
+ if (BopomofoReadingtoneOrder(a.tone) !== BopomofoReadingtoneOrder(b.tone))
84
+ return BopomofoReadingtoneOrder(a.tone) - BopomofoReadingtoneOrder(b.tone);
85
+ return 0;
86
+ }
@@ -0,0 +1,28 @@
1
+ export interface Yinping {
2
+ readonly kind: "Yinping";
3
+ }
4
+ export interface Yangping {
5
+ readonly kind: "Yangping";
6
+ }
7
+ export interface Shang {
8
+ readonly kind: "Shang";
9
+ }
10
+ export interface Qu {
11
+ readonly kind: "Qu";
12
+ }
13
+ export interface Neutral {
14
+ readonly kind: "Neutral";
15
+ }
16
+ export interface Ru {
17
+ readonly kind: "Ru";
18
+ }
19
+ export type BopomofoTone = Yinping | Yangping | Shang | Qu | Neutral | Ru;
20
+ export declare const BopomofoTone: Readonly<{
21
+ Yinping: Readonly<Yinping>;
22
+ Yangping: Readonly<Yangping>;
23
+ Shang: Readonly<Shang>;
24
+ Qu: Readonly<Qu>;
25
+ Neutral: Readonly<Neutral>;
26
+ Ru: Readonly<Ru>;
27
+ }>;
28
+ export declare function compareBopomofoTone(a: BopomofoTone, b: BopomofoTone): number;
@@ -0,0 +1,26 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export const BopomofoTone = Object.freeze({
3
+ Yinping: Object.freeze({ kind: "Yinping" }),
4
+ Yangping: Object.freeze({ kind: "Yangping" }),
5
+ Shang: Object.freeze({ kind: "Shang" }),
6
+ Qu: Object.freeze({ kind: "Qu" }),
7
+ Neutral: Object.freeze({ kind: "Neutral" }),
8
+ Ru: Object.freeze({ kind: "Ru" })
9
+ });
10
+ export function compareBopomofoTone(a, b) {
11
+ if (a === b)
12
+ return 0;
13
+ if (a.kind === "Yinping")
14
+ return 0 - (b.kind === "Yinping" ? 0 : 0);
15
+ if (a.kind === "Yangping")
16
+ return 1 - (b.kind === "Yangping" ? 1 : 0);
17
+ if (a.kind === "Shang")
18
+ return 2 - (b.kind === "Shang" ? 2 : 0);
19
+ if (a.kind === "Qu")
20
+ return 3 - (b.kind === "Qu" ? 3 : 0);
21
+ if (a.kind === "Neutral")
22
+ return 4 - (b.kind === "Neutral" ? 4 : 0);
23
+ if (a.kind === "Ru")
24
+ return 5 - (b.kind === "Ru" ? 5 : 0);
25
+ return 0;
26
+ }
@@ -0,0 +1,16 @@
1
+ export interface PreserveInput {
2
+ readonly kind: "PreserveInput";
3
+ }
4
+ export interface PreferClreqRecommendedCodepoints {
5
+ readonly kind: "PreferClreqRecommendedCodepoints";
6
+ }
7
+ export interface ForceClreqRecommendedCodepoints {
8
+ readonly kind: "ForceClreqRecommendedCodepoints";
9
+ }
10
+ export type CjkPunctuationGlyphPolicy = PreserveInput | PreferClreqRecommendedCodepoints | ForceClreqRecommendedCodepoints;
11
+ export declare const CjkPunctuationGlyphPolicy: Readonly<{
12
+ PreserveInput: Readonly<PreserveInput>;
13
+ PreferClreqRecommendedCodepoints: Readonly<PreferClreqRecommendedCodepoints>;
14
+ ForceClreqRecommendedCodepoints: Readonly<ForceClreqRecommendedCodepoints>;
15
+ }>;
16
+ export declare function compareCjkPunctuationGlyphPolicy(a: CjkPunctuationGlyphPolicy, b: CjkPunctuationGlyphPolicy): number;
@@ -0,0 +1,17 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export const CjkPunctuationGlyphPolicy = Object.freeze({
3
+ PreserveInput: Object.freeze({ kind: "PreserveInput" }),
4
+ PreferClreqRecommendedCodepoints: Object.freeze({ kind: "PreferClreqRecommendedCodepoints" }),
5
+ ForceClreqRecommendedCodepoints: Object.freeze({ kind: "ForceClreqRecommendedCodepoints" })
6
+ });
7
+ export function compareCjkPunctuationGlyphPolicy(a, b) {
8
+ if (a === b)
9
+ return 0;
10
+ if (a.kind === "PreserveInput")
11
+ return 0 - (b.kind === "PreserveInput" ? 0 : 0);
12
+ if (a.kind === "PreferClreqRecommendedCodepoints")
13
+ return 1 - (b.kind === "PreferClreqRecommendedCodepoints" ? 1 : 0);
14
+ if (a.kind === "ForceClreqRecommendedCodepoints")
15
+ return 2 - (b.kind === "ForceClreqRecommendedCodepoints" ? 2 : 0);
16
+ return 0;
17
+ }
@@ -0,0 +1,27 @@
1
+ import { AdjustmentStylePolicy } from "./AdjustmentStylePolicy.js";
2
+ import { AutoSpacePolicy } from "./AutoSpacePolicy.js";
3
+ import { CjkPunctuationGlyphPolicy } from "./CjkPunctuationGlyphPolicy.js";
4
+ import { ClreqRegion } from "./ClreqRegion.js";
5
+ import { ClreqStrictness } from "./ClreqStrictness.js";
6
+ import { type KinsokuMode } from "./KinsokuMode.js";
7
+ import { type PunctuationGluePlacement } from "./PunctuationGluePlacement.js";
8
+ import { PunctuationWidthPolicy } from "./PunctuationWidthPolicy.js";
9
+ export declare class ClreqProfile {
10
+ readonly id: string;
11
+ readonly strictness: ClreqStrictness;
12
+ readonly region: ClreqRegion;
13
+ readonly punctuationGlyphPolicy: CjkPunctuationGlyphPolicy;
14
+ readonly coalesceRepeatablePunctuation: readonly number[];
15
+ readonly autoSpace: AutoSpacePolicy;
16
+ readonly gluePlacement: PunctuationGluePlacement;
17
+ readonly adjustment: AdjustmentStylePolicy;
18
+ readonly kinsokuMode: KinsokuMode;
19
+ readonly punctuationWidth: PunctuationWidthPolicy;
20
+ static readonly DefaultCoalesceRepeatablePunctuation: readonly number[];
21
+ static readonly MainlandHorizontal: ClreqProfile;
22
+ static readonly TaiwanHorizontal: ClreqProfile;
23
+ static readonly HongKongHorizontal: ClreqProfile;
24
+ constructor(id: string, strictness: ClreqStrictness, region: ClreqRegion, punctuationGlyphPolicy: CjkPunctuationGlyphPolicy | null, coalesceRepeatablePunctuation: readonly number[] | null, autoSpace: AutoSpacePolicy | null, gluePlacement: PunctuationGluePlacement | null, adjustment: AdjustmentStylePolicy, kinsokuMode: KinsokuMode, punctuationWidth: PunctuationWidthPolicy);
25
+ toString(): string;
26
+ static sameProfile(a: ClreqProfile, b: ClreqProfile): boolean;
27
+ }
@@ -0,0 +1,58 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { AdjustmentStylePolicy } from "./AdjustmentStylePolicy.js";
3
+ import { AutoSpacePolicy } from "./AutoSpacePolicy.js";
4
+ import { CjkPunctuationGlyphPolicy } from "./CjkPunctuationGlyphPolicy.js";
5
+ import { ClreqRegion } from "./ClreqRegion.js";
6
+ import { ClreqStrictness } from "./ClreqStrictness.js";
7
+ import { KinsokuModes } from "./KinsokuModes.js";
8
+ import { PunctuationGluePlacements } from "./PunctuationGluePlacements.js";
9
+ import { PunctuationWidthPolicy } from "./PunctuationWidthPolicy.js";
10
+ export class ClreqProfile {
11
+ id;
12
+ strictness;
13
+ region;
14
+ punctuationGlyphPolicy;
15
+ coalesceRepeatablePunctuation;
16
+ autoSpace;
17
+ gluePlacement;
18
+ adjustment;
19
+ kinsokuMode;
20
+ punctuationWidth;
21
+ static DefaultCoalesceRepeatablePunctuation = [8212, 8230, 8943];
22
+ static MainlandHorizontal = new ClreqProfile("clreq-mainland-horizontal", ClreqStrictness.Normal, ClreqRegion.Mainland, CjkPunctuationGlyphPolicy.PreferClreqRecommendedCodepoints, ClreqProfile.DefaultCoalesceRepeatablePunctuation, AutoSpacePolicy.Default, null, new AdjustmentStylePolicy(), { kind: "MeasureAdaptive", hangBelowEm: 14.0, gbAboveEm: 24.0, strictAboveEm: 32.0 }, new PunctuationWidthPolicy());
23
+ static TaiwanHorizontal = new ClreqProfile("clreq-taiwan-horizontal", ClreqStrictness.Normal, ClreqRegion.Taiwan, CjkPunctuationGlyphPolicy.PreferClreqRecommendedCodepoints, ClreqProfile.DefaultCoalesceRepeatablePunctuation, AutoSpacePolicy.Default, null, new AdjustmentStylePolicy(), { kind: "MeasureAdaptive", hangBelowEm: 14.0, gbAboveEm: 24.0, strictAboveEm: 32.0 }, new PunctuationWidthPolicy());
24
+ static HongKongHorizontal = new ClreqProfile("clreq-hongkong-horizontal", ClreqStrictness.Normal, ClreqRegion.HongKong, CjkPunctuationGlyphPolicy.PreferClreqRecommendedCodepoints, ClreqProfile.DefaultCoalesceRepeatablePunctuation, AutoSpacePolicy.Default, null, new AdjustmentStylePolicy(), { kind: "MeasureAdaptive", hangBelowEm: 14.0, gbAboveEm: 24.0, strictAboveEm: 32.0 }, new PunctuationWidthPolicy());
25
+ constructor(id, strictness, region, punctuationGlyphPolicy = null, coalesceRepeatablePunctuation = null, autoSpace = null, gluePlacement = null, adjustment, kinsokuMode, punctuationWidth) {
26
+ this.id = id;
27
+ this.strictness = strictness;
28
+ this.region = region;
29
+ this.punctuationGlyphPolicy = punctuationGlyphPolicy ?? CjkPunctuationGlyphPolicy.PreferClreqRecommendedCodepoints;
30
+ this.coalesceRepeatablePunctuation = coalesceRepeatablePunctuation ?? ClreqProfile.DefaultCoalesceRepeatablePunctuation;
31
+ this.autoSpace = autoSpace ?? AutoSpacePolicy.Default;
32
+ this.gluePlacement = gluePlacement ?? PunctuationGluePlacements.forRegion(region);
33
+ this.adjustment = adjustment;
34
+ this.kinsokuMode = kinsokuMode;
35
+ this.punctuationWidth = punctuationWidth;
36
+ }
37
+ toString() {
38
+ return `ClreqProfile(id=${this.id}, strictness=${this.strictness.kind}, region=${this.region.kind}, punctuationGlyphPolicy=${this.punctuationGlyphPolicy.kind}, coalesceRepeatablePunctuation=${(() => { let out = "["; const n = this.coalesceRepeatablePunctuation.length; for (let i = 0; i < n; i += 1) {
39
+ if (i > 0) {
40
+ out += ", ";
41
+ }
42
+ out += this.coalesceRepeatablePunctuation[i];
43
+ } out += "]"; return out; })()}, autoSpace=${this.autoSpace.toString()}, gluePlacement=${this.gluePlacement.kind}, adjustment=${this.adjustment.toString()}, kinsokuMode=${this.kinsokuMode.kind === "MeasureAdaptive" ? ("MeasureAdaptive(hangBelowEm=" + this.kinsokuMode.hangBelowEm + ", gbAboveEm=" + this.kinsokuMode.gbAboveEm + ", strictAboveEm=" + this.kinsokuMode.strictAboveEm + ")") : ("Fixed(level=" + this.kinsokuMode.level.kind + ", hanging=" + this.kinsokuMode.hanging.kind + ")")}, punctuationWidth=${this.punctuationWidth.toString()})`;
44
+ }
45
+ static sameProfile(a, b) {
46
+ if (a.id !== b.id || a.strictness !== b.strictness || a.region !== b.region || a.punctuationGlyphPolicy !== b.punctuationGlyphPolicy || a.coalesceRepeatablePunctuation.length !== b.coalesceRepeatablePunctuation.length || !AutoSpacePolicy.samePolicy(a.autoSpace, b.autoSpace) || a.gluePlacement !== b.gluePlacement || !AdjustmentStylePolicy.samePolicy(a.adjustment, b.adjustment) || !KinsokuModes.sameMode(a.kinsokuMode, b.kinsokuMode) || !PunctuationWidthPolicy.samePolicy(a.punctuationWidth, b.punctuationWidth)) {
47
+ return false;
48
+ }
49
+ let index = 0;
50
+ while (index < a.coalesceRepeatablePunctuation.length) {
51
+ if (a.coalesceRepeatablePunctuation[index] !== b.coalesceRepeatablePunctuation[index]) {
52
+ return false;
53
+ }
54
+ index += 1;
55
+ }
56
+ return true;
57
+ }
58
+ }
@@ -0,0 +1,20 @@
1
+ export interface Mainland {
2
+ readonly kind: "Mainland";
3
+ }
4
+ export interface Taiwan {
5
+ readonly kind: "Taiwan";
6
+ }
7
+ export interface HongKong {
8
+ readonly kind: "HongKong";
9
+ }
10
+ export interface Custom {
11
+ readonly kind: "Custom";
12
+ }
13
+ export type ClreqRegion = Mainland | Taiwan | HongKong | Custom;
14
+ export declare const ClreqRegion: Readonly<{
15
+ Mainland: Readonly<Mainland>;
16
+ Taiwan: Readonly<Taiwan>;
17
+ HongKong: Readonly<HongKong>;
18
+ Custom: Readonly<Custom>;
19
+ }>;
20
+ export declare function compareClreqRegion(a: ClreqRegion, b: ClreqRegion): number;
@@ -0,0 +1,20 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ export const ClreqRegion = Object.freeze({
3
+ Mainland: Object.freeze({ kind: "Mainland" }),
4
+ Taiwan: Object.freeze({ kind: "Taiwan" }),
5
+ HongKong: Object.freeze({ kind: "HongKong" }),
6
+ Custom: Object.freeze({ kind: "Custom" })
7
+ });
8
+ export function compareClreqRegion(a, b) {
9
+ if (a === b)
10
+ return 0;
11
+ if (a.kind === "Mainland")
12
+ return 0 - (b.kind === "Mainland" ? 0 : 0);
13
+ if (a.kind === "Taiwan")
14
+ return 1 - (b.kind === "Taiwan" ? 1 : 0);
15
+ if (a.kind === "HongKong")
16
+ return 2 - (b.kind === "HongKong" ? 2 : 0);
17
+ if (a.kind === "Custom")
18
+ return 3 - (b.kind === "Custom" ? 3 : 0);
19
+ return 0;
20
+ }
@@ -0,0 +1,16 @@
1
+ export interface Loose {
2
+ readonly kind: "Loose";
3
+ }
4
+ export interface Normal {
5
+ readonly kind: "Normal";
6
+ }
7
+ export interface Strict {
8
+ readonly kind: "Strict";
9
+ }
10
+ export type ClreqStrictness = Loose | Normal | Strict;
11
+ export declare const ClreqStrictness: Readonly<{
12
+ Loose: Readonly<Loose>;
13
+ Normal: Readonly<Normal>;
14
+ Strict: Readonly<Strict>;
15
+ }>;
16
+ export declare function compareClreqStrictness(a: ClreqStrictness, b: ClreqStrictness): number;