@tscaps/engine 0.1.1 → 0.3.0

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 (657) hide show
  1. package/README.md +48 -10
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
  7. package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
  8. package/dist/modules/bidi/BidiAnalyzer.js +2 -0
  9. package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
  10. package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
  11. package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
  12. package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
  13. package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
  14. package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
  15. package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
  16. package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
  17. package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
  18. package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
  19. package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
  20. package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
  21. package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
  22. package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
  23. package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
  24. package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
  25. package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
  26. package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
  27. package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
  28. package/dist/modules/bidi/HorizontalSide.js +3 -0
  29. package/dist/modules/bidi/HorizontalSide.js.map +1 -0
  30. package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
  31. package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
  32. package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
  33. package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
  34. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
  35. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
  36. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
  37. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
  38. package/dist/modules/bidi/TextDirection.d.ts +9 -0
  39. package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
  40. package/dist/modules/bidi/TextDirection.js +2 -0
  41. package/dist/modules/bidi/TextDirection.js.map +1 -0
  42. package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
  43. package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
  44. package/dist/modules/bidi/TextDirectionDetector.js +2 -0
  45. package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
  46. package/dist/modules/bidi/WordFragment.d.ts +34 -0
  47. package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
  48. package/dist/modules/bidi/WordFragment.js +2 -0
  49. package/dist/modules/bidi/WordFragment.js.map +1 -0
  50. package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
  51. package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
  52. package/dist/modules/bidi/WordFragmenter.js +112 -0
  53. package/dist/modules/bidi/WordFragmenter.js.map +1 -0
  54. package/dist/modules/bidi/index.d.ts +14 -0
  55. package/dist/modules/bidi/index.d.ts.map +1 -0
  56. package/dist/modules/bidi/index.js +8 -0
  57. package/dist/modules/bidi/index.js.map +1 -0
  58. package/dist/modules/css/CssBlockSealer.d.ts +30 -0
  59. package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
  60. package/dist/modules/css/CssBlockSealer.js +64 -0
  61. package/dist/modules/css/CssBlockSealer.js.map +1 -0
  62. package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
  63. package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
  64. package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
  65. package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
  66. package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
  67. package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
  68. package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
  69. package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
  70. package/dist/modules/css/CssFragmentParser.d.ts +53 -0
  71. package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
  72. package/dist/modules/css/CssFragmentParser.js +127 -0
  73. package/dist/modules/css/CssFragmentParser.js.map +1 -0
  74. package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
  75. package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
  76. package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
  77. package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
  78. package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
  79. package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
  80. package/dist/modules/css/CssKeyframesScanner.js +102 -0
  81. package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
  82. package/dist/modules/css/CssLayer.d.ts +20 -0
  83. package/dist/modules/css/CssLayer.d.ts.map +1 -0
  84. package/dist/modules/css/CssLayer.js +21 -0
  85. package/dist/modules/css/CssLayer.js.map +1 -0
  86. package/dist/modules/css/CssScoper.d.ts +31 -2
  87. package/dist/modules/css/CssScoper.d.ts.map +1 -1
  88. package/dist/modules/css/CssScoper.js +168 -79
  89. package/dist/modules/css/CssScoper.js.map +1 -1
  90. package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
  91. package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
  92. package/dist/modules/css/CssSelectorClassScanner.js +91 -0
  93. package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
  94. package/dist/modules/css/CssVarReferenceScanner.d.ts +16 -0
  95. package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -0
  96. package/dist/modules/css/CssVarReferenceScanner.js +27 -0
  97. package/dist/modules/css/CssVarReferenceScanner.js.map +1 -0
  98. package/dist/modules/css/index.d.ts +9 -0
  99. package/dist/modules/css/index.d.ts.map +1 -1
  100. package/dist/modules/css/index.js +9 -0
  101. package/dist/modules/css/index.js.map +1 -1
  102. package/dist/modules/document/CssClass.d.ts +20 -0
  103. package/dist/modules/document/CssClass.d.ts.map +1 -0
  104. package/dist/modules/document/CssClass.js +21 -0
  105. package/dist/modules/document/CssClass.js.map +1 -0
  106. package/dist/modules/document/CssVariable.d.ts +21 -6
  107. package/dist/modules/document/CssVariable.d.ts.map +1 -1
  108. package/dist/modules/document/CssVariable.js +27 -5
  109. package/dist/modules/document/CssVariable.js.map +1 -1
  110. package/dist/modules/document/DataAttribute.d.ts +26 -0
  111. package/dist/modules/document/DataAttribute.d.ts.map +1 -0
  112. package/dist/modules/document/DataAttribute.js +27 -0
  113. package/dist/modules/document/DataAttribute.js.map +1 -0
  114. package/dist/modules/document/Decoration.d.ts +42 -0
  115. package/dist/modules/document/Decoration.d.ts.map +1 -0
  116. package/dist/modules/document/Decoration.js +52 -0
  117. package/dist/modules/document/Decoration.js.map +1 -0
  118. package/dist/modules/document/Document.d.ts.map +1 -1
  119. package/dist/modules/document/Document.js +0 -3
  120. package/dist/modules/document/Document.js.map +1 -1
  121. package/dist/modules/document/DocumentEditor.d.ts +51 -9
  122. package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
  123. package/dist/modules/document/DocumentEditor.js +118 -26
  124. package/dist/modules/document/DocumentEditor.js.map +1 -1
  125. package/dist/modules/document/DocumentNodeId.d.ts +23 -0
  126. package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
  127. package/dist/modules/document/DocumentNodeId.js +31 -0
  128. package/dist/modules/document/DocumentNodeId.js.map +1 -0
  129. package/dist/modules/document/Line.d.ts +10 -7
  130. package/dist/modules/document/Line.d.ts.map +1 -1
  131. package/dist/modules/document/Line.js +13 -25
  132. package/dist/modules/document/Line.js.map +1 -1
  133. package/dist/modules/document/Section.d.ts +1 -8
  134. package/dist/modules/document/Section.d.ts.map +1 -1
  135. package/dist/modules/document/Section.js +4 -35
  136. package/dist/modules/document/Section.js.map +1 -1
  137. package/dist/modules/document/Segment.d.ts +24 -14
  138. package/dist/modules/document/Segment.d.ts.map +1 -1
  139. package/dist/modules/document/Segment.js +41 -23
  140. package/dist/modules/document/Segment.js.map +1 -1
  141. package/dist/modules/document/Word.d.ts +21 -8
  142. package/dist/modules/document/Word.d.ts.map +1 -1
  143. package/dist/modules/document/Word.js +34 -35
  144. package/dist/modules/document/Word.js.map +1 -1
  145. package/dist/modules/document/index.d.ts +5 -2
  146. package/dist/modules/document/index.d.ts.map +1 -1
  147. package/dist/modules/document/index.js +4 -1
  148. package/dist/modules/document/index.js.map +1 -1
  149. package/dist/modules/effect/CarryQuotesEffect.d.ts +1 -7
  150. package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -1
  151. package/dist/modules/effect/CarryQuotesEffect.js +17 -30
  152. package/dist/modules/effect/CarryQuotesEffect.js.map +1 -1
  153. package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
  154. package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
  155. package/dist/modules/effect/GapFreeEffect.js +29 -4
  156. package/dist/modules/effect/GapFreeEffect.js.map +1 -1
  157. package/dist/modules/effect/RemovePunctuationEffect.d.ts +10 -2
  158. package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -1
  159. package/dist/modules/effect/RemovePunctuationEffect.js +26 -6
  160. package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -1
  161. package/dist/modules/effect/SmartLowercaseEffect.d.ts +7 -6
  162. package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -1
  163. package/dist/modules/effect/SmartLowercaseEffect.js +11 -7
  164. package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -1
  165. package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +3 -3
  166. package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -1
  167. package/dist/modules/pipeline/RenderPipelineBuilder.js +13 -8
  168. package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
  169. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +19 -25
  170. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
  171. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +43 -717
  172. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
  173. package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
  174. package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
  175. package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
  176. package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
  177. package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +10 -5
  178. package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
  179. package/dist/modules/rendering/index.d.ts +16 -8
  180. package/dist/modules/rendering/index.d.ts.map +1 -1
  181. package/dist/modules/rendering/index.js +8 -2
  182. package/dist/modules/rendering/index.js.map +1 -1
  183. package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +41 -0
  184. package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -0
  185. package/dist/modules/rendering/styles/BaselineCssComposer.js +64 -0
  186. package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -0
  187. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts +7 -0
  188. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -0
  189. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +35 -0
  190. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -0
  191. package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
  192. package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
  193. package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
  194. package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
  195. package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +20 -0
  196. package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -0
  197. package/dist/modules/rendering/styles/InlineStyleEmitter.js +44 -0
  198. package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -0
  199. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts +15 -0
  200. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts.map +1 -0
  201. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js +33 -0
  202. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js.map +1 -0
  203. package/dist/modules/rendering/{VideoFrameLayerClass.d.ts → styles/VideoFrameLayerBaselineCss.d.ts} +3 -10
  204. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
  205. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
  206. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
  207. package/dist/modules/rendering/subtitle/AbstractAnim.d.ts +13 -0
  208. package/dist/modules/rendering/subtitle/AbstractAnim.d.ts.map +1 -0
  209. package/dist/modules/rendering/subtitle/AbstractAnim.js +2 -0
  210. package/dist/modules/rendering/subtitle/AbstractAnim.js.map +1 -0
  211. package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts +20 -0
  212. package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts.map +1 -0
  213. package/dist/modules/rendering/subtitle/ActiveRenderSession.js +31 -0
  214. package/dist/modules/rendering/subtitle/ActiveRenderSession.js.map +1 -0
  215. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +21 -0
  216. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -0
  217. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +46 -0
  218. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -0
  219. package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +39 -0
  220. package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -0
  221. package/dist/modules/rendering/subtitle/AnimationProbe.js +203 -0
  222. package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -0
  223. package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts +15 -0
  224. package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts.map +1 -0
  225. package/dist/modules/rendering/subtitle/AssetGroupBuilder.js +26 -0
  226. package/dist/modules/rendering/subtitle/AssetGroupBuilder.js.map +1 -0
  227. package/dist/modules/rendering/subtitle/BatchPlan.d.ts +32 -0
  228. package/dist/modules/rendering/subtitle/BatchPlan.d.ts.map +1 -0
  229. package/dist/modules/rendering/subtitle/BatchPlan.js +2 -0
  230. package/dist/modules/rendering/subtitle/BatchPlan.js.map +1 -0
  231. package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +32 -0
  232. package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -0
  233. package/dist/modules/rendering/subtitle/BatchPlanner.js +93 -0
  234. package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -0
  235. package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +36 -0
  236. package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -0
  237. package/dist/modules/rendering/subtitle/PreparedStyle.js +2 -0
  238. package/dist/modules/rendering/subtitle/PreparedStyle.js.map +1 -0
  239. package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts +31 -0
  240. package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts.map +1 -0
  241. package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +91 -0
  242. package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -0
  243. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts +13 -0
  244. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts.map +1 -0
  245. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js +24 -0
  246. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js.map +1 -0
  247. package/dist/modules/rendering/{SegmentPaintRegionResolver.d.ts → subtitle/SegmentPaintRegionResolver.d.ts} +1 -1
  248. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -0
  249. package/dist/modules/rendering/{SegmentPaintRegionResolver.js → subtitle/SegmentPaintRegionResolver.js} +7 -4
  250. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -0
  251. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts +45 -0
  252. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts.map +1 -0
  253. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js +50 -0
  254. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js.map +1 -0
  255. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +108 -0
  256. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
  257. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +246 -0
  258. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -0
  259. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +40 -0
  260. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -0
  261. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +132 -0
  262. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -0
  263. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +48 -0
  264. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -0
  265. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +143 -0
  266. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -0
  267. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts +17 -0
  268. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts.map +1 -0
  269. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js +58 -0
  270. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js.map +1 -0
  271. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +20 -0
  272. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -0
  273. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +30 -0
  274. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -0
  275. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts +42 -0
  276. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -0
  277. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +121 -0
  278. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -0
  279. package/dist/modules/rendering/types/AlignmentConfig.d.ts +33 -0
  280. package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -0
  281. package/dist/modules/rendering/types/AlignmentConfig.js +3 -0
  282. package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -0
  283. package/dist/modules/rendering/types/BoxEdges.d.ts.map +1 -0
  284. package/dist/modules/rendering/types/BoxEdges.js.map +1 -0
  285. package/dist/modules/rendering/types/DecorationPlacementSide.d.ts +8 -0
  286. package/dist/modules/rendering/types/DecorationPlacementSide.d.ts.map +1 -0
  287. package/dist/modules/rendering/types/DecorationPlacementSide.js +2 -0
  288. package/dist/modules/rendering/types/DecorationPlacementSide.js.map +1 -0
  289. package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +23 -0
  290. package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -0
  291. package/dist/modules/rendering/types/ElementRenderOverrides.js +52 -0
  292. package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -0
  293. package/dist/modules/rendering/types/InlineStyleMap.d.ts.map +1 -0
  294. package/dist/modules/rendering/types/InlineStyleMap.js.map +1 -0
  295. package/dist/modules/rendering/{RenderingConfig.d.ts → types/RenderingConfig.d.ts} +8 -1
  296. package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -0
  297. package/dist/modules/rendering/types/RenderingConfig.js.map +1 -0
  298. package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +24 -0
  299. package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -0
  300. package/dist/modules/rendering/types/ScopedRenderOverride.js.map +1 -0
  301. package/dist/modules/rendering/types/VideoFrameSource.d.ts.map +1 -0
  302. package/dist/modules/rendering/types/VideoFrameSource.js.map +1 -0
  303. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts +33 -0
  304. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts.map +1 -0
  305. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js +100 -0
  306. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js.map +1 -0
  307. package/dist/modules/splitting/FixedTailLineSplitter.d.ts +29 -0
  308. package/dist/modules/splitting/FixedTailLineSplitter.d.ts.map +1 -0
  309. package/dist/modules/splitting/FixedTailLineSplitter.js +43 -0
  310. package/dist/modules/splitting/FixedTailLineSplitter.js.map +1 -0
  311. package/dist/modules/splitting/index.d.ts +4 -0
  312. package/dist/modules/splitting/index.d.ts.map +1 -1
  313. package/dist/modules/splitting/index.js +2 -0
  314. package/dist/modules/splitting/index.js.map +1 -1
  315. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
  316. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
  317. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
  318. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
  319. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
  320. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
  321. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
  322. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
  323. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
  324. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
  325. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
  326. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
  327. package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
  328. package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
  329. package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
  330. package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
  331. package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
  332. package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
  333. package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
  334. package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
  335. package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
  336. package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
  337. package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
  338. package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
  339. package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
  340. package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
  341. package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
  342. package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
  343. package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
  344. package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
  345. package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
  346. package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
  347. package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
  348. package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
  349. package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
  350. package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
  351. package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
  352. package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
  353. package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
  354. package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
  355. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
  356. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
  357. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
  358. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
  359. package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
  360. package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
  361. package/dist/modules/subtitle-file/Timecode.js +32 -0
  362. package/dist/modules/subtitle-file/Timecode.js.map +1 -0
  363. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
  364. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
  365. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
  366. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
  367. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
  368. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
  369. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
  370. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
  371. package/dist/modules/subtitle-file/index.d.ts +10 -0
  372. package/dist/modules/subtitle-file/index.d.ts.map +1 -0
  373. package/dist/modules/subtitle-file/index.js +8 -0
  374. package/dist/modules/subtitle-file/index.js.map +1 -0
  375. package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
  376. package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
  377. package/dist/modules/svg-filter/SvgFilter.js +9 -1
  378. package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
  379. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
  380. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
  381. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
  382. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
  383. package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
  384. package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
  385. package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
  386. package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
  387. package/dist/modules/svg-filter/index.d.ts +2 -0
  388. package/dist/modules/svg-filter/index.d.ts.map +1 -1
  389. package/dist/modules/svg-filter/index.js +1 -0
  390. package/dist/modules/svg-filter/index.js.map +1 -1
  391. package/dist/modules/tagging/PauseTagger.d.ts +24 -0
  392. package/dist/modules/tagging/PauseTagger.d.ts.map +1 -0
  393. package/dist/modules/tagging/PauseTagger.js +42 -0
  394. package/dist/modules/tagging/PauseTagger.js.map +1 -0
  395. package/dist/modules/tagging/RegexTagger.js +1 -1
  396. package/dist/modules/tagging/RegexTagger.js.map +1 -1
  397. package/dist/modules/tagging/SpanTagger.js +1 -1
  398. package/dist/modules/tagging/SpanTagger.js.map +1 -1
  399. package/dist/modules/tagging/StructureTagger.d.ts +1 -2
  400. package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
  401. package/dist/modules/tagging/StructureTagger.js +12 -11
  402. package/dist/modules/tagging/StructureTagger.js.map +1 -1
  403. package/dist/modules/tagging/WordlistTagger.js +1 -1
  404. package/dist/modules/tagging/WordlistTagger.js.map +1 -1
  405. package/dist/modules/tagging/index.d.ts +2 -0
  406. package/dist/modules/tagging/index.d.ts.map +1 -1
  407. package/dist/modules/tagging/index.js +1 -0
  408. package/dist/modules/tagging/index.js.map +1 -1
  409. package/dist/modules/tags/AndTagCondition.d.ts +10 -0
  410. package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
  411. package/dist/modules/tags/AndTagCondition.js +14 -0
  412. package/dist/modules/tags/AndTagCondition.js.map +1 -0
  413. package/dist/modules/tags/HasTagCondition.d.ts +10 -0
  414. package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
  415. package/dist/modules/tags/HasTagCondition.js +18 -0
  416. package/dist/modules/tags/HasTagCondition.js.map +1 -0
  417. package/dist/modules/tags/NotTagCondition.d.ts +10 -0
  418. package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
  419. package/dist/modules/tags/NotTagCondition.js +14 -0
  420. package/dist/modules/tags/NotTagCondition.js.map +1 -0
  421. package/dist/modules/tags/OrTagCondition.d.ts +10 -0
  422. package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
  423. package/dist/modules/tags/OrTagCondition.js +14 -0
  424. package/dist/modules/tags/OrTagCondition.js.map +1 -0
  425. package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +4 -10
  426. package/dist/modules/tags/StructureTag.d.ts.map +1 -0
  427. package/dist/modules/{document/Tag.js → tags/StructureTag.js} +4 -19
  428. package/dist/modules/tags/StructureTag.js.map +1 -0
  429. package/dist/modules/tags/Tag.d.ts +8 -0
  430. package/dist/modules/tags/Tag.d.ts.map +1 -0
  431. package/dist/modules/tags/Tag.js +16 -0
  432. package/dist/modules/tags/Tag.js.map +1 -0
  433. package/dist/modules/tags/TagCondition.d.ts +12 -0
  434. package/dist/modules/tags/TagCondition.d.ts.map +1 -0
  435. package/dist/modules/tags/TagCondition.js +2 -0
  436. package/dist/modules/tags/TagCondition.js.map +1 -0
  437. package/dist/modules/tags/TagConditionParser.d.ts +21 -0
  438. package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
  439. package/dist/modules/tags/TagConditionParser.js +75 -0
  440. package/dist/modules/tags/TagConditionParser.js.map +1 -0
  441. package/dist/modules/tags/index.d.ts +9 -0
  442. package/dist/modules/tags/index.d.ts.map +1 -0
  443. package/dist/modules/tags/index.js +8 -0
  444. package/dist/modules/tags/index.js.map +1 -0
  445. package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
  446. package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
  447. package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
  448. package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
  449. package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
  450. package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
  451. package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
  452. package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
  453. package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
  454. package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
  455. package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
  456. package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
  457. package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
  458. package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
  459. package/dist/modules/transcription/CueParseResult.d.ts +16 -0
  460. package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
  461. package/dist/modules/transcription/CueParseResult.js +2 -0
  462. package/dist/modules/transcription/CueParseResult.js.map +1 -0
  463. package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
  464. package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
  465. package/dist/modules/transcription/CueTextTokenizer.js +21 -0
  466. package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
  467. package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
  468. package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
  469. package/dist/modules/transcription/CueTimecodeReader.js +45 -0
  470. package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
  471. package/dist/modules/transcription/CueWordReader.d.ts +12 -0
  472. package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
  473. package/dist/modules/transcription/CueWordReader.js +2 -0
  474. package/dist/modules/transcription/CueWordReader.js.map +1 -0
  475. package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
  476. package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
  477. package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
  478. package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
  479. package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
  480. package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
  481. package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
  482. package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
  483. package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
  484. package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
  485. package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
  486. package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
  487. package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
  488. package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
  489. package/dist/modules/transcription/ModelFileCache.js +2 -0
  490. package/dist/modules/transcription/ModelFileCache.js.map +1 -0
  491. package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
  492. package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
  493. package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
  494. package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
  495. package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
  496. package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
  497. package/dist/modules/transcription/SrtTranscriber.js +32 -90
  498. package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
  499. package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
  500. package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
  501. package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
  502. package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
  503. package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
  504. package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
  505. package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
  506. package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
  507. package/dist/modules/transcription/Transcriber.d.ts +13 -0
  508. package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
  509. package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
  510. package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
  511. package/dist/modules/transcription/TransformersRuntime.js +79 -0
  512. package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
  513. package/dist/modules/transcription/VttTranscriber.d.ts +46 -0
  514. package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -0
  515. package/dist/modules/transcription/VttTranscriber.js +80 -0
  516. package/dist/modules/transcription/VttTranscriber.js.map +1 -0
  517. package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
  518. package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
  519. package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
  520. package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
  521. package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
  522. package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
  523. package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
  524. package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
  525. package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
  526. package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
  527. package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
  528. package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
  529. package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
  530. package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
  531. package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
  532. package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
  533. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
  534. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
  535. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
  536. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
  537. package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
  538. package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
  539. package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
  540. package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
  541. package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
  542. package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
  543. package/dist/modules/transcription/WhisperTranscriber.js +312 -25
  544. package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
  545. package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
  546. package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
  547. package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
  548. package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
  549. package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
  550. package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
  551. package/dist/modules/transcription/WordTimingEstimator.js +33 -0
  552. package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
  553. package/dist/modules/transcription/index.d.ts +9 -2
  554. package/dist/modules/transcription/index.d.ts.map +1 -1
  555. package/dist/modules/transcription/index.js +6 -1
  556. package/dist/modules/transcription/index.js.map +1 -1
  557. package/dist/modules/video/RenderJob.d.ts +17 -0
  558. package/dist/modules/video/RenderJob.d.ts.map +1 -1
  559. package/dist/modules/video/RenderTimeMap.d.ts +50 -0
  560. package/dist/modules/video/RenderTimeMap.d.ts.map +1 -0
  561. package/dist/modules/video/RenderTimeMap.js +90 -0
  562. package/dist/modules/video/RenderTimeMap.js.map +1 -0
  563. package/dist/modules/video/index.d.ts +8 -1
  564. package/dist/modules/video/index.d.ts.map +1 -1
  565. package/dist/modules/video/index.js +4 -0
  566. package/dist/modules/video/index.js.map +1 -1
  567. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts +102 -0
  568. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -0
  569. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +207 -0
  570. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -0
  571. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +12 -52
  572. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -1
  573. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +25 -190
  574. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -1
  575. package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +7 -0
  576. package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -1
  577. package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +2 -2
  578. package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -1
  579. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +2 -0
  580. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -1
  581. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +8 -2
  582. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -1
  583. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +3 -0
  584. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -1
  585. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +9 -2
  586. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -1
  587. package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +7 -0
  588. package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -1
  589. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +4 -2
  590. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
  591. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
  592. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
  593. package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +9 -2
  594. package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -1
  595. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +5 -2
  596. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -1
  597. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +8 -2
  598. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -1
  599. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts +35 -0
  600. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts.map +1 -0
  601. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +69 -0
  602. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -0
  603. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts +23 -0
  604. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts.map +1 -0
  605. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js +23 -0
  606. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js.map +1 -0
  607. package/dist/modules/video/mediabunny/painter/FramePainter.d.ts +46 -0
  608. package/dist/modules/video/mediabunny/painter/FramePainter.d.ts.map +1 -0
  609. package/dist/modules/video/mediabunny/painter/FramePainter.js +2 -0
  610. package/dist/modules/video/mediabunny/painter/FramePainter.js.map +1 -0
  611. package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +24 -0
  612. package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -0
  613. package/dist/modules/video/mediabunny/painter/TopLayerSource.js +2 -0
  614. package/dist/modules/video/mediabunny/painter/TopLayerSource.js.map +1 -0
  615. package/package.json +13 -10
  616. package/dist/modules/document/Tag.d.ts.map +0 -1
  617. package/dist/modules/document/Tag.js.map +0 -1
  618. package/dist/modules/rendering/AlignmentConfig.d.ts +0 -21
  619. package/dist/modules/rendering/AlignmentConfig.d.ts.map +0 -1
  620. package/dist/modules/rendering/AlignmentConfig.js +0 -2
  621. package/dist/modules/rendering/AlignmentConfig.js.map +0 -1
  622. package/dist/modules/rendering/BoxEdges.d.ts.map +0 -1
  623. package/dist/modules/rendering/BoxEdges.js.map +0 -1
  624. package/dist/modules/rendering/ElementRenderOverrides.d.ts +0 -15
  625. package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +0 -1
  626. package/dist/modules/rendering/ElementRenderOverrides.js +0 -24
  627. package/dist/modules/rendering/ElementRenderOverrides.js.map +0 -1
  628. package/dist/modules/rendering/InlineStyleMap.d.ts.map +0 -1
  629. package/dist/modules/rendering/InlineStyleMap.js.map +0 -1
  630. package/dist/modules/rendering/RenderingConfig.d.ts.map +0 -1
  631. package/dist/modules/rendering/RenderingConfig.js.map +0 -1
  632. package/dist/modules/rendering/ScopedRenderOverride.d.ts +0 -19
  633. package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +0 -1
  634. package/dist/modules/rendering/ScopedRenderOverride.js.map +0 -1
  635. package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +0 -1
  636. package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +0 -1
  637. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +0 -58
  638. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +0 -1
  639. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +0 -132
  640. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +0 -1
  641. package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +0 -1
  642. package/dist/modules/rendering/VideoFrameLayerClass.js +0 -21
  643. package/dist/modules/rendering/VideoFrameLayerClass.js.map +0 -1
  644. package/dist/modules/rendering/VideoFrameSource.d.ts.map +0 -1
  645. package/dist/modules/rendering/VideoFrameSource.js.map +0 -1
  646. package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
  647. package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
  648. package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
  649. package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
  650. /package/dist/modules/rendering/{BoxEdges.d.ts → types/BoxEdges.d.ts} +0 -0
  651. /package/dist/modules/rendering/{BoxEdges.js → types/BoxEdges.js} +0 -0
  652. /package/dist/modules/rendering/{InlineStyleMap.d.ts → types/InlineStyleMap.d.ts} +0 -0
  653. /package/dist/modules/rendering/{InlineStyleMap.js → types/InlineStyleMap.js} +0 -0
  654. /package/dist/modules/rendering/{RenderingConfig.js → types/RenderingConfig.js} +0 -0
  655. /package/dist/modules/rendering/{ScopedRenderOverride.js → types/ScopedRenderOverride.js} +0 -0
  656. /package/dist/modules/rendering/{VideoFrameSource.d.ts → types/VideoFrameSource.d.ts} +0 -0
  657. /package/dist/modules/rendering/{VideoFrameSource.js → types/VideoFrameSource.js} +0 -0
