@mermanjs/web-analysis 0.9.2 → 0.10.0-alpha.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.
Files changed (58) hide show
  1. package/README.md +9 -3
  2. package/THIRD_PARTY_LICENSES/rust-cargo-dependencies.json +90 -296
  3. package/THIRD_PARTY_NOTICES.md +6 -6
  4. package/artifacts/provenance.json +132 -92
  5. package/artifacts/wasm/merman_wasm.d.ts +18 -3
  6. package/artifacts/wasm/merman_wasm.js +80 -11
  7. package/artifacts/wasm/merman_wasm_bg.wasm +0 -0
  8. package/artifacts/wasm/merman_wasm_bg.wasm.d.ts +5 -1
  9. package/dist/generated/binding-contract.d.ts +384 -0
  10. package/dist/generated/binding-contract.d.ts.map +1 -0
  11. package/dist/generated/binding-contract.js +55 -17
  12. package/dist/generated/binding-contract.js.map +1 -1
  13. package/dist/generated/capability-surface.d.ts +56 -3
  14. package/dist/generated/capability-surface.d.ts.map +1 -1
  15. package/dist/generated/capability-surface.js +64 -1
  16. package/dist/generated/capability-surface.js.map +1 -1
  17. package/dist/generated/resource-contract.d.ts +3 -3
  18. package/dist/generated/resource-contract.d.ts.map +1 -1
  19. package/dist/generated/resource-contract.js +36 -10
  20. package/dist/generated/resource-contract.js.map +1 -1
  21. package/dist/generated/text-measurement-abi.d.ts +5 -0
  22. package/dist/generated/text-measurement-abi.d.ts.map +1 -1
  23. package/dist/generated/text-measurement-abi.js +1 -0
  24. package/dist/generated/text-measurement-abi.js.map +1 -1
  25. package/dist/index.d.ts +5 -3
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/json-input.js +13 -0
  28. package/dist/json-input.js.map +1 -0
  29. package/dist/package-entries/analysis.d.ts +6 -6
  30. package/dist/package-entries/analysis.d.ts.map +1 -1
  31. package/dist/package-entries/analysis.js +6 -6
  32. package/dist/package-entries/analysis.js.map +1 -1
  33. package/dist/public-catalog.d.ts +7 -7
  34. package/dist/public-catalog.d.ts.map +1 -1
  35. package/dist/public-catalog.js +6 -15
  36. package/dist/public-catalog.js.map +1 -1
  37. package/dist/public-types.d.ts +740 -54
  38. package/dist/public-types.d.ts.map +1 -1
  39. package/dist/runtime-analysis.d.ts.map +1 -1
  40. package/dist/runtime-analysis.js +2 -1
  41. package/dist/runtime-analysis.js.map +1 -1
  42. package/dist/runtime-core.d.ts +5 -3
  43. package/dist/runtime-core.d.ts.map +1 -1
  44. package/dist/runtime-core.js +222 -75
  45. package/dist/runtime-core.js.map +1 -1
  46. package/dist/runtime-mount.d.ts +4 -0
  47. package/dist/runtime-mount.d.ts.map +1 -0
  48. package/dist/runtime-render-session.d.ts +4 -0
  49. package/dist/runtime-render-session.d.ts.map +1 -0
  50. package/dist/runtime-render.d.ts +13 -5
  51. package/dist/runtime-render.d.ts.map +1 -1
  52. package/dist/runtime-state.d.ts +4 -3
  53. package/dist/runtime-state.d.ts.map +1 -1
  54. package/dist/runtime-state.js +3 -2
  55. package/dist/runtime-state.js.map +1 -1
  56. package/dist/surface-runtime.js +2 -2
  57. package/dist/surface-runtime.js.map +1 -1
  58. package/package.json +3 -2
@@ -1,19 +1,23 @@
1
- import type { AsciiCapability, BindingStatusCodeName, DiagramFamilyCapability, DiagramType, LintBindingOptions, LintRuleCatalogResponse, LintRuleCategory, LintRuleSeverity, LintRuleTag, RuntimeCapabilities } from "./public-catalog.js";
1
+ import type { AsciiCapability, BindingStatusCodeName, DiagramFamilyCapability, DiagramType, LintBindingOptions, LintRuleCatalogResponse, LintRuleCategory, LintRuleSeverity, LintRuleTag, RuntimeCapabilities, ThemeName } from "./public-catalog.js";
2
2
  import type { HostTextDirection, HostTextMeasurementOperation, HostTextMeasurementPhase, HostTextWhiteSpace, HostTextWrapMode } from "./generated/text-measurement-abi.js";
3
3
  import type { EditorRenamePolicy } from "./generated/editor-rename-policy.js";
4
- import type { ResourceOverrideId, ResourceLimitId, ResourceOptions, ResourceProfile } from "./generated/resource-contract.js";
4
+ import type { BINDING_OPTIONS_SCHEMA_VERSION, ResourceOverrideId, ResourceLimitId, ResourceOptions, ResourceProfile } from "./generated/resource-contract.js";
5
5
  export type { HostTextDirection, HostTextMeasurementOperation, HostTextMeasurementPhase, HostTextMeasurementResultKind, HostTextWhiteSpace, HostTextWrapMode, } from "./generated/text-measurement-abi.js";
6
6
  export type { ResourceOptions } from "./generated/resource-contract.js";
7
7
  export interface ParseOptions {
8
8
  suppress_errors?: boolean;
9
9
  }
10
10
  export interface LayoutOptions {
11
+ /** Explicit whole-column packing, currently supported by Kanban only. */
12
+ adaptation?: "none" | "fit-width";
11
13
  container_width?: number;
12
14
  container_height?: number;
13
15
  screen_available_width?: number;
14
16
  }
15
17
  export interface RenderEnvironmentOptions {
16
- text_measurement?: "deterministic";
18
+ /** Require the renderer's native portability admission; pipeline selection alone is not strict. */
19
+ theme_portability?: "best-effort" | "require-portable";
20
+ text_measurement?: "deterministic" | null;
17
21
  math_renderer?: "none" | "ratex";
18
22
  }
