@tscaps/engine 0.1.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/LICENSE +21 -0
- package/README.md +349 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.d.ts +5 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.js +41 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/CssMinifier.d.ts +12 -0
- package/dist/modules/css/CssMinifier.d.ts.map +1 -0
- package/dist/modules/css/CssMinifier.js +47 -0
- package/dist/modules/css/CssMinifier.js.map +1 -0
- package/dist/modules/css/CssResourceEmbedder.d.ts +4 -0
- package/dist/modules/css/CssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/CssResourceEmbedder.js +2 -0
- package/dist/modules/css/CssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +16 -0
- package/dist/modules/css/CssScoper.d.ts.map +1 -0
- package/dist/modules/css/CssScoper.js +109 -0
- package/dist/modules/css/CssScoper.js.map +1 -0
- package/dist/modules/css/NoopCssResourceEmbedder.d.ts +12 -0
- package/dist/modules/css/NoopCssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/NoopCssResourceEmbedder.js +13 -0
- package/dist/modules/css/NoopCssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/index.d.ts +6 -0
- package/dist/modules/css/index.d.ts.map +1 -0
- package/dist/modules/css/index.js +5 -0
- package/dist/modules/css/index.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +46 -0
- package/dist/modules/document/CssVariable.d.ts.map +1 -0
- package/dist/modules/document/CssVariable.js +47 -0
- package/dist/modules/document/CssVariable.js.map +1 -0
- package/dist/modules/document/Document.d.ts +43 -0
- package/dist/modules/document/Document.d.ts.map +1 -0
- package/dist/modules/document/Document.js +86 -0
- package/dist/modules/document/Document.js.map +1 -0
- package/dist/modules/document/DocumentEditor.d.ts +111 -0
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -0
- package/dist/modules/document/DocumentEditor.js +555 -0
- package/dist/modules/document/DocumentEditor.js.map +1 -0
- package/dist/modules/document/Letter.d.ts +17 -0
- package/dist/modules/document/Letter.d.ts.map +1 -0
- package/dist/modules/document/Letter.js +17 -0
- package/dist/modules/document/Letter.js.map +1 -0
- package/dist/modules/document/Line.d.ts +31 -0
- package/dist/modules/document/Line.d.ts.map +1 -0
- package/dist/modules/document/Line.js +94 -0
- package/dist/modules/document/Line.js.map +1 -0
- package/dist/modules/document/LineState.d.ts +6 -0
- package/dist/modules/document/LineState.d.ts.map +1 -0
- package/dist/modules/document/LineState.js +7 -0
- package/dist/modules/document/LineState.js.map +1 -0
- package/dist/modules/document/NarrationPace.d.ts +20 -0
- package/dist/modules/document/NarrationPace.d.ts.map +1 -0
- package/dist/modules/document/NarrationPace.js +60 -0
- package/dist/modules/document/NarrationPace.js.map +1 -0
- package/dist/modules/document/Section.d.ts +45 -0
- package/dist/modules/document/Section.d.ts.map +1 -0
- package/dist/modules/document/Section.js +94 -0
- package/dist/modules/document/Section.js.map +1 -0
- package/dist/modules/document/Segment.d.ts +40 -0
- package/dist/modules/document/Segment.d.ts.map +1 -0
- package/dist/modules/document/Segment.js +85 -0
- package/dist/modules/document/Segment.js.map +1 -0
- package/dist/modules/document/Tag.d.ts +24 -0
- package/dist/modules/document/Tag.d.ts.map +1 -0
- package/dist/modules/document/Tag.js +37 -0
- package/dist/modules/document/Tag.js.map +1 -0
- package/dist/modules/document/TimeFragment.d.ts +11 -0
- package/dist/modules/document/TimeFragment.d.ts.map +1 -0
- package/dist/modules/document/TimeFragment.js +29 -0
- package/dist/modules/document/TimeFragment.js.map +1 -0
- package/dist/modules/document/Word.d.ts +40 -0
- package/dist/modules/document/Word.d.ts.map +1 -0
- package/dist/modules/document/Word.js +114 -0
- package/dist/modules/document/Word.js.map +1 -0
- package/dist/modules/document/WordState.d.ts +6 -0
- package/dist/modules/document/WordState.d.ts.map +1 -0
- package/dist/modules/document/WordState.js +7 -0
- package/dist/modules/document/WordState.js.map +1 -0
- package/dist/modules/document/index.d.ts +14 -0
- package/dist/modules/document/index.d.ts.map +1 -0
- package/dist/modules/document/index.js +14 -0
- package/dist/modules/document/index.js.map +1 -0
- package/dist/modules/effect/CarryQuotesEffect.d.ts +47 -0
- package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -0
- package/dist/modules/effect/CarryQuotesEffect.js +181 -0
- package/dist/modules/effect/CarryQuotesEffect.js.map +1 -0
- package/dist/modules/effect/Effect.d.ts +16 -0
- package/dist/modules/effect/Effect.d.ts.map +1 -0
- package/dist/modules/effect/Effect.js +2 -0
- package/dist/modules/effect/Effect.js.map +1 -0
- package/dist/modules/effect/GapFreeEffect.d.ts +24 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -0
- package/dist/modules/effect/GapFreeEffect.js +67 -0
- package/dist/modules/effect/GapFreeEffect.js.map +1 -0
- package/dist/modules/effect/RemovePunctuationEffect.d.ts +21 -0
- package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -0
- package/dist/modules/effect/RemovePunctuationEffect.js +52 -0
- package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -0
- package/dist/modules/effect/SmartLowercaseEffect.d.ts +21 -0
- package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -0
- package/dist/modules/effect/SmartLowercaseEffect.js +45 -0
- package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -0
- package/dist/modules/effect/SmartPunctuationEffect.d.ts +25 -0
- package/dist/modules/effect/SmartPunctuationEffect.d.ts.map +1 -0
- package/dist/modules/effect/SmartPunctuationEffect.js +68 -0
- package/dist/modules/effect/SmartPunctuationEffect.js.map +1 -0
- package/dist/modules/effect/index.d.ts +7 -0
- package/dist/modules/effect/index.d.ts.map +1 -0
- package/dist/modules/effect/index.js +6 -0
- package/dist/modules/effect/index.js.map +1 -0
- package/dist/modules/pipeline/PipelineProgress.d.ts +30 -0
- package/dist/modules/pipeline/PipelineProgress.d.ts.map +1 -0
- package/dist/modules/pipeline/PipelineProgress.js +2 -0
- package/dist/modules/pipeline/PipelineProgress.js.map +1 -0
- package/dist/modules/pipeline/RenderPipeline.d.ts +105 -0
- package/dist/modules/pipeline/RenderPipeline.d.ts.map +1 -0
- package/dist/modules/pipeline/RenderPipeline.js +232 -0
- package/dist/modules/pipeline/RenderPipeline.js.map +1 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +143 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.js +317 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -0
- package/dist/modules/pipeline/index.d.ts +6 -0
- package/dist/modules/pipeline/index.d.ts.map +1 -0
- package/dist/modules/pipeline/index.js +3 -0
- package/dist/modules/pipeline/index.js.map +1 -0
- package/dist/modules/profiling/Profiler.d.ts +115 -0
- package/dist/modules/profiling/Profiler.d.ts.map +1 -0
- package/dist/modules/profiling/Profiler.js +316 -0
- package/dist/modules/profiling/Profiler.js.map +1 -0
- package/dist/modules/profiling/index.d.ts +2 -0
- package/dist/modules/profiling/index.d.ts.map +1 -0
- package/dist/modules/profiling/index.js +2 -0
- package/dist/modules/profiling/index.js.map +1 -0
- package/dist/modules/rendering/AlignmentConfig.d.ts +21 -0
- package/dist/modules/rendering/AlignmentConfig.d.ts.map +1 -0
- package/dist/modules/rendering/AlignmentConfig.js +2 -0
- package/dist/modules/rendering/AlignmentConfig.js.map +1 -0
- package/dist/modules/rendering/BoxEdges.d.ts +8 -0
- package/dist/modules/rendering/BoxEdges.d.ts.map +1 -0
- package/dist/modules/rendering/BoxEdges.js +2 -0
- package/dist/modules/rendering/BoxEdges.js.map +1 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.d.ts +12 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.js +31 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +57 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +775 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/ElementRenderOverrides.d.ts +15 -0
- package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +1 -0
- package/dist/modules/rendering/ElementRenderOverrides.js +24 -0
- package/dist/modules/rendering/ElementRenderOverrides.js.map +1 -0
- package/dist/modules/rendering/InlineStyleMap.d.ts +9 -0
- package/dist/modules/rendering/InlineStyleMap.d.ts.map +1 -0
- package/dist/modules/rendering/InlineStyleMap.js +2 -0
- package/dist/modules/rendering/InlineStyleMap.js.map +1 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.d.ts +20 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.d.ts.map +1 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.js +36 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.js.map +1 -0
- package/dist/modules/rendering/OverlayFrameRenderer.d.ts +27 -0
- package/dist/modules/rendering/OverlayFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/OverlayFrameRenderer.js +2 -0
- package/dist/modules/rendering/OverlayFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/RenderingConfig.d.ts +22 -0
- package/dist/modules/rendering/RenderingConfig.d.ts.map +1 -0
- package/dist/modules/rendering/RenderingConfig.js +2 -0
- package/dist/modules/rendering/RenderingConfig.js.map +1 -0
- package/dist/modules/rendering/ScopedRenderOverride.d.ts +19 -0
- package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +1 -0
- package/dist/modules/rendering/ScopedRenderOverride.js +2 -0
- package/dist/modules/rendering/ScopedRenderOverride.js.map +1 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts +41 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +1 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.js +47 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +1 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +58 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +132 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +111 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.js +2 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts +21 -0
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +1 -0
- package/dist/modules/rendering/VideoFrameLayerClass.js +21 -0
- package/dist/modules/rendering/VideoFrameLayerClass.js.map +1 -0
- package/dist/modules/rendering/VideoFrameSource.d.ts +29 -0
- package/dist/modules/rendering/VideoFrameSource.d.ts.map +1 -0
- package/dist/modules/rendering/VideoFrameSource.js +2 -0
- package/dist/modules/rendering/VideoFrameSource.js.map +1 -0
- package/dist/modules/rendering/index.d.ts +14 -0
- package/dist/modules/rendering/index.d.ts.map +1 -0
- package/dist/modules/rendering/index.js +6 -0
- package/dist/modules/rendering/index.js.map +1 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts +24 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BalancedLineSplitter.js +81 -0
- package/dist/modules/splitting/BalancedLineSplitter.js.map +1 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts +31 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js +99 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js.map +1 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.d.ts +19 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.js +38 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.d.ts +8 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.js +12 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts +56 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts.map +1 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js +197 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js.map +1 -0
- package/dist/modules/splitting/GraphemeWordSplitter.d.ts +11 -0
- package/dist/modules/splitting/GraphemeWordSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/GraphemeWordSplitter.js +12 -0
- package/dist/modules/splitting/GraphemeWordSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.d.ts +15 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.js +64 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.d.ts +30 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.js +66 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.d.ts +12 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.js +25 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LineSplitter.d.ts +10 -0
- package/dist/modules/splitting/LineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LineSplitter.js +2 -0
- package/dist/modules/splitting/LineSplitter.js.map +1 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.d.ts +24 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.js +43 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/SegmentSplitter.d.ts +10 -0
- package/dist/modules/splitting/SegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/SegmentSplitter.js +2 -0
- package/dist/modules/splitting/SegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.d.ts +17 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.js +46 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/TextMeasurer.d.ts +15 -0
- package/dist/modules/splitting/TextMeasurer.d.ts.map +1 -0
- package/dist/modules/splitting/TextMeasurer.js +2 -0
- package/dist/modules/splitting/TextMeasurer.js.map +1 -0
- package/dist/modules/splitting/WordSplitter.d.ts +8 -0
- package/dist/modules/splitting/WordSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/WordSplitter.js +2 -0
- package/dist/modules/splitting/WordSplitter.js.map +1 -0
- package/dist/modules/splitting/index.d.ts +24 -0
- package/dist/modules/splitting/index.d.ts.map +1 -0
- package/dist/modules/splitting/index.js +12 -0
- package/dist/modules/splitting/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.js +28 -0
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterBundle.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilterBundle.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterBundle.js +20 -0
- package/dist/modules/svg-filter/SvgFilterBundle.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js +25 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +21 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +50 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.d.ts +17 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.js +27 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScope.d.ts +18 -0
- package/dist/modules/svg-filter/SvgFilterScope.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScope.js +28 -0
- package/dist/modules/svg-filter/SvgFilterScope.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.d.ts +52 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.js +2 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScoper.d.ts +60 -0
- package/dist/modules/svg-filter/SvgFilterScoper.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScoper.js +58 -0
- package/dist/modules/svg-filter/SvgFilterScoper.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +10 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -0
- package/dist/modules/svg-filter/index.js +8 -0
- package/dist/modules/svg-filter/index.js.map +1 -0
- package/dist/modules/tagging/RegexTagger.d.ts +11 -0
- package/dist/modules/tagging/RegexTagger.d.ts.map +1 -0
- package/dist/modules/tagging/RegexTagger.js +32 -0
- package/dist/modules/tagging/RegexTagger.js.map +1 -0
- package/dist/modules/tagging/SpanTagger.d.ts +25 -0
- package/dist/modules/tagging/SpanTagger.d.ts.map +1 -0
- package/dist/modules/tagging/SpanTagger.js +73 -0
- package/dist/modules/tagging/SpanTagger.js.map +1 -0
- package/dist/modules/tagging/StructureTagger.d.ts +20 -0
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -0
- package/dist/modules/tagging/StructureTagger.js +74 -0
- package/dist/modules/tagging/StructureTagger.js.map +1 -0
- package/dist/modules/tagging/Tagger.d.ts +5 -0
- package/dist/modules/tagging/Tagger.d.ts.map +1 -0
- package/dist/modules/tagging/Tagger.js +5 -0
- package/dist/modules/tagging/Tagger.js.map +1 -0
- package/dist/modules/tagging/WordlistTagger.d.ts +11 -0
- package/dist/modules/tagging/WordlistTagger.d.ts.map +1 -0
- package/dist/modules/tagging/WordlistTagger.js +31 -0
- package/dist/modules/tagging/WordlistTagger.js.map +1 -0
- package/dist/modules/tagging/index.d.ts +6 -0
- package/dist/modules/tagging/index.d.ts.map +1 -0
- package/dist/modules/tagging/index.js +6 -0
- package/dist/modules/tagging/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +11 -0
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/AudioDecoder.js +2 -0
- package/dist/modules/transcription/AudioDecoder.js.map +1 -0
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +13 -0
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/BrowserAudioDecoder.js +34 -0
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/PassthroughTranscriber.d.ts +20 -0
- package/dist/modules/transcription/PassthroughTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/PassthroughTranscriber.js +23 -0
- package/dist/modules/transcription/PassthroughTranscriber.js.map +1 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.d.ts +12 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.js +14 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +33 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.js +111 -0
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +23 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -0
- package/dist/modules/transcription/Transcriber.js +2 -0
- package/dist/modules/transcription/Transcriber.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +44 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.js +162 -0
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +8 -0
- package/dist/modules/transcription/index.d.ts.map +1 -0
- package/dist/modules/transcription/index.js +6 -0
- package/dist/modules/transcription/index.js.map +1 -0
- package/dist/modules/video/RenderJob.d.ts +95 -0
- package/dist/modules/video/RenderJob.d.ts.map +1 -0
- package/dist/modules/video/RenderJob.js +2 -0
- package/dist/modules/video/RenderJob.js.map +1 -0
- package/dist/modules/video/VideoRenderer.d.ts +5 -0
- package/dist/modules/video/VideoRenderer.d.ts.map +1 -0
- package/dist/modules/video/VideoRenderer.js +2 -0
- package/dist/modules/video/VideoRenderer.js.map +1 -0
- package/dist/modules/video/index.d.ts +33 -0
- package/dist/modules/video/index.d.ts.map +1 -0
- package/dist/modules/video/index.js +17 -0
- package/dist/modules/video/index.js.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +69 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +206 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.d.ts +24 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.js +2 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +20 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.js +2 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.d.ts +11 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +32 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.d.ts +12 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.js +14 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +28 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +52 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +25 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +52 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts +32 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js +60 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts +27 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js +72 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts +32 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.js +2 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts +25 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js +37 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +32 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.js +2 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.js.map +1 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.d.ts +59 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.js +110 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts +27 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js +44 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.d.ts +10 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.js +15 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.d.ts +29 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.js +2 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.d.ts +16 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.js +2 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +25 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +74 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.d.ts +26 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.js +147 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts +12 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js +25 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +30 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.js +2 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.d.ts +44 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.js +334 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +10 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +17 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.d.ts +30 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.js +2 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts +22 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.js +2 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.d.ts +17 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.js +48 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.d.ts +11 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.js +22 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.js.map +1 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.d.ts +27 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.js +2 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Effect } from '../effect/Effect';
|
|
2
|
+
import type { Document } from '../document/Document';
|
|
3
|
+
import type { Segment } from '../document/Segment';
|
|
4
|
+
/**
|
|
5
|
+
* Strips trailing punctuation from each matching word's `displayText`,
|
|
6
|
+
* leaving the original `text` (the transcription source of truth)
|
|
7
|
+
* untouched. Only punctuation at the end of the word is removed, so
|
|
8
|
+
* tokens like `google.com` or `15:30` keep their inner symbols. The
|
|
9
|
+
* deriver re-runs splitters and taggers from `text`, so toggling this
|
|
10
|
+
* effect off naturally restores the punctuated rendering on the next
|
|
11
|
+
* derivation.
|
|
12
|
+
*/
|
|
13
|
+
export declare class RemovePunctuationEffect implements Effect {
|
|
14
|
+
private readonly segmentFilter;
|
|
15
|
+
private static readonly PUNCTUATION;
|
|
16
|
+
private static readonly TRAILING_PUNCTUATION;
|
|
17
|
+
private static buildTrailingRegex;
|
|
18
|
+
constructor(segmentFilter?: (segment: Segment) => boolean);
|
|
19
|
+
apply(document: Document): Document;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=RemovePunctuationEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemovePunctuationEffect.d.ts","sourceRoot":"","sources":["../../../src/modules/effect/RemovePunctuationEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,YAAW,MAAM;IAqBlD,OAAO,CAAC,QAAQ,CAAC,aAAa;IApBhC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAOjC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAgD;IAE5F,OAAO,CAAC,MAAM,CAAC,kBAAkB;gBASd,aAAa,GAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAoB;IAG5E,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ;CAkBpC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strips trailing punctuation from each matching word's `displayText`,
|
|
3
|
+
* leaving the original `text` (the transcription source of truth)
|
|
4
|
+
* untouched. Only punctuation at the end of the word is removed, so
|
|
5
|
+
* tokens like `google.com` or `15:30` keep their inner symbols. The
|
|
6
|
+
* deriver re-runs splitters and taggers from `text`, so toggling this
|
|
7
|
+
* effect off naturally restores the punctuated rendering on the next
|
|
8
|
+
* derivation.
|
|
9
|
+
*/
|
|
10
|
+
export class RemovePunctuationEffect {
|
|
11
|
+
segmentFilter;
|
|
12
|
+
static PUNCTUATION = [
|
|
13
|
+
'...',
|
|
14
|
+
'.',
|
|
15
|
+
',',
|
|
16
|
+
';',
|
|
17
|
+
':',
|
|
18
|
+
'…',
|
|
19
|
+
];
|
|
20
|
+
static TRAILING_PUNCTUATION = RemovePunctuationEffect.buildTrailingRegex();
|
|
21
|
+
static buildTrailingRegex() {
|
|
22
|
+
const alternatives = [...RemovePunctuationEffect.PUNCTUATION]
|
|
23
|
+
.sort((a, b) => b.length - a.length)
|
|
24
|
+
.map((p) => p.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
|
|
25
|
+
.join('|');
|
|
26
|
+
return new RegExp(`(?:${alternatives})+$`, 'u');
|
|
27
|
+
}
|
|
28
|
+
constructor(segmentFilter = () => true) {
|
|
29
|
+
this.segmentFilter = segmentFilter;
|
|
30
|
+
}
|
|
31
|
+
apply(document) {
|
|
32
|
+
const newSections = document.sections.map((section) => {
|
|
33
|
+
const newSegments = section.segments.map((segment) => {
|
|
34
|
+
if (!this.segmentFilter(segment))
|
|
35
|
+
return segment;
|
|
36
|
+
const newLines = segment.lines.map((line) => {
|
|
37
|
+
const newWords = line.words.map((word) => {
|
|
38
|
+
const stripped = word.text.replace(RemovePunctuationEffect.TRAILING_PUNCTUATION, '');
|
|
39
|
+
if (stripped === word.displayText)
|
|
40
|
+
return word;
|
|
41
|
+
return word.with({ displayText: stripped });
|
|
42
|
+
});
|
|
43
|
+
return line.with({ words: newWords });
|
|
44
|
+
});
|
|
45
|
+
return segment.with({ lines: newLines });
|
|
46
|
+
});
|
|
47
|
+
return section.with({ segments: newSegments });
|
|
48
|
+
});
|
|
49
|
+
return document.with({ sections: newSections });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=RemovePunctuationEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemovePunctuationEffect.js","sourceRoot":"","sources":["../../../src/modules/effect/RemovePunctuationEffect.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAuB;IAqBf;IApBX,MAAM,CAAU,WAAW,GAAsB;QACvD,KAAK;QACL,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;KACJ,CAAC;IAEM,MAAM,CAAU,oBAAoB,GAAG,uBAAuB,CAAC,kBAAkB,EAAE,CAAC;IAEpF,MAAM,CAAC,kBAAkB;QAC/B,MAAM,YAAY,GAAG,CAAC,GAAG,uBAAuB,CAAC,WAAW,CAAC;aAC1D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;aACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;aACpD,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,IAAI,MAAM,CAAC,MAAM,YAAY,KAAK,EAAE,GAAG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E,CAAC,CAAC;IAClD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Effect } from '../effect/Effect';
|
|
2
|
+
import type { Document } from '../document/Document';
|
|
3
|
+
import type { Segment } from '../document/Segment';
|
|
4
|
+
/**
|
|
5
|
+
* Lowercases each matching word's `displayText`, preserving only words
|
|
6
|
+
* tagged as `entity` (proper nouns) and the English pronoun "I"
|
|
7
|
+
* (including contractions like "I'm", "I'll"). Targets the casual
|
|
8
|
+
* "all-lowercase" caption aesthetic where even sentence starts stay
|
|
9
|
+
* lowercased.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SmartLowercaseEffect implements Effect {
|
|
12
|
+
private readonly segmentFilter;
|
|
13
|
+
private static readonly I_PRONOUN;
|
|
14
|
+
constructor(segmentFilter?: (segment: Segment) => boolean);
|
|
15
|
+
apply(document: Document): Document;
|
|
16
|
+
private rewriteSegment;
|
|
17
|
+
private rewriteLine;
|
|
18
|
+
private rewriteWord;
|
|
19
|
+
private isPreserved;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=SmartLowercaseEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartLowercaseEffect.d.ts","sourceRoot":"","sources":["../../../src/modules/effect/SmartLowercaseEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIzD;;;;;;GAMG;AACH,qBAAa,oBAAqB,YAAW,MAAM;IAK/C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAHhC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAkB;gBAGhC,aAAa,GAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAoB;IAG5E,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ;IAUnC,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lowercases each matching word's `displayText`, preserving only words
|
|
3
|
+
* tagged as `entity` (proper nouns) and the English pronoun "I"
|
|
4
|
+
* (including contractions like "I'm", "I'll"). Targets the casual
|
|
5
|
+
* "all-lowercase" caption aesthetic where even sentence starts stay
|
|
6
|
+
* lowercased.
|
|
7
|
+
*/
|
|
8
|
+
export class SmartLowercaseEffect {
|
|
9
|
+
segmentFilter;
|
|
10
|
+
static I_PRONOUN = /^I(?:$|['’])/;
|
|
11
|
+
constructor(segmentFilter = () => true) {
|
|
12
|
+
this.segmentFilter = segmentFilter;
|
|
13
|
+
}
|
|
14
|
+
apply(document) {
|
|
15
|
+
return document.with({
|
|
16
|
+
sections: document.sections.map((section) => section.with({
|
|
17
|
+
segments: section.segments.map((segment) => this.rewriteSegment(segment)),
|
|
18
|
+
})),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
rewriteSegment(segment) {
|
|
22
|
+
if (!this.segmentFilter(segment))
|
|
23
|
+
return segment;
|
|
24
|
+
return segment.with({
|
|
25
|
+
lines: segment.lines.map((line) => this.rewriteLine(line)),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
rewriteLine(line) {
|
|
29
|
+
return line.with({
|
|
30
|
+
words: line.words.map((word) => this.rewriteWord(word)),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
rewriteWord(word) {
|
|
34
|
+
if (this.isPreserved(word))
|
|
35
|
+
return word;
|
|
36
|
+
const lowered = word.displayText.toLowerCase();
|
|
37
|
+
if (lowered === word.displayText)
|
|
38
|
+
return word;
|
|
39
|
+
return word.with({ displayText: lowered });
|
|
40
|
+
}
|
|
41
|
+
isPreserved(word) {
|
|
42
|
+
return word.hasTagName('entity') || SmartLowercaseEffect.I_PRONOUN.test(word.text);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=SmartLowercaseEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartLowercaseEffect.js","sourceRoot":"","sources":["../../../src/modules/effect/SmartLowercaseEffect.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IAKZ;IAHX,MAAM,CAAU,SAAS,GAAG,cAAc,CAAC;IAEnD,YACmB,gBAA+C,GAAG,EAAE,CAAC,IAAI;QAAzD,kBAAa,GAAb,aAAa,CAA4C;IACzE,CAAC;IAEJ,KAAK,CAAC,QAAkB;QACtB,OAAO,QAAQ,CAAC,IAAI,CAAC;YACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1C,OAAO,CAAC,IAAI,CAAC;gBACX,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;aAC1E,CAAC,CACH;SACF,CAAC,CAAC;IACL,CAAC;IAEO,cAAc,CAAC,OAAgB;QACrC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;YAAE,OAAO,OAAO,CAAC;QACjD,OAAO,OAAO,CAAC,IAAI,CAAC;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC3D,CAAC,CAAC;IACL,CAAC;IAEO,WAAW,CAAC,IAAU;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC;YACf,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;IAEO,WAAW,CAAC,IAAU;QAC5B,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAEO,WAAW,CAAC,IAAU;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Effect } from '../effect/Effect';
|
|
2
|
+
import type { Document } from '../document/Document';
|
|
3
|
+
import type { Segment } from '../document/Segment';
|
|
4
|
+
/**
|
|
5
|
+
* Replaces ASCII punctuation with typographic equivalents in each
|
|
6
|
+
* matching word's `displayText`. Reads `displayText` (not `text`) so
|
|
7
|
+
* the substitution composes with other display-text effects in the
|
|
8
|
+
* pipeline order.
|
|
9
|
+
*
|
|
10
|
+
* Substitutions per word:
|
|
11
|
+
* - `"` followed by a letter or digit → `“`; otherwise → `”`
|
|
12
|
+
* - `'` always → `’` (typographic apostrophe)
|
|
13
|
+
* - `--` → `—` (em dash)
|
|
14
|
+
* - `...` → `…` (ellipsis)
|
|
15
|
+
*/
|
|
16
|
+
export declare class SmartPunctuationEffect implements Effect {
|
|
17
|
+
private readonly segmentFilter;
|
|
18
|
+
constructor(segmentFilter?: (segment: Segment) => boolean);
|
|
19
|
+
apply(document: Document): Document;
|
|
20
|
+
private smartify;
|
|
21
|
+
private replaceMultiCharGlyphs;
|
|
22
|
+
private replaceQuotes;
|
|
23
|
+
private opensAQuotation;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=SmartPunctuationEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartPunctuationEffect.d.ts","sourceRoot":"","sources":["../../../src/modules/effect/SmartPunctuationEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,qBAAa,sBAAuB,YAAW,MAAM;IAGjD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,GAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAoB;IAG5E,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ;IAmBnC,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,eAAe;CAIxB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces ASCII punctuation with typographic equivalents in each
|
|
3
|
+
* matching word's `displayText`. Reads `displayText` (not `text`) so
|
|
4
|
+
* the substitution composes with other display-text effects in the
|
|
5
|
+
* pipeline order.
|
|
6
|
+
*
|
|
7
|
+
* Substitutions per word:
|
|
8
|
+
* - `"` followed by a letter or digit → `“`; otherwise → `”`
|
|
9
|
+
* - `'` always → `’` (typographic apostrophe)
|
|
10
|
+
* - `--` → `—` (em dash)
|
|
11
|
+
* - `...` → `…` (ellipsis)
|
|
12
|
+
*/
|
|
13
|
+
export class SmartPunctuationEffect {
|
|
14
|
+
segmentFilter;
|
|
15
|
+
constructor(segmentFilter = () => true) {
|
|
16
|
+
this.segmentFilter = segmentFilter;
|
|
17
|
+
}
|
|
18
|
+
apply(document) {
|
|
19
|
+
const newSections = document.sections.map((section) => {
|
|
20
|
+
const newSegments = section.segments.map((segment) => {
|
|
21
|
+
if (!this.segmentFilter(segment))
|
|
22
|
+
return segment;
|
|
23
|
+
const newLines = segment.lines.map((line) => {
|
|
24
|
+
const newWords = line.words.map((word) => {
|
|
25
|
+
const styled = this.smartify(word.displayText);
|
|
26
|
+
if (styled === word.displayText)
|
|
27
|
+
return word;
|
|
28
|
+
return word.with({ displayText: styled });
|
|
29
|
+
});
|
|
30
|
+
return line.with({ words: newWords });
|
|
31
|
+
});
|
|
32
|
+
return segment.with({ lines: newLines });
|
|
33
|
+
});
|
|
34
|
+
return section.with({ segments: newSegments });
|
|
35
|
+
});
|
|
36
|
+
return document.with({ sections: newSections });
|
|
37
|
+
}
|
|
38
|
+
smartify(text) {
|
|
39
|
+
const expanded = this.replaceMultiCharGlyphs(text);
|
|
40
|
+
return this.replaceQuotes(expanded);
|
|
41
|
+
}
|
|
42
|
+
replaceMultiCharGlyphs(text) {
|
|
43
|
+
return text
|
|
44
|
+
.replace(/\.{3}/g, '…')
|
|
45
|
+
.replace(/--/g, '—');
|
|
46
|
+
}
|
|
47
|
+
replaceQuotes(text) {
|
|
48
|
+
let result = '';
|
|
49
|
+
for (let i = 0; i < text.length; i++) {
|
|
50
|
+
const ch = text[i];
|
|
51
|
+
if (ch === '"') {
|
|
52
|
+
result += this.opensAQuotation(text, i) ? '“' : '”';
|
|
53
|
+
}
|
|
54
|
+
else if (ch === "'") {
|
|
55
|
+
result += '’';
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
result += ch;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
opensAQuotation(text, index) {
|
|
64
|
+
const next = text[index + 1] ?? '';
|
|
65
|
+
return /[\p{L}\p{N}]/u.test(next);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=SmartPunctuationEffect.js.map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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { Effect } from '../effect/Effect';
|
|
2
|
+
export { GapFreeEffect } from '../effect/GapFreeEffect';
|
|
3
|
+
export { RemovePunctuationEffect } from '../effect/RemovePunctuationEffect';
|
|
4
|
+
export { SmartPunctuationEffect } from '../effect/SmartPunctuationEffect';
|
|
5
|
+
export { SmartLowercaseEffect } from '../effect/SmartLowercaseEffect';
|
|
6
|
+
export { CarryQuotesEffect } from '../effect/CarryQuotesEffect';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/effect/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { GapFreeEffect } from '../effect/GapFreeEffect';
|
|
2
|
+
export { RemovePunctuationEffect } from '../effect/RemovePunctuationEffect';
|
|
3
|
+
export { SmartPunctuationEffect } from '../effect/SmartPunctuationEffect';
|
|
4
|
+
export { SmartLowercaseEffect } from '../effect/SmartLowercaseEffect';
|
|
5
|
+
export { CarryQuotesEffect } from '../effect/CarryQuotesEffect';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/effect/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TranscriberProgressEvent } from '../transcription/Transcriber';
|
|
2
|
+
import type { RenderProgress } from '../video/RenderJob';
|
|
3
|
+
/**
|
|
4
|
+
* One step of the render pipeline reporting status. `transcribing` and
|
|
5
|
+
* `rendering` wrap the underlying stage event so listeners get the full
|
|
6
|
+
* progress payload of the work being done; the structural steps in the
|
|
7
|
+
* middle (`splitting`, tagging, effects) emit a `started`/`completed`
|
|
8
|
+
* boundary because they finish in a single synchronous pass.
|
|
9
|
+
*/
|
|
10
|
+
export type PipelineProgressEvent = {
|
|
11
|
+
stage: 'transcribing';
|
|
12
|
+
inner: TranscriberProgressEvent;
|
|
13
|
+
} | {
|
|
14
|
+
stage: 'splitting';
|
|
15
|
+
status: 'started' | 'completed';
|
|
16
|
+
} | {
|
|
17
|
+
stage: 'tagging-structural';
|
|
18
|
+
status: 'started' | 'completed';
|
|
19
|
+
} | {
|
|
20
|
+
stage: 'tagging-semantic';
|
|
21
|
+
status: 'started' | 'completed';
|
|
22
|
+
} | {
|
|
23
|
+
stage: 'applying-effects';
|
|
24
|
+
status: 'started' | 'completed';
|
|
25
|
+
} | {
|
|
26
|
+
stage: 'rendering';
|
|
27
|
+
inner: RenderProgress;
|
|
28
|
+
};
|
|
29
|
+
export type PipelineProgressListener = (event: PipelineProgressEvent) => void;
|
|
30
|
+
//# sourceMappingURL=PipelineProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineProgress.d.ts","sourceRoot":"","sources":["../../../src/modules/pipeline/PipelineProgress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,wBAAwB,CAAA;CAAE,GAC1D;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GACvD;IAAE,KAAK,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GAChE;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GAC9D;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GAC9D;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineProgress.js","sourceRoot":"","sources":["../../../src/modules/pipeline/PipelineProgress.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Document } from '../document/Document';
|
|
2
|
+
import type { Transcriber, TranscriberOptions } from '../transcription/Transcriber';
|
|
3
|
+
import type { SegmentSplitter } from '../splitting/SegmentSplitter';
|
|
4
|
+
import type { LineSplitter } from '../splitting/LineSplitter';
|
|
5
|
+
import type { Tagger } from '../tagging/Tagger';
|
|
6
|
+
import type { Effect } from '../effect/Effect';
|
|
7
|
+
import type { SubtitleStyle } from '../rendering/SubtitleFrameRenderer';
|
|
8
|
+
import type { VideoRenderer } from '../video/VideoRenderer';
|
|
9
|
+
import type { RenderResult, OutputFormat, RenderQuality, RenderOutputChunk, AudioDiscardReason, FallbackDecoderInfo } from '../video/RenderJob';
|
|
10
|
+
import type { PipelineProgressListener } from '../pipeline/PipelineProgress';
|
|
11
|
+
/** Px resolution; either supplied up front or probed from the input video. */
|
|
12
|
+
export interface OutputResolution {
|
|
13
|
+
readonly width: number;
|
|
14
|
+
readonly height: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Knobs that influence the lazily-built default line splitter. Honoured
|
|
18
|
+
* only when no explicit `LineSplitter` was supplied to the pipeline.
|
|
19
|
+
*/
|
|
20
|
+
export interface DefaultLineSplitterRuntimeConfig {
|
|
21
|
+
readonly maxLines: number;
|
|
22
|
+
readonly minLines: number;
|
|
23
|
+
readonly maxWidthRatio: number;
|
|
24
|
+
}
|
|
25
|
+
export interface RenderPipelineConfig {
|
|
26
|
+
readonly video: File | Blob;
|
|
27
|
+
readonly transcriber: Transcriber;
|
|
28
|
+
readonly transcriberOptions: TranscriberOptions | undefined;
|
|
29
|
+
readonly segmentSplitter: SegmentSplitter;
|
|
30
|
+
/** Explicit line splitter; when `null`, a default is built lazily once the resolved css and output dimensions are known. */
|
|
31
|
+
readonly lineSplitter: LineSplitter | null;
|
|
32
|
+
readonly defaultLineSplitterConfig: DefaultLineSplitterRuntimeConfig;
|
|
33
|
+
readonly structureTagger: Tagger;
|
|
34
|
+
readonly semanticTaggers: ReadonlyArray<Tagger>;
|
|
35
|
+
readonly effects: ReadonlyArray<Effect>;
|
|
36
|
+
/** Applied to every `Section.kind` found in the document unless `explicitStyles` is set. */
|
|
37
|
+
readonly defaultStyle: SubtitleStyle;
|
|
38
|
+
/** When set, takes over from `defaultStyle` and is passed as-is to the video renderer. */
|
|
39
|
+
readonly explicitStyles: Readonly<Record<string, SubtitleStyle>> | null;
|
|
40
|
+
readonly videoRenderer: VideoRenderer;
|
|
41
|
+
readonly outputFormat: OutputFormat | undefined;
|
|
42
|
+
readonly quality: RenderQuality | undefined;
|
|
43
|
+
readonly outputResolution: OutputResolution | undefined;
|
|
44
|
+
readonly outputStream: WritableStream<RenderOutputChunk> | undefined;
|
|
45
|
+
readonly overlayHtml: string | undefined;
|
|
46
|
+
readonly onAudioDiscarded: ((reason: AudioDiscardReason) => void) | undefined;
|
|
47
|
+
readonly confirmFallbackDecoder: ((info: FallbackDecoderInfo) => Promise<boolean>) | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Orchestrates the end-to-end render flow over the components supplied
|
|
51
|
+
* by `RenderPipelineBuilder`: transcribe → split → tag (structural and
|
|
52
|
+
* semantic) → apply effects → render. Each step is also exposed
|
|
53
|
+
* individually so callers can inspect or mutate the current `Document`
|
|
54
|
+
* between stages.
|
|
55
|
+
*
|
|
56
|
+
* The pipeline owns the current `Document`. After a step it stores the
|
|
57
|
+
* result and feeds it to the next step; `getDocument`/`setDocument`
|
|
58
|
+
* give callers a read/replace handle for that state. `run` short-
|
|
59
|
+
* circuits through every step in order; if a Document is already
|
|
60
|
+
* loaded (whether from a previous step or via `setDocument`), it skips
|
|
61
|
+
* the transcription step and starts from splitting.
|
|
62
|
+
*
|
|
63
|
+
* Instances are built by `RenderPipelineBuilder.build` — the builder
|
|
64
|
+
* is the supported construction surface.
|
|
65
|
+
*/
|
|
66
|
+
export declare class RenderPipeline {
|
|
67
|
+
private readonly config;
|
|
68
|
+
private currentDocument;
|
|
69
|
+
private cachedVideoDimensions;
|
|
70
|
+
private cachedVideoFile;
|
|
71
|
+
constructor(config: RenderPipelineConfig);
|
|
72
|
+
/** Current document state; `null` before transcription runs. */
|
|
73
|
+
getDocument(): Document | null;
|
|
74
|
+
/** Replaces the current document — typical after a manual edit between steps. */
|
|
75
|
+
setDocument(document: Document): void;
|
|
76
|
+
/**
|
|
77
|
+
* Runs every step in order and returns the final render result.
|
|
78
|
+
* Skips transcription when a document is already loaded.
|
|
79
|
+
*/
|
|
80
|
+
run(onProgress?: PipelineProgressListener): Promise<RenderResult>;
|
|
81
|
+
runTranscriptionStep(onProgress?: PipelineProgressListener): Promise<Document>;
|
|
82
|
+
private restoreTranscriberProgressHandler;
|
|
83
|
+
runSplittingStep(onProgress?: PipelineProgressListener): Promise<Document>;
|
|
84
|
+
runStructuralTaggingStep(onProgress?: PipelineProgressListener): Document;
|
|
85
|
+
runSemanticTaggingStep(onProgress?: PipelineProgressListener): Promise<Document>;
|
|
86
|
+
runEffectsStep(onProgress?: PipelineProgressListener): Document;
|
|
87
|
+
runRenderingStep(onProgress?: PipelineProgressListener): Promise<RenderResult>;
|
|
88
|
+
private requireDocument;
|
|
89
|
+
private applySegmentSplitterToSections;
|
|
90
|
+
private applyLineSplittingToSections;
|
|
91
|
+
private resolveLineSplitter;
|
|
92
|
+
private buildDefaultLineSplitter;
|
|
93
|
+
private extractCssVariablesFromInlineStyles;
|
|
94
|
+
private resolveOutputDimensions;
|
|
95
|
+
private probeVideoNaturalDimensions;
|
|
96
|
+
private resolveStylesForDocument;
|
|
97
|
+
private buildRenderJob;
|
|
98
|
+
/**
|
|
99
|
+
* The video renderer's job expects a `File`. Inputs that arrive as a
|
|
100
|
+
* raw `Blob` are wrapped once and reused across runs so the same
|
|
101
|
+
* underlying bytes back every render call.
|
|
102
|
+
*/
|
|
103
|
+
private resolveVideoAsFile;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=RenderPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderPipeline.d.ts","sourceRoot":"","sources":["../../../src/modules/pipeline/RenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,KAAK,EA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