@@ -0,0 +1,43 @@
1
+ import type * as Transformers from '@huggingface/transformers';
2
+ import type { LogitsProcessorList } from '@huggingface/transformers';
3
+ import type { WhisperLoopAbortLogitsProcessor } from '../transcription/WhisperLoopAbortLogitsProcessor';
4
+ /**
5
+ * Builds the logits-processor list a generation is handed, out of the
6
+ * inference library's base classes.
7
+ *
8
+ * The two subclasses below are defined here, against a module passed in,
9
+ * rather than at the top of their own files against a static import.
10
+ * `extends` runs when a module loads, so a subclass of a library class
11
+ * makes that library a load-time dependency of every file that can reach
12
+ * it — which is the whole package, through its entry point. Everything
13
+ * that does not need the base class stays outside: the loop guard holds
14
+ * its own detection and this only dresses it.
15
+ *
16
+ * Both classes are built once and reused. They close over nothing per
17
+ * call, and rebuilding them would give the pipeline a different
18
+ * `constructor` identity each time, which is exactly what the list's
19
+ * replacement rule compares.
20
+ */
21
+ export declare class LogitsProcessorListFactory {
22
+ private readonly module;
23
+ private listClass;
24
+ private guardClass;
25
+ constructor(module: typeof Transformers);
26
+ /** A list holding `guard`, ready to be passed as `logits_processor`. */
27
+ build(guard: WhisperLoopAbortLogitsProcessor): LogitsProcessorList;
28
+ /**
29
+ * A processor list whose `push` replaces any already-held processor of
30
+ * the same class instead of appending a duplicate.
31
+ *
32
+ * The ASR pipeline reuses one options object across every window of a
33
+ * long transcription, and Whisper's `generate` pushes a fresh set of
34
+ * internal processors into the provided list on every call. On a plain
35
+ * list those pile up — window N would run N copies of each internal
36
+ * processor. Replacement reproduces the fresh-list semantics the
37
+ * library assumes: the newest instance wins.
38
+ */
39
+ private replacingList;
40
+ /** Presents the loop guard as the processor shape the pipeline calls. */
41
+ private guardAdapter;
42
+ }
43
+ //# sourceMappingURL=LogitsProcessorListFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogitsProcessorListFactory.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/LogitsProcessorListFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAmB,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAC9F,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAC;AAE9G;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,0BAA0B;IAIzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,SAAS,CAAgD;IACjE,OAAO,CAAC,UAAU,CAAkF;gBAEvE,MAAM,EAAE,OAAO,YAAY;IAExD,wEAAwE;IACxE,KAAK,CAAC,KAAK,EAAE,+BAA+B,GAAG,mBAAmB;IAMlE;;;;;;;;;;OAUG;IACH,OAAO,CAAC,aAAa;IAerB,yEAAyE;IACzE,OAAO,CAAC,YAAY;CAcrB"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Builds the logits-processor list a generation is handed, out of the
3
+ * inference library's base classes.
4
+ *
5
+ * The two subclasses below are defined here, against a module passed in,
6
+ * rather than at the top of their own files against a static import.
7
+ * `extends` runs when a module loads, so a subclass of a library class
8
+ * makes that library a load-time dependency of every file that can reach
9
+ * it — which is the whole package, through its entry point. Everything
10
+ * that does not need the base class stays outside: the loop guard holds
11
+ * its own detection and this only dresses it.
12
+ *
13
+ * Both classes are built once and reused. They close over nothing per
14
+ * call, and rebuilding them would give the pipeline a different
15
+ * `constructor` identity each time, which is exactly what the list's
16
+ * replacement rule compares.
17
+ */
18
+ export class LogitsProcessorListFactory {
19
+ module;
20
+ listClass = null;
21
+ guardClass = null;
22
+ constructor(module) {
23
+ this.module = module;
24
+ }
25
+ /** A list holding `guard`, ready to be passed as `logits_processor`. */
26
+ build(guard) {
27
+ const list = new (this.replacingList())();
28
+ list.push(new (this.guardAdapter())(guard));
29
+ return list;
30
+ }
31
+ /**
32
+ * A processor list whose `push` replaces any already-held processor of
33
+ * the same class instead of appending a duplicate.
34
+ *
35
+ * The ASR pipeline reuses one options object across every window of a
36
+ * long transcription, and Whisper's `generate` pushes a fresh set of
37
+ * internal processors into the provided list on every call. On a plain
38
+ * list those pile up — window N would run N copies of each internal
39
+ * processor. Replacement reproduces the fresh-list semantics the
40
+ * library assumes: the newest instance wins.
41
+ */
42
+ replacingList() {
43
+ if (this.listClass === null) {
44
+ this.listClass = class extends this.module.LogitsProcessorList {
45
+ push(item) {
46
+ const existing = this.processors.findIndex((held) => held.constructor === item.constructor);
47
+ if (existing >= 0)
48
+ this.processors.splice(existing, 1);
49
+ super.push(item);
50
+ }
51
+ };
52
+ }
53
+ return this.listClass;
54
+ }
55
+ /** Presents the loop guard as the processor shape the pipeline calls. */
56
+ guardAdapter() {
57
+ if (this.guardClass === null) {
58
+ this.guardClass = class extends this.module.LogitsProcessor {
59
+ guard;
60
+ constructor(guard) {
61
+ super();
62
+ this.guard = guard;
63
+ }
64
+ _call(inputIds, logits) {
65
+ return this.guard.apply(inputIds, logits);
66
+ }
67
+ };
68
+ }
69
+ return this.guardClass;
70
+ }
71
+ }
72
+ //# sourceMappingURL=LogitsProcessorListFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogitsProcessorListFactory.js","sourceRoot":"","sources":["../../../src/modules/transcription/LogitsProcessorListFactory.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,0BAA0B;IAIR;IAHrB,SAAS,GAA2C,IAAI,CAAC;IACzD,UAAU,GAA6E,IAAI,CAAC;IAEpG,YAA6B,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IAAG,CA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F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ import type { AudioDecoder } from '../transcription/AudioDecoder';
2
+ /**
3
+ * Decodes an audio/video Blob to mono `Float32Array` PCM at the
4
+ * requested sample rate by demuxing the container with mediabunny and
5
+ * iterating the primary audio track through {@link AudioSampleSink}.
6
+ * Downmixes and resamples in fixed-size batches via
7
+ * {@link BatchedMonoResampler} so peak memory is bounded by one batch
8
+ * of source-rate audio plus the pre-sized target buffer, not by the
9
+ * whole track — a long video no longer holds ~4× its useful PCM size
10
+ * in transient buffers on the way to the worker.
11
+ *
12
+ * Main-thread only — `OfflineAudioContext` is not available inside
13
+ * Worker contexts.
14
+ *
15
+ * A codec the current browser cannot decode surfaces as a
16
+ * `DOMException` named `NotSupportedError`, following the WebCodecs
17
+ * convention. Any other underlying mediabunny / WebCodecs failure is
18
+ * re-thrown verbatim so callers can inspect its `name` / `cause` to
19
+ * classify the reason.
20
+ */
21
+ export declare class MediaBunnyAudioDecoder implements AudioDecoder {
22
+ decode(audio: Blob, targetSampleRate: number, onProgress?: (progress: number) => void): Promise<Float32Array>;
23
+ private decodeInput;
24
+ private streamMonoInto;
25
+ private progressAt;
26
+ }
27
+ //# sourceMappingURL=MediaBunnyAudioDecoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaBunnyAudioDecoder.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/MediaBunnyAudioDecoder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,sBAAuB,YAAW,YAAY;IACnD,MAAM,CACV,KAAK,EAAE,IAAI,EACX,gBAAgB,EAAE,MAAM,EACxB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,YAAY,CAAC;YASV,WAAW;YAuBX,cAAc;IAmB5B,OAAO,CAAC,UAAU;CAQnB"}
@@ -0,0 +1,76 @@
1
+ import { ALL_FORMATS, AudioSampleSink, BlobSource, Input, } from 'mediabunny';
2
+ import { BatchedMonoResampler } from '../transcription/BatchedMonoResampler';
3
+ /**
4
+ * Decodes an audio/video Blob to mono `Float32Array` PCM at the
5
+ * requested sample rate by demuxing the container with mediabunny and
6
+ * iterating the primary audio track through {@link AudioSampleSink}.
7
+ * Downmixes and resamples in fixed-size batches via
8
+ * {@link BatchedMonoResampler} so peak memory is bounded by one batch
9
+ * of source-rate audio plus the pre-sized target buffer, not by the
10
+ * whole track — a long video no longer holds ~4× its useful PCM size
11
+ * in transient buffers on the way to the worker.
12
+ *
13
+ * Main-thread only — `OfflineAudioContext` is not available inside
14
+ * Worker contexts.
15
+ *
16
+ * A codec the current browser cannot decode surfaces as a
17
+ * `DOMException` named `NotSupportedError`, following the WebCodecs
18
+ * convention. Any other underlying mediabunny / WebCodecs failure is
19
+ * re-thrown verbatim so callers can inspect its `name` / `cause` to
20
+ * classify the reason.
21
+ */
22
+ export class MediaBunnyAudioDecoder {
23
+ async decode(audio, targetSampleRate, onProgress) {
24
+ const input = new Input({ formats: ALL_FORMATS, source: new BlobSource(audio) });
25
+ try {
26
+ return await this.decodeInput(input, targetSampleRate, onProgress);
27
+ }
28
+ finally {
29
+ input.dispose();
30
+ }
31
+ }
32
+ async decodeInput(input, targetSampleRate, onProgress) {
33
+ const track = await input.getPrimaryAudioTrack();
34
+ if (!track)
35
+ return new Float32Array(0);
36
+ if (!(await track.canDecode())) {
37
+ const codec = await track.getCodec();
38
+ throw new DOMException(`Audio codec is not supported by this browser: ${codec ?? 'unknown'}`, 'NotSupportedError');
39
+ }
40
+ const durationSeconds = await track.computeDuration();
41
+ if (durationSeconds <= 0)
42
+ return new Float32Array(0);
43
+ const target = new Float32Array(Math.max(1, Math.ceil(durationSeconds * targetSampleRate)));
44
+ const resampler = new BatchedMonoResampler(target, targetSampleRate);
45
+ const written = await this.streamMonoInto(track, resampler, durationSeconds, onProgress);
46
+ return target.subarray(0, written);
47
+ }
48
+ async streamMonoInto(track, resampler, durationSeconds, onProgress) {
49
+ const sink = new AudioSampleSink(track);
50
+ for await (const sample of sink.samples(0)) {
51
+ try {
52
+ await resampler.append(sample);
53
+ if (onProgress)
54
+ onProgress(this.progressAt(sample, durationSeconds));
55
+ }
56
+ finally {
57
+ sample.close();
58
+ }
59
+ }
60
+ if (onProgress)
61
+ onProgress(1);
62
+ return resampler.flush();
63
+ }
64
+ progressAt(sample, durationSeconds) {
65
+ const decodedSeconds = sample.timestamp + sample.numberOfFrames / sample.sampleRate;
66
+ if (durationSeconds <= 0)
67
+ return 0;
68
+ const ratio = decodedSeconds / durationSeconds;
69
+ if (ratio < 0)
70
+ return 0;
71
+ if (ratio > 1)
72
+ return 1;
73
+ return ratio;
74
+ }
75
+ }
76
+ //# sourceMappingURL=MediaBunnyAudioDecoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaBunnyAudioDecoder.js","sourceRoot":"","sources":["../../../src/modules/transcription/MediaBunnyAudioDecoder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,eAAe,EACf,UAAU,EACV,KAAK,GAGN,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,sBAAsB;IACjC,KAAK,CAAC,MAAM,CACV,KAAW,EACX,gBAAwB,EACxB,UAAuC;QAEvC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;QACrE,CAAC;gBAAS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,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC;gBACH,MAAM,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC/B,IAAI,UAAU;oBAAE,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;YACvE,CAAC;oBAAS,CAAC;gBACT,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;QACD,IAAI,UAAU;YAAE,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAEO,UAAU,CAAC,MAAmB,EAAE,eAAuB;QAC7D,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC;QACpF,IAAI,eAAe,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,cAAc,GAAG,eAAe,CAAC;QAC/C,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;QACxB,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Local store for the model files a transcriber downloads, so a later
3
+ * run reads them back instead of fetching them again.
4
+ *
5
+ * Both operations are best-effort by contract: a store that cannot
6
+ * answer reports a miss, and a store that cannot keep a file resolves
7
+ * anyway. Neither ever rejects. Losing the copy costs a download on
8
+ * the next run, which is worth far less than the transcription in
9
+ * flight.
10
+ *
11
+ * Keys are opaque strings chosen by the caller and must round-trip
12
+ * verbatim between `put` and `match`.
13
+ */
14
+ export interface ModelFileCache {
15
+ /** The stored file, or `undefined` when this key was never kept. */
16
+ match(key: string): Promise<Response | undefined>;
17
+ /** Keeps `response` under `key`, replacing nothing already there. */
18
+ put(key: string, response: Response): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=ModelFileCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelFileCache.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAElD,qEAAqE;IACrE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ModelFileCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelFileCache.js","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCache.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Raised when the runtime exposes no place to keep model files, so
3
+ * every run has to download them again.
4
+ *
5
+ * The Cache Storage API is restricted to secure contexts and withheld
6
+ * altogether by some privacy modes, so a page served over plain HTTP
7
+ * from anything other than localhost has nowhere to put them.
8
+ *
9
+ * The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
10
+ * the class, so consumers can recognise the failure across a Worker
11
+ * boundary (where structured cloning preserves the string fields but
12
+ * not the class identity) with a single source of truth.
13
+ */
14
+ export declare class ModelFileCacheUnavailableError extends Error {
15
+ static readonly ERROR_NAME = "ModelFileCacheUnavailableError";
16
+ readonly name = "ModelFileCacheUnavailableError";
17
+ }
18
+ //# sourceMappingURL=ModelFileCacheUnavailableError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelFileCacheUnavailableError.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCacheUnavailableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,MAAM,CAAC,QAAQ,CAAC,UAAU,oCAAoC;IAC9D,QAAQ,CAAC,IAAI,oCAA6C;CAC3D"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Raised when the runtime exposes no place to keep model files, so
3
+ * every run has to download them again.
4
+ *
5
+ * The Cache Storage API is restricted to secure contexts and withheld
6
+ * altogether by some privacy modes, so a page served over plain HTTP
7
+ * from anything other than localhost has nowhere to put them.
8
+ *
9
+ * The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
10
+ * the class, so consumers can recognise the failure across a Worker
11
+ * boundary (where structured cloning preserves the string fields but
12
+ * not the class identity) with a single source of truth.
13
+ */
14
+ export class ModelFileCacheUnavailableError extends Error {
15
+ static ERROR_NAME = 'ModelFileCacheUnavailableError';
16
+ name = ModelFileCacheUnavailableError.ERROR_NAME;
17
+ }
18
+ //# sourceMappingURL=ModelFileCacheUnavailableError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelFileCacheUnavailableError.js","sourceRoot":"","sources":["../../../src/modules/transcription/ModelFileCacheUnavailableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,MAAM,CAAU,UAAU,GAAG,gCAAgC,CAAC;IACrD,IAAI,GAAG,8BAA8B,CAAC,UAAU,CAAC"}
@@ -1,33 +1,42 @@
1
- import { Document } from '../document/Document';
1
+ import type { Document } from '../document/Document';
2
2
  import type { Transcriber, TranscriberOptions, TranscriberProgressEvent } from '../transcription/Transcriber';
3
3
  /**
4
4
  * Builds a Document by parsing a SubRip (SRT) caption file. Each cue
5
5
  * becomes one `Segment` carrying the cue's full time range; the cue's
6
6
  * text (multi-line entries joined with a space, formatting tags
7
- * stripped) becomes one `Line` whose `Word` timings are spread across
8
- * the cue range proportionally to character length, so each word
9
- * lights up in sequence rather than all at once.
7
+ * stripped) becomes one `Line`.
8
+ *
9
+ * SubRip times nothing below a cue, so word timings are shared out
10
+ * across the cue in proportion to how long each word is to write. Each
11
+ * word lights up in sequence rather than all at once, but where one
12
+ * begins is a guess, not something the file said.
10
13
  *
11
14
  * The audio Blob passed to `transcribe` is ignored. Useful when the
12
15
  * caption text and timing are already known — burning a hand-authored
13
16
  * SRT into a video, replaying captions from a previous run, etc.
14
17
  *
15
- * Throws when a timecode is malformed; returns an empty Document when
16
- * the source contains no parseable cues.
18
+ * A block that carries no timecode is skipped and announced through
19
+ * `onSkippedCueBlock`, so a single broken cue costs its own text and
20
+ * nothing else. Throws only when the file has blocks and none of them
21
+ * could be read, or when a timecode itself is malformed.
22
+ *
23
+ * Builds its own collaborators rather than receiving them. The
24
+ * constructor is the surface a consumer of the engine reaches for, and
25
+ * it asks for a source and nothing else, so this class is where the
26
+ * parsing side is assembled rather than a participant in someone
27
+ * else's assembly.
17
28
  */
18
29
  export declare class SrtTranscriber implements Transcriber {
19
30
  private readonly source;
20
31
  onProgress?: (event: TranscriberProgressEvent) => void;
32
+ /**
33
+ * Fired once per block left out of the document, before
34
+ * `transcribe` resolves, carrying the block verbatim.
35
+ */
36
+ onSkippedCueBlock?: (block: string) => void;
37
+ private readonly documentBuilder;
38
+ private readonly wordReader;
21
39
  constructor(source: string);
22
40
  transcribe(_audio: Blob, _options?: TranscriberOptions): Promise<Document>;
23
- private buildDocumentFromSource;
24
- private parseCues;
25
- private parseCueBlock;
26
- private findTimecodeLineIndex;
27
- private parseTimecodeLine;
28
- private toSeconds;
29
- private normalizeCueText;
30
- private buildSegmentFromCue;
31
- private distributeWordsAcrossCueRange;
32
41
  }
33
42
  //# sourceMappingURL=SrtTranscriber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SrtTranscriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAMtD,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB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AAI,EAAE,QAAQ,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAMjF"}
@@ -1,111 +1,53 @@
1
- import { Document } from '../document/Document';
2
- import { Section } from '../document/Section';
3
- import { Segment } from '../document/Segment';
4
- import { Line } from '../document/Line';
5
- import { Word } from '../document/Word';
6
- import { TimeFragment } from '../document/TimeFragment';
7
- const SRT_TIMECODE_RE = /^(\d{1,2}):(\d{2}):(\d{2})[,.](\d{1,3})\s*-->\s*(\d{1,2}):(\d{2}):(\d{2})[,.](\d{1,3})/;
8
- const FORMATTING_TAG_RE = /<[^>]+>|\{[^}]+\}/g;
9
- const BOM_RE = /^\uFEFF/;
1
+ import { CueDocumentBuilder } from '../transcription/CueDocumentBuilder';
2
+ import { CueTextTokenizer } from '../transcription/CueTextTokenizer';
3
+ import { CueTimecodeReader } from '../transcription/CueTimecodeReader';
4
+ import { EstimatedCueWordReader } from '../transcription/EstimatedCueWordReader';
5
+ import { WordTimingEstimator } from '../transcription/WordTimingEstimator';
10
6
  /**
11
7
  * Builds a Document by parsing a SubRip (SRT) caption file. Each cue
12
8
  * becomes one `Segment` carrying the cue's full time range; the cue's
13
9
  * text (multi-line entries joined with a space, formatting tags
14
- * stripped) becomes one `Line` whose `Word` timings are spread across
15
- * the cue range proportionally to character length, so each word
16
- * lights up in sequence rather than all at once.
10
+ * stripped) becomes one `Line`.
11
+ *
12
+ * SubRip times nothing below a cue, so word timings are shared out
13
+ * across the cue in proportion to how long each word is to write. Each
14
+ * word lights up in sequence rather than all at once, but where one
15
+ * begins is a guess, not something the file said.
17
16
  *
18
17
  * The audio Blob passed to `transcribe` is ignored. Useful when the
19
18
  * caption text and timing are already known — burning a hand-authored
20
19
  * SRT into a video, replaying captions from a previous run, etc.
21
20
  *
22
- * Throws when a timecode is malformed; returns an empty Document when
23
- * the source contains no parseable cues.
21
+ * A block that carries no timecode is skipped and announced through
22
+ * `onSkippedCueBlock`, so a single broken cue costs its own text and
23
+ * nothing else. Throws only when the file has blocks and none of them
24
+ * could be read, or when a timecode itself is malformed.
25
+ *
26
+ * Builds its own collaborators rather than receiving them. The
27
+ * constructor is the surface a consumer of the engine reaches for, and
28
+ * it asks for a source and nothing else, so this class is where the
29
+ * parsing side is assembled rather than a participant in someone
30
+ * else's assembly.
24
31
  */