19
23
  /**
@@ -38,33 +42,66 @@ export interface RuntimeCatalog {
38
42
  registry: RuntimeRegistryContract;
39
43
  resources: RuntimeResourceContract;
40
44
  }
41
- export interface PresentationCatalog {
45
+ export interface ThemeCatalog {
42
46
  schema_version: 1;
43
- theme_presets: PresentationThemePresetCatalogEntry[];
44
- profiles: PresentationProfileCatalogEntry[];
45
- }
46
- export interface PresentationThemePresetCatalogEntry {
47
+ structured_spec_available: boolean;
48
+ supported_output_ids: string[];
49
+ presets: ThemePresetCatalogEntry[];
50
+ known_capability_ids: string[];
51
+ known_text_capability_ids: string[];
52
+ known_font_container_ids: string[];
53
+ known_font_source_ids: string[];
54
+ known_semantic_target_ids: string[];
55
+ known_variant_ids: string[];
56
+ resource_limits: ThemeResourceLimitCatalogEntry[];
57
+ }
58
+ export interface ThemePresetCatalogEntry {
47
59
  id: string;
60
+ display_name: string;
48
61
  appearance: string;
49
- fully_available: boolean;
50
- missing_capability_ids: string[];
51
- }
52
- export interface PresentationProfileCatalogEntry {
62
+ maturity: string;
63
+ available: boolean;
64
+ availability_reason_ids: string[];
65
+ /** Ordered color swatches for discovery, not a rendered palette or support claim. */
66
+ preview_colors: string[];
67
+ /** Curated design scope, independent of technical support or qualification. */
68
+ family_designs: ThemePresetFamilyDesign[];
69
+ /** Curated visual guidance; recommendations require an explicit host/user decision. */
70
+ application_notes: ThemePresetApplicationNote[];
71
+ qualified_cells: ThemePresetQualifiedCell[];
72
+ license_expression: string;
73
+ required_attribution: string | null;
74
+ export_kind: "design" | "complete_spec";
75
+ }
76
+ /** Missing families and unknown treatments are unreviewed; preserve unknown IDs. */
77
+ export interface ThemePresetFamilyDesign {
78
+ family_id: string;
79
+ /** Open string: dedicated, base_only, or unreviewed. None grants portability. */
80
+ treatment: string;
81
+ }
82
+ /** Open discovery guidance for a family; presence grants no support or qualification. */
83
+ export interface ThemePresetApplicationNote {
53
84
  id: string;
54
- fully_available: boolean;
55
- missing_capability_ids: string[];
56
- aspects: PresentationAspectCatalogEntry[];
57
- }
58
- export interface PresentationAspectCatalogEntry {
85
+ family_id: string;
86
+ message: string;
87
+ /** Suggested Mermaid site configuration. Never applied by preset selection itself. */
88
+ recommended_config: Record<string, unknown> | null;
89
+ }
90
+ /** Scoped metadata backed by catalog qualification, not an unconditional portability claim. */
91
+ export interface ThemePresetQualifiedCell {
92
+ family_id: string;
93
+ output_id: string;
94
+ /** Scenario and resource conditions. Unknown profiles do not grant usable support. */
95
+ profile_id: string;
96
+ /** Open target admission ID; for example `portable` or `host_dependent`. */
97
+ admission_status: string;
98
+ }
99
+ export interface ThemeResourceLimitCatalogEntry {
59
100
  id: string;
60
- applicability: PresentationAspectApplicability;
61
- required_capability_id: string | null;
62
- available: boolean;
63
- missing_capability_ids: string[];
64
- }
65
- export interface PresentationAspectApplicability {
66
- kind: string;
67
- family_id: string | null;
101
+ phase: string;
102
+ description: string;
103
+ effective_value: number | null;
104
+ hard_cap: boolean;
68
105
  }
