@@ -91,7 +91,7 @@ for await (const result of parseStreamIncremental(response.body!)) {
9191 if (! result .isComplete ) {
9292 // Update UI as chunks arrive - auto-close ensures valid parsing!
9393 console .log (` Received chunk: ${result .chunk .length } bytes ` )
94- console .log (` Current elements: ${result .body .children .length } ` )
94+ console .log (` Current elements: ${result .body .value .length } ` )
9595 renderPartialContent (result .body )
9696 }
9797 else {
@@ -146,27 +146,27 @@ Parses MDC content incrementally, yielding results after each chunk.
146146
147147``` typescript
148148interface ParseResult {
149- body: MDCRoot // The parsed MDC AST
150- excerpt? : MDCRoot // Optional excerpt (content before <!-- more -->)
149+ body: MinimarkTree // The parsed MDC AST
150+ excerpt? : MinimarkTree // Optional excerpt (content before <!-- more -->)
151151 data: any // Frontmatter data
152152 toc? : any // Table of contents
153153}
154154
155155interface IncrementalParseResult {
156156 chunk: string // The chunk just received
157- body: MDCRoot // Current parsed state
157+ body: MinimarkTree // Current parsed state
158158 data: any // Frontmatter data (once available)
159159 isComplete: boolean // Whether stream is finished
160- excerpt? : MDCRoot // Optional excerpt
160+ excerpt? : MinimarkTree // Optional excerpt
161161 toc? : any // TOC (only in final result)
162162}
163163
164- interface MDCRoot {
165- type: ' root '
166- children : MDCNode []
164+ interface MinimarkTree {
165+ type: ' minimark '
166+ value : MinimarkNode []
167167}
168168
169- interface MDCNode {
169+ interface MinimarkNode {
170170 type: ' element' | ' text' | ' comment'
171171 // ... additional properties based on type
172172}
0 commit comments