@mermanjs/web-analysis 0.8.0-alpha.5

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 (68) hide show
  1. package/LICENSE +231 -0
  2. package/README.md +31 -0
  3. package/THIRD_PARTY_LICENSES/dompurify/LICENSE +202 -0
  4. package/THIRD_PARTY_LICENSES/mermaid/LICENSE +21 -0
  5. package/THIRD_PARTY_LICENSES/rust-cargo-dependencies.json +1237 -0
  6. package/THIRD_PARTY_LICENSES/sanitize-url/LICENSE +21 -0
  7. package/THIRD_PARTY_LICENSES/zenuml-core/LICENSE +21 -0
  8. package/THIRD_PARTY_NOTICES.md +72 -0
  9. package/artifacts/provenance.json +317 -0
  10. package/artifacts/wasm/merman_wasm.d.ts +102 -0
  11. package/artifacts/wasm/merman_wasm.js +642 -0
  12. package/artifacts/wasm/merman_wasm_bg.wasm +0 -0
  13. package/artifacts/wasm/merman_wasm_bg.wasm.d.ts +31 -0
  14. package/dist/generated/binding-contract.js +497 -0
  15. package/dist/generated/binding-contract.js.map +1 -0
  16. package/dist/generated/capability-surface.d.ts +118 -0
  17. package/dist/generated/capability-surface.d.ts.map +1 -0
  18. package/dist/generated/capability-surface.js +171 -0
  19. package/dist/generated/capability-surface.js.map +1 -0
  20. package/dist/generated/diagram-catalog.d.ts +2 -0
  21. package/dist/generated/diagram-catalog.d.ts.map +1 -0
  22. package/dist/generated/diagram-catalog.js +40 -0
  23. package/dist/generated/diagram-catalog.js.map +1 -0
  24. package/dist/generated/resource-contract.d.ts +31 -0
  25. package/dist/generated/resource-contract.d.ts.map +1 -0
  26. package/dist/generated/resource-contract.js +193 -0
  27. package/dist/generated/resource-contract.js.map +1 -0
  28. package/dist/generated/text-measurement-abi.d.ts +154 -0
  29. package/dist/generated/text-measurement-abi.d.ts.map +1 -0
  30. package/dist/generated/text-measurement-abi.js +50 -0
  31. package/dist/generated/text-measurement-abi.js.map +1 -0
  32. package/dist/generated/token-descriptor.d.ts +205 -0
  33. package/dist/generated/token-descriptor.d.ts.map +1 -0
  34. package/dist/index.d.ts +16 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/package-entries/analysis.d.ts +33 -0
  37. package/dist/package-entries/analysis.d.ts.map +1 -0
  38. package/dist/package-entries/analysis.js +67 -0
  39. package/dist/package-entries/analysis.js.map +1 -0
  40. package/dist/public-catalog.d.ts +127 -0
  41. package/dist/public-catalog.d.ts.map +1 -0
  42. package/dist/public-catalog.js +130 -0
  43. package/dist/public-catalog.js.map +1 -0
  44. package/dist/public-types.d.ts +764 -0
  45. package/dist/public-types.d.ts.map +1 -0
  46. package/dist/runtime-analysis.d.ts +11 -0
  47. package/dist/runtime-analysis.d.ts.map +1 -0
  48. package/dist/runtime-analysis.js +214 -0
  49. package/dist/runtime-analysis.js.map +1 -0
  50. package/dist/runtime-ascii.d.ts +6 -0
  51. package/dist/runtime-ascii.d.ts.map +1 -0
  52. package/dist/runtime-core.d.ts +18 -0
  53. package/dist/runtime-core.d.ts.map +1 -0
  54. package/dist/runtime-core.js +946 -0
  55. package/dist/runtime-core.js.map +1 -0
  56. package/dist/runtime-editor.d.ts +16 -0
  57. package/dist/runtime-editor.d.ts.map +1 -0
  58. package/dist/runtime-render.d.ts +13 -0
  59. package/dist/runtime-render.d.ts.map +1 -0
  60. package/dist/runtime-state.d.ts +16 -0
  61. package/dist/runtime-state.d.ts.map +1 -0
  62. package/dist/runtime-state.js +27 -0
  63. package/dist/runtime-state.js.map +1 -0
  64. package/dist/surface-runtime.js +45 -0
  65. package/dist/surface-runtime.js.map +1 -0
  66. package/dist/svg-safety.d.ts +27 -0
  67. package/dist/svg-safety.d.ts.map +1 -0
  68. package/package.json +41 -0