25
32
  export class SrtTranscriber {
26
33
  source;
27
34
  onProgress;
35
+ /**
36
+ * Fired once per block left out of the document, before
37
+ * `transcribe` resolves, carrying the block verbatim.
38
+ */
39
+ onSkippedCueBlock;
40
+ documentBuilder = new CueDocumentBuilder(new CueTimecodeReader());
41
+ wordReader = new EstimatedCueWordReader(new CueTextTokenizer(), new WordTimingEstimator());
28
42
  constructor(source) {
29
43
  this.source = source;
30
44
  }
31
45
  async transcribe(_audio, _options) {
32
46
  this.onProgress?.({ stage: 'inferring', progress: 1 });
33
- return this.buildDocumentFromSource(this.source);
34
- }
35
- buildDocumentFromSource(source) {
36
- const segments = this.parseCues(source).map((cue) => this.buildSegmentFromCue(cue));
37
- const section = new Section({ segments, kind: '' });
38
- return new Document({ sections: [section] });
39
- }
40
- parseCues(source) {
41
- const normalized = source.replace(BOM_RE, '').replace(/\r\n?/g, '\n').trim();
42
- if (normalized.length === 0)
43
- return [];
44
- return normalized
45
- .split(/\n{2,}/)
46
- .map((block) => this.parseCueBlock(block))
47
- .filter((cue) => cue !== null);
48
- }
49
- parseCueBlock(block) {
50
- const lines = block.split('\n').map((l) => l.trim()).filter((l) => l.length > 0);
51
- if (lines.length === 0)
52
- return null;
53
- const timecodeLineIndex = this.findTimecodeLineIndex(lines);
54
- if (timecodeLineIndex === -1) {
55
- throw new Error(`SRT block has no timecode line: ${JSON.stringify(block)}`);
56
- }
57
- const range = this.parseTimecodeLine(lines[timecodeLineIndex]);
58
- const text = this.normalizeCueText(lines.slice(timecodeLineIndex + 1));
59
- if (text.length === 0)
60
- return null;
61
- return { startSeconds: range.startSeconds, endSeconds: range.endSeconds, text };
62
- }
63
- findTimecodeLineIndex(lines) {
64
- return lines.findIndex((line) => SRT_TIMECODE_RE.test(line));
65
- }
66
- parseTimecodeLine(line) {
67
- const match = SRT_TIMECODE_RE.exec(line);
68
- if (match === null)
69
- throw new Error(`Malformed SRT timecode: ${JSON.stringify(line)}`);
70
- const startSeconds = this.toSeconds(match[1], match[2], match[3], match[4]);
71
- const endSeconds = this.toSeconds(match[5], match[6], match[7], match[8]);
72
- if (endSeconds < startSeconds) {
73
- throw new Error(`SRT timecode ends before it starts: ${JSON.stringify(line)}`);
74
- }
75
- return { startSeconds, endSeconds };
76
- }
77
- toSeconds(hours, minutes, seconds, milliseconds) {
78
- return (Number(hours) * 3600 +
79
- Number(minutes) * 60 +
80
- Number(seconds) +
81
- Number(milliseconds.padEnd(3, '0')) / 1000);
82
- }
83
- normalizeCueText(textLines) {
84
- return textLines.join(' ').replace(FORMATTING_TAG_RE, '').replace(/\s+/g, ' ').trim();
85
- }
86
- buildSegmentFromCue(cue) {
87
- const tokens = cue.text.split(/\s+/).filter((token) => token.length > 0);
88
- if (tokens.length === 0) {
89
- return new Segment({ lines: [new Line({ words: [] })] });
90
- }
91
- const words = this.distributeWordsAcrossCueRange(tokens, cue.startSeconds, cue.endSeconds);
92
- return new Segment({ lines: [new Line({ words })] });
93
- }
94
- distributeWordsAcrossCueRange(tokens, startSeconds, endSeconds) {
95
- const totalWeight = tokens.reduce((sum, token) => sum + token.length, 0);
96
- const cueDuration = endSeconds - startSeconds;
97
- if (totalWeight === 0 || cueDuration <= 0) {
98
- return tokens.map((token) => new Word({ text: token, time: new TimeFragment(startSeconds, endSeconds) }));
99
- }
100
- const words = [];
101
- let elapsedWeight = 0;
102
- for (const token of tokens) {
103
- const wordStart = startSeconds + (elapsedWeight / totalWeight) * cueDuration;
104
- elapsedWeight += token.length;
105
- const wordEnd = startSeconds + (elapsedWeight / totalWeight) * cueDuration;
106
- words.push(new Word({ text: token, time: new TimeFragment(wordStart, wordEnd) }));
107
- }
108
- return words;
47
+ const result = this.documentBuilder.build(this.source, this.wordReader);
48
+ for (const block of result.skippedBlocks)
49
+ this.onSkippedCueBlock?.(block);
50
+ return result.document;
109
51
  }
110
52
  }
