@miragon/wardley-dsl 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WardleyMap, Method } from '@miragon/wardley-schema-model';
2
2
  export { loadMap, parseMapJSON as mapFromJSON, serializeMap as mapToJSON } from '@miragon/wardley-schema-model';
3
3
 
4
- /** Finding produced while parsing — line is 1-based; `text` is the (comment-stripped) line. */
4
+ /** Finding produced while parsing — line is 1-based; `text` is that source line, trimmed. */
5
5
  interface ParseDiagnostic {
6
6
  readonly line: number;
7
7
  readonly message: string;
@@ -52,6 +52,10 @@ interface InlineDecorators {
52
52
  * - parenthesized: `(market)`, `(ecosystem)`, `(build|buy|outsource)`, combined `(market, outsource)`
53
53
  * - trailing keyword: `inertia`
54
54
  * Returns the decorators found and the line stripped of them.
55
+ *
56
+ * @deprecated Kept for API compatibility; the parser no longer uses it. It reads every `( … )` group
57
+ * and `inertia` anywhere on the line and lets the last method win, while `parseDSL` reads decorators
58
+ * only after the coordinates and keeps the first method.
55
59
  */
56
60
  declare function parseDecorators(line: string): {
57
61
  decorators: InlineDecorators;
@@ -61,10 +65,14 @@ interface LabelOffsetToken {
61
65
  readonly dx: number;
62
66
  readonly dy: number;
63
67
  }
64
- /** Reads an optional `label [dx, dy]` (pixel offset) and returns it plus the stripped line. */
68
+ /**
69
+ * Reads an optional `label [dx, dy]` (pixel offset) and returns it plus the stripped line.
70
+ * `unreadable` holds the matched text when a number in it cannot be read.
71
+ */
65
72
  declare function parseLabelOffset(line: string): {
66
73
  labelOffset: LabelOffsetToken | null;
67
74
  rest: string;
75
+ unreadable?: string;
68
76
  };
69
77
  /** First word (keyword) of a line, lowercased. */
70
78
  declare function keywordOf(line: string): string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WardleyMap, Method } from '@miragon/wardley-schema-model';
2
2
  export { loadMap, parseMapJSON as mapFromJSON, serializeMap as mapToJSON } from '@miragon/wardley-schema-model';
3
3
 
4
- /** Finding produced while parsing — line is 1-based; `text` is the (comment-stripped) line. */
4
+ /** Finding produced while parsing — line is 1-based; `text` is that source line, trimmed. */
5
5
  interface ParseDiagnostic {
6
6
  readonly line: number;
7
7
  readonly message: string;
@@ -52,6 +52,10 @@ interface InlineDecorators {
52
52
  * - parenthesized: `(market)`, `(ecosystem)`, `(build|buy|outsource)`, combined `(market, outsource)`
53
53
  * - trailing keyword: `inertia`
54
54
  * Returns the decorators found and the line stripped of them.
55
+ *
56
+ * @deprecated Kept for API compatibility; the parser no longer uses it. It reads every `( … )` group
57
+ * and `inertia` anywhere on the line and lets the last method win, while `parseDSL` reads decorators
58
+ * only after the coordinates and keeps the first method.
55
59
  */
56
60
  declare function parseDecorators(line: string): {
57
61
  decorators: InlineDecorators;
@@ -61,10 +65,14 @@ interface LabelOffsetToken {
61
65
  readonly dx: number;
62
66
  readonly dy: number;
63
67
  }
64
- /** Reads an optional `label [dx, dy]` (pixel offset) and returns it plus the stripped line. */
68
+ /**
69
+ * Reads an optional `label [dx, dy]` (pixel offset) and returns it plus the stripped line.
70
+ * `unreadable` holds the matched text when a number in it cannot be read.
71
+ */
65
72
  declare function parseLabelOffset(line: string): {
66
73
  labelOffset: LabelOffsetToken | null;
67
74
  rest: string;
75
+ unreadable?: string;
68
76
  };
69
77
  /** First word (keyword) of a line, lowercased. */
70
78
  declare function keywordOf(line: string): string;