@@ -0,0 +1,764 @@
1
+ import type { AsciiCapability, BindingStatusCodeName, DiagramFamilyCapability, DiagramType, LintBindingOptions, LintRuleCatalogResponse, LintRuleCategory, LintRuleSeverity, RuntimeCapabilities } from "./public-catalog.js";
2
+ import type { HostTextDirection, HostTextMeasurementOperation, HostTextMeasurementPhase, HostTextWhiteSpace, HostTextWrapMode } from "./generated/text-measurement-abi.js";
3
+ import type { EditorRenamePolicy } from "./generated/token-descriptor.js";
4
+ import type { ResourceLimitId, ResourceOptions } from "./generated/resource-contract.js";
5
+ export type { HostTextDirection, HostTextMeasurementOperation, HostTextMeasurementPhase, HostTextMeasurementResultKind, HostTextWhiteSpace, HostTextWrapMode, } from "./generated/text-measurement-abi.js";
6
+ export type { ResourceOptions } from "./generated/resource-contract.js";
7
+ export interface ParseOptions {
8
+ suppress_errors?: boolean;
9
+ }
10
+ export interface LayoutOptions {
11
+ container_width?: number;
12
+ container_height?: number;
13
+ screen_available_width?: number;
14
+ }
15
+ export interface RenderEnvironmentOptions {
16
+ text_measurement?: "vendored" | "parity" | "deterministic";
17
+ math_renderer?: "none" | "ratex";
18
+ }
19
+ /**
20
+ * Current capabilities and policies exposed by the loaded browser artifact.
21
+ *
22
+ * Stable ID arrays are sorted and unique. Consumers must tolerate IDs introduced by newer
23
+ * artifacts and should make decisions only from the relations present in this catalog.
24
+ */
25
+ export interface RuntimeCatalog {
26
+ [key: string]: unknown;
27
+ schema_version: 1;
28
+ transport_api_version: number;
29
+ package_version: string;
30
+ options_schema_versions: number[];
31
+ payload_schemas: RuntimePayloadSchema[];
32
+ metadata_ids: string[];
33
+ option_group_ids: string[];
34
+ constructor_service_ids: string[];
35
+ constructor_service_contracts: RuntimeConstructorServiceContract[];
36
+ capabilities: RuntimeCapabilities;
37
+ output_contracts: RuntimeOutputContract[];
38
+ registry: RuntimeRegistryContract;
39
+ resources: RuntimeResourceContract;
40
+ }
41
+ export interface PresentationCatalog {
42
+ schema_version: 1;
43
+ theme_presets: PresentationThemePresetCatalogEntry[];
44
+ profiles: PresentationProfileCatalogEntry[];
45
+ }
46
+ export interface PresentationThemePresetCatalogEntry {
47
+ id: string;
48
+ appearance: string;
49
+ fully_available: boolean;
50
+ missing_capability_ids: string[];
51
+ }
52
+ export interface PresentationProfileCatalogEntry {
53
+ id: string;
54
+ fully_available: boolean;
55
+ missing_capability_ids: string[];
56
+ aspects: PresentationAspectCatalogEntry[];
57
+ }
58
+ export interface PresentationAspectCatalogEntry {
59
+ 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;
68
+ }
69
+ export interface RuntimePayloadSchema {
70
+ [key: string]: unknown;
71
+ id: string;
72
+ version: number;
73
+ }
74
+ export interface RuntimeRegistryContract {
75
+ [key: string]: unknown;
76
+ diagram_family_count: number;
77
+ }
78
+ export interface RuntimeConstructorServiceContract {
79
+ [key: string]: unknown;
80
+ id: string;
81
+ provided_text_measurement_provider_ids: string[];
82
+ resource_limits: RuntimeConstructorResourceLimit[];
83
+ }
84
+ export interface RuntimeConstructorResourceLimit {
85
+ [key: string]: unknown;
86
+ id: string;
87
+ phase: string;
88
+ unit: string;
89
+ description: string;
90
+ value: number;
91
+ }
92
+ export interface RuntimeOutputContract {
93
+ [key: string]: unknown;
94
+ id: string;
95
+ media_type: string;
96
+ system_fonts: RuntimeSystemFontContract | null;
97
+ embedded_images: RuntimeEmbeddedImageContract | null;
98
+ }
99
+ export interface RuntimeSystemFontContract {
100
+ [key: string]: unknown;
101
+ source_id: string;
102
+ discovery: string;
103
+ cache_scope: string;
104
+ host_dependent: boolean;
105
+ caller_configurable: boolean;
106
+ resource_bounded: boolean;
107
+ }
108
+ export interface RuntimeEmbeddedImageContract {
109
+ [key: string]: unknown;
110
+ source_ids: string[];
111
+ filesystem_access: boolean;
112
+ network_access: boolean;
113
+ caller_configurable: boolean;
114
+ limits: RuntimeEmbeddedImageLimits;
115
+ }
116
+ export interface RuntimeEmbeddedImageLimits {
117
+ [key: string]: unknown;
118
+ max_bytes_per_image: number | null;
119
+ max_total_bytes: number | null;
120
+ max_pixels_per_image: number | null;
121
+ max_total_pixels: number | null;
122
+ }
123
+ export interface RuntimeResourceContract {
124
+ [key: string]: unknown;
125
+ general_binding_default_profile: string;
126
+ cli_default_profile: string;
127
+ limits: RuntimeResourceLimit[];
128
+ profiles: RuntimeResourceProfile[];
129
+ }
130
+ export interface RuntimeResourceLimit {
131
+ [key: string]: unknown;
132
+ id: ResourceLimitId;
133
+ phase: string;
134
+ description: string;
135
+ overridable: boolean;
136
+ hard_cap: boolean;
137
+ minimum_value: number;
138
+ operation_ids: string[];
139
+ }
140
+ export interface RuntimeResourceProfile {
141
+ [key: string]: unknown;
142
+ id: string;
143
+ purpose: string;
144
+ trust_assumption: string;
145
+ recommended_binding_default: boolean;
146
+ limits: Record<ResourceLimitId, number | null>;
147
+ }
148
+ export interface SvgOptions {
149
+ diagram_id?: string;
150
+ pipeline?: "parity" | "readable" | "resvg-safe";
151
+ scoped_css?: string;
152
+ css_override_policy?: "preserve" | "strip-existing-important";
153
+ root_background_color?: string;
154
+ drop_native_duplicate_fallbacks?: boolean;
155
+ viewbox_padding?: number;
156
+ viewBoxPadding?: number;
157
+ }
158
+ export type PresentationThemeAppearance = "light" | "dark";
159
+ export interface PresentationThemeOptions {
160
+ preset?: string;
161
+ appearance?: PresentationThemeAppearance;
162
+ font_family?: string;
163
+ font_size?: string;
164
+ roles?: Record<string, string>;
165
+ series_palette?: string[];
166
+ }
167
+ export interface PresentationOptions {
168
+ profile?: string;
169
+ theme?: PresentationThemeOptions;
170
+ }
171
+ export type MermaidSiteConfig = Record<string, unknown>;
172
+ export interface AnalysisBindingOptions {
173
+ fixed_today?: string;
174
+ fixed_local_offset_minutes?: number;
175
+ site_config?: MermaidSiteConfig;
176
+ resources?: ResourceOptions;
177
+ lint?: LintBindingOptions;
178
+ }
179
+ export interface CommonBindingOptions extends AnalysisBindingOptions {
180
+ version?: 2;
181
+ parse?: ParseOptions;
182
+ analysis?: AnalysisBindingOptions;
183
+ merman?: AnalysisBindingOptions;
184
+ }
185
+ export type AsciiCharsetOption = "ascii" | "unicode";
186
+ export type AsciiDirectionOption = "lr" | "leftRight" | "left-right" | "left_right" | "td" | "tb" | "topDown" | "top-down" | "top_down";
187
+ export type AsciiColorModeOption = "plain" | "none" | "ansi16" | "ansi-16" | "ansi_16" | "ansi256" | "ansi-256" | "ansi_256" | "truecolor" | "true-color" | "true_color" | "html";
188
+ export interface AsciiThemeOptions {
189
+ foreground?: string;
190
+ fg?: string;
191
+ background?: string;
192
+ bg?: string;
193
+ line?: string;
194
+ accent?: string;
195
+ muted?: string;
196
+ surface?: string;
197
+ border?: string;
198
+ }
199
+ export interface AsciiRenderOptions {
200
+ charset?: AsciiCharsetOption;
201
+ default_direction?: AsciiDirectionOption;
202
+ defaultDirection?: AsciiDirectionOption;
203
+ color_mode?: AsciiColorModeOption;
204
+ colorMode?: AsciiColorModeOption;
205
+ theme?: AsciiThemeOptions;
206
+ sequence_mirror_actors?: boolean;
207
+ sequenceMirrorActors?: boolean;
208
+ box_border_padding?: number;
209
+ boxBorderPadding?: number;
210
+ graph_padding_x?: number;
211
+ graphPaddingX?: number;
212
+ graph_padding_y?: number;
213
+ graphPaddingY?: number;
214
+ sequence_participant_spacing?: number;
215
+ sequenceParticipantSpacing?: number;
216
+ sequence_message_spacing?: number;
217
+ sequenceMessageSpacing?: number;
218
+ sequence_self_message_width?: number;
219
+ sequenceSelfMessageWidth?: number;
220
+ xychart_vertical_plot_height?: number;
221
+ xychartVerticalPlotHeight?: number;
222
+ xychart_category_band_width?: number;
223
+ xychartCategoryBandWidth?: number;
224
+ xychart_horizontal_plot_width?: number;
225
+ xychartHorizontalPlotWidth?: number;
226
+ relation_summary_diagnostics?: boolean;
227
+ relationSummaryDiagnostics?: boolean;
228
+ }
229
+ export interface AsciiBindingOptions extends CommonBindingOptions {
230
+ ascii?: AsciiRenderOptions;
231
+ }
232
+ export interface SvgBindingOptions extends CommonBindingOptions {
233
+ presentation?: PresentationOptions;
234
+ environment?: RenderEnvironmentOptions;
235
+ layout?: LayoutOptions;
236
+ svg?: SvgOptions;
237
+ }
238
+ export type BindingOptions = SvgBindingOptions;
239
+ export interface HostTextMeasureRequest {
240
+ operation: HostTextMeasurementOperation;
241
+ phase: HostTextMeasurementPhase;
242
+ text: string;
243
+ font_family?: string | null;
244
+ font_size: number;
245
+ font_weight?: string | null;
246
+ font_style: string;
247
+ max_width?: number | null;
248
+ has_max_width: boolean;
249
+ line_height: number;
250
+ letter_spacing: number;
251
+ word_spacing: number;
252
+ wrap_mode: HostTextWrapMode;
253
+ direction: HostTextDirection;
254
+ white_space: HostTextWhiteSpace;
255
+ }
256
+ export interface HostTextMetricsResult {
257
+ handled?: true;
258
+ kind: "metrics";
259
+ width: number;
260
+ height: number;
261
+ line_count: number;
262
+ }
263
+ export interface HostTextLengthResult {
264
+ handled?: true;
265
+ kind: "length";
266
+ length: number;
267
+ }
268
+ export interface HostTextHorizontalExtentsResult {
269
+ handled?: true;
270
+ kind: "horizontal-extents";
271
+ bbox_left: number;
272
+ bbox_right: number;
273
+ }
274
+ export interface HostTextWrappedWithRawWidthResult {
275
+ handled?: true;
276
+ kind: "wrapped-with-raw-width";
277
+ width: number;
278
+ height: number;
279
+ line_count: number;
280
+ raw_width?: number | null;
281
+ }
282
+ export interface HostTextUnhandledResult {
283
+ handled: false;
284
+ }
285
+ export type HostTextMeasureResult = HostTextMetricsResult | HostTextLengthResult | HostTextHorizontalExtentsResult | HostTextWrappedWithRawWidthResult | HostTextUnhandledResult;
286
+ export type HostTextMeasurer = (request: HostTextMeasureRequest) => HostTextMeasureResult | null | undefined;
287
+ export interface BrowserTextMeasurementSession {
288
+ readonly measure: HostTextMeasurer;
289
+ dispose(): void;
290
+ }
291
+ export interface ValidationResult {
292
+ valid: boolean;
293
+ error?: string;
294
+ code: number;
295
+ code_name: BindingStatusCodeName;
296
+ }
297
+ export type AnalysisSourceKind = "diagram" | "markdown" | "mdx";
298
+ export interface AnalysisSource {
299
+ kind: AnalysisSourceKind;
300
+ path?: string | null;
301
+ diagram_index?: number | null;
302
+ language: string;
303
+ }
304
+ export interface AnalysisSummary {
305
+ errors: number;
306
+ warnings: number;
307
+ infos: number;
308
+ hints: number;
309
+ }
310
+ export interface AnalysisUtf16Position {
311
+ line: number;
312
+ character: number;
313
+ }
314
+ export interface AnalysisLspRange {
315
+ start: AnalysisUtf16Position;
316
+ end: AnalysisUtf16Position;
317
+ }
318
+ export interface AnalysisSpan {
319
+ byte_start: number;
320
+ byte_end: number;
321
+ line: number;
322
+ column: number;
323
+ end_line: number;
324
+ end_column: number;
325
+ lsp_range: AnalysisLspRange;
326
+ }
327
+ export interface AnalysisDiagnosticRelated {
328
+ message: string;
329
+ span?: AnalysisSpan | null;
330
+ }
331
+ export interface AnalysisDiagnosticFixEdit {
332
+ span: AnalysisSpan;
333
+ replacement: string;
334
+ }
335
+ export interface AnalysisDiagnosticFix {
336
+ title: string;
337
+ edits: AnalysisDiagnosticFixEdit[];
338
+ is_preferred?: boolean;
339
+ }
340
+ export interface AnalysisDiagnostic {
341
+ id: string;
342
+ severity: LintRuleSeverity;
343
+ category: LintRuleCategory | string;
344
+ message: string;
345
+ code?: number | null;
346
+ code_name?: string | null;
347
+ diagram_type?: string | null;
348
+ span?: AnalysisSpan | null;
349
+ related: AnalysisDiagnosticRelated[];
350
+ help?: string | null;
351
+ fixes?: AnalysisDiagnosticFix[];
352
+ }
353
+ interface AnalysisPayloadFields {
354
+ valid: boolean;
355
+ summary: AnalysisSummary;
356
+ source: AnalysisSource;
357
+ diagnostics: AnalysisDiagnostic[];
358
+ }
359
+ export interface AnalysisResult extends AnalysisPayloadFields {
360
+ version: 1;
361
+ }
362
+ export interface AnalysisByteSpan {
363
+ start: number;
364
+ end: number;
365
+ }
366
+ export interface AnalysisFactSpan {
367
+ local: AnalysisByteSpan;
368
+ document?: AnalysisSpan | null;
369
+ }
370
+ export type AnalysisDiagramKind = "whole_document" | "mermaid_fence" | string;
371
+ export type AnalysisFenceMarker = "backtick" | "tilde" | "colon" | string;
372
+ export interface AnalysisFenceDelimiterFacts {
373
+ marker: AnalysisFenceMarker;
374
+ len: number;
375
+ }
376
+ export type AnalysisEditorSymbolKind = "class" | "event" | "function" | "module" | "namespace" | "object" | "package" | "property" | "string" | "struct" | "variable" | string;
377
+ export type AnalysisSemanticRole = "entity" | "outline" | "payload" | string;
378
+ export type AnalysisRenamePolicy = EditorRenamePolicy;
379
+ export type AnalysisExpectedSyntaxKind = "id_list" | "node_identifier" | "shape" | "shape_trigger" | "direction" | "payload" | string;
380
+ export interface AnalysisReferenceFacts {
381
+ name: string;
382
+ kind: AnalysisEditorSymbolKind;
383
+ spans: AnalysisFactSpan[];
384
+ }
385
+ export interface AnalysisLineItemFacts {
386
+ name: string;
387
+ detail?: string | null;
388
+ kind: AnalysisEditorSymbolKind;
389
+ span: AnalysisFactSpan;
390
+ selection: AnalysisFactSpan;
391
+ }
392
+ export interface AnalysisSemanticItemFacts extends AnalysisLineItemFacts {
393
+ role: AnalysisSemanticRole;
394
+ rename_policy: AnalysisRenamePolicy;
395
+ }
396
+ export interface AnalysisExpectedSyntaxFacts {
397
+ kind: AnalysisExpectedSyntaxKind;
398
+ span: AnalysisFactSpan;
399
+ }
400
+ export interface AnalysisFlowchartEdgeDefaults {
401
+ interpolate?: string | null;
402
+ style: string[];
403
+ }
404
+ export interface AnalysisFlowchartNodeFacts {
405
+ id: string;
406
+ label?: string | null;
407
+ labelType?: string | null;
408
+ layoutShape?: string | null;
409
+ icon?: string | null;
410
+ form?: string | null;
411
+ pos?: string | null;
412
+ img?: string | null;
413
+ constraint?: string | null;
414
+ assetWidth?: number | null;
415
+ assetHeight?: number | null;
416
+ classes: string[];
417
+ styles: string[];
418
+ link?: string | null;
419
+ linkTarget?: string | null;
420
+ haveCallback: boolean;
421
+ }
422
+ export interface AnalysisFlowchartEdgeFacts {
423
+ id: string;
424
+ from: string;
425
+ to: string;
426
+ label?: string | null;
427
+ labelType?: string | null;
428
+ type?: string | null;
429
+ stroke?: string | null;
430
+ interpolate?: string | null;
431
+ classes: string[];
432
+ style: string[];
433
+ animate?: boolean | null;
434
+ animation?: string | null;
435
+ length: number;
436
+ }
437
+ export interface AnalysisFlowchartSubgraphFacts {
438
+ id: string;
439
+ title: string;
440
+ dir?: string | null;
441
+ labelType?: string | null;
442
+ classes: string[];
443
+ styles: string[];
444
+ nodes: string[];
445
+ }
446
+ export interface AnalysisFlowchartFacts {
447
+ direction?: string | null;
448
+ classDefs: Record<string, string[]>;
449
+ edgeDefaults?: AnalysisFlowchartEdgeDefaults | null;
450
+ vertexCalls: string[];
451
+ nodes: AnalysisFlowchartNodeFacts[];
452
+ edges: AnalysisFlowchartEdgeFacts[];
453
+ subgraphs: AnalysisFlowchartSubgraphFacts[];
454
+ tooltips: Record<string, string>;
455
+ }
456
+ export interface AnalysisDiagramSyntaxFacts {
457
+ diagram_type?: string | null;
458
+ effective_layout?: string | null;
459
+ fact_source: EditorSemanticFactSource;
460
+ parser_backed: boolean;
461
+ recovered: boolean;
462
+ source_mapped_spans: boolean;
463
+ flowchart?: AnalysisFlowchartFacts | null;
464
+ node_ids: string[];
465
+ class_names: string[];
466
+ directive_prefixes: string[];
467
+ references: AnalysisReferenceFacts[];
468
+ outline_items: AnalysisLineItemFacts[];
469
+ semantic_items: AnalysisSemanticItemFacts[];
470
+ expected_syntax: AnalysisExpectedSyntaxFacts[];
471
+ }
472
+ export type DiagramParseDisposition = "parsed" | "recovered" | "unavailable";
473
+ export interface AnalysisDiagramFacts {
474
+ source_id: string;
475
+ index: number;
476
+ kind: AnalysisDiagramKind;
477
+ source: AnalysisSource;
478
+ span?: AnalysisSpan | null;
479
+ body_span?: AnalysisSpan | null;
480
+ text_len: number;
481
+ fence_delimiter?: AnalysisFenceDelimiterFacts | null;
482
+ parse_disposition: DiagramParseDisposition;
483
+ syntax: AnalysisDiagramSyntaxFacts;
484
+ }
485
+ export interface AnalysisFactsResult extends AnalysisPayloadFields {
486
+ version: 1;
487
+ diagrams: AnalysisDiagramFacts[];
488
+ }
489
+ /**
490
+ * Capability plan for one SVG render request.
491
+ *
492
+ * The plan is emitted by the compiled SVG owner before drawing. `ready` is
493
+ * false when the selected artifact lacks one or more required capabilities.
494
+ */
495
+ export interface SvgPlanResult {
496
+ schema_version: 1;
497
+ planned_operation_id: "svg";
498
+ diagram_type: string;
499
+ presentation_profile_id: string | null;
500
+ presentation_aspects: SvgPlanPresentationAspect[];
501
+ required_capability_ids: string[];
502
+ missing_capability_ids: string[];
503
+ ready: boolean;
504
+ }
505
+ export interface SvgPlanPresentationAspect {
506
+ id: string;
507
+ state: string;
508
+ required_capability_id: string | null;
509
+ }
510
+ export interface AvailableDiagramDetectionFacts {
511
+ readonly status: "available";
512
+ readonly validity: "valid" | "recoverable-invalid";
513
+ readonly diagramType: DiagramType;
514
+ readonly syntaxId: string;
515
+ readonly effectiveLayoutId: string;
516
+ }
517
+ export interface UnavailableDiagramDetectionFacts {
518
+ readonly status: "unavailable";
519
+ readonly validity: "unknown";
520
+ readonly diagramType: null;
521
+ readonly syntaxId: null;
522
+ readonly effectiveLayoutId: null;
523
+ }
524
+ export type DiagramDetectionFacts = AvailableDiagramDetectionFacts | UnavailableDiagramDetectionFacts;
525
+ export interface EditorPosition {
526
+ line: number;
527
+ character: number;
528
+ }
529
+ export interface EditorRange {
530
+ start: EditorPosition;
531
+ end: EditorPosition;
532
+ }
533
+ export interface EditorTextEdit {
534
+ factSource?: EditorSemanticFactSource | null;
535
+ range: EditorRange;
536
+ newText: string;
537
+ }
538
+ export type EditorSemanticFactSource = "unavailable" | "parser_complete" | "parser_recovered";
539
+ export type EditorCompletionItemKind = "keyword" | "variable" | "class" | "snippet";
540
+ export interface EditorCompletionResolveData {
541
+ kind: "diagram_header" | "operator" | "direction" | "directive" | "shape" | "class_name" | "node_identifier" | "style" | "interaction" | "frontmatter" | "template";
542
+ label: string;
543
+ }
544
+ export interface EditorCompletionTextEdit {
545
+ range: EditorRange;
546
+ new_text: string;
547
+ }
548
+ export interface EditorCompletionItem {
549
+ label: string;
550
+ kind: EditorCompletionItemKind;
551
+ detail?: string | null;
552
+ data?: EditorCompletionResolveData | null;
553
+ insert_text?: string | null;
554
+ insert_text_format?: "plain_text" | "snippet";
555
+ text_edit?: EditorCompletionTextEdit | null;
556
+ label_details?: {
557
+ description?: string | null;
558
+ detail?: string | null;
559
+ } | null;
560
+ }
561
+ export interface EditorCompletionList {
562
+ is_incomplete: boolean;
563
+ fact_source?: EditorSemanticFactSource | null;
564
+ items: EditorCompletionItem[];
565
+ }
566
+ export type EditorDiagnosticSeverity = "error" | "warning" | "info" | "hint";
567
+ export interface EditorDiagnosticRelated {
568
+ message: string;
569
+ range: EditorRange;
570
+ }
571
+ export interface EditorDiagnosticData {
572
+ id: string;
573
+ code?: number | null;
574
+ codeName?: string | null;
575
+ category: LintRuleCategory | string;
576
+ diagramType?: string | null;
577
+ help?: string | null;
578
+ fixes?: AnalysisDiagnosticFix[];
579
+ }
580
+ export interface EditorDiagnostic {
581
+ range: EditorRange;
582
+ severity: EditorDiagnosticSeverity;
583
+ code: number | string;
584
+ source: string;
585
+ message: string;
586
+ related: EditorDiagnosticRelated[];
587
+ data?: EditorDiagnosticData | null;
588
+ }
589
+ export interface EditorDiagnosticsResult {
590
+ version: number;
591
+ valid: boolean;
592
+ summary: AnalysisResult["summary"];
593
+ source: AnalysisResult["source"];
594
+ diagnostics: EditorDiagnostic[];
595
+ }
596
+ export interface EditorCodeAction {
597
+ title: string;
598
+ kind: "quickfix";
599
+ diagnostics: EditorDiagnostic[];
600
+ edit: EditorWorkspaceEdit;
601
+ isPreferred: boolean;
602
+ }
603
+ export interface EditorMarkupContent {
604
+ kind: "markdown";
605
+ value: string;
606
+ }
607
+ export interface EditorHover {
608
+ contents: EditorMarkupContent;
609
+ factSource: EditorSemanticFactSource;
610
+ range?: EditorRange | null;
611
+ }
612
+ export type EditorSymbolKind = "class" | "event" | "function" | "module" | "namespace" | "object" | "package" | "property" | "string" | "struct" | "variable";
613
+ export interface EditorDocumentSymbol {
614
+ name: string;
615
+ detail?: string | null;
616
+ kind: EditorSymbolKind;
617
+ factSource: EditorSemanticFactSource;
618
+ range: EditorRange;
619
+ selectionRange: EditorRange;
620
+ children: EditorDocumentSymbol[];
621
+ }
622
+ export interface EditorLocation {
623
+ uri: string;
624
+ factSource: EditorSemanticFactSource;
625
+ range: EditorRange;
626
+ }
627
+ export interface EditorSymbolInformation {
628
+ name: string;
629
+ kind: EditorSymbolKind;
630
+ factSource: EditorSemanticFactSource;
631
+ location: EditorLocation;
632
+ containerName?: string | null;
633
+ }
634
+ export interface EditorPrepareRename {
635
+ factSource: EditorSemanticFactSource;
636
+ range: EditorRange;
637
+ placeholder: string;
638
+ }
639
+ export interface EditorWorkspaceEdit {
640
+ factSource?: EditorSemanticFactSource | null;
641
+ changes: Record<string, EditorTextEdit[]>;
642
+ }
643
+ export interface EditorSemanticTokenLegend {
644
+ tokenTypes: string[];
645
+ tokenModifiers: string[];
646
+ }
647
+ export type EditorSemanticTokenDescriptor = typeof import("./generated/token-descriptor.js").SEMANTIC_TOKEN_DESCRIPTOR;
648
+ export interface BrowserEditorSession {
649
+ readonly version: number;
650
+ readonly uri: string;
651
+ update(source: string, version: number): void;
652
+ diagnostics(): EditorDiagnosticsResult;
653
+ diagramDetection(): DiagramDetectionFacts;
654
+ codeActions(): EditorCodeAction[];
655
+ completions(position: EditorPosition): EditorCompletionList;
656
+ hover(position: EditorPosition): EditorHover | null;
657
+ documentSymbols(): EditorDocumentSymbol[];
658
+ searchDocumentSymbols(query: string): EditorSymbolInformation[];
659
+ definition(position: EditorPosition): EditorLocation | null;
660
+ references(position: EditorPosition, includeDeclaration?: boolean): EditorLocation[];
661
+ prepareRename(position: EditorPosition): EditorPrepareRename | null;
662
+ rename(position: EditorPosition, newName: string): EditorWorkspaceEdit | null;
663
+ semanticTokens(): Uint32Array;
664
+ dispose(): void;
665
+ }
666
+ export interface WasmEditorSessionBinding {
667
+ readonly version: number;
668
+ readonly uri: string;
669
+ update(source: string, version: number): void;
670
+ diagnostics(): EditorDiagnosticsResult;
671
+ diagramDetection(): DiagramDetectionFacts;
672
+ codeActions(): EditorCodeAction[];
673
+ completions(line: number, character: number): EditorCompletionList;
674
+ hover(line: number, character: number): EditorHover | null;
675
+ documentSymbols(): EditorDocumentSymbol[];
676
+ searchDocumentSymbols(query: string): EditorSymbolInformation[];
677
+ definition(line: number, character: number): EditorLocation | null;
678
+ references(line: number, character: number, includeDeclaration: boolean): EditorLocation[];
679
+ prepareRename(line: number, character: number): EditorPrepareRename | null;
680
+ rename(line: number, character: number, newName: string): EditorWorkspaceEdit | null;
681
+ semanticTokens(): Uint32Array;
682
+ free(): void;
683
+ }
684
+ export interface WasmEditorSessionConstructor {
685
+ new (source: string, version: number, uri?: string | null, optionsJson?: string | null): WasmEditorSessionBinding;
686
+ }
687
+ export interface WasmSemanticTokenDescriptor {
688
+ schemaVersion: number;
689
+ digest: string;
690
+ tokenTypes: Array<{
691
+ id: string;
692
+ code: number;
693
+ lspName: string;
694
+ lspIndex: number;
695
+ }>;
696
+ modifiers: Array<{
697
+ id: string;
698
+ index: number;
699
+ bit: number;
700
+ lspName: string;
701
+ lspIndex: number;
702
+ }>;
703
+ packed: {
704
+ encoding: string;
705
+ wordWidthBits: number;
706
+ recordWidth: number;
707
+ fieldOrder: string[];
708
+ };
709
+ validTypeCodeMax: number;
710
+ validModifierMask: number;
711
+ }
712
+ export type MermanWasmSource = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
713
+ interface WasmBindgenInitEnvelope {
714
+ module_or_path: MermanWasmSource | Promise<MermanWasmSource>;
715
+ }
716
+ export interface MermanWasmModuleBase {
717
+ default: (input?: WasmBindgenInitEnvelope) => Promise<unknown>;
718
+ }
719
+ export interface MermanWasmModule extends MermanWasmModuleBase {
720
+ EditorSession?: WasmEditorSessionConstructor;
721
+ transportApiVersion: () => number;
722
+ packageVersion: () => string;
723
+ renderSvg: (source: string, optionsJson?: string | null) => string;
724
+ svgPlanJson: (source: string, optionsJson?: string | null) => SvgPlanResult;
725
+ renderSvgWithTextMeasurer?: (source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer) => string;
726
+ renderAscii: (source: string, optionsJson?: string | null) => string;
727
+ parseJson: (source: string, optionsJson?: string | null) => string;
728
+ layoutJson: (source: string, optionsJson?: string | null) => string;
729
+ layoutJsonWithTextMeasurer?: (source: string, optionsJson: string | null | undefined, measurer: HostTextMeasurer) => string;
730
+ analyze?: (source: string, optionsJson?: string | null) => AnalysisResult;
731
+ analyzeJson?: (source: string, optionsJson?: string | null) => AnalysisResult;
732
+ analysisFacts?: (source: string, optionsJson?: string | null) => AnalysisFactsResult;
733
+ analyzeDocument?: (source: string, uri: string, optionsJson?: string | null) => AnalysisResult;
734
+ analyzeDocumentFacts?: (source: string, uri: string, optionsJson?: string | null) => AnalysisFactsResult;
735
+ validate: (source: string, optionsJson?: string | null) => ValidationResult;
736
+ editorDiagnostics?: (source: string, optionsJson?: string | null, uri?: string | null) => EditorDiagnosticsResult;
737
+ editorDiagramDetection?: (source: string, optionsJson?: string | null, uri?: string | null) => DiagramDetectionFacts;
738
+ editorCodeActions?: (source: string, optionsJson?: string | null, uri?: string | null) => EditorCodeAction[];
739
+ editorCompletions?: (source: string, line: number, character: number, uri?: string | null, optionsJson?: string | null) => EditorCompletionList;
740
+ editorHover?: (source: string, line: number, character: number, uri?: string | null, optionsJson?: string | null) => EditorHover | null;
741
+ editorDocumentSymbols?: (source: string, uri?: string | null, optionsJson?: string | null) => EditorDocumentSymbol[];
742
+ editorSearchDocumentSymbols?: (source: string, query: string, uri?: string | null, optionsJson?: string | null) => EditorSymbolInformation[];
743
+ editorDefinition?: (source: string, line: number, character: number, uri?: string | null, optionsJson?: string | null) => EditorLocation | null;
744
+ editorReferences?: (source: string, line: number, character: number, includeDeclaration: boolean, uri?: string | null, optionsJson?: string | null) => EditorLocation[];
745
+ editorPrepareRename?: (source: string, line: number, character: number, uri?: string | null, optionsJson?: string | null) => EditorPrepareRename | null;
746
+ editorRename?: (source: string, line: number, character: number, newName: string, uri?: string | null, optionsJson?: string | null) => EditorWorkspaceEdit | null;
747
+ editorSemanticTokenDescriptor?: () => WasmSemanticTokenDescriptor;
748
+ editorSemanticTokens?: (source: string, uri?: string | null, optionsJson?: string | null) => Uint32Array;
749
+ asciiSupportedDiagrams: () => string[];
750
+ asciiCapabilities: () => AsciiCapability[];
751
+ runtimeCatalog: () => RuntimeCatalog;
752
+ presentationCatalog: () => PresentationCatalog;
753
+ diagramFamilyCapabilities: () => DiagramFamilyCapability[];
754
+ lintRuleCatalog?: () => LintRuleCatalogResponse;
755
+ supportedDiagrams: () => string[];
756
+ supportedThemes: () => string[];
757
+ }
758
+ export type MermanWasmLoader<Module extends MermanWasmModuleBase = MermanWasmModule> = () => Promise<Module>;
759
+ export interface MermanInitOptions<Module extends MermanWasmModuleBase = MermanWasmModule> {
760
+ loader?: MermanWasmLoader<Module>;
761
+ wasm?: MermanWasmSource | Promise<MermanWasmSource>;
762
+ }
763
+ export type MermanInitInput<Module extends MermanWasmModuleBase = MermanWasmModule> = MermanWasmLoader<Module> | MermanInitOptions<Module>;
764
+ //# sourceMappingURL=public-types.d.ts.map