69
106
  export interface RuntimePayloadSchema {
70
107
  [key: string]: unknown;
@@ -149,27 +186,500 @@ export interface RuntimeResourceProfile {
149
186
  export interface SvgOptions {
150
187
  diagram_id?: string;
151
188
  pipeline?: "parity" | "readable" | "resvg-safe";
152
- scoped_css?: string;
153
- css_override_policy?: "preserve" | "strip-existing-important";
154
189
  root_background_color?: string;
155
190
  drop_native_duplicate_fallbacks?: boolean;
156
191
  viewbox_padding?: number;
157
192
  viewBoxPadding?: number;
158
193
  }
159
- export type PresentationThemeAppearance = "light" | "dark";
160
- export interface PresentationThemeOptions {
161
- preset?: string;
162
- appearance?: PresentationThemeAppearance;
163
- font_family?: string;
164
- font_size?: string;
165
- roles?: Record<string, string>;
166
- series_palette?: string[];
194
+ /** A named preset, direct specification, or shareable recipe. Select exactly one form. */
195
+ export type DiagramThemeSelection = ({
196
+ kind?: never;
197
+ schema_version?: never;
198
+ design?: never;
199
+ complete_spec?: never;
200
+ } & ({
201
+ preset: string;
202
+ spec?: never;
203
+ } | {
204
+ preset?: never;
205
+ spec: DiagramThemeSpec;
206
+ })) | ThemeRecipeV1;
207
+ /** A literal or an exact document-local token reference; dots have no traversal meaning. */
208
+ export type ThemeValueV1<T> = T | ThemeReferenceV1;
209
+ export interface ThemeReferenceV1 {
210
+ ref: string;
211
+ }
212
+ /** An editable design. Only clearable style fields accept explicit null. */
213
+ export interface ThemeDesignV1 {
214
+ tokens?: Record<string, ThemeDesignTokenV1>;
215
+ styles?: Record<string, ThemeDesignStyleV1>;
216
+ rules?: ThemeDesignRuleV1[];
217
+ palettes?: Record<string, ThemeValueV1<ThemeValueV1<string>[]>>;
218
+ canvas?: ThemeDesignCanvasV1;
219
+ typography?: ThemeDesignTypographyV1;
220
+ mermaid?: MermaidThemeCompatibility;
221
+ assets?: ThemeAssetsSpec;
222
+ requirements?: ThemeRequirementsSpec;
223
+ }
224
+ export type ThemeDesignTokenV1 = {
225
+ label?: string;
226
+ description?: string;
227
+ group?: string;
228
+ } & ({
229
+ type: "color";
230
+ value: ThemeValueV1<string>;
231
+ } | {
232
+ type: "number";
233
+ value: ThemeValueV1<number>;
234
+ } | {
235
+ type: "string";
236
+ value: ThemeValueV1<string>;
237
+ } | {
238
+ type: "length";
239
+ value: ThemeValueV1<ThemeLength>;
240
+ } | {
241
+ type: "insets";
242
+ value: ThemeValueV1<ThemeInsets>;
243
+ } | {
244
+ type: "line-height";
245
+ value: ThemeValueV1<ThemeLineHeight>;
246
+ } | {
247
+ type: "font-stack";
248
+ value: ThemeValueV1<string[]>;
249
+ } | {
250
+ type: "palette";
251
+ value: ThemeValueV1<ThemeValueV1<string>[]>;
252
+ } | {
253
+ type: "paint";
254
+ value: ThemeValueV1<ThemeDesignPaintV1>;
255
+ } | {
256
+ type: "stroke";
257
+ value: ThemeValueV1<ThemeDesignStrokeV1>;
258
+ } | {
259
+ type: "text-style";
260
+ value: ThemeValueV1<ThemeDesignTextStyleV1>;
261
+ } | {
262
+ type: "effect";
263
+ value: ThemeValueV1<ThemeDesignEffectV1>;
264
+ });
265
+ export interface ThemeDesignRuleV1 {
266
+ target: string;
267
+ family?: string;
268
+ variant?: string;
269
+ ordinal?: ThemeRuleEntry["ordinal"];
270
+ style: ThemeDesignStyleV1;
271
+ }
272
+ export interface ThemeDesignStyleV1 {
273
+ fill?: ThemePatch<ThemeValueV1<ThemeDesignPaintV1>>;
274
+ opacity?: ThemePatch<ThemeValueV1<number>>;
275
+ fill_opacity?: ThemePatch<ThemeValueV1<number>>;
276
+ stroke?: ThemeValueV1<ThemeDesignStrokeV1>;
277
+ radius?: ThemePatch<ThemeValueV1<ThemeLength>>;
278
+ padding?: ThemePatch<ThemeValueV1<ThemeInsets>>;
279
+ typography?: ThemeValueV1<ThemeDesignTextStyleV1>;
280
+ effect?: ThemePatch<ThemeValueV1<ThemeDesignEffectV1>>;
281
+ }
282
+ export interface ThemeDesignStrokeV1 {
283
+ paint?: ThemePatch<ThemeValueV1<ThemeDesignPaintV1>>;
284
+ width?: ThemePatch<ThemeValueV1<ThemeLength>>;
285
+ dasharray?: ThemePatch<ThemeValueV1<number>[]>;
286
+ linecap?: ThemePatch<ThemeValueV1<"butt" | "round" | "square">>;
287
+ linejoin?: ThemePatch<ThemeValueV1<"miter" | "round" | "bevel">>;
288
+ opacity?: ThemePatch<ThemeValueV1<number>>;
289
+ }
290
+ export interface ThemeDesignTextStyleV1 {
291
+ font_stack?: ThemePatch<ThemeValueV1<string[]>>;
292
+ font_size_px?: ThemePatch<ThemeValueV1<ThemeLength>>;
293
+ font_weight?: ThemePatch<ThemeValueV1<number>>;
294
+ font_style?: ThemePatch<ThemeValueV1<"normal" | "italic" | "oblique">>;
295
+ line_height?: ThemePatch<ThemeValueV1<ThemeLineHeight>>;
296
+ letter_spacing_px?: ThemePatch<ThemeValueV1<ThemeLength>>;
297
+ word_spacing_px?: ThemePatch<ThemeValueV1<ThemeLength>>;
298
+ transform?: ThemePatch<ThemeValueV1<"none" | "uppercase" | "lowercase" | "capitalize">>;
299
+ decoration?: ThemePatch<ThemeValueV1<"none" | "underline" | "overline" | "line-through">>;
300
+ text_align?: ThemePatch<ThemeValueV1<"start" | "center" | "end">>;
301
+ white_space?: ThemePatch<ThemeValueV1<"normal" | "pre" | "no-wrap" | "pre-wrap" | "pre-line">>;
302
+ wrap?: ThemePatch<ThemeValueV1<"normal" | "break-word" | "anywhere">>;
303
+ }
304
+ export interface ThemeDesignTypographyV1 {
305
+ default?: ThemeValueV1<ThemeDesignTextStyleV1>;
306
+ families?: Record<string, ThemeValueV1<ThemeDesignTextStyleV1>>;
307
+ }
308
+ export type ThemeDesignPaintV1 = string | {
309
+ kind: "transparent";
310
+ } | {
311
+ kind: "solid";
312
+ color: ThemeValueV1<string>;
313
+ } | {
314
+ kind: "linear-gradient";
315
+ angle_degrees: ThemeValueV1<number>;
316
+ stops: ThemeDesignGradientStopV1[];
317
+ repetition?: ThemeLinearGradientRepetition;
318
+ } | {
319
+ kind: "radial-gradient";
320
+ center_x: ThemeValueV1<ThemeLength>;
321
+ center_y: ThemeValueV1<ThemeLength>;
322
+ radius: ThemeValueV1<ThemeLength>;
323
+ stops: ThemeDesignGradientStopV1[];
324
+ repetition?: ThemeRadialGradientRepetition;
325
+ } | {
326
+ /** Acceptance preserves the request; it does not establish pattern renderer support. */
327
+ kind: "pattern";
328
+ pattern: "dots" | "grid" | "stripes";
329
+ cell_width: ThemeValueV1<ThemeLength>;
330
+ cell_height: ThemeValueV1<ThemeLength>;
331
+ foreground: ThemeValueV1<string>;
332
+ background?: ThemeValueV1<string>;
333
+ angle_degrees?: ThemeValueV1<number>;
334
+ };
335
+ export interface ThemeDesignGradientStopV1 {
336
+ offset: ThemeValueV1<number>;
337
+ color: ThemeValueV1<string>;
338
+ opacity?: ThemeValueV1<number>;
339
+ }
340
+ export interface ThemeDesignCanvasV1 {
341
+ base?: ThemeValueV1<ThemeDesignPaintV1>;
342
+ layers?: ThemeDesignCanvasLayerV1[];
343
+ bleed?: ThemeValueV1<ThemeInsets>;
344
+ }
345
+ export interface ThemeDesignCanvasLayerV1 {
346
+ paint: ThemeValueV1<ThemeDesignPaintV1>;
347
+ opacity?: ThemeValueV1<number>;
348
+ blend_mode?: ThemeCanvasLayer["blend_mode"];
349
+ offset_x?: ThemeValueV1<ThemeLength>;
350
+ offset_y?: ThemeValueV1<ThemeLength>;
351
+ }
352
+ export type ThemeShadowCompositionV1 = "independent" | "cascade";
353
+ export type ThemeDesignEffectV1 = {
354
+ kind: "shadow-stack";
355
+ composition: ThemeShadowCompositionV1;
356
+ color_space?: "linear-rgb" | "srgb";
357
+ shadows: ThemeDesignShadowV1[];
358
+ } | {
359
+ kind: "graph";
360
+ color_space?: "linear-rgb" | "srgb";
361
+ primitives: ThemeEffectPrimitive[];
362
+ };
363
+ export interface ThemeDesignShadowV1 {
364
+ offset_x: ThemeValueV1<ThemeLength>;
365
+ offset_y: ThemeValueV1<ThemeLength>;
366
+ /** Gaussian standard deviation in pixels; zero produces a hard shadow. */
367
+ std_deviation: ThemeValueV1<ThemeLength>;
368
+ color: ThemeValueV1<string>;
369
+ opacity?: ThemeValueV1<number>;
370
+ }
371
+ export interface MaterializedThemeWireV1 {
372
+ schema_version: 1;
373
+ authoring_schema_version: 1;
374
+ expansion_version: 1;
375
+ spec_schema_version: 1;
376
+ spec: DiagramThemeSpec;
377
+ /** Declared authoring references and consumer constraints; this is not a winning-rule trace. */
378
+ references?: ThemeDesignReferenceUse[];
379
+ }
380
+ export interface ThemeDesignValueDomain {
381
+ value_type: ThemeDesignTokenV1["type"];
382
+ choices?: string[];
383
+ units?: string[];
384
+ min?: number;
385
+ max?: number;
386
+ }
387
+ export interface ThemeDesignReferenceUse {
388
+ token: string;
389
+ /** JSON Pointer to the authored consumer. */
390
+ path: string;
391
+ domain: ThemeDesignValueDomain;
392
+ }
393
+ export interface ThemeDesignInspection {
394
+ references: ThemeDesignReferenceUse[];
395
+ }
396
+ export type ThemeSupportOutputId = "standalone-svg" | "browser-svg" | "png" | "jpeg" | "pdf" | "ascii" | (string & {});
397
+ declare const themeSupportUnknownSubjectKind: unique symbol;
398
+ /**
399
+ * A subject kind not understood by this Web contract revision.
400
+ *
401
+ * The brand prevents an incomplete known subject such as `{ kind: "rule" }` from falling through
402
+ * to the forward-compatible branch. Values decoded from a newer runtime can retain their unknown
403
+ * kind, while authored known subjects remain checked against their exact required fields.
404
+ */
405
+ export type ThemeSupportUnknownSubjectKindV1 = string & {
406
+ readonly [themeSupportUnknownSubjectKind]: "unknown-theme-support-subject";
407
+ };
408
+ export type ThemeSupportUnknownSubjectV1 = {
409
+ kind: ThemeSupportUnknownSubjectKindV1;
410
+ } & Record<string, unknown>;
411
+ export type ThemeSupportSubjectV1 = {
412
+ kind: "rule";
413
+ target: string;
414
+ facet: string;
415
+ } | {
416
+ kind: "ordinal-palette";
417
+ target: string;
418
+ } | {
419
+ kind: "base-typography";
420
+ property: string;
421
+ } | ThemeSupportUnknownSubjectV1;
422
+ export interface ThemeSupportQueryV1 {
423
+ schema_version: 1;
424
+ family: string;
425
+ output: ThemeSupportOutputId;
426
+ subject: ThemeSupportSubjectV1;
427
+ }
428
+ export type ThemeSupportState = "unconditional" | "conditional" | "not-applicable" | "unsupported" | "unverified";
429
+ export interface ThemeCapabilityDescriptorV1 {
430
+ schema_version: 1;
431
+ claim_revision: number;
432
+ query: ThemeSupportQueryV1;
433
+ state: ThemeSupportState;
434
+ reason_ids: string[];
167
435
  }
168
- export interface PresentationOptions {
169
- profile?: string;
170
- theme?: PresentationThemeOptions;
436
+ export type ThemeCapabilityDescriptor = ThemeCapabilityDescriptorV1;
437
+ /**
438
+ * A versioned theme document that can be saved as JSON and passed directly as options.theme.
439
+ * A recipe describes authored styles; it does not certify every family or output target.
440
+ */
441
+ export type ThemeRecipeV1 = {
442
+ schema_version: 1;
443
+ preset?: never;
444
+ spec?: never;
445
+ } & ({
446
+ kind: "design";
447
+ design: ThemeDesignV1;
448
+ complete_spec?: never;
449
+ } | {
450
+ kind: "complete_spec";
451
+ complete_spec: DiagramThemeSpec;
452
+ design?: never;
453
+ });
454
+ export interface DiagramThemeSpec {
455
+ mermaid?: MermaidThemeCompatibility;
456
+ typography?: ThemeTypographySpec;
457
+ styles?: ThemeStyleEntry[];
458
+ canvas?: ThemeCanvasSpec;
459
+ effects?: ThemeEffectEntry[];
460
+ requirements?: ThemeRequirementsSpec;
461
+ assets?: ThemeAssetsSpec;
462
+ }
463
+ export interface MermaidThemeCompatibility {
464
+ theme?: ThemeName;
465
+ dark_mode?: boolean;
466
+ variables?: Record<string, string | number | boolean>;
467
+ }
468
+ export interface ThemeTypographySpec {
469
+ default?: ThemeTextStyle;
470
+ families?: Record<string, ThemeTextStyle>;
471
+ }
472
+ export interface ThemeTextStyle {
473
+ font_stack?: string[];
474
+ font_size_px?: number;
475
+ font_weight?: number;
476
+ font_style?: "normal" | "italic" | "oblique";
477
+ line_height?: ThemeLineHeight;
478
+ letter_spacing_px?: number;
479
+ word_spacing_px?: number;
480
+ transform?: "none" | "uppercase" | "lowercase" | "capitalize";
481
+ decoration?: "none" | "underline" | "overline" | "line-through";
482
+ text_align?: "start" | "center" | "end";
483
+ white_space?: "normal" | "pre" | "no-wrap" | "pre-wrap" | "pre-line";
484
+ wrap?: "normal" | "break-word" | "anywhere";
485
+ }
486
+ export type ThemeLineHeight = "normal" | number | {
487
+ px: number;
488
+ };
489
+ export type ThemePatch<T> = T | null;
490
+ export type ThemeLength = number | {
491
+ px: number;
492
+ } | {
493
+ percent: number;
494
+ };
495
+ export type ThemeInsets = number | {
496
+ top: number;
497
+ right: number;
498
+ bottom: number;
499
+ left: number;
500
+ };
501
+ export type ThemePaint = string | {
502
+ kind: "transparent";
503
+ } | {
504
+ kind: "solid";
505
+ color: string;
506
+ } | {
507
+ kind: "linear-gradient";
508
+ angle_degrees: number;
509
+ stops: ThemeGradientStop[];
510
+ repetition?: ThemeLinearGradientRepetition;
511
+ } | {
512
+ kind: "radial-gradient";
513
+ center_x: ThemeLength;
514
+ center_y: ThemeLength;
515
+ radius: ThemeLength;
516
+ stops: ThemeGradientStop[];
517
+ repetition?: ThemeRadialGradientRepetition;
518
+ } | {
519
+ kind: "pattern";
520
+ pattern: "dots" | "grid" | "stripes";
521
+ cell_width: number;
522
+ cell_height: number;
523
+ foreground: string;
524
+ background?: string;
525
+ angle_degrees?: number;
526
+ };
527
+ export type ThemeLinearGradientRepetition = {
528
+ kind: "repeating";
529
+ period_px: number;
530
+ } | {
531
+ kind: "tiled";
532
+ width_px: number;
533
+ height_px: number;
534
+ };
535
+ export type ThemeRadialGradientRepetition = {
536
+ kind: "repeating";
537
+ } | {
538
+ kind: "tiled";
539
+ width_px: number;
540
+ height_px: number;
541
+ };
542
+ export interface ThemeGradientStop {
543
+ offset: number;
544
+ color: string;
545
+ }
546
+ export type ThemeStyleEntry = ThemeRuleEntry | ThemeOrdinalPaletteEntry;
547
+ export interface ThemeRuleEntry {
548
+ kind: "rule";
549
+ target: string;
550
+ family?: string;
551
+ variant?: string;
552
+ ordinal?: {
553
+ exact: number;
554
+ } | {
555
+ cycle: {
556
+ period: number;
557
+ offset: number;
558
+ };
559
+ };
560
+ style: ThemeStylePatch;
561
+ }
562
+ export interface ThemeOrdinalPaletteEntry {
563
+ kind: "ordinal-palette";
564
+ target: string;
565
+ colors: string[];
566
+ }
567
+ export interface ThemeStylePatch {
568
+ fill?: ThemePatch<ThemePaint>;
569
+ opacity?: ThemePatch<number>;
570
+ fill_opacity?: ThemePatch<number>;
571
+ stroke?: ThemeStrokePatch;
572
+ radius?: ThemePatch<number>;
573
+ padding?: ThemePatch<ThemeInsets>;
574
+ typography?: ThemeTextStylePatch;
575
+ effect?: ThemePatch<string>;
576
+ }
577
+ export interface ThemeStrokePatch {
578
+ paint?: ThemePatch<ThemePaint>;
579
+ width?: ThemePatch<number>;
580
+ dasharray?: ThemePatch<number[]>;
581
+ linecap?: ThemePatch<"butt" | "round" | "square">;
582
+ linejoin?: ThemePatch<"miter" | "round" | "bevel">;
583
+ opacity?: ThemePatch<number>;
584
+ }
585
+ export interface ThemeTextStylePatch {
586
+ font_stack?: ThemePatch<string[]>;
587
+ font_size_px?: ThemePatch<number>;
588
+ font_weight?: ThemePatch<number>;
589
+ font_style?: ThemePatch<"normal" | "italic" | "oblique">;
590
+ line_height?: ThemePatch<ThemeLineHeight>;
591
+ letter_spacing_px?: ThemePatch<number>;
592
+ word_spacing_px?: ThemePatch<number>;
593
+ transform?: ThemePatch<"none" | "uppercase" | "lowercase" | "capitalize">;
594
+ decoration?: ThemePatch<"none" | "underline" | "overline" | "line-through">;
595
+ text_align?: ThemePatch<"start" | "center" | "end">;
596
+ white_space?: ThemePatch<"normal" | "pre" | "no-wrap" | "pre-wrap" | "pre-line">;
597
+ wrap?: ThemePatch<"normal" | "break-word" | "anywhere">;
598
+ }
599
+ export interface ThemeCanvasSpec {
600
+ base?: ThemePaint;
601
+ layers?: ThemeCanvasLayer[];
602
+ bleed?: ThemeInsets;
603
+ }
604
+ export interface ThemeCanvasLayer {
605
+ paint: ThemePaint;
606
+ opacity?: number;
607
+ blend_mode?: "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "difference";
608
+ offset_x?: number;
609
+ offset_y?: number;
610
+ }
611
+ export type ThemeEffectEntry = ThemeEffectGraph | ThemeEffectBinding;
612
+ export interface ThemeEffectGraph {
613
+ kind: "graph";
614
+ id: string;
615
+ /** Color interpolation for all primitives; defaults to linear-rgb when omitted. */
616
+ color_space?: "linear-rgb" | "srgb";
617
+ /** Independent composition accepts only drop-shadow primitives reading source-graphic. */
618
+ composition?: ThemeShadowCompositionV1;
619
+ primitives: ThemeEffectPrimitive[];
620
+ }
621
+ export interface ThemeEffectBinding {
622
+ kind: "binding";
623
+ target: string;
624
+ effect_id: string;
625
+ }
626
+ export type ThemeEffectInput = "source-graphic" | "previous";
627
+ export type ThemeEffectPrimitive = {
628
+ kind: "drop-shadow";
629
+ input?: ThemeEffectInput;
630
+ offset_x: number;
631
+ offset_y: number;
632
+ blur_radius: number;
633
+ spread: number;
634
+ color: string;
635
+ } | {
636
+ kind: "gaussian-blur";
637
+ input?: ThemeEffectInput;
638
+ std_deviation: number;
639
+ } | {
640
+ kind: "color-matrix";
641
+ input?: ThemeEffectInput;
642
+ values: number[];
643
+ } | {
644
+ kind: "turbulence";
645
+ input?: ThemeEffectInput;
646
+ base_frequency_x: number;
647
+ base_frequency_y: number;
648
+ octaves: number;
649
+ seed: number;
650
+ } | {
651
+ kind: "displacement";
652
+ input?: ThemeEffectInput;
653
+ map_input: ThemeEffectInput;
654
+ scale: number;
655
+ };
656
+ export interface ThemeRequirementsSpec {
657
+ capabilities?: string[];
658
+ text_capabilities?: string[];
659
+ }
660
+ export interface ThemeAssetsSpec {
661
+ fonts?: ThemeFontAsset[];
662
+ aliases?: Array<{
663
+ alias: string;
664
+ target: string;
665
+ }>;
666
+ generic_families?: Array<{
667
+ generic: string;
668
+ target: string;
669
+ }>;
670
+ available_sources?: Array<"embedded" | "system">;
671
+ embedding?: "none" | "full-font" | "subset";
672
+ }
673
+ export interface ThemeFontAsset {
674
+ id: string;
675
+ format: "truetype" | "opentype" | "collection" | "woff2";
676
+ data_base64: string;
677
+ }
678
+ export interface MermaidSiteConfig {
679
+ [key: string]: unknown;
680
+ themeCSS?: never;
681
+ secure?: never;
171
682
  }
172
- export type MermaidSiteConfig = Record<string, unknown>;
173
683
  export interface AnalysisBindingOptions {
174
684
  fixed_today?: string;
175
685
  fixed_local_offset_minutes?: number;
@@ -188,24 +698,24 @@ export type EditorAnalysisBindingOptions = Omit<AnalysisBindingOptions, "resourc
188
698
  resources?: EditorResourceOptions;
189
699
  };
190
700
  interface BindingVersionOptions {
191
- version?: 2;
701
+ version?: typeof BINDING_OPTIONS_SCHEMA_VERSION;
192
702
  }
193
- type NoDirectAnalysisBindingOptions<Options extends AnalysisBindingOptions> = {
703
+ type NoDirectAnalysisBindingOptions<Options extends Omit<AnalysisBindingOptions, "resources">> = {
194
704
  [Property in keyof Options]?: never;
195
705
  };
196
- type DirectAnalysisBindingRoot<Options extends AnalysisBindingOptions> = Options & {
706
+ type DirectAnalysisBindingRoot<Options extends Omit<AnalysisBindingOptions, "resources">> = Options & {
197
707
  analysis?: never;
198
708
  merman?: never;
199
709
  };
200
- type AnalysisWrappedBindingRoot<Options extends AnalysisBindingOptions> = NoDirectAnalysisBindingOptions<Options> & {
710
+ type AnalysisWrappedBindingRoot<Options extends Omit<AnalysisBindingOptions, "resources">> = NoDirectAnalysisBindingOptions<Options> & {
201
711
  analysis: Options;
202
712
  merman?: never;
203
713
  };
204
- type MermanWrappedBindingRoot<Options extends AnalysisBindingOptions> = NoDirectAnalysisBindingOptions<Options> & {
714
+ type MermanWrappedBindingRoot<Options extends Omit<AnalysisBindingOptions, "resources">> = NoDirectAnalysisBindingOptions<Options> & {
205
715
  analysis?: never;
206
716
  merman: Options;
207
717
  };
208
- type AnalysisBindingRoot<Options extends AnalysisBindingOptions> = (DirectAnalysisBindingRoot<Options> | AnalysisWrappedBindingRoot<Options> | MermanWrappedBindingRoot<Options>);
718
+ type AnalysisBindingRoot<Options extends Omit<AnalysisBindingOptions, "resources">> = (DirectAnalysisBindingRoot<Options> | AnalysisWrappedBindingRoot<Options> | MermanWrappedBindingRoot<Options>);
209
719
  export type EditorBindingOptions = BindingVersionOptions & AnalysisBindingRoot<EditorAnalysisBindingOptions>;
210
720
  interface CommonBindingFields {
211
721
  parse?: ParseOptions;
@@ -284,12 +794,100 @@ interface AsciiBindingFields {
284
794
  }
285
795
  export type AsciiBindingOptions = CommonBindingOptions & AsciiBindingFields;
286
796
  interface SvgBindingFields {
287
- presentation?: PresentationOptions;
797
+ /** Relative deadline for this Web/WASM operation, in milliseconds. */
798
+ timeout_ms?: number;
799
+ theme?: DiagramThemeSelection | null;
288
800
  environment?: RenderEnvironmentOptions;
289
801
  layout?: LayoutOptions;
290
802
  svg?: SvgOptions;
291
803
  }
292
804
  export type SvgBindingOptions = CommonBindingOptions & SvgBindingFields;
805
+ /** Already loaded Iconify JSON; acquisition and credentials belong to the host. */
806
+ export interface LoadedIconPack {
807
+ json: string;
808
+ registrationName?: string;
809
+ }
810
+ export interface RenderSessionOptions {
811
+ iconPacks?: readonly LoadedIconPack[];
812
+ }
813
+ /** Immutable constructor services, scoped to this session and its creating package runtime. */
814
+ export interface BrowserRenderSession {
815
+ renderSvg(source: string, options?: SvgBindingOptions | string): string;
816
+ renderSvgResult(source: string, options?: SvgBindingOptions | string): SvgRenderResult;
817
+ layoutJson(source: string, options?: SvgBindingOptions | string): string;
818
+ edgeGeometryJson(source: string, options?: SvgBindingOptions | string): string;
819
+ renderSvgWithTextMeasurer(source: string, measurer: HostTextMeasurer, options?: HostTextMeasurerSvgBindingOptions | string): string;
820
+ renderSvgResultWithTextMeasurer(source: string, measurer: HostTextMeasurer, options?: HostTextMeasurerSvgBindingOptions | string): SvgRenderResult;
821
+ layoutJsonWithTextMeasurer(source: string, measurer: HostTextMeasurer, options?: HostTextMeasurerSvgBindingOptions | string): string;
822
+ edgeGeometryJsonWithTextMeasurer(source: string, measurer: HostTextMeasurer, options?: HostTextMeasurerSvgBindingOptions | string): string;
823
+ dispose(): void;
824
+ }
825
+ export interface WasmRenderSessionBinding {
826
+ renderSvg(source: string, optionsJson?: string | null): string;
827
+ renderSvgResult(source: string, optionsJson?: string | null): SvgRenderResult;
828
+ layoutJson(source: string, optionsJson?: string | null): string;
829
+ edgeGeometryJson(source: string, optionsJson?: string | null): string;
830
+ renderSvgWithTextMeasurer(source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer): string;
831
+ renderSvgResultWithTextMeasurer(source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer): SvgRenderResult;
832
+ layoutJsonWithTextMeasurer(source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer): string;
833
+ edgeGeometryJsonWithTextMeasurer(source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer): string;
834
+ free(): void;
835
+ }
836
+ export interface WasmRenderSessionConstructor {
837
+ new (iconPacksJson?: string | null): WasmRenderSessionBinding;
838
+ }
839
+ /** Redraw settings for frozen parse facts. Prepare again to change configuration or theme. */
840
+ export type PreparedSourceOutputOptions = BindingVersionOptions & {
841
+ /** Relative deadline for this output, in milliseconds. */
842
+ timeout_ms?: number;
843
+ resources?: ResourceOptions;
844
+ environment?: RenderEnvironmentOptions;
845
+ layout?: LayoutOptions;
846
+ svg?: SvgOptions;
847
+ };
848
+ export type HostTextMeasurerPreparedSourceOutputOptions = Omit<PreparedSourceOutputOptions, "environment"> & {
849
+ environment?: Omit<RenderEnvironmentOptions, "text_measurement">;
850
+ };
851
+ export interface BrowserPreparedSource {
852
+ renderSvg(options?: PreparedSourceOutputOptions | string): string;
853
+ renderSvgResult(options?: PreparedSourceOutputOptions | string): SvgRenderResult;
854
+ layoutJson(options?: PreparedSourceOutputOptions | string): string;
855
+ edgeGeometryJson(options?: PreparedSourceOutputOptions | string): string;
856
+ renderSvgWithTextMeasurer(measurer: HostTextMeasurer, options?: HostTextMeasurerPreparedSourceOutputOptions | string): string;
857
+ renderSvgResultWithTextMeasurer(measurer: HostTextMeasurer, options?: HostTextMeasurerPreparedSourceOutputOptions | string): SvgRenderResult;
858
+ layoutJsonWithTextMeasurer(measurer: HostTextMeasurer, options?: HostTextMeasurerPreparedSourceOutputOptions | string): string;
859
+ edgeGeometryJsonWithTextMeasurer(measurer: HostTextMeasurer, options?: HostTextMeasurerPreparedSourceOutputOptions | string): string;
860
+ dispose(): void;
861
+ }
862
+ export interface WasmPreparedSourceBinding {
863
+ renderSvg(optionsJson?: string | null): string;
864
+ renderSvgResult(optionsJson?: string | null): SvgRenderResult;
865
+ layoutJson(optionsJson?: string | null): string;
866
+ edgeGeometryJson(optionsJson?: string | null): string;
867
+ renderSvgWithTextMeasurer(optionsJson: string | null | undefined, measurer: HostTextMeasurer): string;
868
+ renderSvgResultWithTextMeasurer(optionsJson: string | null | undefined, measurer: HostTextMeasurer): SvgRenderResult;
869
+ layoutJsonWithTextMeasurer(optionsJson: string | null | undefined, measurer: HostTextMeasurer): string;
870
+ edgeGeometryJsonWithTextMeasurer(optionsJson: string | null | undefined, measurer: HostTextMeasurer): string;
871
+ free(): void;
872
+ }
873
+ export interface WasmPreparedSourceConstructor {
874
+ new (source: string, optionsJson?: string | null): WasmPreparedSourceBinding;
875
+ }
876
+ export type ThemeResourceLimitId = "max_theme_encoded_bytes" | "max_theme_base64_bytes" | "max_font_asset_compressed_bytes" | "max_font_asset_decoded_bytes" | "max_font_catalog_decoded_bytes" | "max_font_assets" | "max_font_faces" | "max_font_tables" | "max_font_aliases" | "max_font_decoded_expansion_ratio" | "max_effect_graphs" | "max_effect_primitives_per_graph" | "max_effect_bindings" | "max_effect_offset_magnitude" | "max_effect_filter_region_magnitude" | "max_effect_blur_magnitude" | "max_effect_displacement_scale" | "max_effect_turbulence_octaves";
877
+ export interface ThemeAuthoringResourceOptions {
878
+ profile?: ResourceProfile;
879
+ limits?: Partial<Record<ThemeResourceLimitId, number>>;
880
+ }
881
+ type ThemeAuthoringAnalysisOptions = Omit<AnalysisBindingOptions, "resources"> & {
882
+ resources?: ThemeAuthoringResourceOptions;
883
+ };
884
+ export type ThemeAuthoringOptions = BindingVersionOptions & AnalysisBindingRoot<ThemeAuthoringAnalysisOptions> & CommonBindingFields & SvgBindingFields;
885
+ type HostTextMeasurerEnvironmentOptions = Omit<RenderEnvironmentOptions, "text_measurement"> & {
886
+ text_measurement?: never;
887
+ };
888
+ export type HostTextMeasurerSvgBindingOptions = CommonBindingOptions & Omit<SvgBindingFields, "environment"> & {
889
+ environment?: HostTextMeasurerEnvironmentOptions;
890
+ };
293
891
  export type BindingOptions = SvgBindingOptions;
294
892
  export interface HostTextMeasureRequest {
295
893
  operation: HostTextMeasurementOperation;
@@ -485,6 +1083,61 @@ export interface AnalysisFactsResult extends AnalysisPayloadFields {
485
1083
  version: 2;
486
1084
  diagrams: AnalysisDiagramFacts[];
487
1085
  }
1086
+ /**
1087
+ * An actual render explanation with open identifiers, not a portability certificate.
1088
+ * Rule diagnostics may describe partially applied rules; only `property`, when present, names
1089
+ * a specific property. Source paths are RFC 6901 pointers relative to the named recipe payload
1090
+ * (`design` or `complete_spec`). Generated defaults and Rust input may have no source paths.
1091
+ */
1092
+ export interface ThemeDiagnostic {
1093
+ code: string;
1094
+ subject: string;
1095
+ target?: string | null;
1096
+ property?: string | null;
1097
+ source_document?: string | null;
1098
+ source_paths: string[];
1099
+ generated: boolean;
1100
+ }
1101
+ /** Renderer-owned outcome, with open status/reason IDs for forward-compatible consumers. */
1102
+ export interface ThemeExecutionEvidenceV1 {
1103
+ version: 1;
1104
+ family_id: string;
1105
+ theme_status: string;
1106
+ output_mutated: boolean;
1107
+ target_kind: string;
1108
+ target_status: string;
1109
+ target_reason_ids: string[];
1110
+ font_source: string;
1111
+ /** Absent means not supplied. An empty list does not establish portability. */
1112
+ diagnostics?: ThemeDiagnostic[];
1113
+ }
1114
+ /** Unknown versions stay opaque. Never treat an unknown status or version as portable. */
1115
+ export type ThemeExecutionEvidence = ThemeExecutionEvidenceV1 | {
1116
+ version: number;
1117
+ [key: string]: unknown;
1118
+ };
1119
+ /** Actual family placement width, before SVG viewport scaling. */
1120
+ export interface LayoutAdaptationObservation {
1121
+ mode: "fit-width";
1122
+ requested_width: number;
1123
+ actual_width: number;
1124
+ overflowed: boolean;
1125
+ }
1126
+ /** Existing binding metadata for the exact SVG returned by the same execution. */
1127
+ export interface SvgRenderMetadata {
1128
+ version: 1;
1129
+ operation_id: "svg";
1130
+ media_type: "image/svg+xml";
1131
+ runtime_policy: string;
1132
+ byte_length: number;
1133
+ theme_execution_evidence: ThemeExecutionEvidence;
1134
+ layout_adaptation?: LayoutAdaptationObservation;
1135
+ [key: string]: unknown;
1136
+ }
1137
+ export interface SvgRenderResult {
1138
+ svg: string;
1139
+ metadata: SvgRenderMetadata;
1140
+ }
488
1141
  /**
489
1142
  * Capability plan for one SVG render request.
490
1143
  *
@@ -495,17 +1148,11 @@ export interface SvgPlanResult {
495
1148
  schema_version: 1;
496
1149
  planned_operation_id: "svg";
497
1150
  diagram_type: string;
498
- presentation_profile_id: string | null;
499
- presentation_aspects: SvgPlanPresentationAspect[];
500
1151
  required_capability_ids: string[];
501
1152
  missing_capability_ids: string[];
1153
+ supported_layout_adaptation_ids: ("none" | "fit-width")[];
502
1154
  ready: boolean;
503
1155
  }
504
- export interface SvgPlanPresentationAspect {
505
- id: string;
506
- state: string;
507
- required_capability_id: string | null;
508
- }
509
1156
  export interface AvailableDiagramDetectionFacts {
510
1157
  readonly status: "available";
511
1158
  readonly validity: "valid" | "recoverable-invalid";
@@ -686,9 +1333,13 @@ export interface MermanWasmModuleBase {
686
1333
  }
687
1334
  export interface MermanWasmModule extends MermanWasmModuleBase {
688
1335
  EditorSession?: WasmEditorSessionConstructor;
1336
+ PreparedSource?: WasmPreparedSourceConstructor;
1337
+ RenderSession?: WasmRenderSessionConstructor;
689
1338
  transportApiVersion: () => number;
690
1339
  packageVersion: () => string;
691
1340
  renderSvg: (source: string, optionsJson?: string | null) => string;
1341
+ renderSvgResult: (source: string, optionsJson?: string | null) => SvgRenderResult;
1342
+ renderSvgResultWithTextMeasurer?: (source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer) => SvgRenderResult;
692
1343
  edgeGeometryJson: (source: string, optionsJson?: string | null) => string;
693
1344
  edgeGeometryJsonWithTextMeasurer?: (source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer) => string;
694
1345
  svgPlanJson: (source: string, optionsJson?: string | null) => SvgPlanResult;
@@ -718,7 +1369,10 @@ export interface MermanWasmModule extends MermanWasmModuleBase {
718
1369
  asciiSupportedDiagrams: () => string[];
719
1370
  asciiCapabilities: () => AsciiCapability[];
720
1371
  runtimeCatalog: () => RuntimeCatalog;
721
- presentationCatalog: () => PresentationCatalog;
1372
+ themeCatalog: () => ThemeCatalog;
1373
+ materializeTheme: (designJson: string, optionsJson?: string | null) => MaterializedThemeWireV1;
1374
+ describeThemeSupport: (queryJson: string, optionsJson?: string | null) => ThemeCapabilityDescriptor;
1375
+ exportThemePreset: (presetId: string, optionsJson?: string | null) => ThemeRecipeV1;
722
1376
  diagramFamilyCapabilities: () => DiagramFamilyCapability[];
723
1377
  lintRuleCatalog?: () => LintRuleCatalogResponse;
724
1378
  supportedDiagrams: () => string[];
@@ -730,4 +1384,36 @@ export interface MermanInitOptions<Module extends MermanWasmModuleBase = MermanW
730
1384
  wasm?: MermanWasmSource | Promise<MermanWasmSource>;
731
1385
  }
732
1386
  export type MermanInitInput<Module extends MermanWasmModuleBase = MermanWasmModule> = MermanWasmLoader<Module> | MermanInitOptions<Module>;
1387
+ /** A persistent mount keeps its last successful drawing when a newer request fails. */
1388
+ export type MountedDiagramStatus = "pending" | "rendering" | "ready" | "failed" | "destroyed";
1389
+ export interface MountDiagramOptions {
1390
+ /** Frozen parse inputs and output defaults. Changing these options prepares a new snapshot. */
1391
+ prepareOptions?: SvgBindingOptions & {
1392
+ svg?: Omit<SvgOptions, "diagram_id"> & {
1393
+ diagram_id?: never;
1394
+ };
1395
+ };
1396
+ /** Fresh redraw settings. The mount owns svg.diagram_id and fit-width container_width. */
1397
+ outputOptions?: Omit<PreparedSourceOutputOptions, "svg"> & {
1398
+ svg?: Omit<SvgOptions, "diagram_id"> & {
1399
+ diagram_id?: never;
1400
+ };
1401
+ };
1402
+ /** Browser measurement is opt-in; a supplied callback uses the existing host provider. */
1403
+ textMeasurement?: "deterministic" | "browser" | HostTextMeasurer;
1404
+ onRender?: (result: SvgRenderResult, mount: MountedDiagram) => void;
1405
+ onError?: (error: unknown, mount: MountedDiagram) => void;
1406
+ }
1407
+ export interface MountedDiagram {
1408
+ readonly source: string;
1409
+ readonly result: SvgRenderResult | null;
1410
+ readonly error: unknown;
1411
+ readonly status: MountedDiagramStatus;
1412
+ /** Omitted options retain the current options; supplied options replace them completely. */
1413
+ update(source: string, options?: MountDiagramOptions): void;
1414
+ /** Refresh after external typography changes or adoption into another Document. */
1415
+ refresh(): void;
1416
+ /** Releases resources and leaves the last published DOM in place. Idempotent. */
1417
+ destroy(): void;
1418
+ }
733
1419
  //# sourceMappingURL=public-types.d.ts.map