@docmentis/udoc-viewer 0.7.20 → 0.8.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/API-COMPARISON.md +441 -0
- package/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +21 -0
- package/README.md +23 -1220
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/dist/worker/worker-source.d.ts +3 -0
- package/dist/worker/worker-source.d.ts.map +1 -0
- package/dist/worker/worker-source.js +11 -0
- package/dist/worker/worker.d.ts +2 -0
- package/dist/worker/worker.d.ts.map +1 -0
- package/dist/worker/worker.js +5 -0
- package/dist/worker/worker.js.map +1 -0
- package/package.json +48 -59
- package/dist/package.json +0 -79
- package/dist/src/UDocClient.d.ts +0 -730
- package/dist/src/UDocClient.d.ts.map +0 -1
- package/dist/src/UDocClient.js +0 -649
- package/dist/src/UDocClient.js.map +0 -1
- package/dist/src/UDocViewer.d.ts +0 -883
- package/dist/src/UDocViewer.d.ts.map +0 -1
- package/dist/src/UDocViewer.js +0 -2180
- package/dist/src/UDocViewer.js.map +0 -1
- package/dist/src/fonts.d.ts +0 -47
- package/dist/src/fonts.d.ts.map +0 -1
- package/dist/src/fonts.js +0 -49
- package/dist/src/fonts.js.map +0 -1
- package/dist/src/index.d.ts +0 -13
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -5
- package/dist/src/index.js.map +0 -1
- package/dist/src/meta-url.d.ts +0 -2
- package/dist/src/meta-url.d.ts.map +0 -1
- package/dist/src/meta-url.js +0 -10
- package/dist/src/meta-url.js.map +0 -1
- package/dist/src/performance/PerformanceCounter.d.ts +0 -132
- package/dist/src/performance/PerformanceCounter.d.ts.map +0 -1
- package/dist/src/performance/PerformanceCounter.js +0 -129
- package/dist/src/performance/PerformanceCounter.js.map +0 -1
- package/dist/src/performance/index.d.ts +0 -2
- package/dist/src/performance/index.d.ts.map +0 -1
- package/dist/src/performance/index.js +0 -2
- package/dist/src/performance/index.js.map +0 -1
- package/dist/src/ui/framework/component.d.ts +0 -68
- package/dist/src/ui/framework/component.d.ts.map +0 -1
- package/dist/src/ui/framework/component.js +0 -97
- package/dist/src/ui/framework/component.js.map +0 -1
- package/dist/src/ui/framework/dom.d.ts +0 -19
- package/dist/src/ui/framework/dom.d.ts.map +0 -1
- package/dist/src/ui/framework/dom.js +0 -29
- package/dist/src/ui/framework/dom.js.map +0 -1
- package/dist/src/ui/framework/events.d.ts +0 -18
- package/dist/src/ui/framework/events.d.ts.map +0 -1
- package/dist/src/ui/framework/events.js +0 -23
- package/dist/src/ui/framework/events.js.map +0 -1
- package/dist/src/ui/framework/index.d.ts +0 -15
- package/dist/src/ui/framework/index.d.ts.map +0 -1
- package/dist/src/ui/framework/index.js +0 -15
- package/dist/src/ui/framework/index.js.map +0 -1
- package/dist/src/ui/framework/selectors.d.ts +0 -51
- package/dist/src/ui/framework/selectors.d.ts.map +0 -1
- package/dist/src/ui/framework/selectors.js +0 -28
- package/dist/src/ui/framework/selectors.js.map +0 -1
- package/dist/src/ui/framework/store.d.ts +0 -44
- package/dist/src/ui/framework/store.d.ts.map +0 -1
- package/dist/src/ui/framework/store.js +0 -79
- package/dist/src/ui/framework/store.js.map +0 -1
- package/dist/src/ui/viewer/a11y.d.ts +0 -26
- package/dist/src/ui/viewer/a11y.d.ts.map +0 -1
- package/dist/src/ui/viewer/a11y.js +0 -116
- package/dist/src/ui/viewer/a11y.js.map +0 -1
- package/dist/src/ui/viewer/actions.d.ts +0 -308
- package/dist/src/ui/viewer/actions.d.ts.map +0 -1
- package/dist/src/ui/viewer/actions.js +0 -2
- package/dist/src/ui/viewer/actions.js.map +0 -1
- package/dist/src/ui/viewer/animation-presets.d.ts +0 -37
- package/dist/src/ui/viewer/animation-presets.d.ts.map +0 -1
- package/dist/src/ui/viewer/animation-presets.js +0 -123
- package/dist/src/ui/viewer/animation-presets.js.map +0 -1
- package/dist/src/ui/viewer/animation.d.ts +0 -162
- package/dist/src/ui/viewer/animation.d.ts.map +0 -1
- package/dist/src/ui/viewer/animation.js +0 -506
- package/dist/src/ui/viewer/animation.js.map +0 -1
- package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts +0 -9
- package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/LinkRenderer.js +0 -17
- package/dist/src/ui/viewer/annotation/LinkRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts +0 -21
- package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/MarkupRenderer.js +0 -136
- package/dist/src/ui/viewer/annotation/MarkupRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts +0 -33
- package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/ShapeRenderer.js +0 -379
- package/dist/src/ui/viewer/annotation/ShapeRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/TextRenderer.d.ts +0 -23
- package/dist/src/ui/viewer/annotation/TextRenderer.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/TextRenderer.js +0 -196
- package/dist/src/ui/viewer/annotation/TextRenderer.js.map +0 -1
- package/dist/src/ui/viewer/annotation/index.d.ts +0 -9
- package/dist/src/ui/viewer/annotation/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/index.js +0 -10
- package/dist/src/ui/viewer/annotation/index.js.map +0 -1
- package/dist/src/ui/viewer/annotation/propertyUtils.d.ts +0 -29
- package/dist/src/ui/viewer/annotation/propertyUtils.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/propertyUtils.js +0 -151
- package/dist/src/ui/viewer/annotation/propertyUtils.js.map +0 -1
- package/dist/src/ui/viewer/annotation/render.d.ts +0 -24
- package/dist/src/ui/viewer/annotation/render.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/render.js +0 -191
- package/dist/src/ui/viewer/annotation/render.js.map +0 -1
- package/dist/src/ui/viewer/annotation/types.d.ts +0 -309
- package/dist/src/ui/viewer/annotation/types.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/types.js +0 -7
- package/dist/src/ui/viewer/annotation/types.js.map +0 -1
- package/dist/src/ui/viewer/annotation/utils.d.ts +0 -75
- package/dist/src/ui/viewer/annotation/utils.d.ts.map +0 -1
- package/dist/src/ui/viewer/annotation/utils.js +0 -250
- package/dist/src/ui/viewer/annotation/utils.js.map +0 -1
- package/dist/src/ui/viewer/components/AnnotationPanel.d.ts +0 -20
- package/dist/src/ui/viewer/components/AnnotationPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/AnnotationPanel.js +0 -276
- package/dist/src/ui/viewer/components/AnnotationPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts +0 -8
- package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/AttachmentsPanel.js +0 -16
- package/dist/src/ui/viewer/components/AttachmentsPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/BookmarksPanel.d.ts +0 -8
- package/dist/src/ui/viewer/components/BookmarksPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/BookmarksPanel.js +0 -16
- package/dist/src/ui/viewer/components/BookmarksPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/Branding.d.ts +0 -49
- package/dist/src/ui/viewer/components/Branding.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Branding.js +0 -334
- package/dist/src/ui/viewer/components/Branding.js.map +0 -1
- package/dist/src/ui/viewer/components/ColorSelect.d.ts +0 -26
- package/dist/src/ui/viewer/components/ColorSelect.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/ColorSelect.js +0 -120
- package/dist/src/ui/viewer/components/ColorSelect.js.map +0 -1
- package/dist/src/ui/viewer/components/FloatingToolbar.d.ts +0 -10
- package/dist/src/ui/viewer/components/FloatingToolbar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/FloatingToolbar.js +0 -396
- package/dist/src/ui/viewer/components/FloatingToolbar.js.map +0 -1
- package/dist/src/ui/viewer/components/FontsPanel.d.ts +0 -12
- package/dist/src/ui/viewer/components/FontsPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/FontsPanel.js +0 -141
- package/dist/src/ui/viewer/components/FontsPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/LayersPanel.d.ts +0 -12
- package/dist/src/ui/viewer/components/LayersPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/LayersPanel.js +0 -139
- package/dist/src/ui/viewer/components/LayersPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/LeftPanel.d.ts +0 -11
- package/dist/src/ui/viewer/components/LeftPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/LeftPanel.js +0 -296
- package/dist/src/ui/viewer/components/LeftPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/LoadingOverlay.d.ts +0 -13
- package/dist/src/ui/viewer/components/LoadingOverlay.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/LoadingOverlay.js +0 -146
- package/dist/src/ui/viewer/components/LoadingOverlay.js.map +0 -1
- package/dist/src/ui/viewer/components/NumberInput.d.ts +0 -32
- package/dist/src/ui/viewer/components/NumberInput.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/NumberInput.js +0 -101
- package/dist/src/ui/viewer/components/NumberInput.js.map +0 -1
- package/dist/src/ui/viewer/components/OutlinePanel.d.ts +0 -11
- package/dist/src/ui/viewer/components/OutlinePanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/OutlinePanel.js +0 -307
- package/dist/src/ui/viewer/components/OutlinePanel.js.map +0 -1
- package/dist/src/ui/viewer/components/PasswordDialog.d.ts +0 -16
- package/dist/src/ui/viewer/components/PasswordDialog.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/PasswordDialog.js +0 -179
- package/dist/src/ui/viewer/components/PasswordDialog.js.map +0 -1
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts +0 -27
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.js +0 -79
- package/dist/src/ui/viewer/components/PermitNoticeOverlay.js.map +0 -1
- package/dist/src/ui/viewer/components/PrintDialog.d.ts +0 -34
- package/dist/src/ui/viewer/components/PrintDialog.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/PrintDialog.js +0 -317
- package/dist/src/ui/viewer/components/PrintDialog.js.map +0 -1
- package/dist/src/ui/viewer/components/RightPanel.d.ts +0 -10
- package/dist/src/ui/viewer/components/RightPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/RightPanel.js +0 -154
- package/dist/src/ui/viewer/components/RightPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/SearchPanel.d.ts +0 -21
- package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/SearchPanel.js +0 -323
- package/dist/src/ui/viewer/components/SearchPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/SheetTabBar.d.ts +0 -9
- package/dist/src/ui/viewer/components/SheetTabBar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/SheetTabBar.js +0 -57
- package/dist/src/ui/viewer/components/SheetTabBar.js.map +0 -1
- package/dist/src/ui/viewer/components/Spread.d.ts +0 -85
- package/dist/src/ui/viewer/components/Spread.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Spread.js +0 -749
- package/dist/src/ui/viewer/components/Spread.js.map +0 -1
- package/dist/src/ui/viewer/components/SubToolbar.d.ts +0 -11
- package/dist/src/ui/viewer/components/SubToolbar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/SubToolbar.js +0 -722
- package/dist/src/ui/viewer/components/SubToolbar.js.map +0 -1
- package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts +0 -12
- package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/ThumbnailPanel.js +0 -290
- package/dist/src/ui/viewer/components/ThumbnailPanel.js.map +0 -1
- package/dist/src/ui/viewer/components/Toolbar.d.ts +0 -12
- package/dist/src/ui/viewer/components/Toolbar.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Toolbar.js +0 -761
- package/dist/src/ui/viewer/components/Toolbar.js.map +0 -1
- package/dist/src/ui/viewer/components/ViewModeMenu.d.ts +0 -10
- package/dist/src/ui/viewer/components/ViewModeMenu.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/ViewModeMenu.js +0 -206
- package/dist/src/ui/viewer/components/ViewModeMenu.js.map +0 -1
- package/dist/src/ui/viewer/components/Viewport.d.ts +0 -28
- package/dist/src/ui/viewer/components/Viewport.d.ts.map +0 -1
- package/dist/src/ui/viewer/components/Viewport.js +0 -1721
- package/dist/src/ui/viewer/components/Viewport.js.map +0 -1
- package/dist/src/ui/viewer/effects.d.ts +0 -8
- package/dist/src/ui/viewer/effects.d.ts.map +0 -1
- package/dist/src/ui/viewer/effects.js +0 -452
- package/dist/src/ui/viewer/effects.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ar.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ar.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ar.js +0 -198
- package/dist/src/ui/viewer/i18n/ar.js.map +0 -1
- package/dist/src/ui/viewer/i18n/de.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/de.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/de.js +0 -198
- package/dist/src/ui/viewer/i18n/de.js.map +0 -1
- package/dist/src/ui/viewer/i18n/en.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/en.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/en.js +0 -200
- package/dist/src/ui/viewer/i18n/en.js.map +0 -1
- package/dist/src/ui/viewer/i18n/es.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/es.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/es.js +0 -198
- package/dist/src/ui/viewer/i18n/es.js.map +0 -1
- package/dist/src/ui/viewer/i18n/fr.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/fr.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/fr.js +0 -198
- package/dist/src/ui/viewer/i18n/fr.js.map +0 -1
- package/dist/src/ui/viewer/i18n/index.d.ts +0 -27
- package/dist/src/ui/viewer/i18n/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/index.js +0 -88
- package/dist/src/ui/viewer/i18n/index.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ja.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ja.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ja.js +0 -198
- package/dist/src/ui/viewer/i18n/ja.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ko.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ko.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ko.js +0 -198
- package/dist/src/ui/viewer/i18n/ko.js.map +0 -1
- package/dist/src/ui/viewer/i18n/pt-BR.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/pt-BR.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/pt-BR.js +0 -198
- package/dist/src/ui/viewer/i18n/pt-BR.js.map +0 -1
- package/dist/src/ui/viewer/i18n/ru.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/ru.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/ru.js +0 -198
- package/dist/src/ui/viewer/i18n/ru.js.map +0 -1
- package/dist/src/ui/viewer/i18n/types.d.ts +0 -176
- package/dist/src/ui/viewer/i18n/types.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/types.js +0 -2
- package/dist/src/ui/viewer/i18n/types.js.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-CN.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/zh-CN.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-CN.js +0 -198
- package/dist/src/ui/viewer/i18n/zh-CN.js.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-TW.d.ts +0 -3
- package/dist/src/ui/viewer/i18n/zh-TW.d.ts.map +0 -1
- package/dist/src/ui/viewer/i18n/zh-TW.js +0 -198
- package/dist/src/ui/viewer/i18n/zh-TW.js.map +0 -1
- package/dist/src/ui/viewer/icons.d.ts +0 -77
- package/dist/src/ui/viewer/icons.d.ts.map +0 -1
- package/dist/src/ui/viewer/icons.js +0 -109
- package/dist/src/ui/viewer/icons.js.map +0 -1
- package/dist/src/ui/viewer/index.d.ts +0 -6
- package/dist/src/ui/viewer/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/index.js +0 -6
- package/dist/src/ui/viewer/index.js.map +0 -1
- package/dist/src/ui/viewer/layout/index.d.ts +0 -3
- package/dist/src/ui/viewer/layout/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/layout/index.js +0 -3
- package/dist/src/ui/viewer/layout/index.js.map +0 -1
- package/dist/src/ui/viewer/layout/pixelAlign.d.ts +0 -8
- package/dist/src/ui/viewer/layout/pixelAlign.d.ts.map +0 -1
- package/dist/src/ui/viewer/layout/pixelAlign.js +0 -42
- package/dist/src/ui/viewer/layout/pixelAlign.js.map +0 -1
- package/dist/src/ui/viewer/layout/spreadLayout.d.ts +0 -155
- package/dist/src/ui/viewer/layout/spreadLayout.d.ts.map +0 -1
- package/dist/src/ui/viewer/layout/spreadLayout.js +0 -574
- package/dist/src/ui/viewer/layout/spreadLayout.js.map +0 -1
- package/dist/src/ui/viewer/navigation.d.ts +0 -91
- package/dist/src/ui/viewer/navigation.d.ts.map +0 -1
- package/dist/src/ui/viewer/navigation.js +0 -59
- package/dist/src/ui/viewer/navigation.js.map +0 -1
- package/dist/src/ui/viewer/reducer.d.ts +0 -4
- package/dist/src/ui/viewer/reducer.d.ts.map +0 -1
- package/dist/src/ui/viewer/reducer.js +0 -841
- package/dist/src/ui/viewer/reducer.js.map +0 -1
- package/dist/src/ui/viewer/search/index.d.ts +0 -2
- package/dist/src/ui/viewer/search/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/search/index.js +0 -2
- package/dist/src/ui/viewer/search/index.js.map +0 -1
- package/dist/src/ui/viewer/search/search.d.ts +0 -31
- package/dist/src/ui/viewer/search/search.d.ts.map +0 -1
- package/dist/src/ui/viewer/search/search.js +0 -446
- package/dist/src/ui/viewer/search/search.js.map +0 -1
- package/dist/src/ui/viewer/shell.d.ts +0 -65
- package/dist/src/ui/viewer/shell.d.ts.map +0 -1
- package/dist/src/ui/viewer/shell.js +0 -366
- package/dist/src/ui/viewer/shell.js.map +0 -1
- package/dist/src/ui/viewer/state.d.ts +0 -313
- package/dist/src/ui/viewer/state.d.ts.map +0 -1
- package/dist/src/ui/viewer/state.js +0 -157
- package/dist/src/ui/viewer/state.js.map +0 -1
- package/dist/src/ui/viewer/styles-inline.d.ts +0 -2
- package/dist/src/ui/viewer/styles-inline.d.ts.map +0 -1
- package/dist/src/ui/viewer/styles-inline.js +0 -3526
- package/dist/src/ui/viewer/styles-inline.js.map +0 -1
- package/dist/src/ui/viewer/text/index.d.ts +0 -6
- package/dist/src/ui/viewer/text/index.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/index.js +0 -6
- package/dist/src/ui/viewer/text/index.js.map +0 -1
- package/dist/src/ui/viewer/text/render.d.ts +0 -18
- package/dist/src/ui/viewer/text/render.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/render.js +0 -480
- package/dist/src/ui/viewer/text/render.js.map +0 -1
- package/dist/src/ui/viewer/text/selection.d.ts +0 -12
- package/dist/src/ui/viewer/text/selection.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/selection.js +0 -69
- package/dist/src/ui/viewer/text/selection.js.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts +0 -21
- package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationDrawController.js +0 -410
- package/dist/src/ui/viewer/tools/AnnotationDrawController.js.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts +0 -22
- package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationSelectController.js +0 -378
- package/dist/src/ui/viewer/tools/AnnotationSelectController.js.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts +0 -29
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.js +0 -144
- package/dist/src/ui/viewer/tools/AnnotationUndoManager.js.map +0 -1
- package/dist/src/ui/viewer/tools/ViewToolController.d.ts +0 -20
- package/dist/src/ui/viewer/tools/ViewToolController.d.ts.map +0 -1
- package/dist/src/ui/viewer/tools/ViewToolController.js +0 -179
- package/dist/src/ui/viewer/tools/ViewToolController.js.map +0 -1
- package/dist/src/ui/viewer/transition-gl.d.ts +0 -25
- package/dist/src/ui/viewer/transition-gl.d.ts.map +0 -1
- package/dist/src/ui/viewer/transition-gl.js +0 -823
- package/dist/src/ui/viewer/transition-gl.js.map +0 -1
- package/dist/src/ui/viewer/transition.d.ts +0 -26
- package/dist/src/ui/viewer/transition.d.ts.map +0 -1
- package/dist/src/ui/viewer/transition.js +0 -1383
- package/dist/src/ui/viewer/transition.js.map +0 -1
- package/dist/src/wasm/LICENSE +0 -112
- package/dist/src/wasm/udoc.d.ts +0 -1338
- package/dist/src/wasm/udoc.js +0 -2645
- package/dist/src/wasm/udoc_bg.wasm +0 -0
- package/dist/src/wasm/udoc_bg.wasm.d.ts +0 -58
- package/dist/src/worker/WorkerClient.d.ts +0 -489
- package/dist/src/worker/WorkerClient.d.ts.map +0 -1
- package/dist/src/worker/WorkerClient.js +0 -1383
- package/dist/src/worker/WorkerClient.js.map +0 -1
- package/dist/src/worker/index.d.ts +0 -4
- package/dist/src/worker/index.d.ts.map +0 -1
- package/dist/src/worker/index.js +0 -2
- package/dist/src/worker/index.js.map +0 -1
- package/dist/src/worker/wasmError.d.ts +0 -17
- package/dist/src/worker/wasmError.d.ts.map +0 -1
- package/dist/src/worker/wasmError.js +0 -28
- package/dist/src/worker/wasmError.js.map +0 -1
- package/dist/src/worker/worker-inline.d.ts +0 -2
- package/dist/src/worker/worker-inline.d.ts.map +0 -1
- package/dist/src/worker/worker-inline.js +0 -2
- package/dist/src/worker/worker-inline.js.map +0 -1
- package/dist/src/worker/worker.d.ts +0 -530
- package/dist/src/worker/worker.d.ts.map +0 -1
- package/dist/src/worker/worker.js +0 -2935
- package/dist/src/worker/worker.js.map +0 -1
package/dist/src/UDocClient.d.ts
DELETED
|
@@ -1,730 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UDocClient - SDK entry point for document viewing.
|
|
3
|
-
*
|
|
4
|
-
* Manages the WASM engine and provides document operations.
|
|
5
|
-
*/
|
|
6
|
-
import { WorkerClient } from "./worker/index.js";
|
|
7
|
-
import type { RenderCacheStats } from "./worker/index.js";
|
|
8
|
-
import type { Composition, ComposePick, ExtractedFont, ExtractedImage, FontEntry, FontInfo, SplitByOutlineResult } from "./worker/index.js";
|
|
9
|
-
import { UDocViewer } from "./UDocViewer.js";
|
|
10
|
-
import type { ScrollMode, LayoutMode, ZoomMode, PanelTab, ThemeMode, SpacingMode, PageRotation } from "./ui/viewer/state.js";
|
|
11
|
-
import type { ScrollAlignment } from "./ui/viewer/navigation.js";
|
|
12
|
-
import type { PerformanceLogCallback } from "./performance/index.js";
|
|
13
|
-
import type { CustomPageOverlayRenderer } from "./ui/viewer/components/Spread.js";
|
|
14
|
-
export type { CustomPageOverlayRenderer } from "./ui/viewer/components/Spread.js";
|
|
15
|
-
/**
|
|
16
|
-
* License information for the client.
|
|
17
|
-
*/
|
|
18
|
-
export interface LicenseInfo {
|
|
19
|
-
/**
|
|
20
|
-
* Whether the license is valid.
|
|
21
|
-
*/
|
|
22
|
-
valid: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* License tier: "free" (no license) or "licensed" (valid license).
|
|
25
|
-
*/
|
|
26
|
-
tier: "free" | "licensed";
|
|
27
|
-
/**
|
|
28
|
-
* Enabled feature flags.
|
|
29
|
-
*/
|
|
30
|
-
features: string[];
|
|
31
|
-
/**
|
|
32
|
-
* Numeric limits (e.g., max_file_size_mb).
|
|
33
|
-
*/
|
|
34
|
-
limits: Record<string, number>;
|
|
35
|
-
/**
|
|
36
|
-
* Organization name from the license.
|
|
37
|
-
*/
|
|
38
|
-
organization?: string;
|
|
39
|
-
/**
|
|
40
|
-
* When the license expires (if applicable).
|
|
41
|
-
*/
|
|
42
|
-
expiresAt?: Date;
|
|
43
|
-
/**
|
|
44
|
-
* Error message if license validation failed.
|
|
45
|
-
*/
|
|
46
|
-
error?: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Options for creating a UDocClient.
|
|
50
|
-
*/
|
|
51
|
-
export interface ClientOptions {
|
|
52
|
-
/**
|
|
53
|
-
* License key for commercial use.
|
|
54
|
-
* Client runs in trial mode if not provided.
|
|
55
|
-
*/
|
|
56
|
-
license?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Base URL for loading worker and WASM files.
|
|
59
|
-
*
|
|
60
|
-
* By default, files are loaded relative to the package location.
|
|
61
|
-
*
|
|
62
|
-
* Expected files at baseUrl:
|
|
63
|
-
* - `{baseUrl}/worker.js`
|
|
64
|
-
* - `{baseUrl}/udoc_bg.wasm`
|
|
65
|
-
*/
|
|
66
|
-
baseUrl?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Locale for UI strings and date formatting.
|
|
69
|
-
* @default 'en'
|
|
70
|
-
*/
|
|
71
|
-
locale?: string;
|
|
72
|
-
/**
|
|
73
|
-
* Enable GPU-accelerated rendering via WebGPU.
|
|
74
|
-
* Falls back to CPU if the browser doesn't support WebGPU.
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
__experimentalGpu?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Enable Google Fonts for automatic font fetching.
|
|
80
|
-
* When true, fonts not embedded in the document are fetched from Google Fonts
|
|
81
|
-
* on-demand during rendering. Google Fonts are resolved after any URL fonts
|
|
82
|
-
* registered via `fonts`.
|
|
83
|
-
* @default true
|
|
84
|
-
*/
|
|
85
|
-
googleFonts?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Register font URLs for on-demand fetching during layout.
|
|
88
|
-
* Call before loading documents. Registered fonts take priority over Google Fonts.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* const client = await UDocClient.create({
|
|
93
|
-
* fonts: [
|
|
94
|
-
* { typeface: "Roboto", bold: false, italic: false, url: "https://cdn.example.com/Roboto-Regular.woff2" },
|
|
95
|
-
* { typeface: "Roboto", bold: true, italic: false, url: "https://cdn.example.com/Roboto-Bold.woff2" },
|
|
96
|
-
* ],
|
|
97
|
-
* });
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
fonts?: FontEntry[];
|
|
101
|
-
/**
|
|
102
|
-
* Disable anonymous telemetry reporting.
|
|
103
|
-
* Requires a valid license with the "no_telemetry" feature.
|
|
104
|
-
* Ignored without a qualifying license.
|
|
105
|
-
* @default false
|
|
106
|
-
*/
|
|
107
|
-
disableTelemetry?: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Disable checking npm registry for a newer version on startup.
|
|
110
|
-
* When enabled (default), a background check logs a console reminder
|
|
111
|
-
* if a newer version is available. Never blocks initialization.
|
|
112
|
-
* @default false
|
|
113
|
-
*/
|
|
114
|
-
disableUpdateCheck?: boolean;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Options for creating a viewer.
|
|
118
|
-
*/
|
|
119
|
-
export interface ViewerOptions {
|
|
120
|
-
/**
|
|
121
|
-
* Container element or CSS selector.
|
|
122
|
-
* If not provided, viewer runs in headless mode (no UI).
|
|
123
|
-
*/
|
|
124
|
-
container?: string | HTMLElement;
|
|
125
|
-
/**
|
|
126
|
-
* Scroll mode for page navigation.
|
|
127
|
-
* @default ScrollMode.Continuous
|
|
128
|
-
*/
|
|
129
|
-
scrollMode?: ScrollMode;
|
|
130
|
-
/**
|
|
131
|
-
* Page layout mode.
|
|
132
|
-
* @default LayoutMode.SinglePage
|
|
133
|
-
*/
|
|
134
|
-
layoutMode?: LayoutMode;
|
|
135
|
-
/**
|
|
136
|
-
* Zoom mode for automatic scaling.
|
|
137
|
-
* @default ZoomMode.FitSpreadWidth
|
|
138
|
-
*/
|
|
139
|
-
zoomMode?: ZoomMode;
|
|
140
|
-
/**
|
|
141
|
-
* Initial zoom level (when zoomMode is Custom).
|
|
142
|
-
* @default 1
|
|
143
|
-
*/
|
|
144
|
-
zoom?: number;
|
|
145
|
-
/**
|
|
146
|
-
* Custom zoom steps for zoom in/out.
|
|
147
|
-
* @default DEFAULT_ZOOM_STEPS
|
|
148
|
-
*/
|
|
149
|
-
zoomSteps?: readonly number[];
|
|
150
|
-
/**
|
|
151
|
-
* Spacing between pages in pixels.
|
|
152
|
-
* @default 10
|
|
153
|
-
*/
|
|
154
|
-
pageSpacing?: number;
|
|
155
|
-
/**
|
|
156
|
-
* Spacing between spreads in pixels.
|
|
157
|
-
* @default 20
|
|
158
|
-
*/
|
|
159
|
-
spreadSpacing?: number;
|
|
160
|
-
/**
|
|
161
|
-
* Default scroll alignment when navigating to a destination (outline, links, goToDestination).
|
|
162
|
-
* @default "top"
|
|
163
|
-
*/
|
|
164
|
-
navigationScrollAlignment?: ScrollAlignment;
|
|
165
|
-
/**
|
|
166
|
-
* Default scroll alignment when navigating to search results.
|
|
167
|
-
* @default "nearest"
|
|
168
|
-
*/
|
|
169
|
-
searchScrollAlignment?: ScrollAlignment;
|
|
170
|
-
/**
|
|
171
|
-
* Width of thumbnail images in the thumbnail panel, in CSS pixels.
|
|
172
|
-
* Height is derived automatically from the page aspect ratio.
|
|
173
|
-
* @default 150
|
|
174
|
-
*/
|
|
175
|
-
thumbnailWidth?: number;
|
|
176
|
-
/**
|
|
177
|
-
* Initially active panel, or null for no panel.
|
|
178
|
-
* @default null
|
|
179
|
-
*/
|
|
180
|
-
activePanel?: PanelTab | null;
|
|
181
|
-
/**
|
|
182
|
-
* Target display DPI for rendering.
|
|
183
|
-
* PDF points are 72 DPI; this setting determines the CSS pixel ratio.
|
|
184
|
-
* Most displays use 96 DPI (CSS standard).
|
|
185
|
-
* @default 96
|
|
186
|
-
*/
|
|
187
|
-
dpi?: number;
|
|
188
|
-
/**
|
|
189
|
-
* Enable performance tracking for debugging and analytics.
|
|
190
|
-
* When enabled, records timing for all major operations.
|
|
191
|
-
* @default false
|
|
192
|
-
*/
|
|
193
|
-
enablePerformanceCounter?: boolean;
|
|
194
|
-
/**
|
|
195
|
-
* Callback for performance log entries.
|
|
196
|
-
* Called for each operation start/end when enablePerformanceCounter is true.
|
|
197
|
-
*/
|
|
198
|
-
onPerformanceLog?: PerformanceLogCallback;
|
|
199
|
-
/**
|
|
200
|
-
* Hide the "Powered by docMentis" attribution link.
|
|
201
|
-
* Requires a valid license with the "no_attribution" feature.
|
|
202
|
-
* Ignored without a qualifying license.
|
|
203
|
-
* @default false
|
|
204
|
-
*/
|
|
205
|
-
hideAttribution?: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* Hide the loading overlay shown during document download and processing.
|
|
208
|
-
* Requires a valid license with the "no_attribution" feature.
|
|
209
|
-
* Ignored without a qualifying license.
|
|
210
|
-
* @default false
|
|
211
|
-
*/
|
|
212
|
-
hideLoadingOverlay?: boolean;
|
|
213
|
-
/**
|
|
214
|
-
* Hide the top toolbar.
|
|
215
|
-
* @default false
|
|
216
|
-
*/
|
|
217
|
-
hideToolbar?: boolean;
|
|
218
|
-
/**
|
|
219
|
-
* Hide the floating toolbar (page navigation, zoom, view mode controls).
|
|
220
|
-
* When hidden and the top toolbar is visible, the controls are moved into the top toolbar.
|
|
221
|
-
* @default false
|
|
222
|
-
*/
|
|
223
|
-
hideFloatingToolbar?: boolean;
|
|
224
|
-
/**
|
|
225
|
-
* Disable the fullscreen button.
|
|
226
|
-
* @default false
|
|
227
|
-
*/
|
|
228
|
-
disableFullscreen?: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Disable the entire left panel area (thumbnails, outline, bookmarks, layers, attachments).
|
|
231
|
-
* @default false
|
|
232
|
-
*/
|
|
233
|
-
disableLeftPanel?: boolean;
|
|
234
|
-
/**
|
|
235
|
-
* Disable the entire right panel area (search, comments).
|
|
236
|
-
* @default false
|
|
237
|
-
*/
|
|
238
|
-
disableRightPanel?: boolean;
|
|
239
|
-
/**
|
|
240
|
-
* Disable the thumbnail panel tab.
|
|
241
|
-
* Disabled panels are removed from the UI and cannot be opened.
|
|
242
|
-
* @default false
|
|
243
|
-
*/
|
|
244
|
-
disableThumbnails?: boolean;
|
|
245
|
-
/**
|
|
246
|
-
* Disable the outline (table of contents) panel tab.
|
|
247
|
-
* @default false
|
|
248
|
-
*/
|
|
249
|
-
disableOutline?: boolean;
|
|
250
|
-
/**
|
|
251
|
-
* Disable the bookmarks panel tab.
|
|
252
|
-
* @default false
|
|
253
|
-
*/
|
|
254
|
-
disableBookmarks?: boolean;
|
|
255
|
-
/**
|
|
256
|
-
* Disable the layers panel tab.
|
|
257
|
-
* @default false
|
|
258
|
-
*/
|
|
259
|
-
disableLayers?: boolean;
|
|
260
|
-
/**
|
|
261
|
-
* Disable the attachments panel tab.
|
|
262
|
-
* @default false
|
|
263
|
-
*/
|
|
264
|
-
disableAttachments?: boolean;
|
|
265
|
-
/**
|
|
266
|
-
* Disable the fonts panel tab.
|
|
267
|
-
* @default false
|
|
268
|
-
*/
|
|
269
|
-
disableFonts?: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* Disable the search panel tab.
|
|
272
|
-
* @default false
|
|
273
|
-
*/
|
|
274
|
-
disableSearch?: boolean;
|
|
275
|
-
/**
|
|
276
|
-
* Disable the comments panel tab.
|
|
277
|
-
* @default false
|
|
278
|
-
*/
|
|
279
|
-
disableComments?: boolean;
|
|
280
|
-
/**
|
|
281
|
-
* Color theme for the viewer UI.
|
|
282
|
-
* - 'light': Light theme (default)
|
|
283
|
-
* - 'dark': Dark theme
|
|
284
|
-
* - 'system': Follow operating system preference
|
|
285
|
-
* @default 'light'
|
|
286
|
-
*/
|
|
287
|
-
theme?: ThemeMode;
|
|
288
|
-
/**
|
|
289
|
-
* Disable the theme toggle button in the toolbar.
|
|
290
|
-
* The theme can still be changed programmatically via setTheme().
|
|
291
|
-
* @default false
|
|
292
|
-
*/
|
|
293
|
-
disableThemeSwitching?: boolean;
|
|
294
|
-
/**
|
|
295
|
-
* Disable text selection in the viewer.
|
|
296
|
-
* When true, users cannot select or copy text from rendered documents.
|
|
297
|
-
* @default false
|
|
298
|
-
*/
|
|
299
|
-
disableTextSelection?: boolean;
|
|
300
|
-
/**
|
|
301
|
-
* Disable the download button in the toolbar.
|
|
302
|
-
* The download() method can still be called programmatically.
|
|
303
|
-
* @default false
|
|
304
|
-
*/
|
|
305
|
-
disableDownload?: boolean;
|
|
306
|
-
/**
|
|
307
|
-
* Disable the print button in the toolbar.
|
|
308
|
-
* The print() method can still be called programmatically.
|
|
309
|
-
* @default false
|
|
310
|
-
*/
|
|
311
|
-
disablePrint?: boolean;
|
|
312
|
-
/**
|
|
313
|
-
* Initial page rotation in degrees.
|
|
314
|
-
* @default 0
|
|
315
|
-
*/
|
|
316
|
-
pageRotation?: PageRotation;
|
|
317
|
-
/**
|
|
318
|
-
* Initial spacing mode between pages and spreads.
|
|
319
|
-
* @default 'all'
|
|
320
|
-
*/
|
|
321
|
-
spacingMode?: SpacingMode;
|
|
322
|
-
/**
|
|
323
|
-
* Minimum zoom level.
|
|
324
|
-
* @default 0.1
|
|
325
|
-
*/
|
|
326
|
-
minZoom?: number;
|
|
327
|
-
/**
|
|
328
|
-
* Maximum zoom level.
|
|
329
|
-
* @default 5
|
|
330
|
-
*/
|
|
331
|
-
maxZoom?: number;
|
|
332
|
-
/**
|
|
333
|
-
* Disable the view tools (pointer, hand, zoom) in the toolbar.
|
|
334
|
-
* @default false
|
|
335
|
-
*/
|
|
336
|
-
disableViewTools?: boolean;
|
|
337
|
-
/**
|
|
338
|
-
* Disable the annotation tool set (freehand, line, arrow, shapes, text box).
|
|
339
|
-
* @default false
|
|
340
|
-
*/
|
|
341
|
-
disableAnnotateTools?: boolean;
|
|
342
|
-
/**
|
|
343
|
-
* Disable the markup tool set (highlight, underline, strikethrough, squiggly).
|
|
344
|
-
* @default true
|
|
345
|
-
*/
|
|
346
|
-
__experimentalDisableMarkupTools?: boolean;
|
|
347
|
-
/**
|
|
348
|
-
* Enable slide transition animations for PPTX documents.
|
|
349
|
-
* When true, transitions defined in the presentation will play
|
|
350
|
-
* when navigating between slides in spread (single-page) mode.
|
|
351
|
-
* @default false
|
|
352
|
-
*/
|
|
353
|
-
enableTransitions?: boolean;
|
|
354
|
-
/**
|
|
355
|
-
* Enable slide build sequences (animations) for PPTX documents.
|
|
356
|
-
*
|
|
357
|
-
* When true, a slide's animations play in spread (single-page) mode: the
|
|
358
|
-
* slide starts with its entrance targets hidden and reveals them one
|
|
359
|
-
* advance at a time, driven by a click, the wheel, or the next-page button.
|
|
360
|
-
*
|
|
361
|
-
* Beta. Entrance and exit effects and paragraph builds are sequenced
|
|
362
|
-
* correctly; only Appear, Fade and Zoom play their authored motion, and
|
|
363
|
-
* every other preset falls back to a fade.
|
|
364
|
-
* @default false
|
|
365
|
-
*/
|
|
366
|
-
enableAnimations?: boolean;
|
|
367
|
-
/**
|
|
368
|
-
* Locale for UI strings.
|
|
369
|
-
*
|
|
370
|
-
* Built-in locales: `en`, `zh-CN`, `zh-TW`, `ja`, `ko`, `es`, `fr`, `de`, `pt-BR`, `ar`, `ru`.
|
|
371
|
-
* Falls back to English for unrecognized locales.
|
|
372
|
-
* @default browser language (navigator.language)
|
|
373
|
-
*/
|
|
374
|
-
locale?: string;
|
|
375
|
-
/**
|
|
376
|
-
* Override individual translation strings on top of the resolved locale.
|
|
377
|
-
* Keys are dot-separated (e.g. "toolbar.search", "print.title").
|
|
378
|
-
* See `TranslationKeys` for the full list.
|
|
379
|
-
*/
|
|
380
|
-
translations?: Record<string, string>;
|
|
381
|
-
/**
|
|
382
|
-
* Render a Custom Page Overlay above every built-in page layer (canvas,
|
|
383
|
-
* text, annotations, search highlights).
|
|
384
|
-
*
|
|
385
|
-
* Invoked once per page slot when the slot mounts. The callback receives
|
|
386
|
-
* the 0-based page index, an overlay container element sized and rotated
|
|
387
|
-
* to match the page, and the current points-to-CSS-pixels scale. Append
|
|
388
|
-
* any DOM (buttons, floating toolbars, badges, …) to the container and
|
|
389
|
-
* optionally return a cleanup function — it runs when the slot is
|
|
390
|
-
* destroyed (e.g. when the page scrolls out of view in continuous mode).
|
|
391
|
-
*
|
|
392
|
-
* The container is `pointer-events: none` by default so it never blocks
|
|
393
|
-
* text selection or annotation interaction underneath. Set
|
|
394
|
-
* `pointer-events: auto` on individual children that need to receive
|
|
395
|
-
* input.
|
|
396
|
-
*
|
|
397
|
-
* @example
|
|
398
|
-
* ```ts
|
|
399
|
-
* customPageOverlay: (pageIndex, container) => {
|
|
400
|
-
* const btn = document.createElement("button");
|
|
401
|
-
* btn.textContent = "Comment";
|
|
402
|
-
* btn.style.cssText = "position:absolute;top:8px;right:-40px;pointer-events:auto;";
|
|
403
|
-
* btn.onclick = () => console.log("comment on page", pageIndex);
|
|
404
|
-
* container.appendChild(btn);
|
|
405
|
-
* return () => btn.remove();
|
|
406
|
-
* }
|
|
407
|
-
* ```
|
|
408
|
-
*/
|
|
409
|
-
customPageOverlay?: CustomPageOverlayRenderer;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* A document source can be:
|
|
413
|
-
* - URL string
|
|
414
|
-
* - File object
|
|
415
|
-
* - Raw bytes
|
|
416
|
-
* - An existing viewer (uses its loaded document)
|
|
417
|
-
*/
|
|
418
|
-
export type DocumentSource = string | File | Uint8Array | UDocViewer;
|
|
419
|
-
/**
|
|
420
|
-
* A pick specifies which pages to take from which document.
|
|
421
|
-
*/
|
|
422
|
-
export interface Pick {
|
|
423
|
-
/**
|
|
424
|
-
* Document source (viewer, URL, File, or bytes).
|
|
425
|
-
*/
|
|
426
|
-
doc: DocumentSource;
|
|
427
|
-
/**
|
|
428
|
-
* Page range to pick. Can be:
|
|
429
|
-
* - A string like "0-2,4" (0-based page indices)
|
|
430
|
-
* - A single page index
|
|
431
|
-
* - An array of page indices
|
|
432
|
-
*/
|
|
433
|
-
pages: string | number | number[];
|
|
434
|
-
/**
|
|
435
|
-
* Optional rotation to apply to the picked pages.
|
|
436
|
-
* Value in degrees: 0, 90, 180, or 270.
|
|
437
|
-
*/
|
|
438
|
-
rotation?: 0 | 90 | 180 | 270;
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Re-export low-level types for advanced usage.
|
|
442
|
-
*/
|
|
443
|
-
export type { Composition, ComposePick, ExtractedFont, ExtractedImage, FontEntry, FontInfo, SplitByOutlineResult };
|
|
444
|
-
/**
|
|
445
|
-
* SDK entry point for document viewing.
|
|
446
|
-
*
|
|
447
|
-
* Manages the WASM engine, creates viewers, and provides document operations.
|
|
448
|
-
*/
|
|
449
|
-
export declare class UDocClient {
|
|
450
|
-
/**
|
|
451
|
-
* SDK version string (replaced at build time).
|
|
452
|
-
*/
|
|
453
|
-
static readonly version: string;
|
|
454
|
-
private workerClient;
|
|
455
|
-
private options;
|
|
456
|
-
private viewers;
|
|
457
|
-
private destroyed;
|
|
458
|
-
private licenseInfo;
|
|
459
|
-
private constructor();
|
|
460
|
-
/**
|
|
461
|
-
* Create and initialize a client instance.
|
|
462
|
-
* Loads the WASM engine.
|
|
463
|
-
*/
|
|
464
|
-
static create(options?: ClientOptions): Promise<UDocClient>;
|
|
465
|
-
/**
|
|
466
|
-
* Get current license information.
|
|
467
|
-
*/
|
|
468
|
-
get license(): LicenseInfo;
|
|
469
|
-
/**
|
|
470
|
-
* Check if a feature is available with the current license.
|
|
471
|
-
* @param feature - Feature name (e.g., "merge")
|
|
472
|
-
*/
|
|
473
|
-
hasFeature(feature: string): boolean;
|
|
474
|
-
/**
|
|
475
|
-
* Register custom font URLs for on-demand fetching during layout.
|
|
476
|
-
*
|
|
477
|
-
* Fonts are fetched when the engine needs them during rendering.
|
|
478
|
-
* Registered fonts take priority over Google Fonts.
|
|
479
|
-
* Call before loading documents. Supports OTF, TTF, WOFF, and WOFF2 formats.
|
|
480
|
-
*
|
|
481
|
-
* @param fonts - Array of font entries with typeface, style, and URL
|
|
482
|
-
*
|
|
483
|
-
* @example
|
|
484
|
-
* ```ts
|
|
485
|
-
* await client.registerFonts([
|
|
486
|
-
* { typeface: "Roboto", bold: false, italic: false, url: "https://cdn.example.com/Roboto-Regular.woff2" },
|
|
487
|
-
* { typeface: "Roboto", bold: true, italic: false, url: "https://cdn.example.com/Roboto-Bold.woff2" },
|
|
488
|
-
* ]);
|
|
489
|
-
* ```
|
|
490
|
-
*/
|
|
491
|
-
registerFonts(fonts: FontEntry[]): Promise<void>;
|
|
492
|
-
/**
|
|
493
|
-
* Enable Google Fonts for automatic font fetching.
|
|
494
|
-
*
|
|
495
|
-
* When enabled, fonts not embedded in the document are fetched from
|
|
496
|
-
* Google Fonts on-demand during rendering. Google Fonts are resolved
|
|
497
|
-
* after any fonts registered via `registerFonts`.
|
|
498
|
-
*
|
|
499
|
-
* Call before loading documents. Enabled by default unless
|
|
500
|
-
* `googleFonts: false` is passed to `create()`.
|
|
501
|
-
*/
|
|
502
|
-
enableGoogleFonts(): Promise<void>;
|
|
503
|
-
/**
|
|
504
|
-
* Create a viewer instance.
|
|
505
|
-
*
|
|
506
|
-
* - With container: Full UI mode
|
|
507
|
-
* - Without container: Headless mode (same API, no UI)
|
|
508
|
-
*/
|
|
509
|
-
createViewer(options?: ViewerOptions): Promise<UDocViewer>;
|
|
510
|
-
/**
|
|
511
|
-
* Compose new documents by cherry-picking pages from source documents.
|
|
512
|
-
*
|
|
513
|
-
* This is a powerful method that allows creating new documents by selecting
|
|
514
|
-
* specific pages from multiple source documents in any order. Pages can
|
|
515
|
-
* optionally be rotated during composition.
|
|
516
|
-
*
|
|
517
|
-
* @param compositions - Array of compositions. Each composition creates one output document.
|
|
518
|
-
* Each composition is an array of picks specifying which pages from which documents.
|
|
519
|
-
* @returns Array of viewers containing the composed documents
|
|
520
|
-
*
|
|
521
|
-
* @example
|
|
522
|
-
* ```ts
|
|
523
|
-
* // Create a document with pages 1-3 from viewer A and page 5 from viewer B
|
|
524
|
-
* const [newDoc] = await client.compose([
|
|
525
|
-
* [
|
|
526
|
-
* { doc: viewerA, pages: "1-3" },
|
|
527
|
-
* { doc: viewerB, pages: "5" }
|
|
528
|
-
* ]
|
|
529
|
-
* ]);
|
|
530
|
-
*
|
|
531
|
-
* // Create multiple documents at once
|
|
532
|
-
* const [doc1, doc2] = await client.compose([
|
|
533
|
-
* [{ doc: viewerA, pages: "1" }], // doc1: page 1 from A
|
|
534
|
-
* [{ doc: viewerA, pages: "2" }, { doc: viewerB, pages: "1" }] // doc2: page 2 from A + page 1 from B
|
|
535
|
-
* ]);
|
|
536
|
-
*
|
|
537
|
-
* // Rotate pages during composition
|
|
538
|
-
* const [rotated] = await client.compose([
|
|
539
|
-
* [
|
|
540
|
-
* { doc: viewerA, pages: "1", rotation: 90 }, // rotate page 1 by 90 degrees
|
|
541
|
-
* { doc: viewerA, pages: "2", rotation: 180 } // rotate page 2 by 180 degrees
|
|
542
|
-
* ]
|
|
543
|
-
* ]);
|
|
544
|
-
* ```
|
|
545
|
-
*/
|
|
546
|
-
compose(compositions: Pick[][]): Promise<UDocViewer[]>;
|
|
547
|
-
/**
|
|
548
|
-
* Split a document by its outline (bookmarks) structure.
|
|
549
|
-
*
|
|
550
|
-
* Creates multiple documents, one for each outline section at the specified level.
|
|
551
|
-
* The original document remains unchanged.
|
|
552
|
-
*
|
|
553
|
-
* @param source - Document source (viewer, URL, File, or bytes)
|
|
554
|
-
* @param options - Split options
|
|
555
|
-
* @param options.maxLevel - Maximum outline level to consider (1 = top level only, default: 1)
|
|
556
|
-
* @param options.splitMidPage - When true, filters page content when sections share a page (default: false)
|
|
557
|
-
* @returns Object with viewers array and sections metadata
|
|
558
|
-
*
|
|
559
|
-
* @example
|
|
560
|
-
* ```ts
|
|
561
|
-
* // Split a document by top-level bookmarks
|
|
562
|
-
* const result = await client.splitByOutline(viewer);
|
|
563
|
-
* console.log(`Split into ${result.viewers.length} documents`);
|
|
564
|
-
* result.sections.forEach((section, i) => {
|
|
565
|
-
* console.log(`Document ${i}: ${section.title}`);
|
|
566
|
-
* });
|
|
567
|
-
*
|
|
568
|
-
* // Split with mid-page content filtering
|
|
569
|
-
* const result = await client.splitByOutline(viewer, { maxLevel: 2, splitMidPage: true });
|
|
570
|
-
* ```
|
|
571
|
-
*/
|
|
572
|
-
splitByOutline(source: DocumentSource, options?: {
|
|
573
|
-
maxLevel?: number;
|
|
574
|
-
splitMidPage?: boolean;
|
|
575
|
-
}): Promise<{
|
|
576
|
-
viewers: UDocViewer[];
|
|
577
|
-
sections: {
|
|
578
|
-
title: string;
|
|
579
|
-
index: number;
|
|
580
|
-
}[];
|
|
581
|
-
}>;
|
|
582
|
-
/**
|
|
583
|
-
* Extract all embedded images from a document.
|
|
584
|
-
*
|
|
585
|
-
* @param source - Document source (viewer, URL, File, or bytes)
|
|
586
|
-
* @param options - Extract options
|
|
587
|
-
* @param options.convertRawToPng - When true, converts raw pixel data to PNG format (default: false)
|
|
588
|
-
* @returns Array of extracted images with metadata and data
|
|
589
|
-
*
|
|
590
|
-
* @example
|
|
591
|
-
* ```ts
|
|
592
|
-
* const images = await client.extractImages(viewer);
|
|
593
|
-
* for (const image of images) {
|
|
594
|
-
* console.log(`${image.name}: ${image.format} (${image.width}x${image.height})`);
|
|
595
|
-
* // image.data contains the raw image bytes
|
|
596
|
-
* }
|
|
597
|
-
*
|
|
598
|
-
* // Convert raw images to PNG for easier viewing
|
|
599
|
-
* const pngImages = await client.extractImages(viewer, { convertRawToPng: true });
|
|
600
|
-
* ```
|
|
601
|
-
*/
|
|
602
|
-
extractImages(source: DocumentSource, options?: {
|
|
603
|
-
convertRawToPng?: boolean;
|
|
604
|
-
}): Promise<ExtractedImage[]>;
|
|
605
|
-
/**
|
|
606
|
-
* Extract all embedded fonts from a document.
|
|
607
|
-
*
|
|
608
|
-
* @param source - Document source (viewer, URL, File, or bytes)
|
|
609
|
-
* @returns Array of extracted fonts with metadata and data
|
|
610
|
-
*
|
|
611
|
-
* @example
|
|
612
|
-
* ```ts
|
|
613
|
-
* const fonts = await client.extractFonts(viewer);
|
|
614
|
-
* for (const font of fonts) {
|
|
615
|
-
* console.log(`${font.name}: ${font.fontType} (.${font.extension})`);
|
|
616
|
-
* // font.data contains the raw font bytes
|
|
617
|
-
* }
|
|
618
|
-
* ```
|
|
619
|
-
*/
|
|
620
|
-
extractFonts(source: DocumentSource): Promise<ExtractedFont[]>;
|
|
621
|
-
/**
|
|
622
|
-
* Parse font information from raw font binary data.
|
|
623
|
-
*
|
|
624
|
-
* Extracts the typeface name, bold, and italic properties from a font file.
|
|
625
|
-
* Useful for building a font registry before calling {@link registerFonts}.
|
|
626
|
-
*
|
|
627
|
-
* @param data - Raw font binary data (e.g., .ttf, .otf, .woff2)
|
|
628
|
-
* @returns Font information including typeface, bold, and italic
|
|
629
|
-
*
|
|
630
|
-
* @example
|
|
631
|
-
* ```ts
|
|
632
|
-
* const fontBytes = new Uint8Array(await fetch("Roboto-Bold.woff2").then(r => r.arrayBuffer()));
|
|
633
|
-
* const info = await client.parseFontInfo(fontBytes);
|
|
634
|
-
* // info = { typeface: "Roboto", bold: true, italic: false }
|
|
635
|
-
*
|
|
636
|
-
* // Use the info to register fonts:
|
|
637
|
-
* await client.registerFonts([
|
|
638
|
-
* { typeface: info.typeface, bold: info.bold, italic: info.italic, url: "https://..." },
|
|
639
|
-
* ]);
|
|
640
|
-
* ```
|
|
641
|
-
*/
|
|
642
|
-
parseFontInfo(data: Uint8Array): Promise<FontInfo>;
|
|
643
|
-
/**
|
|
644
|
-
* Compress a document.
|
|
645
|
-
*
|
|
646
|
-
* Saves the document with full compression options enabled:
|
|
647
|
-
* - Compress stream data using FlateDecode
|
|
648
|
-
* - Pack objects into compressed object streams (PDF 1.5+)
|
|
649
|
-
* - Use compressed xref streams (PDF 1.5+)
|
|
650
|
-
* - Remove unreferenced objects
|
|
651
|
-
*
|
|
652
|
-
* @param source - Document source (viewer, URL, File, or bytes)
|
|
653
|
-
* @returns Compressed PDF data as Uint8Array
|
|
654
|
-
*
|
|
655
|
-
* @example
|
|
656
|
-
* ```ts
|
|
657
|
-
* const compressedBytes = await client.compress(viewer);
|
|
658
|
-
* // Save to file or download
|
|
659
|
-
* const blob = new Blob([compressedBytes], { type: 'application/pdf' });
|
|
660
|
-
* ```
|
|
661
|
-
*/
|
|
662
|
-
compress(source: DocumentSource): Promise<Uint8Array>;
|
|
663
|
-
/**
|
|
664
|
-
* Decompress a document.
|
|
665
|
-
*
|
|
666
|
-
* Removes all filter encodings from streams, resulting in raw,
|
|
667
|
-
* uncompressed stream data. Useful for debugging or inspection.
|
|
668
|
-
*
|
|
669
|
-
* @param source - Document source (viewer, URL, File, or bytes)
|
|
670
|
-
* @returns Decompressed PDF data as Uint8Array
|
|
671
|
-
*
|
|
672
|
-
* @example
|
|
673
|
-
* ```ts
|
|
674
|
-
* const decompressedBytes = await client.decompress(viewer);
|
|
675
|
-
* // Save to file for inspection
|
|
676
|
-
* const blob = new Blob([decompressedBytes], { type: 'application/pdf' });
|
|
677
|
-
* ```
|
|
678
|
-
*/
|
|
679
|
-
decompress(source: DocumentSource): Promise<Uint8Array>;
|
|
680
|
-
/**
|
|
681
|
-
* Load a document source and return its ID.
|
|
682
|
-
* Note: This is only used for PDF operations (compose, split, etc.)
|
|
683
|
-
*/
|
|
684
|
-
private loadSource;
|
|
685
|
-
/**
|
|
686
|
-
* Normalize page specification to a string format.
|
|
687
|
-
*/
|
|
688
|
-
private normalizePages;
|
|
689
|
-
/**
|
|
690
|
-
* Destroy the client and release all resources.
|
|
691
|
-
* All viewers created by this client become invalid.
|
|
692
|
-
*/
|
|
693
|
-
destroy(): void;
|
|
694
|
-
/**
|
|
695
|
-
* Get the underlying worker client (for internal use).
|
|
696
|
-
* @internal
|
|
697
|
-
*/
|
|
698
|
-
getWorkerClient(): WorkerClient;
|
|
699
|
-
/**
|
|
700
|
-
* Snapshot of rendered bitmap caches. Use for debug overlays / memory
|
|
701
|
-
* pressure monitoring on mobile.
|
|
702
|
-
*/
|
|
703
|
-
getRenderCacheStats(): RenderCacheStats;
|
|
704
|
-
/**
|
|
705
|
-
* Current WASM linear-memory size in bytes for the worker's engine.
|
|
706
|
-
* Rises when the Rust allocator grows; never shrinks.
|
|
707
|
-
*/
|
|
708
|
-
getWasmMemoryBytes(): Promise<number>;
|
|
709
|
-
/**
|
|
710
|
-
* Subscribe to render OOM events. Fires after the client has cleared its
|
|
711
|
-
* bitmap caches to reclaim memory.
|
|
712
|
-
*/
|
|
713
|
-
onOOM(callback: (error: Error) => void): () => void;
|
|
714
|
-
private ensureNotDestroyed;
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* Resolve a self-hosted asset URL, stamped with the SDK version.
|
|
718
|
-
*
|
|
719
|
-
* Self-hosted deployments serve `worker.js` and `udoc_bg.wasm` under stable
|
|
720
|
-
* filenames, so an upgrade can be served half from cache — stale JS glue
|
|
721
|
-
* against a fresh engine binary, which fails to instantiate. The version
|
|
722
|
-
* query gives each release its own cache key.
|
|
723
|
-
*
|
|
724
|
-
* The stamp is skipped when running from source, where the build-time version
|
|
725
|
-
* placeholder hasn't been replaced.
|
|
726
|
-
*
|
|
727
|
-
* Exported for tests; not part of the public API.
|
|
728
|
-
*/
|
|
729
|
-
export declare function assetUrl(file: string, baseUrl: string, version: string): string;
|
|
730
|
-
//# sourceMappingURL=UDocClient.d.ts.map
|