@ox-content/napi 2.63.0 → 2.65.0

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 (3) hide show
  1. package/index.d.ts +94 -0
  2. package/index.js +2 -0
  3. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -1,5 +1,39 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ /** Stateful Markdown parser for append-only streams. */
4
+ export declare class IncrementalMarkdownParser {
5
+ /** Creates an incremental Markdown parser. */
6
+ constructor(options?: JsParserOptions | undefined | null)
7
+ /** Appends Markdown and returns committed plus optional provisional AST JSON. */
8
+ append(chunk: string, options?: JsIncrementalParseOptions | undefined | null): IncrementalMarkdownParseResult
9
+ /** Finalizes the stream and commits any remaining Markdown. */
10
+ finish(options?: JsIncrementalParseOptions | undefined | null): IncrementalMarkdownParseResult
11
+ /** Clears all stream state. */
12
+ reset(): void
13
+ /** Returns the current unstable Markdown tail. */
14
+ get pendingMarkdown(): string
15
+ /** Returns the number of bytes committed from the stream. */
16
+ get committedBytes(): number
17
+ /** Returns the total number of bytes observed from the stream. */
18
+ get totalBytes(): number
19
+ }
20
+
21
+ /** Stateful Markdown-to-HTML renderer for append-only streams. */
22
+ export declare class IncrementalMarkdownRenderer {
23
+ /** Creates an incremental Markdown renderer. */
24
+ constructor(options?: JsParserOptions | undefined | null)
25
+ /** Appends Markdown and returns committed delta plus provisional HTML. */
26
+ append(chunk: string, options?: JsIncrementalRenderOptions | undefined | null): IncrementalMarkdownRenderResult
27
+ /** Finalizes the stream and commits any remaining Markdown. */
28
+ finish(): IncrementalMarkdownRenderResult
29
+ /** Clears parser, renderer, and accumulated HTML state. */
30
+ reset(): void
31
+ /** Returns all committed HTML so far. */
32
+ get committedHtml(): string
33
+ /** Returns the current unstable Markdown tail. */
34
+ get pendingMarkdown(): string
35
+ }
36
+
3
37
  /** Builds the public API export graph from entry points. */
4
38
  export declare function buildExportGraph(entryPoints: Array<JsEntryPointSpec>, options?: JsGraphOptions | undefined | null): JsExportGraph
5
39
 
@@ -199,6 +233,40 @@ export interface I18NLoadResult {
199
233
  errors: Array<string>
200
234
  }
201
235
 
236
+ /** Incremental parser append result. */
237
+ export interface IncrementalMarkdownParseResult {
238
+ ast: string
239
+ pendingAst: string
240
+ markdown: string
241
+ pendingMarkdown: string
242
+ committedByteStart: number
243
+ committedByteEnd: number
244
+ committedBytes: number
245
+ pendingBytes: number
246
+ totalBytes: number
247
+ didCommit: boolean
248
+ isFinal: boolean
249
+ errors: Array<string>
250
+ }
251
+
252
+ /** Incremental renderer append result. */
253
+ export interface IncrementalMarkdownRenderResult {
254
+ deltaHtml: string
255
+ committedHtml: string
256
+ pendingHtml: string
257
+ html: string
258
+ markdown: string
259
+ pendingMarkdown: string
260
+ committedByteStart: number
261
+ committedByteEnd: number
262
+ committedBytes: number
263
+ pendingBytes: number
264
+ totalBytes: number
265
+ didCommit: boolean
266
+ isFinal: boolean
267
+ errors: Array<string>
268
+ }
269
+
202
270
  /** Attribute syntax transform options. */
203
271
  export interface JsAttrsOptions {
204
272
  /** Enable markdown-it-attrs style `{#id .class key=value}`. */
@@ -406,6 +474,8 @@ export interface JsDocsMarkdownOptions {
406
474
  * sort strategy.
407
475
  */
408
476
  kindSortOrder?: Array<string>
477
+ /** Single-entry root handling for TypeDoc-style Markdown output. */
478
+ singleEntryRoot?: 'preserve' | 'flatten'
409
479
  }
410
480
 
411
481
  /** Ordered JSDoc tag used by generated API Markdown. */
@@ -445,6 +515,8 @@ export interface JsDocsNavOptions {
445
515
  * `groupOrder`) and the `kind` sort strategy.
446
516
  */
447
517
  kindSortOrder?: Array<string>
518
+ /** Single-entry root handling for TypeDoc-style nav. */
519
+ singleEntryRoot?: 'preserve' | 'flatten'
448
520
  }
