@vedivad/typst-web-service 0.15.0 → 0.15.2
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/dist/index.d.ts +13 -1
- package/dist/index.js +36 -5
- package/dist/index.js.map +1 -1
- package/dist/renderer-worker.js +68 -4
- package/dist/renderer-worker.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -512,7 +512,19 @@ declare class TypstRenderer {
|
|
|
512
512
|
static create(options?: TypstRendererOptions): TypstRenderer;
|
|
513
513
|
/** Terminate the worker. The instance is unusable afterwards. */
|
|
514
514
|
destroy(): void;
|
|
515
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Render a Typst vector artifact to a single merged SVG string.
|
|
517
|
+
*
|
|
518
|
+
* Ownership of `vector.buffer` transfers to the worker (zero-copy).
|
|
519
|
+
* Don't reuse the vector after passing it in — accessing its bytes from
|
|
520
|
+
* the main thread after this call is undefined behavior.
|
|
521
|
+
*
|
|
522
|
+
* Concurrent calls are serialized in the worker: while a render is in
|
|
523
|
+
* flight, the most recent `vector` becomes the next render and any
|
|
524
|
+
* intermediate calls are dropped. All overlapping callers share one
|
|
525
|
+
* returned promise that resolves with the LAST rendered SVG — your
|
|
526
|
+
* specific vector may have been superseded.
|
|
527
|
+
*/
|
|
516
528
|
renderSvg(vector: Uint8Array): Promise<string>;
|
|
517
529
|
/**
|
|
518
530
|
* Render a Typst vector artifact into one self-contained SVG string per
|