@r4ai/typst-ast-node 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ await init();
21
21
  const result = parse("= Hello\n\nThis is *typst*.", { mode: "markup" });
22
22
  console.log(result);
23
23
  // {
24
- // root: { kind: "Markup", range: [0, 26], text: null, children: [...] },
24
+ // root: { kind: "Markup", range: [0, 25], children: [...] },
25
25
  // errors: []
26
26
  // }
27
27
  ```
@@ -49,22 +49,22 @@ Parses Typst source text and returns the AST.
49
49
  **Return value**
50
50
 
51
51
  ```ts
52
- type ParseResult = {
53
- root: Node;
52
+ interface ParseResult {
53
+ root: SyntaxNode;
54
54
  errors: ParseError[];
55
- };
55
+ }
56
56
 
57
- type Node = {
58
- kind: string; // SyntaxKind variant name (e.g. "Markup", "Heading", "Strong")
59
- range: [number, number]; // [start, end] byte offsets
60
- text: string | null; // leaf node text, null for inner nodes
61
- children: Node[];
62
- };
57
+ interface SyntaxNode {
58
+ kind: string;
59
+ range: [number, number];
60
+ text?: string;
61
+ children: SyntaxNode[];
62
+ }
63
63
 
64
- type ParseError = {
64
+ interface ParseError {
65
65
  message: string;
66
66
  range: [number, number];
67
- };
67
+ }
68
68
  ```
69
69
 
70
70
  ## Development
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "collaborators": [
4
4
  "r4ai"
5
5
  ],
6
- "version": "0.2.0",
6
+ "version": "0.2.1",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
package/typst_ast_bg.wasm CHANGED
Binary file