@psrt/sdk 0.1.0

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/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @psrt/sdk
2
+
3
+ Stateless PSRT SDK powered by WebAssembly (Go core).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @psrt/sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { initPsrt, parse, compileToHtml, adaptEntriesForWeb } from '@psrt/sdk'
15
+
16
+ await initPsrt('/path/to/psrt.wasm')
17
+
18
+ const doc = parse(psrtString)
19
+ const html = compileToHtml(doc)
20
+ const styles = adaptEntriesForWeb(JSON.stringify(entries), 800, 600, 1)
21
+ ```
22
+
23
+ ## Browser (Vite)
24
+
25
+ Copy `wasm/psrt.wasm` and `wasm/wasm_exec.js` to your `public/` folder, then:
26
+
27
+ ```typescript
28
+ await initPsrt(`${import.meta.env.BASE_URL}wasm/psrt.wasm`)
29
+ ```
30
+
31
+ ## Exports
32
+
33
+ - **I/O:** `parse`, `stringify`, `formatDocument`, `resolveDocument`
34
+ - **Compile:** `compileToHtml`, `compileToSvg`
35
+ - **Preview:** `adaptEntriesForWeb`
36
+ - **Editor:** `addText`, `setTextContent`, `transform`, …
37
+ - **Types:** `PsrtDocument`, `Document`, `Page`, `TextBlock`, …
package/dist/index.cjs ADDED
@@ -0,0 +1,570 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Transformer: () => Transformer,
24
+ adaptEntriesForWeb: () => adaptEntriesForWeb,
25
+ addConst: () => addConst,
26
+ addFont: () => addFont,
27
+ addMask: () => addMask,
28
+ addPage: () => addPage,
29
+ addText: () => addText,
30
+ compileToHtml: () => compileToHtml,
31
+ compileToSvg: () => compileToSvg,
32
+ findMaskByIndex: () => findMaskByIndex,
33
+ findPage: () => findPage,
34
+ findPageIndex: () => findPageIndex,
35
+ findTextByIndex: () => findTextByIndex,
36
+ formatDocument: () => formatDocument,
37
+ formatPageDocumentJSON: () => formatPageDocumentJSON,
38
+ initPsrt: () => initPsrt,
39
+ mergePageDocumentPSRT: () => mergePageDocumentPSRT,
40
+ mergeStyle: () => mergeStyle,
41
+ movePage: () => movePage,
42
+ nudgeTextPosition: () => nudgeTextPosition,
43
+ parse: () => parse,
44
+ parseTextIndex: () => parseTextIndex,
45
+ removeConst: () => removeConst,
46
+ removeFont: () => removeFont,
47
+ removeMask: () => removeMask,
48
+ removeMaskStyleKey: () => removeMaskStyleKey,
49
+ removePage: () => removePage,
50
+ removePageStyleKey: () => removePageStyleKey,
51
+ removeStyleKey: () => removeStyleKey,
52
+ removeText: () => removeText,
53
+ removeTextStyleKey: () => removeTextStyleKey,
54
+ renamePage: () => renamePage,
55
+ reorderTextByDelta: () => reorderTextByDelta,
56
+ reorderTextRelative: () => reorderTextRelative,
57
+ reorderTextTo: () => reorderTextTo,
58
+ resolveDocument: () => resolveDocument,
59
+ resolveDocumentStrict: () => resolveDocumentStrict,
60
+ revertConstReferences: () => revertConstReferences,
61
+ setMaskPosition: () => setMaskPosition,
62
+ setMaskStyle: () => setMaskStyle,
63
+ setPagePath: () => setPagePath,
64
+ setPageStyle: () => setPageStyle,
65
+ setStyleKey: () => setStyleKey,
66
+ setTextContent: () => setTextContent,
67
+ setTextPosition: () => setTextPosition,
68
+ setTextStyle: () => setTextStyle,
69
+ stringify: () => stringify,
70
+ substituteConstReferences: () => substituteConstReferences,
71
+ transform: () => transform
72
+ });
73
+ module.exports = __toCommonJS(index_exports);
74
+
75
+ // src/wasm.ts
76
+ var import_meta = {};
77
+ var decoder = new TextDecoder();
78
+ var encoder = new TextEncoder();
79
+ var wasmExports = null;
80
+ function decodeData(data) {
81
+ return decoder.decode(data);
82
+ }
83
+ function encodeDoc(doc) {
84
+ return encoder.encode(JSON.stringify(doc));
85
+ }
86
+ function encodeInput(input) {
87
+ return typeof input === "string" ? input : encodeDoc(input);
88
+ }
89
+ function encodeArg(arg) {
90
+ if (arg === void 0) {
91
+ return void 0;
92
+ }
93
+ if (arg instanceof Uint8Array) {
94
+ return arg;
95
+ }
96
+ if (typeof arg === "object" && arg !== null) {
97
+ return encoder.encode(JSON.stringify(arg));
98
+ }
99
+ return arg;
100
+ }
101
+ function call(name, ...args) {
102
+ if (!wasmExports) {
103
+ throw new Error("PSRT WASM not initialized; call initPsrt() first");
104
+ }
105
+ const fn = wasmExports[name];
106
+ if (!fn) {
107
+ throw new Error(`unknown WASM handler: ${name}`);
108
+ }
109
+ const encoded = args.map(encodeArg);
110
+ return fn(...encoded);
111
+ }
112
+ function requireBytes(result) {
113
+ if (!result.ok) {
114
+ throw new Error(result.err ?? "WASM call failed");
115
+ }
116
+ if (!result.data) {
117
+ throw new Error("WASM call returned no data");
118
+ }
119
+ return result.data;
120
+ }
121
+ function parseDocResult(result) {
122
+ return JSON.parse(decodeData(requireBytes(result)));
123
+ }
124
+ function parseTextResult(result) {
125
+ return decodeData(requireBytes(result));
126
+ }
127
+ function parseJSONResult(result) {
128
+ return JSON.parse(decodeData(requireBytes(result)));
129
+ }
130
+ function invokeDocMutation(handler, doc, ...extra) {
131
+ return parseDocResult(call(handler, encodeDoc(doc), ...extra));
132
+ }
133
+ function invokeDocQuery(handler, doc, ...extra) {
134
+ return parseJSONResult(call(handler, encodeDoc(doc), ...extra));
135
+ }
136
+ function invokeRaw(handler, ...args) {
137
+ return parseJSONResult(call(handler, ...args));
138
+ }
139
+ function invokeText(handler, ...args) {
140
+ return parseTextResult(call(handler, ...args));
141
+ }
142
+ function invokeStyleMutation(handler, style, ...extra) {
143
+ return parseJSONResult(call(handler, style, ...extra));
144
+ }
145
+ function invokeParse(psrtString) {
146
+ return parseDocResult(call("parse", psrtString));
147
+ }
148
+ function invokeStringify(doc) {
149
+ return parseTextResult(call("stringify", encodeDoc(doc)));
150
+ }
151
+ function invokeFormatDocument(doc) {
152
+ return parseTextResult(call("formatDocument", encodeDoc(doc)));
153
+ }
154
+ function invokeCompileToHtml(input, options) {
155
+ return parseTextResult(call("compileToHtml", encodeInput(input), options ?? {}));
156
+ }
157
+ function invokeCompileToSvg(input, pageName, options) {
158
+ return parseTextResult(call("compileToSvg", encodeInput(input), pageName, options ?? {}));
159
+ }
160
+ function wireWasmFromGlobal() {
161
+ const exp = globalThis.psrtWasm;
162
+ if (!exp) {
163
+ throw new Error("psrtWasm exports not found on globalThis");
164
+ }
165
+ wasmExports = exp;
166
+ }
167
+ async function initPsrt(wasmUrl) {
168
+ if (wasmExports) {
169
+ return;
170
+ }
171
+ if (globalThis.psrtWasm) {
172
+ wireWasmFromGlobal();
173
+ return;
174
+ }
175
+ await loadWasmExec();
176
+ const go = new Go();
177
+ const url = wasmUrl ?? new URL("../wasm/psrt.wasm", import_meta.url).href;
178
+ const response = await fetch(url);
179
+ if (!response.ok) {
180
+ throw new Error(`failed to fetch WASM: ${response.status}`);
181
+ }
182
+ const bytes = await response.arrayBuffer();
183
+ const { instance } = await WebAssembly.instantiate(bytes, go.importObject);
184
+ void go.run(instance);
185
+ await waitForExports();
186
+ const exp = globalThis.psrtWasm;
187
+ if (!exp) {
188
+ throw new Error("psrtWasm exports not found after WASM init");
189
+ }
190
+ wasmExports = exp;
191
+ }
192
+ function waitForExports() {
193
+ return new Promise((resolve, reject) => {
194
+ let attempts = 0;
195
+ const tick = () => {
196
+ if (globalThis.psrtWasm) {
197
+ resolve();
198
+ return;
199
+ }
200
+ attempts++;
201
+ if (attempts > 200) {
202
+ reject(new Error("timeout waiting for psrtWasm exports"));
203
+ return;
204
+ }
205
+ setTimeout(tick, 10);
206
+ };
207
+ tick();
208
+ });
209
+ }
210
+ async function loadWasmExec() {
211
+ if (typeof globalThis.Go !== "undefined") {
212
+ return;
213
+ }
214
+ const scriptUrl = new URL("../wasm/wasm_exec.js", import_meta.url).href;
215
+ await import(
216
+ /* @vite-ignore */
217
+ scriptUrl
218
+ );
219
+ }
220
+
221
+ // src/parse.ts
222
+ function parse(psrtString) {
223
+ return invokeParse(psrtString);
224
+ }
225
+ function stringify(doc) {
226
+ return invokeStringify(doc);
227
+ }
228
+ function formatDocument(doc) {
229
+ return invokeFormatDocument(doc);
230
+ }
231
+
232
+ // src/compile.ts
233
+ function compileToHtml(doc, options) {
234
+ return invokeCompileToHtml(doc, options);
235
+ }
236
+ function compileToSvg(doc, pageName, options) {
237
+ return invokeCompileToSvg(doc, pageName, options);
238
+ }
239
+
240
+ // src/editor/consts.ts
241
+ function addConst(doc, name, value) {
242
+ return invokeDocMutation("addConst", doc, name, value);
243
+ }
244
+ function removeConst(doc, name) {
245
+ return invokeDocMutation("removeConst", doc, name);
246
+ }
247
+ function substituteConstReferences(doc, name, value) {
248
+ return invokeDocMutation("substituteConstReferences", doc, name, value);
249
+ }
250
+ function revertConstReferences(doc, name, value) {
251
+ return invokeDocMutation("revertConstReferences", doc, name, value);
252
+ }
253
+
254
+ // src/editor/fonts.ts
255
+ function addFont(doc, url) {
256
+ return invokeDocMutation("addFont", doc, url);
257
+ }
258
+ function removeFont(doc, url) {
259
+ return invokeDocMutation("removeFont", doc, url);
260
+ }
261
+
262
+ // src/editor/pages.ts
263
+ function renamePage(doc, oldName, newName) {
264
+ return invokeDocMutation("renamePage", doc, oldName, newName);
265
+ }
266
+ function setPagePath(doc, pageName, path) {
267
+ return invokeDocMutation("setPagePath", doc, pageName, path);
268
+ }
269
+ function setPageStyle(doc, pageName, key, value, partial) {
270
+ return invokeDocMutation("setPageStyle", doc, pageName, key, value, partial);
271
+ }
272
+ function removePageStyleKey(doc, pageName, key) {
273
+ return invokeDocMutation("removePageStyleKey", doc, pageName, key);
274
+ }
275
+ function movePage(doc, pageName, before = "", after = "") {
276
+ return invokeDocMutation("movePage", doc, pageName, before, after);
277
+ }
278
+ function addPage(doc, page, before = "", after = "") {
279
+ return invokeDocMutation("addPage", doc, page, before, after);
280
+ }
281
+ function removePage(doc, name) {
282
+ return invokeDocMutation("removePage", doc, name);
283
+ }
284
+
285
+ // src/editor/text.ts
286
+ function setTextStyle(doc, pageName, textIndex, key, value, partial) {
287
+ return invokeDocMutation("setTextStyle", doc, pageName, textIndex, key, value, partial);
288
+ }
289
+ function removeTextStyleKey(doc, pageName, textIndex, key) {
290
+ return invokeDocMutation("removeTextStyleKey", doc, pageName, textIndex, key);
291
+ }
292
+ function setTextContent(doc, pageName, index, newContent, appendContent = false) {
293
+ return invokeDocMutation("setTextContent", doc, pageName, index, newContent, appendContent);
294
+ }
295
+ function addText(doc, pageName, text, beforeIndex = -1, afterIndex = -1) {
296
+ return invokeDocMutation("addText", doc, pageName, text, beforeIndex, afterIndex);
297
+ }
298
+ function removeText(doc, pageName, textIndex) {
299
+ return invokeDocMutation("removeText", doc, pageName, textIndex);
300
+ }
301
+ function reorderTextRelative(doc, pageName, textIndex, beforeIndex = -1, afterIndex = -1) {
302
+ return invokeDocMutation("reorderTextRelative", doc, pageName, textIndex, beforeIndex, afterIndex);
303
+ }
304
+ function reorderTextTo(doc, pageName, textIndex, to) {
305
+ return invokeDocMutation("reorderTextTo", doc, pageName, textIndex, to);
306
+ }
307
+ function reorderTextByDelta(doc, pageName, textIndex, delta) {
308
+ return invokeDocMutation("reorderTextByDelta", doc, pageName, textIndex, delta);
309
+ }
310
+ function setTextPosition(doc, pageName, textIndex, pos) {
311
+ return invokeDocMutation("setTextPosition", doc, pageName, textIndex, pos);
312
+ }
313
+ function nudgeTextPosition(doc, pageName, textIndex, delta) {
314
+ return invokeDocMutation("nudgeTextPosition", doc, pageName, textIndex, delta);
315
+ }
316
+
317
+ // src/editor/mask.ts
318
+ function setMaskPosition(doc, pageName, maskIndex, pos) {
319
+ const posBytes = new TextEncoder().encode(JSON.stringify(pos));
320
+ return invokeDocMutation("setMaskPosition", doc, pageName, maskIndex, posBytes);
321
+ }
322
+ function addMask(doc, pageName, mask, beforeIndex = -1, afterIndex = -1) {
323
+ return invokeDocMutation("addMask", doc, pageName, mask, beforeIndex, afterIndex);
324
+ }
325
+ function removeMask(doc, pageName, maskIndex) {
326
+ return invokeDocMutation("removeMask", doc, pageName, maskIndex);
327
+ }
328
+ function setMaskStyle(doc, pageName, maskIndex, key, value, partial) {
329
+ return invokeDocMutation("setMaskStyle", doc, pageName, maskIndex, key, value, partial);
330
+ }
331
+ function removeMaskStyleKey(doc, pageName, maskIndex, key) {
332
+ return invokeDocMutation("removeMaskStyleKey", doc, pageName, maskIndex, key);
333
+ }
334
+
335
+ // src/transformer.ts
336
+ var Transformer = class {
337
+ _doc;
338
+ constructor(input) {
339
+ this._doc = typeof input === "string" ? parse(input) : structuredClone(input);
340
+ }
341
+ /** Read-only view of the current document state. */
342
+ get document() {
343
+ return this._doc;
344
+ }
345
+ addConst(name, value) {
346
+ this._doc = addConst(this._doc, name, value);
347
+ return this;
348
+ }
349
+ removeConst(name) {
350
+ this._doc = removeConst(this._doc, name);
351
+ return this;
352
+ }
353
+ substituteConstReferences(name, value) {
354
+ this._doc = substituteConstReferences(this._doc, name, value);
355
+ return this;
356
+ }
357
+ revertConstReferences(name, value) {
358
+ this._doc = revertConstReferences(this._doc, name, value);
359
+ return this;
360
+ }
361
+ addFont(url) {
362
+ this._doc = addFont(this._doc, url);
363
+ return this;
364
+ }
365
+ removeFont(url) {
366
+ this._doc = removeFont(this._doc, url);
367
+ return this;
368
+ }
369
+ renamePage(oldName, newName) {
370
+ this._doc = renamePage(this._doc, oldName, newName);
371
+ return this;
372
+ }
373
+ setPagePath(pageName, path) {
374
+ this._doc = setPagePath(this._doc, pageName, path);
375
+ return this;
376
+ }
377
+ setPageStyle(pageName, key, value, partial) {
378
+ this._doc = setPageStyle(this._doc, pageName, key, value, partial);
379
+ return this;
380
+ }
381
+ removePageStyleKey(pageName, key) {
382
+ this._doc = removePageStyleKey(this._doc, pageName, key);
383
+ return this;
384
+ }
385
+ movePage(pageName, before = "", after = "") {
386
+ this._doc = movePage(this._doc, pageName, before, after);
387
+ return this;
388
+ }
389
+ addPage(page, before = "", after = "") {
390
+ this._doc = addPage(this._doc, page, before, after);
391
+ return this;
392
+ }
393
+ removePage(name) {
394
+ this._doc = removePage(this._doc, name);
395
+ return this;
396
+ }
397
+ setTextStyle(pageName, textIndex, key, value, partial) {
398
+ this._doc = setTextStyle(this._doc, pageName, textIndex, key, value, partial);
399
+ return this;
400
+ }
401
+ removeTextStyleKey(pageName, textIndex, key) {
402
+ this._doc = removeTextStyleKey(this._doc, pageName, textIndex, key);
403
+ return this;
404
+ }
405
+ setTextContent(pageName, index, content, appendContent = false) {
406
+ this._doc = setTextContent(this._doc, pageName, index, content, appendContent);
407
+ return this;
408
+ }
409
+ addText(pageName, text, opts) {
410
+ this._doc = addText(this._doc, pageName, text, opts?.beforeIndex ?? -1, opts?.afterIndex ?? -1);
411
+ return this;
412
+ }
413
+ removeText(pageName, textIndex) {
414
+ this._doc = removeText(this._doc, pageName, textIndex);
415
+ return this;
416
+ }
417
+ reorderTextRelative(pageName, textIndex, beforeIndex = 0, afterIndex = 0) {
418
+ this._doc = reorderTextRelative(this._doc, pageName, textIndex, beforeIndex, afterIndex);
419
+ return this;
420
+ }
421
+ reorderTextTo(pageName, textIndex, to) {
422
+ this._doc = reorderTextTo(this._doc, pageName, textIndex, to);
423
+ return this;
424
+ }
425
+ reorderTextByDelta(pageName, textIndex, delta) {
426
+ this._doc = reorderTextByDelta(this._doc, pageName, textIndex, delta);
427
+ return this;
428
+ }
429
+ setTextPosition(pageName, textIndex, pos) {
430
+ this._doc = setTextPosition(this._doc, pageName, textIndex, pos);
431
+ return this;
432
+ }
433
+ nudgeTextPosition(pageName, textIndex, delta) {
434
+ this._doc = nudgeTextPosition(this._doc, pageName, textIndex, delta);
435
+ return this;
436
+ }
437
+ setMaskPosition(pageName, maskIndex, pos) {
438
+ this._doc = setMaskPosition(this._doc, pageName, maskIndex, pos);
439
+ return this;
440
+ }
441
+ addMask(pageName, mask, opts) {
442
+ this._doc = addMask(this._doc, pageName, mask, opts?.beforeIndex ?? -1, opts?.afterIndex ?? -1);
443
+ return this;
444
+ }
445
+ removeMask(pageName, maskIndex) {
446
+ this._doc = removeMask(this._doc, pageName, maskIndex);
447
+ return this;
448
+ }
449
+ setMaskStyle(pageName, maskIndex, key, value, partial) {
450
+ this._doc = setMaskStyle(this._doc, pageName, maskIndex, key, value, partial);
451
+ return this;
452
+ }
453
+ removeMaskStyleKey(pageName, maskIndex, key) {
454
+ this._doc = removeMaskStyleKey(this._doc, pageName, maskIndex, key);
455
+ return this;
456
+ }
457
+ /** Returns the accumulated document after the edit chain. */
458
+ build() {
459
+ return structuredClone(this._doc);
460
+ }
461
+ /** Shortcut: build() + stringify(). */
462
+ buildPsrt() {
463
+ return stringify(this.build());
464
+ }
465
+ };
466
+ function transform(input) {
467
+ return new Transformer(input);
468
+ }
469
+
470
+ // src/gui.ts
471
+ function adaptEntriesForWeb(entriesJSON, canvasW, canvasH, zoom) {
472
+ return invokeRaw("adaptEntriesForWeb", entriesJSON, canvasW, canvasH, zoom);
473
+ }
474
+ function mergePageDocumentPSRT(fullDocJSON, pageName, psrtText) {
475
+ const json = invokeText("mergePageDocumentPSRT", fullDocJSON, pageName, psrtText);
476
+ return JSON.parse(json);
477
+ }
478
+ function formatPageDocumentJSON(docJSON, pageName) {
479
+ return invokeText("formatPageDocumentJSON", docJSON, pageName);
480
+ }
481
+
482
+ // src/editor/style.ts
483
+ function setStyleKey(style, key, value) {
484
+ return invokeStyleMutation("setStyleKey", style, key, value);
485
+ }
486
+ function removeStyleKey(style, key) {
487
+ return invokeStyleMutation("removeStyleKey", style, key);
488
+ }
489
+ function mergeStyle(style, partial) {
490
+ const partialBytes = new TextEncoder().encode(JSON.stringify(partial));
491
+ return invokeStyleMutation("mergeStyle", style, partialBytes);
492
+ }
493
+
494
+ // src/editor/lookup.ts
495
+ function findPage(doc, name) {
496
+ return invokeDocQuery("findPage", doc, name);
497
+ }
498
+ function findPageIndex(doc, name) {
499
+ return invokeDocQuery("findPageIndex", doc, name).index;
500
+ }
501
+ function findTextByIndex(doc, pageName, index) {
502
+ return invokeDocQuery("findTextByIndex", doc, pageName, index);
503
+ }
504
+ function findMaskByIndex(doc, pageName, index) {
505
+ return invokeDocQuery("findMaskByIndex", doc, pageName, index);
506
+ }
507
+ function parseTextIndex(s) {
508
+ return invokeRaw("parseTextIndex", s).index;
509
+ }
510
+
511
+ // src/resolve.ts
512
+ function resolveDocument(doc) {
513
+ return invokeDocMutation("resolveDocument", doc);
514
+ }
515
+ function resolveDocumentStrict(doc) {
516
+ return invokeDocMutation("resolveDocumentStrict", doc);
517
+ }
518
+ // Annotate the CommonJS export names for ESM import in node:
519
+ 0 && (module.exports = {
520
+ Transformer,
521
+ adaptEntriesForWeb,
522
+ addConst,
523
+ addFont,
524
+ addMask,
525
+ addPage,
526
+ addText,
527
+ compileToHtml,
528
+ compileToSvg,
529
+ findMaskByIndex,
530
+ findPage,
531
+ findPageIndex,
532
+ findTextByIndex,
533
+ formatDocument,
534
+ formatPageDocumentJSON,
535
+ initPsrt,
536
+ mergePageDocumentPSRT,
537
+ mergeStyle,
538
+ movePage,
539
+ nudgeTextPosition,
540
+ parse,
541
+ parseTextIndex,
542
+ removeConst,
543
+ removeFont,
544
+ removeMask,
545
+ removeMaskStyleKey,
546
+ removePage,
547
+ removePageStyleKey,
548
+ removeStyleKey,
549
+ removeText,
550
+ removeTextStyleKey,
551
+ renamePage,
552
+ reorderTextByDelta,
553
+ reorderTextRelative,
554
+ reorderTextTo,
555
+ resolveDocument,
556
+ resolveDocumentStrict,
557
+ revertConstReferences,
558
+ setMaskPosition,
559
+ setMaskStyle,
560
+ setPagePath,
561
+ setPageStyle,
562
+ setStyleKey,
563
+ setTextContent,
564
+ setTextPosition,
565
+ setTextStyle,
566
+ stringify,
567
+ substituteConstReferences,
568
+ transform
569
+ });
570
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/wasm.ts","../src/parse.ts","../src/compile.ts","../src/editor/consts.ts","../src/editor/fonts.ts","../src/editor/pages.ts","../src/editor/text.ts","../src/editor/mask.ts","../src/transformer.ts","../src/gui.ts","../src/editor/style.ts","../src/editor/lookup.ts","../src/resolve.ts"],"sourcesContent":["export { initPsrt } from './wasm.js'\nexport { parse, stringify, formatDocument } from './parse.js'\nexport { compileToHtml, compileToSvg } from './compile.js'\nexport { Transformer, transform } from './transformer.js'\nexport {\n adaptEntriesForWeb,\n formatPageDocumentJSON,\n mergePageDocumentPSRT,\n type WebPreviewStyle,\n} from './gui.js'\nexport * from './editor/index.js'\nexport type {\n CompileOptions,\n Document,\n MaskPositionFields,\n Page,\n PositionFields,\n PsrtDocument,\n PsrtMask,\n PsrtPage,\n PsrtStyle,\n PsrtText,\n TextBlock,\n} from './types.js'\nexport { resolveDocument, resolveDocumentStrict } from './resolve.js'\n","import type { CompileOptions, PsrtDocument, PsrtStyle, WasmResult } from './types.js'\n\nconst decoder = new TextDecoder()\nconst encoder = new TextEncoder()\n\nlet wasmExports: Record<string, (...args: unknown[]) => WasmResult> | null = null\n\nfunction decodeData(data: Uint8Array): string {\n return decoder.decode(data)\n}\n\nfunction encodeDoc(doc: PsrtDocument): Uint8Array {\n return encoder.encode(JSON.stringify(doc))\n}\n\nfunction encodeInput(input: PsrtDocument | string): Uint8Array | string {\n return typeof input === 'string' ? input : encodeDoc(input)\n}\n\nfunction encodeArg(arg: unknown): unknown {\n if (arg === undefined) {\n return undefined\n }\n if (arg instanceof Uint8Array) {\n return arg\n }\n if (typeof arg === 'object' && arg !== null) {\n return encoder.encode(JSON.stringify(arg))\n }\n return arg\n}\n\nfunction call(name: string, ...args: unknown[]): WasmResult {\n if (!wasmExports) {\n throw new Error('PSRT WASM not initialized; call initPsrt() first')\n }\n const fn = wasmExports[name]\n if (!fn) {\n throw new Error(`unknown WASM handler: ${name}`)\n }\n const encoded = args.map(encodeArg)\n return fn(...encoded) as WasmResult\n}\n\nfunction requireBytes(result: WasmResult): Uint8Array {\n if (!result.ok) {\n throw new Error(result.err ?? 'WASM call failed')\n }\n if (!result.data) {\n throw new Error('WASM call returned no data')\n }\n return result.data\n}\n\nfunction parseDocResult(result: WasmResult): PsrtDocument {\n return JSON.parse(decodeData(requireBytes(result))) as PsrtDocument\n}\n\nfunction parseTextResult(result: WasmResult): string {\n return decodeData(requireBytes(result))\n}\n\nfunction parseJSONResult<T>(result: WasmResult): T {\n return JSON.parse(decodeData(requireBytes(result))) as T\n}\n\nexport function invokeDocMutation(\n handler: string,\n doc: PsrtDocument,\n ...extra: unknown[]\n): PsrtDocument {\n return parseDocResult(call(handler, encodeDoc(doc), ...extra))\n}\n\nexport function invokeDocQuery<T>(handler: string, doc: PsrtDocument, ...extra: unknown[]): T {\n return parseJSONResult<T>(call(handler, encodeDoc(doc), ...extra))\n}\n\nexport function invokeRaw<T>(handler: string, ...args: unknown[]): T {\n return parseJSONResult<T>(call(handler, ...args))\n}\n\nexport function invokeText(handler: string, ...args: unknown[]): string {\n return parseTextResult(call(handler, ...args))\n}\n\nexport function invokeStyleMutation(handler: string, style: PsrtStyle, ...extra: unknown[]): PsrtStyle {\n return parseJSONResult<PsrtStyle>(call(handler, style, ...extra))\n}\n\nexport function invokeParse(psrtString: string): PsrtDocument {\n return parseDocResult(call('parse', psrtString))\n}\n\nexport function invokeStringify(doc: PsrtDocument): string {\n return parseTextResult(call('stringify', encodeDoc(doc)))\n}\n\nexport function invokeFormatDocument(doc: PsrtDocument): string {\n return parseTextResult(call('formatDocument', encodeDoc(doc)))\n}\n\nexport function invokeCompileToHtml(\n input: PsrtDocument | string,\n options?: CompileOptions\n): string {\n return parseTextResult(call('compileToHtml', encodeInput(input), options ?? {}))\n}\n\nexport function invokeCompileToSvg(\n input: PsrtDocument | string,\n pageName: string,\n options?: CompileOptions\n): string {\n return parseTextResult(call('compileToSvg', encodeInput(input), pageName, options ?? {}))\n}\n\nexport function wireWasmFromGlobal(): void {\n const exp = (globalThis as { psrtWasm?: Record<string, (...args: unknown[]) => WasmResult> })\n .psrtWasm\n if (!exp) {\n throw new Error('psrtWasm exports not found on globalThis')\n }\n wasmExports = exp\n}\n\nexport async function initPsrt(wasmUrl?: string): Promise<void> {\n if (wasmExports) {\n return\n }\n if ((globalThis as { psrtWasm?: unknown }).psrtWasm) {\n wireWasmFromGlobal()\n return\n }\n await loadWasmExec()\n const go = new Go()\n const url = wasmUrl ?? new URL('../wasm/psrt.wasm', import.meta.url).href\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(`failed to fetch WASM: ${response.status}`)\n }\n const bytes = await response.arrayBuffer()\n const { instance } = await WebAssembly.instantiate(bytes, go.importObject)\n void go.run(instance)\n await waitForExports()\n const exp = (globalThis as { psrtWasm?: Record<string, (...args: unknown[]) => WasmResult> })\n .psrtWasm\n if (!exp) {\n throw new Error('psrtWasm exports not found after WASM init')\n }\n wasmExports = exp\n}\n\nfunction waitForExports(): Promise<void> {\n return new Promise((resolve, reject) => {\n let attempts = 0\n const tick = (): void => {\n if ((globalThis as { psrtWasm?: unknown }).psrtWasm) {\n resolve()\n return\n }\n attempts++\n if (attempts > 200) {\n reject(new Error('timeout waiting for psrtWasm exports'))\n return\n }\n setTimeout(tick, 10)\n }\n tick()\n })\n}\n\nasync function loadWasmExec(): Promise<void> {\n if (typeof (globalThis as { Go?: unknown }).Go !== 'undefined') {\n return\n }\n const scriptUrl = new URL('../wasm/wasm_exec.js', import.meta.url).href\n await import(/* @vite-ignore */ scriptUrl)\n}\n\ndeclare class Go {\n importObject: WebAssembly.Imports\n run(instance: WebAssembly.Instance): Promise<void>\n}\n","import { invokeFormatDocument, invokeParse, invokeStringify } from './wasm.js'\nimport type { PsrtDocument } from './types.js'\n\n/** Converts a .psrt string into a typed PsrtDocument. */\nexport function parse(psrtString: string): PsrtDocument {\n return invokeParse(psrtString)\n}\n\n/** Converts a PsrtDocument back to normative .psrt text. */\nexport function stringify(doc: PsrtDocument): string {\n return invokeStringify(doc)\n}\n\n/** Formats a document with editor cleanup rules. */\nexport function formatDocument(doc: PsrtDocument): string {\n return invokeFormatDocument(doc)\n}\n","import { invokeCompileToHtml, invokeCompileToSvg } from './wasm.js'\nimport type { CompileOptions, PsrtDocument } from './types.js'\n\n/** Compiles the document to a self-contained HTML string. */\nexport function compileToHtml(doc: PsrtDocument | string, options?: CompileOptions): string {\n return invokeCompileToHtml(doc, options)\n}\n\n/** Compiles one page of the document to SVG. */\nexport function compileToSvg(\n doc: PsrtDocument | string,\n pageName: string,\n options?: CompileOptions\n): string {\n return invokeCompileToSvg(doc, pageName, options)\n}\n","import { invokeDocMutation } from '../wasm.js'\nimport type { PsrtDocument } from '../types.js'\n\nexport function addConst(doc: PsrtDocument, name: string, value: string): PsrtDocument {\n return invokeDocMutation('addConst', doc, name, value)\n}\n\nexport function removeConst(doc: PsrtDocument, name: string): PsrtDocument {\n return invokeDocMutation('removeConst', doc, name)\n}\n\nexport function substituteConstReferences(\n doc: PsrtDocument,\n name: string,\n value: string\n): PsrtDocument {\n return invokeDocMutation('substituteConstReferences', doc, name, value)\n}\n\nexport function revertConstReferences(\n doc: PsrtDocument,\n name: string,\n value: string\n): PsrtDocument {\n return invokeDocMutation('revertConstReferences', doc, name, value)\n}\n","import { invokeDocMutation } from '../wasm.js'\nimport type { PsrtDocument } from '../types.js'\n\nexport function addFont(doc: PsrtDocument, url: string): PsrtDocument {\n return invokeDocMutation('addFont', doc, url)\n}\n\nexport function removeFont(doc: PsrtDocument, url: string): PsrtDocument {\n return invokeDocMutation('removeFont', doc, url)\n}\n","import { invokeDocMutation } from '../wasm.js'\nimport type { PsrtDocument, PsrtPage, PsrtStyle } from '../types.js'\n\nexport function renamePage(doc: PsrtDocument, oldName: string, newName: string): PsrtDocument {\n return invokeDocMutation('renamePage', doc, oldName, newName)\n}\n\nexport function setPagePath(doc: PsrtDocument, pageName: string, path: string): PsrtDocument {\n return invokeDocMutation('setPagePath', doc, pageName, path)\n}\n\nexport function setPageStyle(\n doc: PsrtDocument,\n pageName: string,\n key: string,\n value: string,\n partial?: PsrtStyle\n): PsrtDocument {\n return invokeDocMutation('setPageStyle', doc, pageName, key, value, partial)\n}\n\nexport function removePageStyleKey(doc: PsrtDocument, pageName: string, key: string): PsrtDocument {\n return invokeDocMutation('removePageStyleKey', doc, pageName, key)\n}\n\nexport function movePage(\n doc: PsrtDocument,\n pageName: string,\n before = '',\n after = ''\n): PsrtDocument {\n return invokeDocMutation('movePage', doc, pageName, before, after)\n}\n\nexport function addPage(\n doc: PsrtDocument,\n page: PsrtPage,\n before = '',\n after = ''\n): PsrtDocument {\n return invokeDocMutation('addPage', doc, page, before, after)\n}\n\nexport function removePage(doc: PsrtDocument, name: string): PsrtDocument {\n return invokeDocMutation('removePage', doc, name)\n}\n","import { invokeDocMutation } from '../wasm.js'\nimport type { PositionFields, PsrtDocument, PsrtStyle, PsrtText } from '../types.js'\n\nexport function setTextStyle(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n key: string,\n value: string,\n partial?: PsrtStyle\n): PsrtDocument {\n return invokeDocMutation('setTextStyle', doc, pageName, textIndex, key, value, partial)\n}\n\nexport function removeTextStyleKey(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n key: string\n): PsrtDocument {\n return invokeDocMutation('removeTextStyleKey', doc, pageName, textIndex, key)\n}\n\nexport function setTextContent(\n doc: PsrtDocument,\n pageName: string,\n index: number,\n newContent: string,\n appendContent = false\n): PsrtDocument {\n return invokeDocMutation('setTextContent', doc, pageName, index, newContent, appendContent)\n}\n\nexport function addText(\n doc: PsrtDocument,\n pageName: string,\n text: PsrtText,\n beforeIndex = -1,\n afterIndex = -1\n): PsrtDocument {\n return invokeDocMutation('addText', doc, pageName, text, beforeIndex, afterIndex)\n}\n\nexport function removeText(doc: PsrtDocument, pageName: string, textIndex: number): PsrtDocument {\n return invokeDocMutation('removeText', doc, pageName, textIndex)\n}\n\nexport function reorderTextRelative(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n beforeIndex = -1,\n afterIndex = -1\n): PsrtDocument {\n return invokeDocMutation('reorderTextRelative', doc, pageName, textIndex, beforeIndex, afterIndex)\n}\n\nexport function reorderTextTo(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n to: number\n): PsrtDocument {\n return invokeDocMutation('reorderTextTo', doc, pageName, textIndex, to)\n}\n\nexport function reorderTextByDelta(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n delta: number\n): PsrtDocument {\n return invokeDocMutation('reorderTextByDelta', doc, pageName, textIndex, delta)\n}\n\nexport function setTextPosition(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n pos: PositionFields\n): PsrtDocument {\n return invokeDocMutation('setTextPosition', doc, pageName, textIndex, pos)\n}\n\nexport function nudgeTextPosition(\n doc: PsrtDocument,\n pageName: string,\n textIndex: number,\n delta: PositionFields\n): PsrtDocument {\n return invokeDocMutation('nudgeTextPosition', doc, pageName, textIndex, delta)\n}\n","import { invokeDocMutation } from '../wasm.js'\nimport type { MaskPositionFields, PsrtDocument, PsrtMask, PsrtStyle } from '../types.js'\n\nexport function setMaskPosition(\n doc: PsrtDocument,\n pageName: string,\n maskIndex: number,\n pos: MaskPositionFields\n): PsrtDocument {\n const posBytes = new TextEncoder().encode(JSON.stringify(pos))\n return invokeDocMutation('setMaskPosition', doc, pageName, maskIndex, posBytes)\n}\n\nexport function addMask(\n doc: PsrtDocument,\n pageName: string,\n mask: PsrtMask,\n beforeIndex = -1,\n afterIndex = -1\n): PsrtDocument {\n return invokeDocMutation('addMask', doc, pageName, mask, beforeIndex, afterIndex)\n}\n\nexport function removeMask(doc: PsrtDocument, pageName: string, maskIndex: number): PsrtDocument {\n return invokeDocMutation('removeMask', doc, pageName, maskIndex)\n}\n\nexport function setMaskStyle(\n doc: PsrtDocument,\n pageName: string,\n maskIndex: number,\n key: string,\n value: string,\n partial?: PsrtStyle\n): PsrtDocument {\n return invokeDocMutation('setMaskStyle', doc, pageName, maskIndex, key, value, partial)\n}\n\nexport function removeMaskStyleKey(\n doc: PsrtDocument,\n pageName: string,\n maskIndex: number,\n key: string\n): PsrtDocument {\n return invokeDocMutation('removeMaskStyleKey', doc, pageName, maskIndex, key)\n}\n","import { parse, stringify } from './parse.js'\nimport type { MaskPositionFields, PositionFields, PsrtDocument, PsrtMask, PsrtPage, PsrtStyle, PsrtText } from './types.js'\nimport {\n addConst,\n removeConst,\n substituteConstReferences,\n revertConstReferences,\n} from './editor/consts.js'\nimport { addFont, removeFont } from './editor/fonts.js'\nimport {\n addPage,\n movePage,\n removePage,\n removePageStyleKey,\n renamePage,\n setPagePath,\n setPageStyle,\n} from './editor/pages.js'\nimport {\n addText,\n nudgeTextPosition,\n removeText,\n removeTextStyleKey,\n reorderTextByDelta,\n reorderTextRelative,\n reorderTextTo,\n setTextContent,\n setTextPosition,\n setTextStyle,\n} from './editor/text.js'\nimport {\n addMask,\n removeMask,\n removeMaskStyleKey,\n setMaskPosition,\n setMaskStyle,\n} from './editor/mask.js'\n\n/** Fluent builder for chained PSRT document edits. */\nexport class Transformer {\n private _doc: PsrtDocument\n\n constructor(input: PsrtDocument | string) {\n this._doc = typeof input === 'string' ? parse(input) : structuredClone(input)\n }\n\n /** Read-only view of the current document state. */\n get document(): Readonly<PsrtDocument> {\n return this._doc\n }\n\n addConst(name: string, value: string): this {\n this._doc = addConst(this._doc, name, value)\n return this\n }\n\n removeConst(name: string): this {\n this._doc = removeConst(this._doc, name)\n return this\n }\n\n substituteConstReferences(name: string, value: string): this {\n this._doc = substituteConstReferences(this._doc, name, value)\n return this\n }\n\n revertConstReferences(name: string, value: string): this {\n this._doc = revertConstReferences(this._doc, name, value)\n return this\n }\n\n addFont(url: string): this {\n this._doc = addFont(this._doc, url)\n return this\n }\n\n removeFont(url: string): this {\n this._doc = removeFont(this._doc, url)\n return this\n }\n\n renamePage(oldName: string, newName: string): this {\n this._doc = renamePage(this._doc, oldName, newName)\n return this\n }\n\n setPagePath(pageName: string, path: string): this {\n this._doc = setPagePath(this._doc, pageName, path)\n return this\n }\n\n setPageStyle(pageName: string, key: string, value: string, partial?: PsrtStyle): this {\n this._doc = setPageStyle(this._doc, pageName, key, value, partial)\n return this\n }\n\n removePageStyleKey(pageName: string, key: string): this {\n this._doc = removePageStyleKey(this._doc, pageName, key)\n return this\n }\n\n movePage(pageName: string, before = '', after = ''): this {\n this._doc = movePage(this._doc, pageName, before, after)\n return this\n }\n\n addPage(page: PsrtPage, before = '', after = ''): this {\n this._doc = addPage(this._doc, page, before, after)\n return this\n }\n\n removePage(name: string): this {\n this._doc = removePage(this._doc, name)\n return this\n }\n\n setTextStyle(\n pageName: string,\n textIndex: number,\n key: string,\n value: string,\n partial?: PsrtStyle\n ): this {\n this._doc = setTextStyle(this._doc, pageName, textIndex, key, value, partial)\n return this\n }\n\n removeTextStyleKey(pageName: string, textIndex: number, key: string): this {\n this._doc = removeTextStyleKey(this._doc, pageName, textIndex, key)\n return this\n }\n\n setTextContent(pageName: string, index: number, content: string, appendContent = false): this {\n this._doc = setTextContent(this._doc, pageName, index, content, appendContent)\n return this\n }\n\n addText(\n pageName: string,\n text: PsrtText,\n opts?: { beforeIndex?: number; afterIndex?: number }\n ): this {\n this._doc = addText(this._doc, pageName, text, opts?.beforeIndex ?? -1, opts?.afterIndex ?? -1)\n return this\n }\n\n removeText(pageName: string, textIndex: number): this {\n this._doc = removeText(this._doc, pageName, textIndex)\n return this\n }\n\n reorderTextRelative(\n pageName: string,\n textIndex: number,\n beforeIndex = 0,\n afterIndex = 0\n ): this {\n this._doc = reorderTextRelative(this._doc, pageName, textIndex, beforeIndex, afterIndex)\n return this\n }\n\n reorderTextTo(pageName: string, textIndex: number, to: number): this {\n this._doc = reorderTextTo(this._doc, pageName, textIndex, to)\n return this\n }\n\n reorderTextByDelta(pageName: string, textIndex: number, delta: number): this {\n this._doc = reorderTextByDelta(this._doc, pageName, textIndex, delta)\n return this\n }\n\n setTextPosition(pageName: string, textIndex: number, pos: PositionFields): this {\n this._doc = setTextPosition(this._doc, pageName, textIndex, pos)\n return this\n }\n\n nudgeTextPosition(pageName: string, textIndex: number, delta: PositionFields): this {\n this._doc = nudgeTextPosition(this._doc, pageName, textIndex, delta)\n return this\n }\n\n setMaskPosition(pageName: string, maskIndex: number, pos: MaskPositionFields): this {\n this._doc = setMaskPosition(this._doc, pageName, maskIndex, pos)\n return this\n }\n\n addMask(\n pageName: string,\n mask: PsrtMask,\n opts?: { beforeIndex?: number; afterIndex?: number }\n ): this {\n this._doc = addMask(this._doc, pageName, mask, opts?.beforeIndex ?? -1, opts?.afterIndex ?? -1)\n return this\n }\n\n removeMask(pageName: string, maskIndex: number): this {\n this._doc = removeMask(this._doc, pageName, maskIndex)\n return this\n }\n\n setMaskStyle(\n pageName: string,\n maskIndex: number,\n key: string,\n value: string,\n partial?: PsrtStyle\n ): this {\n this._doc = setMaskStyle(this._doc, pageName, maskIndex, key, value, partial)\n return this\n }\n\n removeMaskStyleKey(pageName: string, maskIndex: number, key: string): this {\n this._doc = removeMaskStyleKey(this._doc, pageName, maskIndex, key)\n return this\n }\n\n /** Returns the accumulated document after the edit chain. */\n build(): PsrtDocument {\n return structuredClone(this._doc)\n }\n\n /** Shortcut: build() + stringify(). */\n buildPsrt(): string {\n return stringify(this.build())\n }\n}\n\nexport function transform(input: PsrtDocument | string): Transformer {\n return new Transformer(input)\n}\n","import { invokeRaw, invokeText } from './wasm.js'\nimport type { PsrtDocument } from './types.js'\n\nexport interface WebPreviewStyle {\n container: Record<string, string>\n text: Record<string, string>\n hasStroke: boolean\n}\n\n/** Adapts text/mask entries for live web preview CSS (percent → px, stroke → WebKit, etc.). */\nexport function adaptEntriesForWeb(\n entriesJSON: string,\n canvasW: number,\n canvasH: number,\n zoom: number,\n): WebPreviewStyle[] {\n return invokeRaw<WebPreviewStyle[]>('adaptEntriesForWeb', entriesJSON, canvasW, canvasH, zoom)\n}\n\n/** Applies a page PSRT fragment into a full document. */\nexport function mergePageDocumentPSRT(\n fullDocJSON: string,\n pageName: string,\n psrtText: string,\n): PsrtDocument {\n const json = invokeText('mergePageDocumentPSRT', fullDocJSON, pageName, psrtText)\n return JSON.parse(json) as PsrtDocument\n}\n\n/** Formats one page plus document fonts and constants as PSRT text. */\nexport function formatPageDocumentJSON(docJSON: string, pageName: string): string {\n return invokeText('formatPageDocumentJSON', docJSON, pageName)\n}\n","import { invokeStyleMutation } from '../wasm.js'\nimport type { PsrtStyle } from '../types.js'\n\nexport function setStyleKey(style: PsrtStyle, key: string, value: string): PsrtStyle {\n return invokeStyleMutation('setStyleKey', style, key, value) as PsrtStyle\n}\n\nexport function removeStyleKey(style: PsrtStyle, key: string): PsrtStyle {\n return invokeStyleMutation('removeStyleKey', style, key) as PsrtStyle\n}\n\nexport function mergeStyle(style: PsrtStyle, partial: PsrtStyle): PsrtStyle {\n const partialBytes = new TextEncoder().encode(JSON.stringify(partial))\n return invokeStyleMutation('mergeStyle', style, partialBytes) as PsrtStyle\n}\n","import { invokeDocQuery, invokeRaw } from '../wasm.js'\nimport type { PsrtDocument, PsrtMask, PsrtPage, PsrtText } from '../types.js'\n\nexport function findPage(doc: PsrtDocument, name: string): PsrtPage {\n return invokeDocQuery<PsrtPage>('findPage', doc, name)\n}\n\nexport function findPageIndex(doc: PsrtDocument, name: string): number {\n return invokeDocQuery<{ index: number }>('findPageIndex', doc, name).index\n}\n\nexport function findTextByIndex(doc: PsrtDocument, pageName: string, index: number): PsrtText {\n return invokeDocQuery<PsrtText>('findTextByIndex', doc, pageName, index)\n}\n\nexport function findMaskByIndex(doc: PsrtDocument, pageName: string, index: number): PsrtMask {\n return invokeDocQuery<PsrtMask>('findMaskByIndex', doc, pageName, index)\n}\n\nexport function parseTextIndex(s: string): number {\n return invokeRaw<{ index: number }>('parseTextIndex', s).index\n}\n","import { invokeDocMutation } from './wasm.js'\nimport type { PsrtDocument } from './types.js'\n\n/** Expands all @const@ placeholders in styles, content, and URLs. */\nexport function resolveDocument(doc: PsrtDocument): PsrtDocument {\n return invokeDocMutation('resolveDocument', doc)\n}\n\n/** Like resolveDocument but throws on invalid style JSON after expansion. */\nexport function resolveDocumentStrict(doc: PsrtDocument): PsrtDocument {\n return invokeDocMutation('resolveDocumentStrict', doc)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAEA,IAAM,UAAU,IAAI,YAAY;AAChC,IAAM,UAAU,IAAI,YAAY;AAEhC,IAAI,cAAyE;AAE7E,SAAS,WAAW,MAA0B;AAC5C,SAAO,QAAQ,OAAO,IAAI;AAC5B;AAEA,SAAS,UAAU,KAA+B;AAChD,SAAO,QAAQ,OAAO,KAAK,UAAU,GAAG,CAAC;AAC3C;AAEA,SAAS,YAAY,OAAmD;AACtE,SAAO,OAAO,UAAU,WAAW,QAAQ,UAAU,KAAK;AAC5D;AAEA,SAAS,UAAU,KAAuB;AACxC,MAAI,QAAQ,QAAW;AACr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