@typbase/engine 0.3.1 → 0.3.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/engine.d.ts +15 -15
- package/engine.js +12 -12
- package/engine_bg.wasm +0 -0
- package/package.json +1 -1
package/engine.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* A `#typbase.section(kind: ...)[...]` block. Ranges are raw source bytes
|
|
4
|
+
* A `#typbase.section(kind: ...)[...]` block. Ranges are raw source bytes.
|
|
5
5
|
* `content_start..content_end` is the markup inside the brackets.
|
|
6
6
|
*/
|
|
7
7
|
export interface SectionSpan {
|
|
@@ -15,7 +15,7 @@ export interface SectionSpan {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* A file, source, or package the compiler asked for but the world does not
|
|
18
|
-
* have. Every compile returns the requests it accumulated
|
|
18
|
+
* have. Every compile returns the requests it accumulated, and the caller
|
|
19
19
|
* resolves them (workspace source, blob bytes, package tarball) and recompiles.
|
|
20
20
|
*/
|
|
21
21
|
export type TypstRequest = { type: "source"; value: string } | { type: "file"; value: string } | { type: "package"; value: { namespace: string; name: string; version: string } };
|
|
@@ -60,7 +60,7 @@ export interface SvgRangedFrame {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* One flattened source block. `map[i]` is the raw byte offset of plain byte
|
|
63
|
-
* `i
|
|
63
|
+
* `i`. FTS offsets in `plain` translate through it to editor positions.
|
|
64
64
|
*/
|
|
65
65
|
export interface FlattenedBlock {
|
|
66
66
|
kind: string;
|
|
@@ -95,7 +95,7 @@ export interface LinkSpan {
|
|
|
95
95
|
target_from: number;
|
|
96
96
|
target_to: number;
|
|
97
97
|
/**
|
|
98
|
-
* True when the target is computed at compile time
|
|
98
|
+
* True when the target is computed at compile time. The index resolves
|
|
99
99
|
* the ids from a compile and this span only locates the call.
|
|
100
100
|
*/
|
|
101
101
|
dynamic: boolean;
|
|
@@ -197,7 +197,7 @@ export interface RenderHtmlResult {
|
|
|
197
197
|
diagnostics: TypstDiagnostic[];
|
|
198
198
|
/**
|
|
199
199
|
* Requests the caller must satisfy before re-rendering (query JSON,
|
|
200
|
-
* embedded pages). The editor's `compileHTML` carries them too
|
|
200
|
+
* embedded pages). The editor's `compileHTML` carries them too, but the
|
|
201
201
|
* publish worker needs them on this path.
|
|
202
202
|
*/
|
|
203
203
|
requests: TypstRequest[];
|
|
@@ -378,13 +378,13 @@ export class TypstState {
|
|
|
378
378
|
evictCachesAged(max_age: number): void;
|
|
379
379
|
/**
|
|
380
380
|
* Extracts notebook cells (`// %%` markers) as UTF-16 spans, ready for
|
|
381
|
-
* CodeMirror positions. Pure syntax pass
|
|
381
|
+
* CodeMirror positions. Pure syntax pass with no state needed.
|
|
382
382
|
*/
|
|
383
383
|
extractCells(text: string): CellSpan[];
|
|
384
384
|
/**
|
|
385
385
|
* Extracts the app's link calls (`typbase.page-link`, `typbase.embed`,
|
|
386
|
-
* and `typbase://page/` URLs) with UTF-16 ranges. Pure syntax pass
|
|
387
|
-
* state
|
|
386
|
+
* and `typbase://page/` URLs) with UTF-16 ranges. Pure syntax pass
|
|
387
|
+
* that needs no state.
|
|
388
388
|
*/
|
|
389
389
|
extractLinks(text: string): LinkSpan[];
|
|
390
390
|
/**
|
|
@@ -393,7 +393,7 @@ export class TypstState {
|
|
|
393
393
|
extractSections(text: string): SectionSpan[];
|
|
394
394
|
/**
|
|
395
395
|
* Plain-text flattening per block for the search index, plus the byte
|
|
396
|
-
* map back to raw source. Pure syntax pass
|
|
396
|
+
* map back to raw source. Pure syntax pass. No state needed.
|
|
397
397
|
*/
|
|
398
398
|
flattenDocument(text: string): FlattenedBlock[];
|
|
399
399
|
highlight(id: FileId, text: string): TypstHighlight[];
|
|
@@ -405,8 +405,8 @@ export class TypstState {
|
|
|
405
405
|
jumpHTML(id: FileId, element: Uint32Array): TypstJump | undefined;
|
|
406
406
|
jumpPaged(id: FileId, x: number, y: number): TypstJump | undefined;
|
|
407
407
|
/**
|
|
408
|
-
* Current WASM heap size in bytes. The lab watches this to catch leaks
|
|
409
|
-
*
|
|
408
|
+
* Current WASM heap size in bytes. The lab watches this to catch leaks.
|
|
409
|
+
* The wasm allocator rarely returns memory to the browser, so growth
|
|
410
410
|
* here usually means a compile loop.
|
|
411
411
|
*/
|
|
412
412
|
memoryBytes(): number;
|
|
@@ -419,20 +419,20 @@ export class TypstState {
|
|
|
419
419
|
removePackage(spec: string): void;
|
|
420
420
|
/**
|
|
421
421
|
* Renders the whole note to one HTML document, with recovery. Used by
|
|
422
|
-
* publish, export, and chat
|
|
422
|
+
* publish, export, and chat. The editor's inline frames use
|
|
423
423
|
* `compileHTML` instead.
|
|
424
424
|
*/
|
|
425
425
|
renderHtml(id: FileId, text: string, prelude: string): RenderHtmlResult;
|
|
426
426
|
/**
|
|
427
427
|
* PDF publishing, compiled only when the `pdf` cargo feature is on.
|
|
428
|
-
* Returns the PDF bytes plus diagnostics
|
|
428
|
+
* Returns the PDF bytes plus diagnostics. The caller uploads the bytes
|
|
429
429
|
* as a blob on `at.typbase.post`.
|
|
430
430
|
*/
|
|
431
431
|
renderPdf(id: FileId, text: string, prelude: string): RenderPdfResult;
|
|
432
432
|
/**
|
|
433
433
|
* SVG export of the paged document: one entry per page, or a single
|
|
434
434
|
* merged document. Uses the PDF page geometry so the sheets match the
|
|
435
|
-
* PDF export
|
|
435
|
+
* PDF export. The caller sets the page width through `resize`.
|
|
436
436
|
*/
|
|
437
437
|
renderSvg(id: FileId, text: string, prelude: string, merged: boolean): RenderSvgResult;
|
|
438
438
|
resize(id: FileId, width?: number | null, height?: number | null): boolean;
|
|
@@ -477,7 +477,7 @@ export class TypstState {
|
|
|
477
477
|
* The two wasm tasks write the same `pkg/` directory, so a stray
|
|
478
478
|
* `engine:build-dev` edge in a release graph silently swaps the optimized
|
|
479
479
|
* engine for the unoptimized one. Release tooling can read this before
|
|
480
|
-
* publishing
|
|
480
|
+
* publishing. Custom sections cannot key that kind of check because wasm-opt
|
|
481
481
|
* and wasm-bindgen rewrite them.
|
|
482
482
|
*/
|
|
483
483
|
export function isDevelopmentBuild(): boolean;
|
package/engine.js
CHANGED
|
@@ -435,7 +435,7 @@ export class TypstState {
|
|
|
435
435
|
}
|
|
436
436
|
/**
|
|
437
437
|
* Extracts notebook cells (`// %%` markers) as UTF-16 spans, ready for
|
|
438
|
-
* CodeMirror positions. Pure syntax pass
|
|
438
|
+
* CodeMirror positions. Pure syntax pass with no state needed.
|
|
439
439
|
* @param {string} text
|
|
440
440
|
* @returns {CellSpan[]}
|
|
441
441
|
*/
|
|
@@ -461,8 +461,8 @@ export class TypstState {
|
|
|
461
461
|
}
|
|
462
462
|
/**
|
|
463
463
|
* Extracts the app's link calls (`typbase.page-link`, `typbase.embed`,
|
|
464
|
-
* and `typbase://page/` URLs) with UTF-16 ranges. Pure syntax pass
|
|
465
|
-
* state
|
|
464
|
+
* and `typbase://page/` URLs) with UTF-16 ranges. Pure syntax pass
|
|
465
|
+
* that needs no state.
|
|
466
466
|
* @param {string} text
|
|
467
467
|
* @returns {LinkSpan[]}
|
|
468
468
|
*/
|
|
@@ -513,7 +513,7 @@ export class TypstState {
|
|
|
513
513
|
}
|
|
514
514
|
/**
|
|
515
515
|
* Plain-text flattening per block for the search index, plus the byte
|
|
516
|
-
* map back to raw source. Pure syntax pass
|
|
516
|
+
* map back to raw source. Pure syntax pass. No state needed.
|
|
517
517
|
* @param {string} text
|
|
518
518
|
* @returns {FlattenedBlock[]}
|
|
519
519
|
*/
|
|
@@ -681,8 +681,8 @@ export class TypstState {
|
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
/**
|
|
684
|
-
* Current WASM heap size in bytes. The lab watches this to catch leaks
|
|
685
|
-
*
|
|
684
|
+
* Current WASM heap size in bytes. The lab watches this to catch leaks.
|
|
685
|
+
* The wasm allocator rarely returns memory to the browser, so growth
|
|
686
686
|
* here usually means a compile loop.
|
|
687
687
|
* @returns {number}
|
|
688
688
|
*/
|
|
@@ -731,7 +731,7 @@ export class TypstState {
|
|
|
731
731
|
}
|
|
732
732
|
/**
|
|
733
733
|
* Renders the whole note to one HTML document, with recovery. Used by
|
|
734
|
-
* publish, export, and chat
|
|
734
|
+
* publish, export, and chat. The editor's inline frames use
|
|
735
735
|
* `compileHTML` instead.
|
|
736
736
|
* @param {FileId} id
|
|
737
737
|
* @param {string} text
|
|
@@ -760,7 +760,7 @@ export class TypstState {
|
|
|
760
760
|
}
|
|
761
761
|
/**
|
|
762
762
|
* PDF publishing, compiled only when the `pdf` cargo feature is on.
|
|
763
|
-
* Returns the PDF bytes plus diagnostics
|
|
763
|
+
* Returns the PDF bytes plus diagnostics. The caller uploads the bytes
|
|
764
764
|
* as a blob on `at.typbase.post`.
|
|
765
765
|
* @param {FileId} id
|
|
766
766
|
* @param {string} text
|
|
@@ -790,7 +790,7 @@ export class TypstState {
|
|
|
790
790
|
/**
|
|
791
791
|
* SVG export of the paged document: one entry per page, or a single
|
|
792
792
|
* merged document. Uses the PDF page geometry so the sheets match the
|
|
793
|
-
* PDF export
|
|
793
|
+
* PDF export. The caller sets the page width through `resize`.
|
|
794
794
|
* @param {FileId} id
|
|
795
795
|
* @param {string} text
|
|
796
796
|
* @param {string} prelude
|
|
@@ -990,7 +990,7 @@ if (Symbol.dispose) TypstState.prototype[Symbol.dispose] = TypstState.prototype.
|
|
|
990
990
|
* The two wasm tasks write the same `pkg/` directory, so a stray
|
|
991
991
|
* `engine:build-dev` edge in a release graph silently swaps the optimized
|
|
992
992
|
* engine for the unoptimized one. Release tooling can read this before
|
|
993
|
-
* publishing
|
|
993
|
+
* publishing. Custom sections cannot key that kind of check because wasm-opt
|
|
994
994
|
* and wasm-bindgen rewrite them.
|
|
995
995
|
* @returns {boolean}
|
|
996
996
|
*/
|
|
@@ -1067,10 +1067,10 @@ function __wbg_get_imports() {
|
|
|
1067
1067
|
__wbg___wbindgen_throw_bb96b2010945f0bc: function(arg0, arg1) {
|
|
1068
1068
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1069
1069
|
},
|
|
1070
|
-
|
|
1070
|
+
__wbg_debug_e8912e4c5ebba290: function(arg0, arg1) {
|
|
1071
1071
|
console.debug(getStringFromWasm0(arg0, arg1));
|
|
1072
1072
|
},
|
|
1073
|
-
|
|
1073
|
+
__wbg_error_9c32e922355be9f2: function(arg0, arg1) {
|
|
1074
1074
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
1075
1075
|
},
|
|
1076
1076
|
__wbg_getTime_63fb0332e6c4ec17: function(arg0) {
|
package/engine_bg.wasm
CHANGED
|
Binary file
|