|
|
1 месяц назад | |
|---|---|---|
| .. | ||
| assets | 1 месяц назад | |
| src | 1 месяц назад | |
| LICENSE | 1 месяц назад | |
| README.en.md | 1 месяц назад | |
| README.md | 1 месяц назад | |
| package.json | 1 месяц назад | |
| tsconfig.json | 1 месяц назад | |
Standalone Typst renderer package for Flyfish File Viewer. It reads .typ / .typst source files directly and uses the browser WASM compiler / renderer from @myriaddreamin/typst.ts to produce paged SVG output, so source-code fallback is never treated as a successful preview.
import FileViewer from '@file-viewer/vue3'
import { typstRenderer } from '@file-viewer/renderer-typst'
const options = {
rendererMode: 'replace',
renderers: typstRenderer,
}
You can also compose it with other renderer packages:
import { pdfRenderer } from '@file-viewer/renderer-pdf'
import { typstRenderer } from '@file-viewer/renderer-typst'
const options = {
rendererMode: 'replace',
renderers: [pdfRenderer, typstRenderer],
}
.typ and .typst.options.typst.renderTimeoutMs for slow asset loading and long-running documents.The default asset paths are:
wasm/typst/typst_ts_web_compiler_bg.wasmwasm/typst/typst_ts_renderer_bg.wasmwasm/typst/fonts/For private deployments, override them with options.typst.compilerWasmUrl, options.typst.rendererWasmUrl, and options.typst.fontAssetsUrl. The default text fonts ship with this package and are copied by file-viewer-copy-assets / @file-viewer/vite-plugin, so the runtime does not depend on public CDNs.
Typst rendering has moved out of @file-viewer/core into this package. Core only keeps the renderFileViewerTypst() compatibility export with a clear installation error, and no longer installs @myriaddreamin/* by default. Install this renderer explicitly, or use @file-viewer/preset-all, when real Typst preview is required.