449
521
 
450
522
  /** Options for writing generated API documentation files. */
@@ -462,6 +534,8 @@ export interface JsDocsOutputOptions {
462
534
  sortEntryPoints?: boolean
463
535
  /** TypeDoc-style kind ranking for generated nav groups. */
464
536
  kindSortOrder?: Array<string>
537
+ /** Single-entry root handling for generated nav metadata. */
538
+ singleEntryRoot?: 'preserve' | 'flatten'
465
539
  }
466
540
 
467
541
  /** Docs-as-tests extraction options. */
@@ -668,6 +742,26 @@ export interface JsI18NRuntimeLocale {
668
742
  dir?: string
669
743
  }
670
744
 
745
+ /** Options for appending to an incremental parser. */
746
+ export interface JsIncrementalParseOptions {
747
+ /** Treat this append as the final stream chunk. */
748
+ isFinal?: boolean
749
+ /** Include a provisional AST for the current unstable tail. */
750
+ includePendingAst?: boolean
751
+ /** Temporarily close unmatched inline delimiters in the provisional AST. */
752
+ completeInline?: boolean
753
+ }
754
+
755
+ /** Options for appending to an incremental renderer. */
756
+ export interface JsIncrementalRenderOptions {
757
+ /** Treat this append as the final stream chunk. */
758
+ isFinal?: boolean
759
+ /** Render the current unstable tail as replaceable provisional HTML. */
760
+ renderPending?: boolean
761
+ /** Temporarily close unmatched inline delimiters in provisional HTML. */
762
+ completeInline?: boolean
763
+ }
764
+
671
765
  /** Locale information for the locale switcher. */
672
766
  export interface JsLocaleInfo {
673
767
  /** BCP 47 locale tag. */
package/index.js CHANGED
@@ -74,6 +74,8 @@ module.exports.parseTransferRaw = binding.parseTransferRaw;
74
74
  module.exports.parseMdastRaw = binding.parseMdastRaw;
75
75
  module.exports.parseAndRender = binding.parseAndRender;
76
76
  module.exports.parseAndRenderAsync = binding.parseAndRenderAsync;
77
+ module.exports.IncrementalMarkdownParser = binding.IncrementalMarkdownParser;
78
+ module.exports.IncrementalMarkdownRenderer = binding.IncrementalMarkdownRenderer;
77
79
  module.exports.prepareSource = binding.prepareSource;
78
80
  module.exports.prepareSourceRaw = binding.prepareSourceRaw;
79
81
  module.exports.lintMarkdown = binding.lintMarkdown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "2.63.0",
3
+ "version": "2.65.0",
4
4
  "description": "Node.js bindings for Ox Content - High-performance Markdown parser",
5
5
  "keywords": [
6
6
  "markdown",
@@ -45,10 +45,10 @@
45
45
  ]
46
46
  },
47
47
  "optionalDependencies": {
48
- "@ox-content/binding-darwin-x64": "2.63.0",
49
- "@ox-content/binding-darwin-arm64": "2.63.0",
50
- "@ox-content/binding-linux-x64-gnu": "2.63.0",
51
- "@ox-content/binding-linux-arm64-gnu": "2.63.0",
52
- "@ox-content/binding-win32-x64-msvc": "2.63.0"
48
+ "@ox-content/binding-darwin-x64": "2.65.0",
49
+ "@ox-content/binding-darwin-arm64": "2.65.0",
50
+ "@ox-content/binding-linux-x64-gnu": "2.65.0",
51
+ "@ox-content/binding-linux-arm64-gnu": "2.65.0",
52
+ "@ox-content/binding-win32-x64-msvc": "2.65.0"
53
53
  }
54
54
  }