@tscaps/engine 0.2.1 → 0.3.1
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/README.md +47 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
- package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiAnalyzer.js +2 -0
- package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
- package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
- package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
- package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSide.js +3 -0
- package/dist/modules/bidi/HorizontalSide.js.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
- package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/TextDirection.d.ts +9 -0
- package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirection.js +2 -0
- package/dist/modules/bidi/TextDirection.js.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.js +2 -0
- package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/WordFragment.d.ts +34 -0
- package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragment.js +2 -0
- package/dist/modules/bidi/WordFragment.js.map +1 -0
- package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
- package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragmenter.js +112 -0
- package/dist/modules/bidi/WordFragmenter.js.map +1 -0
- package/dist/modules/bidi/index.d.ts +14 -0
- package/dist/modules/bidi/index.d.ts.map +1 -0
- package/dist/modules/bidi/index.js +8 -0
- package/dist/modules/bidi/index.js.map +1 -0
- package/dist/modules/css/CssBlockSealer.d.ts +30 -0
- package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
- package/dist/modules/css/CssBlockSealer.js +64 -0
- package/dist/modules/css/CssBlockSealer.js.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
- package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
- package/dist/modules/css/CssFragmentParser.d.ts +53 -0
- package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
- package/dist/modules/css/CssFragmentParser.js +127 -0
- package/dist/modules/css/CssFragmentParser.js.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
- package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.js +102 -0
- package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
- package/dist/modules/css/CssLayer.d.ts +20 -0
- package/dist/modules/css/CssLayer.d.ts.map +1 -0
- package/dist/modules/css/CssLayer.js +21 -0
- package/dist/modules/css/CssLayer.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +11 -2
- package/dist/modules/css/CssScoper.d.ts.map +1 -1
- package/dist/modules/css/CssScoper.js +53 -37
- package/dist/modules/css/CssScoper.js.map +1 -1
- package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
- package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
- package/dist/modules/css/CssSelectorClassScanner.js +91 -0
- package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
- package/dist/modules/css/CssVarReferenceScanner.d.ts +8 -5
- package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -1
- package/dist/modules/css/CssVarReferenceScanner.js +14 -7
- package/dist/modules/css/CssVarReferenceScanner.js.map +1 -1
- package/dist/modules/css/index.d.ts +8 -0
- package/dist/modules/css/index.d.ts.map +1 -1
- package/dist/modules/css/index.js +8 -0
- package/dist/modules/css/index.js.map +1 -1
- package/dist/modules/document/CssClass.d.ts +20 -0
- package/dist/modules/document/CssClass.d.ts.map +1 -0
- package/dist/modules/document/CssClass.js +21 -0
- package/dist/modules/document/CssClass.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +0 -6
- package/dist/modules/document/CssVariable.d.ts.map +1 -1
- package/dist/modules/document/CssVariable.js +0 -6
- package/dist/modules/document/CssVariable.js.map +1 -1
- package/dist/modules/document/DataAttribute.d.ts +26 -0
- package/dist/modules/document/DataAttribute.d.ts.map +1 -0
- package/dist/modules/document/DataAttribute.js +27 -0
- package/dist/modules/document/DataAttribute.js.map +1 -0
- package/dist/modules/document/DocumentEditor.d.ts +40 -9
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
- package/dist/modules/document/DocumentEditor.js +69 -17
- package/dist/modules/document/DocumentEditor.js.map +1 -1
- package/dist/modules/document/DocumentNodeId.d.ts +23 -0
- package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
- package/dist/modules/document/DocumentNodeId.js +31 -0
- package/dist/modules/document/DocumentNodeId.js.map +1 -0
- package/dist/modules/document/Line.d.ts +1 -1
- package/dist/modules/document/Line.d.ts.map +1 -1
- package/dist/modules/document/Line.js +2 -1
- package/dist/modules/document/Line.js.map +1 -1
- package/dist/modules/document/Section.d.ts +1 -4
- package/dist/modules/document/Section.d.ts.map +1 -1
- package/dist/modules/document/Section.js +2 -17
- package/dist/modules/document/Section.js.map +1 -1
- package/dist/modules/document/Segment.d.ts +14 -7
- package/dist/modules/document/Segment.d.ts.map +1 -1
- package/dist/modules/document/Segment.js +26 -1
- package/dist/modules/document/Segment.js.map +1 -1
- package/dist/modules/document/Word.d.ts +1 -1
- package/dist/modules/document/Word.d.ts.map +1 -1
- package/dist/modules/document/Word.js +2 -1
- package/dist/modules/document/Word.js.map +1 -1
- package/dist/modules/document/index.d.ts +4 -2
- package/dist/modules/document/index.d.ts.map +1 -1
- package/dist/modules/document/index.js +3 -1
- package/dist/modules/document/index.js.map +1 -1
- package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
- package/dist/modules/effect/GapFreeEffect.js +29 -4
- package/dist/modules/effect/GapFreeEffect.js.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.js +3 -3
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +4 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +2 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/index.d.ts +7 -4
- package/dist/modules/rendering/index.d.ts.map +1 -1
- package/dist/modules/rendering/index.js +5 -2
- package/dist/modules/rendering/index.js.map +1 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +19 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.js +32 -8
- package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -1
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -1
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +5 -4
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -1
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +0 -7
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -1
- package/dist/modules/rendering/styles/InlineStyleEmitter.js +0 -9
- package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -1
- package/dist/modules/rendering/styles/{VideoFrameLayerClass.d.ts → VideoFrameLayerBaselineCss.d.ts} +3 -10
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +3 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +9 -4
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -1
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +23 -9
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/AnimationProbe.js +86 -81
- package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -1
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +1 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/BatchPlanner.js +16 -14
- package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js +7 -4
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +30 -2
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +85 -27
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +3 -8
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +31 -40
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -1
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +2 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +18 -9
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -1
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +8 -15
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +10 -20
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -1
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +12 -3
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -1
- package/dist/modules/rendering/types/AlignmentConfig.d.ts +16 -4
- package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -1
- package/dist/modules/rendering/types/AlignmentConfig.js +2 -1
- package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -1
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +8 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -1
- package/dist/modules/rendering/types/ElementRenderOverrides.js +28 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -1
- package/dist/modules/rendering/types/RenderingConfig.d.ts +7 -2
- package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -1
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +9 -4
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -1
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
- package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
- package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
- package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
- package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
- package/dist/modules/subtitle-file/Timecode.js +32 -0
- package/dist/modules/subtitle-file/Timecode.js.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/index.d.ts +10 -0
- package/dist/modules/subtitle-file/index.d.ts.map +1 -0
- package/dist/modules/subtitle-file/index.js +8 -0
- package/dist/modules/subtitle-file/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilter.js +9 -1
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +2 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -1
- package/dist/modules/svg-filter/index.js +1 -0
- package/dist/modules/svg-filter/index.js.map +1 -1
- package/dist/modules/tagging/PauseTagger.d.ts.map +1 -1
- package/dist/modules/tagging/PauseTagger.js +2 -1
- package/dist/modules/tagging/PauseTagger.js.map +1 -1
- package/dist/modules/tagging/RegexTagger.js +1 -1
- package/dist/modules/tagging/RegexTagger.js.map +1 -1
- package/dist/modules/tagging/SpanTagger.js +1 -1
- package/dist/modules/tagging/SpanTagger.js.map +1 -1
- package/dist/modules/tagging/StructureTagger.d.ts +0 -1
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
- package/dist/modules/tagging/StructureTagger.js +3 -8
- package/dist/modules/tagging/StructureTagger.js.map +1 -1
- package/dist/modules/tagging/WordlistTagger.js +1 -1
- package/dist/modules/tagging/WordlistTagger.js.map +1 -1
- package/dist/modules/tags/AndTagCondition.d.ts +10 -0
- package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/AndTagCondition.js +14 -0
- package/dist/modules/tags/AndTagCondition.js.map +1 -0
- package/dist/modules/tags/HasTagCondition.d.ts +10 -0
- package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/HasTagCondition.js +18 -0
- package/dist/modules/tags/HasTagCondition.js.map +1 -0
- package/dist/modules/tags/NotTagCondition.d.ts +10 -0
- package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/NotTagCondition.js +14 -0
- package/dist/modules/tags/NotTagCondition.js.map +1 -0
- package/dist/modules/tags/OrTagCondition.d.ts +10 -0
- package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/OrTagCondition.js +14 -0
- package/dist/modules/tags/OrTagCondition.js.map +1 -0
- package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +2 -11
- package/dist/modules/tags/StructureTag.d.ts.map +1 -0
- package/dist/modules/{document/Tag.js → tags/StructureTag.js} +1 -19
- package/dist/modules/tags/StructureTag.js.map +1 -0
- package/dist/modules/tags/Tag.d.ts +8 -0
- package/dist/modules/tags/Tag.d.ts.map +1 -0
- package/dist/modules/tags/Tag.js +16 -0
- package/dist/modules/tags/Tag.js.map +1 -0
- package/dist/modules/tags/TagCondition.d.ts +12 -0
- package/dist/modules/tags/TagCondition.d.ts.map +1 -0
- package/dist/modules/tags/TagCondition.js +2 -0
- package/dist/modules/tags/TagCondition.js.map +1 -0
- package/dist/modules/tags/TagConditionParser.d.ts +21 -0
- package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
- package/dist/modules/tags/TagConditionParser.js +75 -0
- package/dist/modules/tags/TagConditionParser.js.map +1 -0
- package/dist/modules/tags/index.d.ts +9 -0
- package/dist/modules/tags/index.d.ts.map +1 -0
- package/dist/modules/tags/index.js +8 -0
- package/dist/modules/tags/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
- package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
- package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
- package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
- package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
- package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
- package/dist/modules/transcription/CueParseResult.d.ts +16 -0
- package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
- package/dist/modules/transcription/CueParseResult.js +2 -0
- package/dist/modules/transcription/CueParseResult.js.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.js +21 -0
- package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.js +45 -0
- package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
- package/dist/modules/transcription/CueWordReader.d.ts +12 -0
- package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueWordReader.js +2 -0
- package/dist/modules/transcription/CueWordReader.js.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
- package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCache.js +2 -0
- package/dist/modules/transcription/ModelFileCache.js.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/SrtTranscriber.js +32 -90
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +13 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
- package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
- package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
- package/dist/modules/transcription/TransformersRuntime.js +79 -0
- package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
- package/dist/modules/transcription/VttTranscriber.d.ts +25 -7
- package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/VttTranscriber.js +36 -15
- package/dist/modules/transcription/VttTranscriber.js.map +1 -1
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/WhisperTranscriber.js +312 -25
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.js +33 -0
- package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +8 -2
- package/dist/modules/transcription/index.d.ts.map +1 -1
- package/dist/modules/transcription/index.js +5 -1
- package/dist/modules/transcription/index.js.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +8 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +3 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +6 -7
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -1
- package/package.json +16 -10
- package/dist/modules/document/Tag.d.ts.map +0 -1
- package/dist/modules/document/Tag.js.map +0 -1
- package/dist/modules/rendering/styles/BehindActorBaselineCss.d.ts +0 -19
- package/dist/modules/rendering/styles/BehindActorBaselineCss.d.ts.map +0 -1
- package/dist/modules/rendering/styles/BehindActorBaselineCss.js +0 -19
- package/dist/modules/rendering/styles/BehindActorBaselineCss.js.map +0 -1
- package/dist/modules/rendering/styles/VideoFrameLayerClass.d.ts.map +0 -1
- package/dist/modules/rendering/styles/VideoFrameLayerClass.js +0 -21
- package/dist/modules/rendering/styles/VideoFrameLayerClass.js.map +0 -1
- package/dist/modules/rendering/types/BehindActorRequirement.d.ts +0 -12
- package/dist/modules/rendering/types/BehindActorRequirement.d.ts.map +0 -1
- package/dist/modules/rendering/types/BehindActorRequirement.js +0 -2
- package/dist/modules/rendering/types/BehindActorRequirement.js.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
2
|
+
import { Timecode } from '../subtitle-file/Timecode';
|
|
3
|
+
/** SubRip separates rows and blocks with CRLF, and readers are strict about it. */
|
|
4
|
+
const NEW_LINE = '\r\n';
|
|
5
|
+
/**
|
|
6
|
+
* Writes SubRip (`.srt`): a one-based counter, a
|
|
7
|
+
* `HH:MM:SS,mmm --> HH:MM:SS,mmm` range, and the entry's rows, with a
|
|
8
|
+
* blank line between blocks.
|
|
9
|
+
*
|
|
10
|
+
* The format has no way to time anything below an entry, so word
|
|
11
|
+
* granularity is paid for in entries: one per word, which multiplies
|
|
12
|
+
* the file's length several times over. Every player understands the
|
|
13
|
+
* result, which is the reason to accept the cost.
|
|
14
|
+
*/
|
|
15
|
+
export class SrtSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
16
|
+
mediaType = 'application/x-subrip';
|
|
17
|
+
fileExtension = 'srt';
|
|
18
|
+
write(cues, granularity) {
|
|
19
|
+
const entries = granularity === 'word' ? this.perWordCues(cues) : cues;
|
|
20
|
+
return entries.map((cue, index) => this.writeCue(cue, index + 1)).join(NEW_LINE);
|
|
21
|
+
}
|
|
22
|
+
writeCue(cue, position) {
|
|
23
|
+
const range = `${this.timecode(cue.time.start)} --> ${this.timecode(cue.time.end)}`;
|
|
24
|
+
const body = cue.rows.map((row) => row.text()).join(NEW_LINE);
|
|
25
|
+
return `${position}${NEW_LINE}${range}${NEW_LINE}${body}${NEW_LINE}`;
|
|
26
|
+
}
|
|
27
|
+
timecode(position) {
|
|
28
|
+
const at = new Timecode(position);
|
|
29
|
+
return `${at.padded(at.hours, 2)}:${at.padded(at.minutes, 2)}:${at.padded(at.seconds, 2)}`
|
|
30
|
+
+ `,${at.padded(at.milliseconds, 3)}`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=SrtSubtitleFileSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SrtSubtitleFileSerializer.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SrtSubtitleFileSerializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,mFAAmF;AACnF,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,OAAO,yBAA0B,SAAQ,sBAAsB;IAC1D,SAAS,GAAG,sBAAsB,CAAC;IACnC,aAAa,GAAG,KAAK,CAAC;IAErB,KAAK,CAAC,IAAgC,EAAE,WAAgC;QAChF,MAAM,OAAO,GAAG,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnF,CAAC;IAEO,QAAQ,CAAC,GAAgB,EAAE,QAAgB;QACjD,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACpF,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9D,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;IACvE,CAAC;IAEO,QAAQ,CAAC,QAAgB;QAC/B,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;cACtF,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TimeFragment } from '../document/TimeFragment';
|
|
2
|
+
import type { SubtitleRow } from '../subtitle-file/SubtitleRow';
|
|
3
|
+
import type { SubtitleToken } from '../subtitle-file/SubtitleToken';
|
|
4
|
+
/**
|
|
5
|
+
* One timed entry of a subtitle file: the window it occupies and the
|
|
6
|
+
* rows shown inside it.
|
|
7
|
+
*
|
|
8
|
+
* A cue always covers a window of positive length and holds at least
|
|
9
|
+
* one row. Text carries no markup — escaping and joining are format
|
|
10
|
+
* concerns.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SubtitleCue {
|
|
13
|
+
readonly time: TimeFragment;
|
|
14
|
+
readonly rows: ReadonlyArray<SubtitleRow>;
|
|
15
|
+
constructor(time: TimeFragment, rows: ReadonlyArray<SubtitleRow>);
|
|
16
|
+
tokens(): ReadonlyArray<SubtitleToken>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=SubtitleCue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleCue.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleCue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAE1E;;;;;;;GAOG;AACH,qBAAa,WAAW;IAEpB,QAAQ,CAAC,IAAI,EAAE,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC;gBADhC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC;IAG3C,MAAM,IAAI,aAAa,CAAC,aAAa,CAAC;CAGvC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One timed entry of a subtitle file: the window it occupies and the
|
|
3
|
+
* rows shown inside it.
|
|
4
|
+
*
|
|
5
|
+
* A cue always covers a window of positive length and holds at least
|
|
6
|
+
* one row. Text carries no markup — escaping and joining are format
|
|
7
|
+
* concerns.
|
|
8
|
+
*/
|
|
9
|
+
export class SubtitleCue {
|
|
10
|
+
time;
|
|
11
|
+
rows;
|
|
12
|
+
constructor(time, rows) {
|
|
13
|
+
this.time = time;
|
|
14
|
+
this.rows = rows;
|
|
15
|
+
}
|
|
16
|
+
tokens() {
|
|
17
|
+
return this.rows.flatMap((row) => [...row.tokens]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=SubtitleCue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleCue.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleCue.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,OAAO,WAAW;IAEX;IACA;IAFX,YACW,IAAkB,EAClB,IAAgC;QADhC,SAAI,GAAJ,IAAI,CAAc;QAClB,SAAI,GAAJ,IAAI,CAA4B;IACxC,CAAC;IAEJ,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Document } from '../document/Document';
|
|
2
|
+
import { type TimeRange } from '../video/RenderTimeMap';
|
|
3
|
+
import { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
4
|
+
/**
|
|
5
|
+
* Turns a document into the ordered, self-consistent cue list every
|
|
6
|
+
* subtitle format is written from, so no format has to rediscover the
|
|
7
|
+
* same corrections:
|
|
8
|
+
*
|
|
9
|
+
* - Cues come out sorted by start, because document order is not time
|
|
10
|
+
* order and segments may overlap.
|
|
11
|
+
* - A segment holding an explicit time keeps it, so a phrase held on
|
|
12
|
+
* screen past its narration lasts as long in the file.
|
|
13
|
+
* - Words with no text drop out, and so does anything left covering an
|
|
14
|
+
* empty window — a window of no length never becomes current during
|
|
15
|
+
* playback, so an entry for it is one no player would ever show.
|
|
16
|
+
* - Excluded windows rebase every time, cue and token alike, onto the
|
|
17
|
+
* timeline a render leaves behind.
|
|
18
|
+
*
|
|
19
|
+
* Text comes from each word's `text` rather than its `displayText`: a
|
|
20
|
+
* subtitle file is read back as content, and the styling passes that
|
|
21
|
+
* rewrite `displayText` state a look rather than a correction.
|
|
22
|
+
*/
|
|
23
|
+
export declare class SubtitleCueBuilder {
|
|
24
|
+
build(document: Document, skipRanges: ReadonlyArray<TimeRange>): ReadonlyArray<SubtitleCue>;
|
|
25
|
+
private buildCue;
|
|
26
|
+
private buildRows;
|
|
27
|
+
private buildTokens;
|
|
28
|
+
private resolveTime;
|
|
29
|
+
/**
|
|
30
|
+
* Word windows are not guaranteed to be sorted or contiguous, so the
|
|
31
|
+
* span is the outer envelope rather than the first and last entries.
|
|
32
|
+
*/
|
|
33
|
+
private spanOf;
|
|
34
|
+
private rebase;
|
|
35
|
+
private rebaseRows;
|
|
36
|
+
private rebaseFragment;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=SubtitleCueBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleCueBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleCueBuilder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAIjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kBAAkB;IAE7B,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC;IAW3F,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,WAAW;IAMnB;;;OAGG;IACH,OAAO,CAAC,MAAM;IAYd,OAAO,CAAC,MAAM;IAad,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { TimeFragment } from '../document/TimeFragment';
|
|
2
|
+
import { RenderTimeMap } from '../video/RenderTimeMap';
|
|
3
|
+
import { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
4
|
+
import { SubtitleRow } from '../subtitle-file/SubtitleRow';
|
|
5
|
+
import { SubtitleToken } from '../subtitle-file/SubtitleToken';
|
|
6
|
+
/**
|
|
7
|
+
* Turns a document into the ordered, self-consistent cue list every
|
|
8
|
+
* subtitle format is written from, so no format has to rediscover the
|
|
9
|
+
* same corrections:
|
|
10
|
+
*
|
|
11
|
+
* - Cues come out sorted by start, because document order is not time
|
|
12
|
+
* order and segments may overlap.
|
|
13
|
+
* - A segment holding an explicit time keeps it, so a phrase held on
|
|
14
|
+
* screen past its narration lasts as long in the file.
|
|
15
|
+
* - Words with no text drop out, and so does anything left covering an
|
|
16
|
+
* empty window — a window of no length never becomes current during
|
|
17
|
+
* playback, so an entry for it is one no player would ever show.
|
|
18
|
+
* - Excluded windows rebase every time, cue and token alike, onto the
|
|
19
|
+
* timeline a render leaves behind.
|
|
20
|
+
*
|
|
21
|
+
* Text comes from each word's `text` rather than its `displayText`: a
|
|
22
|
+
* subtitle file is read back as content, and the styling passes that
|
|
23
|
+
* rewrite `displayText` state a look rather than a correction.
|
|
24
|
+
*/
|
|
25
|
+
export class SubtitleCueBuilder {
|
|
26
|
+
build(document, skipRanges) {
|
|
27
|
+
const cues = [];
|
|
28
|
+
for (const segment of document.getSegments()) {
|
|
29
|
+
const cue = this.buildCue(segment);
|
|
30
|
+
if (cue)
|
|
31
|
+
cues.push(cue);
|
|
32
|
+
}
|
|
33
|
+
const ordered = cues.sort((a, b) => a.time.start - b.time.start);
|
|
34
|
+
if (skipRanges.length === 0)
|
|
35
|
+
return ordered;
|
|
36
|
+
return this.rebase(ordered, new RenderTimeMap(skipRanges));
|
|
37
|
+
}
|
|
38
|
+
buildCue(segment) {
|
|
39
|
+
const rows = this.buildRows(segment);
|
|
40
|
+
if (rows.length === 0)
|
|
41
|
+
return null;
|
|
42
|
+
const time = this.resolveTime(segment, rows);
|
|
43
|
+
if (time.duration <= 0)
|
|
44
|
+
return null;
|
|
45
|
+
return new SubtitleCue(time, rows);
|
|
46
|
+
}
|
|
47
|
+
buildRows(segment) {
|
|
48
|
+
const rows = [];
|
|
49
|
+
for (const line of segment.lines) {
|
|
50
|
+
const tokens = this.buildTokens(line);
|
|
51
|
+
if (tokens.length > 0)
|
|
52
|
+
rows.push(new SubtitleRow(tokens));
|
|
53
|
+
}
|
|
54
|
+
return rows;
|
|
55
|
+
}
|
|
56
|
+
buildTokens(line) {
|
|
57
|
+
const tokens = [];
|
|
58
|
+
for (const word of line.words) {
|
|
59
|
+
const text = word.text.trim();
|
|
60
|
+
if (text.length > 0)
|
|
61
|
+
tokens.push(new SubtitleToken(text, word.time));
|
|
62
|
+
}
|
|
63
|
+
return tokens;
|
|
64
|
+
}
|
|
65
|
+
resolveTime(segment, rows) {
|
|
66
|
+
if (segment.customTime)
|
|
67
|
+
return segment.customTime;
|
|
68
|
+
if (segment.effectTime)
|
|
69
|
+
return segment.effectTime;
|
|
70
|
+
return this.spanOf(rows);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Word windows are not guaranteed to be sorted or contiguous, so the
|
|
74
|
+
* span is the outer envelope rather than the first and last entries.
|
|
75
|
+
*/
|
|
76
|
+
spanOf(rows) {
|
|
77
|
+
let start = Number.POSITIVE_INFINITY;
|
|
78
|
+
let end = Number.NEGATIVE_INFINITY;
|
|
79
|
+
for (const row of rows) {
|
|
80
|
+
for (const token of row.tokens) {
|
|
81
|
+
if (token.time.start < start)
|
|
82
|
+
start = token.time.start;
|
|
83
|
+
if (token.time.end > end)
|
|
84
|
+
end = token.time.end;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return new TimeFragment(start, end);
|
|
88
|
+
}
|
|
89
|
+
rebase(cues, timeMap) {
|
|
90
|
+
const rebased = [];
|
|
91
|
+
for (const cue of cues) {
|
|
92
|
+
const time = this.rebaseFragment(cue.time, timeMap);
|
|
93
|
+
if (time.duration <= 0)
|
|
94
|
+
continue;
|
|
95
|
+
rebased.push(new SubtitleCue(time, this.rebaseRows(cue.rows, timeMap)));
|
|
96
|
+
}
|
|
97
|
+
return rebased;
|
|
98
|
+
}
|
|
99
|
+
rebaseRows(rows, timeMap) {
|
|
100
|
+
return rows.map((row) => new SubtitleRow(row.tokens.map((token) => new SubtitleToken(token.text, this.rebaseFragment(token.time, timeMap)))));
|
|
101
|
+
}
|
|
102
|
+
rebaseFragment(fragment, timeMap) {
|
|
103
|
+
return new TimeFragment(timeMap.toOutputTime(fragment.start), timeMap.toOutputTime(fragment.end));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=SubtitleCueBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleCueBuilder.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleCueBuilder.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Document } from '../document/Document';
|
|
2
|
+
import type { TimeRange } from '../video/RenderTimeMap';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Everything a subtitle file is written from.
|
|
6
|
+
*
|
|
7
|
+
* `skipRanges` names the windows a render of the same document leaves
|
|
8
|
+
* out, and must match the ones handed to the renderer. The file is
|
|
9
|
+
* written on the timeline those exclusions produce, so both outputs
|
|
10
|
+
* line up against the same footage; omit it when nothing is excluded.
|
|
11
|
+
*/
|
|
12
|
+
export interface SubtitleFileJob {
|
|
13
|
+
readonly document: Document;
|
|
14
|
+
readonly granularity: SubtitleGranularity;
|
|
15
|
+
readonly skipRanges?: ReadonlyArray<TimeRange>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SubtitleFileJob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleFileJob.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleFileJob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleFileJob.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleFileJob.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import type { SubtitleFileJob } from '../subtitle-file/SubtitleFileJob';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Writes a document out as one subtitle file format.
|
|
6
|
+
*
|
|
7
|
+
* The declared media type and extension travel with the serializer, so
|
|
8
|
+
* everything a caller needs in order to hand the result to a user comes
|
|
9
|
+
* from the object that produced it.
|
|
10
|
+
*
|
|
11
|
+
* Every format is written from the same corrected view of the document,
|
|
12
|
+
* which is why the shared preparation lives here and subclasses are
|
|
13
|
+
* left with nothing but their own syntax. What differs is how far a
|
|
14
|
+
* format can honour `granularity`: some carry word timing inside a
|
|
15
|
+
* normal entry, some can only reach it by emitting one entry per word,
|
|
16
|
+
* and some carry no timing at all.
|
|
17
|
+
*
|
|
18
|
+
* A document with nothing to show yields an empty body rather than an
|
|
19
|
+
* error.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class SubtitleFileSerializer {
|
|
22
|
+
private readonly cueBuilder;
|
|
23
|
+
/** Media type of the produced text. */
|
|
24
|
+
abstract readonly mediaType: string;
|
|
25
|
+
/** Filename extension, without the leading dot. */
|
|
26
|
+
abstract readonly fileExtension: string;
|
|
27
|
+
serialize(job: SubtitleFileJob): string;
|
|
28
|
+
protected abstract write(cues: ReadonlyArray<SubtitleCue>, granularity: SubtitleGranularity): string;
|
|
29
|
+
/**
|
|
30
|
+
* The same content cut down to one entry per word, for a format whose
|
|
31
|
+
* only way to express word timing is to multiply its entries. Words
|
|
32
|
+
* covering an empty window drop out, since no player would show them.
|
|
33
|
+
*/
|
|
34
|
+
protected perWordCues(cues: ReadonlyArray<SubtitleCue>): ReadonlyArray<SubtitleCue>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=SubtitleFileSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleFileSerializer.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,sBAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IAEvD,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAEpC,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAExC,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM;IAKvC,SAAS,CAAC,QAAQ,CAAC,KAAK,CACtB,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,WAAW,EAAE,mBAAmB,GAC/B,MAAM;IAET;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC;CAUpF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import { SubtitleCueBuilder } from '../subtitle-file/SubtitleCueBuilder';
|
|
3
|
+
import { SubtitleRow } from '../subtitle-file/SubtitleRow';
|
|
4
|
+
/**
|
|
5
|
+
* Writes a document out as one subtitle file format.
|
|
6
|
+
*
|
|
7
|
+
* The declared media type and extension travel with the serializer, so
|
|
8
|
+
* everything a caller needs in order to hand the result to a user comes
|
|
9
|
+
* from the object that produced it.
|
|
10
|
+
*
|
|
11
|
+
* Every format is written from the same corrected view of the document,
|
|
12
|
+
* which is why the shared preparation lives here and subclasses are
|
|
13
|
+
* left with nothing but their own syntax. What differs is how far a
|
|
14
|
+
* format can honour `granularity`: some carry word timing inside a
|
|
15
|
+
* normal entry, some can only reach it by emitting one entry per word,
|
|
16
|
+
* and some carry no timing at all.
|
|
17
|
+
*
|
|
18
|
+
* A document with nothing to show yields an empty body rather than an
|
|
19
|
+
* error.
|
|
20
|
+
*/
|
|
21
|
+
export class SubtitleFileSerializer {
|
|
22
|
+
cueBuilder = new SubtitleCueBuilder();
|
|
23
|
+
serialize(job) {
|
|
24
|
+
const cues = this.cueBuilder.build(job.document, job.skipRanges ?? []);
|
|
25
|
+
return this.write(cues, job.granularity);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The same content cut down to one entry per word, for a format whose
|
|
29
|
+
* only way to express word timing is to multiply its entries. Words
|
|
30
|
+
* covering an empty window drop out, since no player would show them.
|
|
31
|
+
*/
|
|
32
|
+
perWordCues(cues) {
|
|
33
|
+
const perWord = [];
|
|
34
|
+
for (const cue of cues) {
|
|
35
|
+
for (const token of cue.tokens()) {
|
|
36
|
+
if (token.time.duration <= 0)
|
|
37
|
+
continue;
|
|
38
|
+
perWord.push(new SubtitleCue(token.time, [new SubtitleRow([token])]));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return perWord;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=SubtitleFileSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleFileSerializer.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAIjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAgB,sBAAsB;IACzB,UAAU,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAQvD,SAAS,CAAC,GAAoB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAOD;;;;OAIG;IACO,WAAW,CAAC,IAAgC;QACpD,MAAM,OAAO,GAAkB,EAAE,CAAC;QAClC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;gBACjC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC;oBAAE,SAAS;gBACvC,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How precisely the caller wants timing represented in the file.
|
|
3
|
+
*
|
|
4
|
+
* `segment` times whole phrases, the shape every player expects.
|
|
5
|
+
* `word` asks for timing down to each word; a format satisfies that
|
|
6
|
+
* however it can, so the cost differs sharply between formats — some
|
|
7
|
+
* carry word timing inside a normal entry, others can only reach it by
|
|
8
|
+
* emitting one entry per word.
|
|
9
|
+
*/
|
|
10
|
+
export type SubtitleGranularity = 'segment' | 'word';
|
|
11
|
+
//# sourceMappingURL=SubtitleGranularity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleGranularity.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleGranularity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleGranularity.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleGranularity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SubtitleToken } from '../subtitle-file/SubtitleToken';
|
|
2
|
+
/**
|
|
3
|
+
* One visual line inside a subtitle entry. Always holds at least one
|
|
4
|
+
* token, and its tokens are in reading order.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SubtitleRow {
|
|
7
|
+
readonly tokens: ReadonlyArray<SubtitleToken>;
|
|
8
|
+
constructor(tokens: ReadonlyArray<SubtitleToken>);
|
|
9
|
+
text(): string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=SubtitleRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleRow.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleRow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAE1E;;;GAGG;AACH,qBAAa,WAAW;IACV,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC;gBAApC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC;IAEzD,IAAI,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One visual line inside a subtitle entry. Always holds at least one
|
|
3
|
+
* token, and its tokens are in reading order.
|
|
4
|
+
*/
|
|
5
|
+
export class SubtitleRow {
|
|
6
|
+
tokens;
|
|
7
|
+
constructor(tokens) {
|
|
8
|
+
this.tokens = tokens;
|
|
9
|
+
}
|
|
10
|
+
text() {
|
|
11
|
+
return this.tokens.map((token) => token.text).join(' ');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SubtitleRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleRow.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleRow.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,WAAW;IACD;IAArB,YAAqB,MAAoC;QAApC,WAAM,GAAN,MAAM,CAA8B;IAAG,CAAC;IAE7D,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TimeFragment } from '../document/TimeFragment';
|
|
2
|
+
/**
|
|
3
|
+
* One spoken word inside a subtitle entry, with the window it occupies.
|
|
4
|
+
*
|
|
5
|
+
* Formats that can express timing below the entry level read the
|
|
6
|
+
* windows; the rest read only the text.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SubtitleToken {
|
|
9
|
+
readonly text: string;
|
|
10
|
+
readonly time: TimeFragment;
|
|
11
|
+
constructor(text: string, time: TimeFragment);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SubtitleToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleToken.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleToken.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE;;;;;GAKG;AACH,qBAAa,aAAa;IAEtB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,YAAY;gBADlB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY;CAE9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One spoken word inside a subtitle entry, with the window it occupies.
|
|
3
|
+
*
|
|
4
|
+
* Formats that can express timing below the entry level read the
|
|
5
|
+
* windows; the rest read only the text.
|
|
6
|
+
*/
|
|
7
|
+
export class SubtitleToken {
|
|
8
|
+
text;
|
|
9
|
+
time;
|
|
10
|
+
constructor(text, time) {
|
|
11
|
+
this.text = text;
|
|
12
|
+
this.time = time;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SubtitleToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubtitleToken.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SubtitleToken.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAEb;IACA;IAFX,YACW,IAAY,EACZ,IAAkB;QADlB,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAc;IAC1B,CAAC;CACL"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Writes the plain transcript (`.txt`): one line per entry, no timing
|
|
6
|
+
* at all. For the reader whose errand is the words themselves — notes,
|
|
7
|
+
* an article, a translation pass — rather than anything played back.
|
|
8
|
+
*
|
|
9
|
+
* Rows are joined with a space rather than kept apart, because where a
|
|
10
|
+
* caption wrapped on screen says nothing about the text. Granularity is
|
|
11
|
+
* ignored: a file with no timing has no timing to make finer.
|
|
12
|
+
*/
|
|
13
|
+
export declare class TextSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
14
|
+
readonly mediaType = "text/plain";
|
|
15
|
+
readonly fileExtension = "txt";
|
|
16
|
+
protected write(cues: ReadonlyArray<SubtitleCue>, _granularity: SubtitleGranularity): string;
|
|
17
|
+
private writeCue;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=TextSubtitleFileSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextSubtitleFileSerializer.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/TextSubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAItF;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,sBAAsB;IACpE,QAAQ,CAAC,SAAS,gBAAgB;IAClC,QAAQ,CAAC,aAAa,SAAS;IAE/B,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,YAAY,EAAE,mBAAmB,GAAG,MAAM;IAK5F,OAAO,CAAC,QAAQ;CAGjB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
2
|
+
const NEW_LINE = '\n';
|
|
3
|
+
/**
|
|
4
|
+
* Writes the plain transcript (`.txt`): one line per entry, no timing
|
|
5
|
+
* at all. For the reader whose errand is the words themselves — notes,
|
|
6
|
+
* an article, a translation pass — rather than anything played back.
|
|
7
|
+
*
|
|
8
|
+
* Rows are joined with a space rather than kept apart, because where a
|
|
9
|
+
* caption wrapped on screen says nothing about the text. Granularity is
|
|
10
|
+
* ignored: a file with no timing has no timing to make finer.
|
|
11
|
+
*/
|
|
12
|
+
export class TextSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
13
|
+
mediaType = 'text/plain';
|
|
14
|
+
fileExtension = 'txt';
|
|
15
|
+
write(cues, _granularity) {
|
|
16
|
+
if (cues.length === 0)
|
|
17
|
+
return '';
|
|
18
|
+
return `${cues.map((cue) => this.writeCue(cue)).join(NEW_LINE)}${NEW_LINE}`;
|
|
19
|
+
}
|
|
20
|
+
writeCue(cue) {
|
|
21
|
+
return cue.rows.map((row) => row.text()).join(' ');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=TextSubtitleFileSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextSubtitleFileSerializer.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/TextSubtitleFileSerializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA2B,SAAQ,sBAAsB;IAC3D,SAAS,GAAG,YAAY,CAAC;IACzB,aAAa,GAAG,KAAK,CAAC;IAErB,KAAK,CAAC,IAAgC,EAAE,YAAiC;QACjF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACjC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;IAC9E,CAAC;IAEO,QAAQ,CAAC,GAAgB;QAC/B,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A position on the timeline broken into the parts a subtitle timecode
|
|
3
|
+
* is written from. Formats differ in separators, padding and precision,
|
|
4
|
+
* so the decomposition is shared and the assembly is not.
|
|
5
|
+
*
|
|
6
|
+
* A position before the start of the timeline clamps to zero, and the
|
|
7
|
+
* fractional part is rounded to whole milliseconds — finer detail than
|
|
8
|
+
* any of these formats can hold.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Timecode {
|
|
11
|
+
readonly hours: number;
|
|
12
|
+
readonly minutes: number;
|
|
13
|
+
readonly seconds: number;
|
|
14
|
+
readonly milliseconds: number;
|
|
15
|
+
constructor(positionSeconds: number);
|
|
16
|
+
/** Hundredths of a second, for formats that stop at that precision. */
|
|
17
|
+
centiseconds(): number;
|
|
18
|
+
padded(value: number, width: number): string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Timecode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timecode.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/Timecode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,QAAQ;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,eAAe,EAAE,MAAM;IAUnC,uEAAuE;IACvE,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAG7C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A position on the timeline broken into the parts a subtitle timecode
|
|
3
|
+
* is written from. Formats differ in separators, padding and precision,
|
|
4
|
+
* so the decomposition is shared and the assembly is not.
|
|
5
|
+
*
|
|
6
|
+
* A position before the start of the timeline clamps to zero, and the
|
|
7
|
+
* fractional part is rounded to whole milliseconds — finer detail than
|
|
8
|
+
* any of these formats can hold.
|
|
9
|
+
*/
|
|
10
|
+
export class Timecode {
|
|
11
|
+
hours;
|
|
12
|
+
minutes;
|
|
13
|
+
seconds;
|
|
14
|
+
milliseconds;
|
|
15
|
+
constructor(positionSeconds) {
|
|
16
|
+
const totalMilliseconds = Math.round(Math.max(0, positionSeconds) * 1000);
|
|
17
|
+
this.milliseconds = totalMilliseconds % 1000;
|
|
18
|
+
const totalSeconds = (totalMilliseconds - this.milliseconds) / 1000;
|
|
19
|
+
this.seconds = totalSeconds % 60;
|
|
20
|
+
const totalMinutes = (totalSeconds - this.seconds) / 60;
|
|
21
|
+
this.minutes = totalMinutes % 60;
|
|
22
|
+
this.hours = (totalMinutes - this.minutes) / 60;
|
|
23
|
+
}
|
|
24
|
+
/** Hundredths of a second, for formats that stop at that precision. */
|
|
25
|
+
centiseconds() {
|
|
26
|
+
return Math.round(this.milliseconds / 10);
|
|
27
|
+
}
|
|
28
|
+
padded(value, width) {
|
|
29
|
+
return String(value).padStart(width, '0');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Timecode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timecode.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/Timecode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,OAAO,QAAQ;IACV,KAAK,CAAS;IACd,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,YAAY,CAAS;IAE9B,YAAY,eAAuB;QACjC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,IAAI,CAAC,CAAC;QAC1E,IAAI,CAAC,YAAY,GAAG,iBAAiB,GAAG,IAAI,CAAC;QAC7C,MAAM,YAAY,GAAG,CAAC,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;QACpE,IAAI,CAAC,OAAO,GAAG,YAAY,GAAG,EAAE,CAAC;QACjC,MAAM,YAAY,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,YAAY,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAClD,CAAC;IAED,uEAAuE;IACvE,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,KAAa,EAAE,KAAa;QACjC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Writes TTML (`.ttml`, also served as DFXP), the timed-text XML that
|
|
6
|
+
* broadcast and streaming workflows exchange. Each entry is a `<p>`
|
|
7
|
+
* carrying `begin` and `end`, and a row break inside one becomes
|
|
8
|
+
* `<br/>`.
|
|
9
|
+
*
|
|
10
|
+
* The format times words inside an entry with nested `<span>` elements,
|
|
11
|
+
* so word granularity costs no extra entries.
|
|
12
|
+
*/
|
|
13
|
+
export declare class TtmlSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
14
|
+
readonly mediaType = "application/ttml+xml";
|
|
15
|
+
readonly fileExtension = "ttml";
|
|
16
|
+
protected write(cues: ReadonlyArray<SubtitleCue>, granularity: SubtitleGranularity): string;
|
|
17
|
+
private writeCue;
|
|
18
|
+
private writeRow;
|
|
19
|
+
private escape;
|
|
20
|
+
private timecode;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=TtmlSubtitleFileSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TtmlSubtitleFileSerializer.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/TtmlSubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAatF;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,sBAAsB;IACpE,QAAQ,CAAC,SAAS,0BAA0B;IAC5C,QAAQ,CAAC,aAAa,UAAU;IAEhC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAM3F,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,QAAQ;CAKjB"}
|