111
53
  //# sourceMappingURL=SrtTranscriber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SrtTranscriber.js","sourceRoot":"","sources":["../../../src/modules/transcription/SrtTranscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAO9D,MAAM,eAAe,GACnB,wFAAwF,CAAC;AAC3F,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,MAAM,GAAG,SAAS,CAAC;AAQzB;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,cAAc;IAGI;IAF7B,UAAU,CAA6C;IAEvD,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,KAAK,CAAC,UAAU,CAAC,MAAY,EAAE,QAA6B;QAC1D,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAEO,uBAAuB,CAAC,MAAc;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;QACpF,MAAM,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,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAOjF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,cAAc;IAeI;IAd7B,UAAU,CAA6C;IAEvD;;;OAGG;IACH,iBAAiB,CAA2B;IAE3B,eAAe,GAAG,IAAI,kBAAkB,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAClE,UAAU,GAAG,IAAI,sBAAsB,CACtD,IAAI,gBAAgB,EAAE,EACtB,IAAI,mBAAmB,EAAE,CAC1B,CAAC;IAEF,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,KAAK,CAAC,UAAU,CAAC,MAAY,EAAE,QAA6B;QAC1D,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACxE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,aAAa;YAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Raised when a caption file yielded no cues at all and at least one
3
+ * of its blocks was unreadable.
4
+ *
5
+ * Skipping the odd broken block leaves a usable file behind; skipping
6
+ * every block does not, and handing back an empty transcript would
7
+ * read as "this file said nothing" rather than "this file could not
8
+ * be understood".
9
+ *
10
+ * A file that is genuinely empty is not this: it yields an empty
11
+ * document, because there is nothing to misread.
12
+ *
13
+ * The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
14
+ * the class, so consumers can recognise the failure across a Worker
15
+ * boundary (where structured cloning preserves the string fields but
16
+ * not the class identity) with a single source of truth.
17
+ */
18
+ export declare class SubtitleFileUnreadableError extends Error {
19
+ static readonly ERROR_NAME = "SubtitleFileUnreadableError";
20
+ readonly name = "SubtitleFileUnreadableError";
21
+ }
22
+ //# sourceMappingURL=SubtitleFileUnreadableError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubtitleFileUnreadableError.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/SubtitleFileUnreadableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAC,QAAQ,CAAC,UAAU,iCAAiC;IAC3D,QAAQ,CAAC,IAAI,iCAA0C;CACxD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Raised when a caption file yielded no cues at all and at least one
3
+ * of its blocks was unreadable.
4
+ *
5
+ * Skipping the odd broken block leaves a usable file behind; skipping
6
+ * every block does not, and handing back an empty transcript would
7
+ * read as "this file said nothing" rather than "this file could not
8
+ * be understood".
9
+ *
10
+ * A file that is genuinely empty is not this: it yields an empty
11
+ * document, because there is nothing to misread.
12
+ *
13
+ * The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
14
+ * the class, so consumers can recognise the failure across a Worker
15
+ * boundary (where structured cloning preserves the string fields but
16
+ * not the class identity) with a single source of truth.
17
+ */
18
+ export class SubtitleFileUnreadableError extends Error {
19
+ static ERROR_NAME = 'SubtitleFileUnreadableError';
20
+ name = SubtitleFileUnreadableError.ERROR_NAME;
21
+ }
22
+ //# sourceMappingURL=SubtitleFileUnreadableError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubtitleFileUnreadableError.js","sourceRoot":"","sources":["../../../src/modules/transcription/SubtitleFileUnreadableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAU,UAAU,GAAG,6BAA6B,CAAC;IAClD,IAAI,GAAG,2BAA2B,CAAC,UAAU,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { Word } from '../document/Word';
2
+ import type { CueTextTokenizer } from '../transcription/CueTextTokenizer';
3
+ import type { CueTimecodeReader } from '../transcription/CueTimecodeReader';
4
+ import type { CueWordReader } from '../transcription/CueWordReader';
5
+ import type { WordTimingEstimator } from '../transcription/WordTimingEstimator';
6
+ /**
7
+ * Reads a cue from a format that can mark, inside the cue's own text,
8
+ * when a word is spoken — WebVTT does this so a caption can be revealed
9
+ * word by word without being broken into an entry per word.
10
+ *
11
+ * Each mark cuts the cue into a stretch that runs until the next mark,
12
+ * and the words of a stretch share it out between them. A mark before
13
+ * every word therefore yields the timing the file recorded; a mark
14
+ * every few words yields those, with the words between them estimated.
15
+ * A cue carrying no marks at all is one stretch, which is the same
16
+ * answer a format without marks would give.
17
+ */
18
+ export declare class TimestampedCueWordReader implements CueWordReader {
19
+ private readonly tokenizer;
20
+ private readonly timecodeReader;
21
+ private readonly estimator;
22
+ constructor(tokenizer: CueTextTokenizer, timecodeReader: CueTimecodeReader, estimator: WordTimingEstimator);
23
+ read(text: string, startSeconds: number, endSeconds: number): ReadonlyArray<Word>;
24
+ private cutIntoStretches;
25
+ private positionOf;
26
+ }
27
+ //# sourceMappingURL=TimestampedCueWordReader.d.ts.map