@tiqian/engine 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.
- 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/BopomofoParser.d.ts +10 -0
- package/dist/org/tiqian/clreq/BopomofoParser.js +46 -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/CjkPunctuationGlyphSubstitution.d.ts +8 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.js +25 -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/ClreqProfileResolver.d.ts +10 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.js +13 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.d.ts +7 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.js +40 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.d.ts +19 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.js +93 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.d.ts +26 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.js +137 -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/NumberSymbolCohesion.d.ts +8 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.js +56 -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/PunctuationPolicy.d.ts +10 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.js +18 -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/AccurateSum.d.ts +3 -0
- package/dist/org/tiqian/core/AccurateSum.js +9 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.js +33 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.js +17 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.d.ts +11 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.js +52 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.d.ts +4 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.js +5 -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/ClusterGeometryDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/ColorSpan.d.ts +8 -0
- package/dist/org/tiqian/core/ColorSpan.js +25 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.js +47 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/DecorationKind.d.ts +20 -0
- package/dist/org/tiqian/core/DecorationKind.js +20 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.d.ts +15 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.js +28 -0
- package/dist/org/tiqian/core/DecorationSpan.d.ts +10 -0
- package/dist/org/tiqian/core/DecorationSpan.js +36 -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/EmergencyTrackingEligibilityDecisionInfo.d.ts +9 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.js +29 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.d.ts +2 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.js +84 -0
- package/dist/org/tiqian/core/FontDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/FontDecisionInfo.js +45 -0
- package/dist/org/tiqian/core/Glyph.d.ts +15 -0
- package/dist/org/tiqian/core/Glyph.js +30 -0
- package/dist/org/tiqian/core/GlyphRun.d.ts +11 -0
- package/dist/org/tiqian/core/GlyphRun.js +28 -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/InlineAttachment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineAttachment.js +14 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.js +14 -0
- package/dist/org/tiqian/core/InlineBoxSpan.d.ts +10 -0
- package/dist/org/tiqian/core/InlineBoxSpan.js +17 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.js +31 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.d.ts +28 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.js +57 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.d.ts +11 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.js +30 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.js +17 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineObjectSpan.d.ts +13 -0
- package/dist/org/tiqian/core/InlineObjectSpan.js +22 -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/IntRangeFns.d.ts +2 -0
- package/dist/org/tiqian/core/IntRangeFns.js +4 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.js +18 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.js +21 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.d.ts +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.js +17 -0
- package/dist/org/tiqian/core/LayoutConstraints.d.ts +7 -0
- package/dist/org/tiqian/core/LayoutConstraints.js +24 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.d.ts +70 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.js +205 -0
- package/dist/org/tiqian/core/LayoutInput.d.ts +22 -0
- package/dist/org/tiqian/core/LayoutInput.js +56 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.d.ts +18 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.js +131 -0
- package/dist/org/tiqian/core/LayoutProfileId.d.ts +6 -0
- package/dist/org/tiqian/core/LayoutProfileId.js +17 -0
- package/dist/org/tiqian/core/LayoutQueries.d.ts +121 -0
- package/dist/org/tiqian/core/LayoutQueries.js +1297 -0
- package/dist/org/tiqian/core/LayoutQueryFns.d.ts +27 -0
- package/dist/org/tiqian/core/LayoutQueryFns.js +65 -0
- package/dist/org/tiqian/core/LayoutResult.d.ts +16 -0
- package/dist/org/tiqian/core/LayoutResult.js +36 -0
- package/dist/org/tiqian/core/LayoutResultFns.d.ts +3 -0
- package/dist/org/tiqian/core/LayoutResultFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.d.ts +4 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.d.ts +37 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.js +379 -0
- package/dist/org/tiqian/core/LineBox.d.ts +23 -0
- package/dist/org/tiqian/core/LineBox.js +43 -0
- package/dist/org/tiqian/core/LineBreakPolicy.d.ts +8 -0
- package/dist/org/tiqian/core/LineBreakPolicy.js +11 -0
- package/dist/org/tiqian/core/LineBreakSpan.d.ts +10 -0
- package/dist/org/tiqian/core/LineBreakSpan.js +30 -0
- package/dist/org/tiqian/core/LineDebugInfo.d.ts +7 -0
- package/dist/org/tiqian/core/LineDebugInfo.js +18 -0
- package/dist/org/tiqian/core/LineDecisionInfo.d.ts +14 -0
- package/dist/org/tiqian/core/LineDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.js +22 -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/LineLengthGrid.d.ts +7 -0
- package/dist/org/tiqian/core/LineLengthGrid.js +12 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.js +26 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.d.ts +8 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.js +14 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.d.ts +16 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.js +30 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.d.ts +15 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.js +31 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.js +20 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.d.ts +3 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.js +12 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.js +25 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.d.ts +8 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.js +17 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.d.ts +19 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/ParagraphStyle.d.ts +22 -0
- package/dist/org/tiqian/core/ParagraphStyle.js +36 -0
- package/dist/org/tiqian/core/PositionedCluster.d.ts +22 -0
- package/dist/org/tiqian/core/PositionedCluster.js +52 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.d.ts +29 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/Rect.d.ts +12 -0
- package/dist/org/tiqian/core/Rect.js +28 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.d.ts +15 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.js +25 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.d.ts +16 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.js +17 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.d.ts +19 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.js +51 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.d.ts +12 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.js +28 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.d.ts +6 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.js +62 -0
- package/dist/org/tiqian/core/RichTextLinePattern.d.ts +24 -0
- package/dist/org/tiqian/core/RichTextLinePattern.js +46 -0
- package/dist/org/tiqian/core/RichTextLineSegment.d.ts +25 -0
- package/dist/org/tiqian/core/RichTextLineSegment.js +55 -0
- package/dist/org/tiqian/core/RichTextPaint.d.ts +17 -0
- package/dist/org/tiqian/core/RichTextPaint.js +64 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.d.ts +7 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.js +102 -0
- package/dist/org/tiqian/core/RichTextRole.d.ts +35 -0
- package/dist/org/tiqian/core/RichTextRole.js +57 -0
- package/dist/org/tiqian/core/RichTextSpan.d.ts +11 -0
- package/dist/org/tiqian/core/RichTextSpan.js +34 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.d.ts +12 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.js +41 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.d.ts +20 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.js +46 -0
- package/dist/org/tiqian/core/RubyKind.d.ts +12 -0
- package/dist/org/tiqian/core/RubyKind.js +14 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.d.ts +12 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.js +14 -0
- package/dist/org/tiqian/core/RubySpan.d.ts +13 -0
- package/dist/org/tiqian/core/RubySpan.js +60 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/Size.d.ts +6 -0
- package/dist/org/tiqian/core/Size.js +12 -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/SpacingDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.js +24 -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/TextSpan.d.ts +8 -0
- package/dist/org/tiqian/core/TextSpan.js +12 -0
- package/dist/org/tiqian/core/TextStyle.d.ts +12 -0
- package/dist/org/tiqian/core/TextStyle.js +28 -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/TiqianTextContent.d.ts +12 -0
- package/dist/org/tiqian/core/TiqianTextContent.js +38 -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/core/Units.d.ts +7 -0
- package/dist/org/tiqian/core/Units.js +11 -0
- package/dist/org/tiqian/core/WritingMode.d.ts +12 -0
- package/dist/org/tiqian/core/WritingMode.js +14 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/font/BaselineClass.d.ts +24 -0
- package/dist/org/tiqian/font/BaselineClass.js +23 -0
- package/dist/org/tiqian/font/BaselinePolicy.d.ts +17 -0
- package/dist/org/tiqian/font/BaselinePolicy.js +18 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.d.ts +4 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.js +9 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.d.ts +8 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.js +43 -0
- package/dist/org/tiqian/font/FontMetricSource.d.ts +24 -0
- package/dist/org/tiqian/font/FontMetricSource.js +23 -0
- package/dist/org/tiqian/font/FontMetrics.d.ts +39 -0
- package/dist/org/tiqian/font/FontMetrics.js +106 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.js +21 -0
- package/dist/org/tiqian/font/FontPolicy.d.ts +36 -0
- package/dist/org/tiqian/font/FontPolicy.js +157 -0
- package/dist/org/tiqian/font/FontRole.d.ts +29 -0
- package/dist/org/tiqian/font/FontRole.js +27 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.d.ts +4 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.js +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.d.ts +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.js +29 -0
- package/dist/org/tiqian/font/MetricBox.d.ts +20 -0
- package/dist/org/tiqian/font/MetricBox.js +20 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.d.ts +10 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.js +30 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.js +21 -0
- package/dist/org/tiqian/font/RawFontMetrics.d.ts +11 -0
- package/dist/org/tiqian/font/RawFontMetrics.js +23 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.js +63 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.js +46 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.js +71 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.js +88 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.d.ts +57 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.js +622 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.d.ts +52 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.js +209 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.d.ts +30 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.js +215 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.d.ts +54 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.js +326 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.d.ts +6 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.js +8 -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/DefaultHyphenator.d.ts +4 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.js +7 -0
- package/dist/org/tiqian/layout/Justifier.d.ts +64 -0
- package/dist/org/tiqian/layout/Justifier.js +474 -0
- package/dist/org/tiqian/layout/KinsokuRule.d.ts +15 -0
- package/dist/org/tiqian/layout/KinsokuRule.js +24 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.d.ts +87 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.js +371 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.d.ts +29 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.js +797 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.d.ts +149 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.js +769 -0
- package/dist/org/tiqian/layout/LineBreaker.d.ts +54 -0
- package/dist/org/tiqian/layout/LineBreaker.js +457 -0
- package/dist/org/tiqian/layout/LineGeometryStage.d.ts +63 -0
- package/dist/org/tiqian/layout/LineGeometryStage.js +344 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +125 -0
- package/dist/org/tiqian/layout/LineOptimization.js +299 -0
- package/dist/org/tiqian/layout/LineRepair.d.ts +30 -0
- package/dist/org/tiqian/layout/LineRepair.js +471 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.d.ts +80 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.js +556 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.d.ts +23 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.js +135 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.d.ts +48 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.js +199 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.d.ts +63 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.js +1471 -0
- package/dist/org/tiqian/layout/PlanLowering.d.ts +10 -0
- package/dist/org/tiqian/layout/PlanLowering.js +329 -0
- package/dist/org/tiqian/layout/PreparedParagraph.d.ts +32 -0
- package/dist/org/tiqian/layout/PreparedParagraph.js +114 -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/PunctuationGeometryLedger.d.ts +92 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.js +617 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.d.ts +73 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.js +631 -0
- package/dist/org/tiqian/layout/PunctuationModel.d.ts +181 -0
- package/dist/org/tiqian/layout/PunctuationModel.js +414 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.d.ts +88 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.js +495 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.d.ts +102 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.js +1207 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.d.ts +19 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.js +64 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.d.ts +5 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.js +14 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.d.ts +4 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.js +4294 -0
- package/dist/org/tiqian/linebreak/Hyphenator.d.ts +17 -0
- package/dist/org/tiqian/linebreak/Hyphenator.js +24 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.d.ts +10 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.js +67 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.d.ts +9 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.js +23 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.d.ts +2 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.js +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.d.ts +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.js +108 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.d.ts +6 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.js +9 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.d.ts +63 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.js +103 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.d.ts +3 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.js +164 -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/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/PlanJson.d.ts +10 -0
- package/dist/org/tiqian/protocol/PlanJson.js +442 -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/PlanPacked.d.ts +34 -0
- package/dist/org/tiqian/protocol/PlanPacked.js +1166 -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/shaping/ReplayableFontBackend.d.ts +48 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.js +97 -0
- package/dist/org/tiqian/shaping/TextShaper.d.ts +71 -0
- package/dist/org/tiqian/shaping/TextShaper.js +176 -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 +22 -4
- package/README.md +0 -3
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { floatToI32, formatFloatRuntime, i32ToFloat, readUnit } from "../../../runtime.js";
|
|
3
|
+
export class PlanJsonNumber {
|
|
4
|
+
static fivePowers = [];
|
|
5
|
+
static twoPowers = [];
|
|
6
|
+
static ecmaJsonNumber(floatValue) {
|
|
7
|
+
return formatFloatRuntime(i32ToFloat(floatToI32(floatValue)));
|
|
8
|
+
}
|
|
9
|
+
static appendJsonString(out, value) {
|
|
10
|
+
out.push("\"");
|
|
11
|
+
for (let i = 0, count = value.length; i < count; i += 1) {
|
|
12
|
+
const c = (Number.isNaN(value.charCodeAt(i)) ? null : value.charCodeAt(i));
|
|
13
|
+
if (c === 34) {
|
|
14
|
+
out.push("\\\"");
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
if (c === 92) {
|
|
18
|
+
out.push("\\\\");
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (c === 8) {
|
|
22
|
+
out.push("\\b");
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
if (c === 12) {
|
|
26
|
+
out.push("\\f");
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (c === 10) {
|
|
30
|
+
out.push("\\n");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (c === 13) {
|
|
34
|
+
out.push("\\r");
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (c === 9) {
|
|
38
|
+
out.push("\\t");
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (c < 32) {
|
|
42
|
+
out.push(`\\u${(((c)) >>> 0).toString(16).toUpperCase().padStart(4, "0").toLowerCase()}`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
out.push(String.fromCodePoint((c)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
out.push("\"");
|
|
56
|
+
}
|
|
57
|
+
static shortestRoundTripDigits(magnitude) {
|
|
58
|
+
const d = PlanJsonNumber.decompose(magnitude);
|
|
59
|
+
const f = d.exp2;
|
|
60
|
+
const expansion = PlanJsonNumber.dyadicDecimal(d.mantissa, f);
|
|
61
|
+
const exact = PlanJsonNumber.trimZeros(expansion.digits);
|
|
62
|
+
const n = expansion.exponent;
|
|
63
|
+
const base = d.mantissa;
|
|
64
|
+
const doubled = PlanJsonNumber.timesSmall(base, 2);
|
|
65
|
+
const hi = PlanJsonNumber.dyadicDecimalString(PlanJsonNumber.addDecimal(doubled, "1"), d.exp2 - 1);
|
|
66
|
+
let lo;
|
|
67
|
+
if (base === "4503599627370496") {
|
|
68
|
+
lo = PlanJsonNumber.dyadicDecimalString(PlanJsonNumber.decrementDecimal(PlanJsonNumber.timesSmall(base, 4)), d.exp2 - 2);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
lo = PlanJsonNumber.dyadicDecimalString(PlanJsonNumber.decrementDecimal(doubled), d.exp2 - 1);
|
|
72
|
+
}
|
|
73
|
+
const inclusive = (readUnit(base, base.length - 1) - 48) % 2 === 0;
|
|
74
|
+
let length = 1;
|
|
75
|
+
while (length <= 17) {
|
|
76
|
+
const keep = exact.substr(0, length);
|
|
77
|
+
const up = PlanJsonNumber.incrementDecimal(keep);
|
|
78
|
+
const upN = n + up.length - length;
|
|
79
|
+
if (PlanJsonNumber.inInterval(keep, n, lo, hi, inclusive) || PlanJsonNumber.inInterval(up, upN, lo, hi, inclusive)) {
|
|
80
|
+
const rounded = PlanJsonNumber.roundToSignificant(exact, length);
|
|
81
|
+
return { digits: rounded.digits, exponent: n + rounded.exponent };
|
|
82
|
+
}
|
|
83
|
+
length += 1;
|
|
84
|
+
}
|
|
85
|
+
return { digits: exact, exponent: n };
|
|
86
|
+
}
|
|
87
|
+
static inInterval(digits, n, lo, hi, inclusive) {
|
|
88
|
+
const low = PlanJsonNumber.compareDecimal(digits, n, lo.digits, lo.exponent);
|
|
89
|
+
const high = PlanJsonNumber.compareDecimal(digits, n, hi.digits, hi.exponent);
|
|
90
|
+
return (low > 0 || low === 0 && inclusive) && (high < 0 || high === 0 && inclusive);
|
|
91
|
+
}
|
|
92
|
+
static canonicalFloatDigits(magnitude, doubleDigits) {
|
|
93
|
+
const d = PlanJsonNumber.decomposeF32(magnitude);
|
|
94
|
+
const exact = (d.mant24 === 0 ? "0" : (d.exp2 >= 0 ? PlanJsonNumber.timesLong(PlanJsonNumber.twoToThe(d.exp2), d.mant24) : PlanJsonNumber.timesLong(PlanJsonNumber.fiveToThe(-d.exp2), d.mant24)));
|
|
95
|
+
const stripped = PlanJsonNumber.trimZeros(exact);
|
|
96
|
+
if (stripped.length <= doubleDigits.length) {
|
|
97
|
+
return doubleDigits;
|
|
98
|
+
}
|
|
99
|
+
const rounded = PlanJsonNumber.roundToSignificant(stripped, doubleDigits.length);
|
|
100
|
+
return (rounded.digits.length === doubleDigits.length ? rounded.digits : doubleDigits);
|
|
101
|
+
}
|
|
102
|
+
static dyadicDecimal(p, f) {
|
|
103
|
+
return PlanJsonNumber.dyadicDecimalString(p, f);
|
|
104
|
+
}
|
|
105
|
+
static dyadicDecimalString(p, f) {
|
|
106
|
+
const digits = (f < 0 ? PlanJsonNumber.multiplyDecimal(PlanJsonNumber.fiveToThe(-f), p) : PlanJsonNumber.multiplyDecimal(PlanJsonNumber.twoToThe(f), p));
|
|
107
|
+
return { digits, exponent: (f < 0 ? digits.length + f : digits.length) };
|
|
108
|
+
}
|
|
109
|
+
static multiplyDecimal(a, b) {
|
|
110
|
+
let result = "0";
|
|
111
|
+
let shift = 0;
|
|
112
|
+
let i = b.length - 1;
|
|
113
|
+
while (i >= 0) {
|
|
114
|
+
const digit = (Number.isNaN(b.charCodeAt(i)) ? null : b.charCodeAt(i)) - 48;
|
|
115
|
+
if (digit !== 0) {
|
|
116
|
+
let part = PlanJsonNumber.timesSmall(a, digit);
|
|
117
|
+
if (shift > 0) {
|
|
118
|
+
part += PlanJsonNumber.zeros(shift);
|
|
119
|
+
}
|
|
120
|
+
result = PlanJsonNumber.addDecimal(result, part);
|
|
121
|
+
}
|
|
122
|
+
shift++;
|
|
123
|
+
i--;
|
|
124
|
+
}
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
static fiveToThe(k) {
|
|
128
|
+
if (PlanJsonNumber.fivePowers.length === 0) {
|
|
129
|
+
PlanJsonNumber.fivePowers = PlanJsonNumber.powerTable(5, 200);
|
|
130
|
+
}
|
|
131
|
+
if (k < PlanJsonNumber.fivePowers.length) {
|
|
132
|
+
return PlanJsonNumber.fivePowers[k];
|
|
133
|
+
}
|
|
134
|
+
return PlanJsonNumber.powerTable(5, k + 1)[k];
|
|
135
|
+
}
|
|
136
|
+
static twoToThe(k) {
|
|
137
|
+
if (PlanJsonNumber.twoPowers.length === 0) {
|
|
138
|
+
PlanJsonNumber.twoPowers = PlanJsonNumber.powerTable(2, 200);
|
|
139
|
+
}
|
|
140
|
+
if (k < PlanJsonNumber.twoPowers.length) {
|
|
141
|
+
return PlanJsonNumber.twoPowers[k];
|
|
142
|
+
}
|
|
143
|
+
return PlanJsonNumber.powerTable(2, k + 1)[k];
|
|
144
|
+
}
|
|
145
|
+
static powerTable(base, entries) {
|
|
146
|
+
const table = ["1"];
|
|
147
|
+
let digits = "1";
|
|
148
|
+
for (let i = 1; i < entries; i += 1) {
|
|
149
|
+
digits = PlanJsonNumber.timesSmall(digits, base);
|
|
150
|
+
table.push(digits);
|
|
151
|
+
}
|
|
152
|
+
return table;
|
|
153
|
+
}
|
|
154
|
+
static timesLong(digits, factor) {
|
|
155
|
+
if (factor === 0) {
|
|
156
|
+
return "0";
|
|
157
|
+
}
|
|
158
|
+
let result = null;
|
|
159
|
+
let shift = 0;
|
|
160
|
+
let remaining = factor;
|
|
161
|
+
while (remaining > 0) {
|
|
162
|
+
const chunk = remaining % 100000000;
|
|
163
|
+
remaining = Math.trunc(remaining / 100000000);
|
|
164
|
+
if (chunk !== 0) {
|
|
165
|
+
let part = PlanJsonNumber.timesSmall(digits, chunk);
|
|
166
|
+
if (shift > 0) {
|
|
167
|
+
part += PlanJsonNumber.zeros(shift);
|
|
168
|
+
}
|
|
169
|
+
result = (result === null ? part : PlanJsonNumber.addDecimal(result, part));
|
|
170
|
+
}
|
|
171
|
+
shift += 8;
|
|
172
|
+
}
|
|
173
|
+
return (result === null ? "0" : result);
|
|
174
|
+
}
|
|
175
|
+
static addDecimal(a, b) {
|
|
176
|
+
const out = [];
|
|
177
|
+
let i = a.length - 1;
|
|
178
|
+
let j = b.length - 1;
|
|
179
|
+
let carry = 0;
|
|
180
|
+
while (i >= 0 || j >= 0 || carry > 0) {
|
|
181
|
+
const sum = (i >= 0 ? (Number.isNaN(a.charCodeAt(i)) ? null : a.charCodeAt(i)) - 48 : 0) + (j >= 0 ? (Number.isNaN(b.charCodeAt(j)) ? null : b.charCodeAt(j)) - 48 : 0) + carry;
|
|
182
|
+
out.push(String.fromCodePoint(48 + sum % 10));
|
|
183
|
+
carry = Math.trunc(sum / 10);
|
|
184
|
+
i--;
|
|
185
|
+
j--;
|
|
186
|
+
}
|
|
187
|
+
const text = out.join("");
|
|
188
|
+
return PlanJsonNumber.reverse(text);
|
|
189
|
+
}
|
|
190
|
+
static roundToSignificant(exact, length) {
|
|
191
|
+
if (length >= exact.length) {
|
|
192
|
+
return { digits: exact, exponent: 0 };
|
|
193
|
+
}
|
|
194
|
+
const keep = exact.substr(0, length);
|
|
195
|
+
const rem = exact.substr(length);
|
|
196
|
+
let up = false;
|
|
197
|
+
if ((Number.isNaN(rem.charCodeAt(0)) ? null : rem.charCodeAt(0)) > 53) {
|
|
198
|
+
up = true;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
if ((Number.isNaN(rem.charCodeAt(0)) ? null : rem.charCodeAt(0)) === 53) {
|
|
202
|
+
let tail = 1;
|
|
203
|
+
while (tail < rem.length && (Number.isNaN(rem.charCodeAt(tail)) ? null : rem.charCodeAt(tail)) === 48) {
|
|
204
|
+
tail++;
|
|
205
|
+
}
|
|
206
|
+
up = tail < rem.length || (readUnit(keep, keep.length - 1) - 48) % 2 !== 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const rounded = (up ? PlanJsonNumber.incrementDecimal(keep) : keep);
|
|
210
|
+
return { digits: PlanJsonNumber.trimZeros(rounded), exponent: rounded.length - length };
|
|
211
|
+
}
|
|
212
|
+
static compareDecimal(a, nA, b, nB) {
|
|
213
|
+
const eA = nA - a.length;
|
|
214
|
+
const eB = nB - b.length;
|
|
215
|
+
const aa = (eA >= eB ? a + PlanJsonNumber.zeros(eA - eB) : a);
|
|
216
|
+
const bb = (eB >= eA ? b + PlanJsonNumber.zeros(eB - eA) : b);
|
|
217
|
+
if (aa.length !== bb.length) {
|
|
218
|
+
return aa.length - bb.length;
|
|
219
|
+
}
|
|
220
|
+
return PlanJsonNumber.compareDigitStrings(aa, bb);
|
|
221
|
+
}
|
|
222
|
+
static timesSmall(digits, factor) {
|
|
223
|
+
const out = [];
|
|
224
|
+
let carry = 0;
|
|
225
|
+
let i = digits.length - 1;
|
|
226
|
+
while (i >= 0) {
|
|
227
|
+
const product = ((Number.isNaN(digits.charCodeAt(i)) ? null : digits.charCodeAt(i)) - 48) * factor + carry;
|
|
228
|
+
out.push(String.fromCodePoint(48 + product % 10));
|
|
229
|
+
carry = Math.trunc(product / 10);
|
|
230
|
+
i--;
|
|
231
|
+
}
|
|
232
|
+
while (carry > 0) {
|
|
233
|
+
out.push(String.fromCodePoint(48 + carry % 10));
|
|
234
|
+
carry = Math.trunc(carry / 10);
|
|
235
|
+
}
|
|
236
|
+
const text = out.join("");
|
|
237
|
+
return PlanJsonNumber.reverse(text);
|
|
238
|
+
}
|
|
239
|
+
static incrementDecimal(digits) {
|
|
240
|
+
const a = digits.split("");
|
|
241
|
+
let i = a.length - 1;
|
|
242
|
+
while (true) {
|
|
243
|
+
if (a[i] !== "9") {
|
|
244
|
+
a[i] = String.fromCodePoint(readUnit(a[i], 0) + 1);
|
|
245
|
+
return a.join("");
|
|
246
|
+
}
|
|
247
|
+
a[i] = "0";
|
|
248
|
+
if (i === 0) {
|
|
249
|
+
return `1${a.join("")}`;
|
|
250
|
+
}
|
|
251
|
+
i--;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
static decrementDecimal(digits) {
|
|
255
|
+
const a = digits.split("");
|
|
256
|
+
let i = a.length - 1;
|
|
257
|
+
while (i >= 0 && a[i] === "0") {
|
|
258
|
+
a[i] = "9";
|
|
259
|
+
i--;
|
|
260
|
+
}
|
|
261
|
+
if (i >= 0) {
|
|
262
|
+
a[i] = String.fromCodePoint(readUnit(a[i], 0) - 1);
|
|
263
|
+
}
|
|
264
|
+
const out = a.join("");
|
|
265
|
+
let start = 0;
|
|
266
|
+
while (start < out.length - 1 && (Number.isNaN(out.charCodeAt(start)) ? null : out.charCodeAt(start)) === 48) {
|
|
267
|
+
start++;
|
|
268
|
+
}
|
|
269
|
+
return out.substr(start);
|
|
270
|
+
}
|
|
271
|
+
static decompose(v) {
|
|
272
|
+
const f = PlanJsonNumber.decomposeF32(v);
|
|
273
|
+
let mantissa = String(f.mant24);
|
|
274
|
+
let exponent = f.exp2;
|
|
275
|
+
if (f.mant24 >= 8388608) {
|
|
276
|
+
mantissa = PlanJsonNumber.timesLong(mantissa, 536870912);
|
|
277
|
+
exponent -= 29;
|
|
278
|
+
}
|
|
279
|
+
while (mantissa.length < 16 || mantissa.length === 16 && PlanJsonNumber.compareDigitStrings(mantissa, "4503599627370496") < 0) {
|
|
280
|
+
mantissa = PlanJsonNumber.timesSmall(mantissa, 2);
|
|
281
|
+
exponent--;
|
|
282
|
+
}
|
|
283
|
+
return { mantissa, exp2: exponent };
|
|
284
|
+
}
|
|
285
|
+
static decomposeF32(v) {
|
|
286
|
+
const bits = floatToI32(v);
|
|
287
|
+
const rawExponent = (bits >>> 23) & 255;
|
|
288
|
+
const rawMantissa = bits & 8388607;
|
|
289
|
+
if (rawExponent === 0) {
|
|
290
|
+
return { mant24: rawMantissa, exp2: -149 };
|
|
291
|
+
}
|
|
292
|
+
return { mant24: rawMantissa | 8388608, exp2: rawExponent - 150 };
|
|
293
|
+
}
|
|
294
|
+
static compareDigitStrings(a, b) {
|
|
295
|
+
if (a.length !== b.length) {
|
|
296
|
+
return a.length - b.length;
|
|
297
|
+
}
|
|
298
|
+
let i = 0;
|
|
299
|
+
while (i < a.length) {
|
|
300
|
+
const da = (Number.isNaN(a.charCodeAt(i)) ? null : a.charCodeAt(i));
|
|
301
|
+
const db = (Number.isNaN(b.charCodeAt(i)) ? null : b.charCodeAt(i));
|
|
302
|
+
if (da !== db) {
|
|
303
|
+
return da - db;
|
|
304
|
+
}
|
|
305
|
+
i++;
|
|
306
|
+
}
|
|
307
|
+
return 0;
|
|
308
|
+
}
|
|
309
|
+
static zeros(n) {
|
|
310
|
+
let buf_b = "";
|
|
311
|
+
for (let i = 0; i < n; i += 1) {
|
|
312
|
+
buf_b += "0";
|
|
313
|
+
}
|
|
314
|
+
return buf_b;
|
|
315
|
+
}
|
|
316
|
+
static trimZeros(s) {
|
|
317
|
+
let e = s.length;
|
|
318
|
+
while (e > 1 && readUnit(s, e - 1) === 48) {
|
|
319
|
+
e--;
|
|
320
|
+
}
|
|
321
|
+
return s.substr(0, e);
|
|
322
|
+
}
|
|
323
|
+
static reverse(s) {
|
|
324
|
+
let buf_b = "";
|
|
325
|
+
let i = s.length - 1;
|
|
326
|
+
while (i >= 0) {
|
|
327
|
+
{
|
|
328
|
+
const c = (Number.isNaN(s.charCodeAt(i)) ? null : s.charCodeAt(i));
|
|
329
|
+
buf_b += String.fromCodePoint(c);
|
|
330
|
+
}
|
|
331
|
+
i--;
|
|
332
|
+
}
|
|
333
|
+
return buf_b;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
export function comparePlanJsonDigitsAndExponent(a, b) {
|
|
337
|
+
if (a === b)
|
|
338
|
+
return 0;
|
|
339
|
+
if (a.digits !== b.digits)
|
|
340
|
+
return a.digits < b.digits ? -1 : 1;
|
|
341
|
+
if (a.exponent !== b.exponent)
|
|
342
|
+
return a.exponent - b.exponent;
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
export function comparePlanJsonDecomposed(a, b) {
|
|
346
|
+
if (a === b)
|
|
347
|
+
return 0;
|
|
348
|
+
if (a.mantissa !== b.mantissa)
|
|
349
|
+
return a.mantissa < b.mantissa ? -1 : 1;
|
|
350
|
+
if (a.exp2 !== b.exp2)
|
|
351
|
+
return a.exp2 - b.exp2;
|
|
352
|
+
return 0;
|
|
353
|
+
}
|
|
354
|
+
export function comparePlanJsonF32Decomposed(a, b) {
|
|
355
|
+
if (a === b)
|
|
356
|
+
return 0;
|
|
357
|
+
if (a.mant24 !== b.mant24)
|
|
358
|
+
return a.mant24 - b.mant24;
|
|
359
|
+
if (a.exp2 !== b.exp2)
|
|
360
|
+
return a.exp2 - b.exp2;
|
|
361
|
+
return 0;
|
|
362
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Plan } from "./Plan.js";
|
|
2
|
+
export declare class PlanPackedWriter {
|
|
3
|
+
private readonly buf;
|
|
4
|
+
constructor();
|
|
5
|
+
u8(v: number): void;
|
|
6
|
+
u16(v: number): void;
|
|
7
|
+
u32(v: number): void;
|
|
8
|
+
f64(v: number): void;
|
|
9
|
+
raw(bytes: Uint8Array): void;
|
|
10
|
+
finish(): Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
export declare class PlanPackedReader {
|
|
13
|
+
private readonly bytes;
|
|
14
|
+
private pos;
|
|
15
|
+
failed: boolean;
|
|
16
|
+
constructor(bytes: Uint8Array);
|
|
17
|
+
u8(): number;
|
|
18
|
+
u32(): number;
|
|
19
|
+
f64(): number;
|
|
20
|
+
string(len: number): string;
|
|
21
|
+
private need;
|
|
22
|
+
}
|
|
23
|
+
export declare class StringPool {
|
|
24
|
+
readonly ordered: string[];
|
|
25
|
+
constructor();
|
|
26
|
+
intern(value: string): number;
|
|
27
|
+
indexOf(value: string): number;
|
|
28
|
+
}
|
|
29
|
+
export declare class PlanPacked {
|
|
30
|
+
private static f32;
|
|
31
|
+
static encode(plan: Plan): Uint8Array;
|
|
32
|
+
private static endReasonCode;
|
|
33
|
+
static decode(bytes: Uint8Array): Plan | null;
|
|
34
|
+
}
|