@ox-content/napi 2.67.0 → 2.69.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 (2) hide show
  1. package/index.d.ts +323 -62
  2. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -269,7 +269,11 @@ export interface IncrementalMarkdownRenderResult {
269
269
 
270
270
  /** Attribute syntax transform options. */
271
271
  export interface JsAttrsOptions {
272
- /** Enable markdown-it-attrs style `{#id .class key=value}`. */
272
+ /**
273
+ * Enable markdown-it-attrs style `{#id .class key=value}`.
274
+ *
275
+ * Default: `false`.
276
+ */
273
277
  enabled?: boolean
274
278
  }
275
279
 
@@ -296,21 +300,45 @@ export interface JsCodeBlockDiagnostic {
296
300
 
297
301
  /** Code block linting options. */
298
302
  export interface JsCodeBlockLintOptions {
299
- /** Enable code block linting. */
303
+ /**
304
+ * Enable code block linting.
305
+ *
306
+ * Default: `false` when the whole option is omitted.
307
+ */
300
308
  enabled?: boolean
301
- /** Restrict linting to these language identifiers. */
309
+ /**
310
+ * Restrict linting to these language identifiers.
311
+ *
312
+ * Default: all fenced block languages.
313
+ */
302
314
  languages?: Array<string>
303
- /** Report fences without a language identifier. */
315
+ /**
316
+ * Report fences without a language identifier.
317
+ *
318
+ * Default: `false`.
319
+ */
304
320
  requireLanguage?: boolean
305
- /** Report trailing whitespace in code block lines. */
321
+ /**
322
+ * Report trailing whitespace in code block lines.
323
+ *
324
+ * Default: `true`.
325
+ */
306
326
  trailingSpaces?: boolean
307
327
  }
308
328
 
309
329
  /** Code import / snippet injection options. */
310
330
  export interface JsCodeImportOptions {
311
- /** Enable `<<< path{selector}` snippet injection. */
331
+ /**
332
+ * Enable `<<< path{selector}` snippet injection.
333
+ *
334
+ * Default: `false`.
335
+ */
312
336
  enabled?: boolean
313
- /** Root directory used for `@/` and absolute snippet imports. */
337
+ /**
338
+ * Root directory used for `@/` and absolute snippet imports.
339
+ *
340
+ * Default: project root from the JavaScript caller.
341
+ */
314
342
  rootDir?: string
315
343
  }
316
344
 
@@ -321,6 +349,7 @@ export interface JsDocEntry {
321
349
  description: string
322
350
  params?: Array<JsDocParam>
323
351
  returns?: JsDocReturn
352
+ throws?: Array<JsDocThrows>
324
353
  examples?: Array<string>
325
354
  tags?: Record<string, string>
326
355
  private: boolean
@@ -350,6 +379,7 @@ export interface JsDocMember {
350
379
  params?: Array<JsDocParam>
351
380
  typeParameters?: Array<JsTypeParam>
352
381
  returns?: JsDocReturn
382
+ throws?: Array<JsDocThrows>
353
383
  members?: Array<JsDocMember>
354
384
  optional?: boolean
355
385
  readonly?: boolean
@@ -394,6 +424,7 @@ export interface JsDocsMarkdownEntry {
394
424
  description: string
395
425
  params?: Array<JsDocParam>
396
426
  returns?: JsDocReturn
427
+ throws?: Array<JsDocThrows>
397
428
  examples?: Array<string>
398
429
  tags?: Array<JsDocsMarkdownTag>
399
430
  private: boolean
@@ -540,33 +571,75 @@ export interface JsDocsOutputOptions {
540
571
 
541
572
  /** Docs-as-tests extraction options. */
542
573
  export interface JsDocsTestOptions {
543
- /** Enable docs test extraction. */
574
+ /**
575
+ * Enable docs test extraction.
576
+ *
577
+ * Default: `false` when the whole option is omitted.
578
+ */
544
579
  enabled?: boolean
545
- /** Languages that can be emitted as test cases. */
580
+ /**
581
+ * Languages that can be emitted as test cases.
582
+ *
583
+ * Default: `["js", "jsx", "ts", "tsx", "mjs", "mts"]`.
584
+ */
546
585
  languages?: Array<string>
547
- /** Require fence meta such as `test`, `runnable`, or `vitest`. */
586
+ /**
587
+ * Require fence meta such as `test`, `runnable`, or `vitest`.
588
+ *
589
+ * Default: `true`.
590
+ */
548
591
  requireMeta?: boolean
549
592
  }
550
593
 
594
+ /** Exception/error documentation used by generated API docs. */
595
+ export interface JsDocThrows {
596
+ type?: string
597
+ description: string
598
+ }
599
+
551
600
  /** Edit-this-page link options. */
552
601
  export interface JsEditThisPageOptions {
553
- /** Enable edit link generation. */
602
+ /**
603
+ * Enable edit link generation.
604
+ *
605
+ * Default: `false` unless `repo_url` is provided by the JavaScript resolver.
606
+ */
554
607
  enabled?: boolean
555
608
  /** GitHub repository URL, e.g. `https://github.com/owner/repo`. */
556
609
  repoUrl?: string
557
- /** Branch used in edit URLs. */
610
+ /**
611
+ * Branch used in edit URLs.
612
+ *
613
+ * Default: `"main"`.
614
+ */
558
615
  branch?: string
559
- /** Root directory used to relativize `sourcePath`. */
616
+ /**
617
+ * Root directory used to relativize `sourcePath`.
618
+ *
619
+ * Default: no extra root prefix.
620
+ */
560
621
  rootDir?: string
561
- /** Link label. */
622
+ /**
623
+ * Link label.
624
+ *
625
+ * Default: `"Edit this page"`.
626
+ */
562
627
  label?: string
563
628
  }
564
629
 
565
630
  /** Emoji-shortcode transform options. */
566
631
  export interface JsEmojiShortcodeOptions {
567
- /** Enable `:shortcode:` expansion. */
632
+ /**
633
+ * Enable `:shortcode:` expansion.
634
+ *
635
+ * Default: `false`.
636
+ */
568
637
  enabled?: boolean
569
- /** Custom shortcode map. Values are emitted verbatim. */
638
+ /**
639
+ * Custom shortcode map. Values are emitted verbatim.
640
+ *
641
+ * Default: `{}`.
642
+ */
570
643
  custom?: Record<string, string>
571
644
  }
572
645
 
@@ -821,15 +894,35 @@ export interface JsMarkdownLintRuleOptions {
821
894
 
822
895
  /** Built-in media embed transform switches. */
823
896
  export interface JsMediaEmbedsOptions {
824
- /** Render `<Spotify>` embeds. */
897
+ /**
898
+ * Render `<Spotify>` embeds.
899
+ *
900
+ * Default: `false`.
901
+ */
825
902
  spotify?: boolean
826
- /** Render `<StackBlitz>` embeds. */
903
+ /**
904
+ * Render `<StackBlitz>` embeds.
905
+ *
906
+ * Default: `false`.
907
+ */
827
908
  stackBlitz?: boolean
828
- /** Render `<Tweet>` / `<XPost>` static cards. */
909
+ /**
910
+ * Render `<Tweet>` / `<XPost>` static cards.
911
+ *
912
+ * Default: `false`.
913
+ */
829
914
  twitter?: boolean
830
- /** Render `<Bluesky>` static cards. */
915
+ /**
916
+ * Render `<Bluesky>` static cards.
917
+ *
918
+ * Default: `false`.
919
+ */
831
920
  bluesky?: boolean
832
- /** Render `<WebContainer>` lazy placeholder blocks. */
921
+ /**
922
+ * Render `<WebContainer>` lazy placeholder blocks.
923
+ *
924
+ * Default: `false`.
925
+ */
833
926
  webContainer?: boolean
834
927
  }
835
928
 
@@ -861,19 +954,47 @@ export interface JsOgImageData {
861
954
  author?: string
862
955
  }
863
956
 
864
- /** Parser options for JavaScript. */
957
+ /**
958
+ * Parser options for JavaScript.
959
+ *
960
+ * When `gfm` is `true`, omitted extension flags inherit the GFM profile.
961
+ */
865
962
  export interface JsParserOptions {
866
- /** Enable GFM extensions. */
963
+ /**
964
+ * Enable the GFM convenience profile.
965
+ *
966
+ * Default: `false`.
967
+ */
867
968
  gfm?: boolean
868
- /** Enable footnotes. */
969
+ /**
970
+ * Enable footnote references and definitions.
971
+ *
972
+ * Default: `false`, or `true` when `gfm` is `true`.
973
+ */
869
974
  footnotes?: boolean
870
- /** Enable task lists. */
975
+ /**
976
+ * Enable GFM task-list item markers.
977
+ *
978
+ * Default: `false`, or `true` when `gfm` is `true`.
979
+ */
871
980
  taskLists?: boolean
872
- /** Enable tables. */
981
+ /**
982
+ * Enable GFM pipe tables.
983
+ *
984
+ * Default: `false`, or `true` when `gfm` is `true`.
985
+ */
873
986
  tables?: boolean
874
- /** Enable strikethrough. */
987
+ /**
988
+ * Enable GFM strikethrough spans.
989
+ *
990
+ * Default: `false`, or `true` when `gfm` is `true`.
991
+ */
875
992
  strikethrough?: boolean
876
- /** Enable autolinks. */
993
+ /**
994
+ * Enable GFM autolinks.
995
+ *
996
+ * Default: `false`, or `true` when `gfm` is `true`.
997
+ */
877
998
  autolinks?: boolean
878
999
  }
879
1000
 
@@ -915,13 +1036,29 @@ export interface JsResolvedModule {
915
1036
 
916
1037
  /** HTML sanitizer options. */
917
1038
  export interface JsSanitizeOptions {
918
- /** Enable sanitizer. When omitted, passing this object enables it. */
1039
+ /**
1040
+ * Enable sanitizer. When omitted, passing this object enables it.
1041
+ *
1042
+ * Default: `false` when the whole option is omitted; `true` when this object is present.
1043
+ */
919
1044
  enabled?: boolean
920
- /** Allowed tag names. Omit for safe defaults. */
1045
+ /**
1046
+ * Allowed tag names. Omit for safe defaults.
1047
+ *
1048
+ * Default: built-in safe tag allow list.
1049
+ */
921
1050
  allowedTags?: Array<string>
922
- /** Allowed attribute names. Omit for safe defaults. */
1051
+ /**
1052
+ * Allowed attribute names. Omit for safe defaults.
1053
+ *
1054
+ * Default: built-in safe attribute allow list.
1055
+ */
923
1056
  allowedAttributes?: Array<string>
924
- /** Allowed URL schemes for URL-bearing attributes. Omit for safe defaults. */
1057
+ /**
1058
+ * Allowed URL schemes for URL-bearing attributes. Omit for safe defaults.
1059
+ *
1060
+ * Default: built-in safe URL scheme allow list.
1061
+ */
925
1062
  allowedUrlSchemes?: Array<string>
926
1063
  }
927
1064
 
@@ -1052,7 +1189,11 @@ export interface JsSourceDocTag {
1052
1189
 
1053
1190
  /** Source preparation options for JavaScript. */
1054
1191
  export interface JsSourceOptions {
1055
- /** Parse YAML frontmatter before returning the content payload. */
1192
+ /**
1193
+ * Parse YAML frontmatter before returning the content payload.
1194
+ *
1195
+ * Default: `false`.
1196
+ */
1056
1197
  frontmatter?: boolean
1057
1198
  }
1058
1199
 
@@ -1323,70 +1464,166 @@ export interface JsThemeLayout {
1323
1464
  maxContentWidth?: string
1324
1465
  }
1325
1466
 
1326
- /** Transform options for JavaScript. */
1467
+ /**
1468
+ * Transform options for JavaScript.
1469
+ *
1470
+ * Omitted parser flags inherit the GFM profile when `gfm` is `true`; otherwise
1471
+ * they use the parser defaults.
1472
+ */
1327
1473
  export interface JsTransformOptions {
1328
- /** Enable GFM extensions. */
1474
+ /**
1475
+ * Enable the GFM convenience profile.
1476
+ *
1477
+ * Default: `false`.
1478
+ */
1329
1479
  gfm?: boolean
1330
- /** Enable footnotes. */
1480
+ /**
1481
+ * Enable footnote references and definitions.
1482
+ *
1483
+ * Default: `false`, or `true` when `gfm` is `true`.
1484
+ */
1331
1485
  footnotes?: boolean
1332
- /** Enable task lists. */
1486
+ /**
1487
+ * Enable GFM task-list item markers.
1488
+ *
1489
+ * Default: `false`, or `true` when `gfm` is `true`.
1490
+ */
1333
1491
  taskLists?: boolean
1334
- /** Enable tables. */
1492
+ /**
1493
+ * Enable GFM pipe tables.
1494
+ *
1495
+ * Default: `false`, or `true` when `gfm` is `true`.
1496
+ */
1335
1497
  tables?: boolean
1336
- /** Enable strikethrough. */
1498
+ /**
1499
+ * Enable GFM strikethrough spans.
1500
+ *
1501
+ * Default: `false`, or `true` when `gfm` is `true`.
1502
+ */
1337
1503
  strikethrough?: boolean
1338
- /** Enable autolinks. */
1504
+ /**
1505
+ * Enable GFM autolinks.
1506
+ *
1507
+ * Default: `false`, or `true` when `gfm` is `true`.
1508
+ */
1339
1509
  autolinks?: boolean
1340
- /** Parse YAML frontmatter before transforming. */
1510
+ /**
1511
+ * Parse YAML frontmatter before transforming.
1512
+ *
1513
+ * Default: `false`.
1514
+ */
1341
1515
  frontmatter?: boolean
1342
- /** Maximum TOC depth (1-6). */
1516
+ /**
1517
+ * Maximum TOC depth (1-6).
1518
+ *
1519
+ * Default: `3`.
1520
+ */
1343
1521
  tocMaxDepth?: number
1344
- /** Convert `.md` links to `.html` links for SSG output. */
1522
+ /**
1523
+ * Convert `.md` links to `.html` links for SSG output.
1524
+ *
1525
+ * Default: `false`.
1526
+ */
1345
1527
  convertMdLinks?: boolean
1346
- /** Base URL for absolute link conversion (e.g., "/" or "/docs/"). */
1528
+ /**
1529
+ * Base URL for absolute link conversion (e.g., "/" or "/docs/").
1530
+ *
1531
+ * Default: `"/"`.
1532
+ */
1347
1533
  baseUrl?: string
1348
- /** Source file path for relative link resolution. */
1534
+ /**
1535
+ * Source file path for relative link resolution.
1536
+ *
1537
+ * Default: empty string.
1538
+ */
1349
1539
  sourcePath?: string
1350
- /** Enable line annotations for code blocks using fence meta. */
1540
+ /**
1541
+ * Enable line annotations for code blocks using fence meta.
1542
+ *
1543
+ * Default: `false`.
1544
+ */
1351
1545
  codeAnnotations?: boolean
1352
- /** Fence meta key used to read code annotations. */
1546
+ /**
1547
+ * Fence meta key used to read code annotations.
1548
+ *
1549
+ * Default: `"annotate"`.
1550
+ */
1353
1551
  codeAnnotationMetaKey?: string
1354
- /** Code annotation syntax mode. */
1552
+ /**
1553
+ * Code annotation syntax mode.
1554
+ *
1555
+ * Default: `"attribute"`.
1556
+ */
1355
1557
  codeAnnotationSyntax?: string
1356
- /** Enable line numbers for all code blocks by default. */
1558
+ /**
1559
+ * Enable line numbers for all code blocks by default.
1560
+ *
1561
+ * Default: `false`.
1562
+ */
1357
1563
  codeAnnotationDefaultLineNumbers?: boolean
1358
1564
  /**
1359
1565
  * Auto-link bare URLs in text. When enabled, the renderer wraps any
1360
1566
  * text occurrence starting with a registered pattern (default `http://`
1361
1567
  * and `https://`) in an `<a>` tag.
1568
+ *
1569
+ * Default: `false`.
1362
1570
  */
1363
1571
  autolinkUrls?: boolean
1364
1572
  /**
1365
1573
  * URL prefix patterns for [`Self::autolink_urls`]. Overrides the
1366
1574
  * default `["http://", "https://"]` when set.
1575
+ *
1576
+ * Default: `["http://", "https://"]`.
1367
1577
  */
1368
1578
  autolinkPatterns?: Array<string>
1369
1579
  /**
1370
1580
  * Add `target="_blank" rel="noopener noreferrer"` to auto-linked URLs.
1371
- * Defaults to true; ignored when [`Self::autolink_urls`] is off.
1581
+ *
1582
+ * Default: `true`; ignored when [`Self::autolink_urls`] is off.
1372
1583
  */
1373
1584
  autolinkTargetBlank?: boolean
1374
- /** Opt-in Obsidian-style wiki links. */
1585
+ /**
1586
+ * Opt-in Obsidian-style wiki links.
1587
+ *
1588
+ * Default: disabled.
1589
+ */
1375
1590
  wikiLinks?: JsWikiLinkOptions
1376
- /** Opt-in emoji shortcode expansion. */
1591
+ /**
1592
+ * Opt-in emoji shortcode expansion.
1593
+ *
1594
+ * Default: disabled.
1595
+ */
1377
1596
  emojiShortcodes?: JsEmojiShortcodeOptions
1378
- /** Opt-in markdown-it-attrs style attributes. */
1597
+ /**
1598
+ * Opt-in markdown-it-attrs style attributes.
1599
+ *
1600
+ * Default: disabled.
1601
+ */
1379
1602
  attributes?: JsAttrsOptions
1380
1603
  /**
1381
1604
  * Opt-in CJK emphasis compatibility flag. The parser is already CJK-friendly;
1382
1605
  * this keeps the feature explicit in the public API.
1606
+ *
1607
+ * Default: `false`.
1383
1608
  */
1384
1609
  cjkEmphasis?: boolean
1385
- /** Opt-in VitePress-style code import/snippet injection. */
1610
+ /**
1611
+ * Opt-in VitePress-style code import/snippet injection.
1612
+ *
1613
+ * Default: disabled.
1614
+ */
1386
1615
  codeImports?: JsCodeImportOptions
1387
- /** Opt-in HTML sanitizer. */
1616
+ /**
1617
+ * Opt-in HTML sanitizer.
1618
+ *
1619
+ * Default: disabled.
1620
+ */
1388
1621
  sanitize?: JsSanitizeOptions
1389
- /** Opt-in edit-this-page link generation. */
1622
+ /**
1623
+ * Opt-in edit-this-page link generation.
1624
+ *
1625
+ * Default: disabled.
1626
+ */
1390
1627
  editThisPage?: JsEditThisPageOptions
1391
1628
  }
1392
1629
 
@@ -1400,9 +1637,17 @@ export interface JsTypeParam {
1400
1637
 
1401
1638
  /** Wiki-link transform options. */
1402
1639
  export interface JsWikiLinkOptions {
1403
- /** Enable `[[target]]` and `[[target|label]]` expansion. */
1640
+ /**
1641
+ * Enable `[[target]]` and `[[target|label]]` expansion.
1642
+ *
1643
+ * Default: `false`.
1644
+ */
1404
1645
  enabled?: boolean
1405
- /** Base URL used for site-relative wiki links. */
1646
+ /**
1647
+ * Base URL used for site-relative wiki links.
1648
+ *
1649
+ * Default: `"/"`.
1650
+ */
1406
1651
  baseUrl?: string
1407
1652
  }
1408
1653
 
@@ -1411,13 +1656,29 @@ export interface JsWikiLinkOptions {
1411
1656
  * `YouTubeOptions` defaults when omitted.
1412
1657
  */
1413
1658
  export interface JsYouTubeOptions {
1414
- /** Use privacy-enhanced mode (youtube-nocookie.com). Default: true. */
1659
+ /**
1660
+ * Use privacy-enhanced mode (`youtube-nocookie.com`).
1661
+ *
1662
+ * Default: `true`.
1663
+ */
1415
1664
  privacyEnhanced?: boolean
1416
- /** Default aspect ratio. Default: "16/9". */
1665
+ /**
1666
+ * Default iframe aspect ratio.
1667
+ *
1668
+ * Default: `"16/9"`.
1669
+ */
1417
1670
  aspectRatio?: string
1418
- /** Allow fullscreen. Default: true. */
1671
+ /**
1672
+ * Allow fullscreen playback.
1673
+ *
1674
+ * Default: `true`.
1675
+ */
1419
1676
  allowFullscreen?: boolean
1420
- /** Lazy-load the iframe. Default: true. */
1677
+ /**
1678
+ * Lazy-load the iframe.
1679
+ *
1680
+ * Default: `true`.
1681
+ */
1421
1682
  lazyLoad?: boolean
1422
1683
  }
1423
1684
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "2.67.0",
3
+ "version": "2.69.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.67.0",
49
- "@ox-content/binding-darwin-arm64": "2.67.0",
50
- "@ox-content/binding-linux-x64-gnu": "2.67.0",
51
- "@ox-content/binding-linux-arm64-gnu": "2.67.0",
52
- "@ox-content/binding-win32-x64-msvc": "2.67.0"
48
+ "@ox-content/binding-darwin-x64": "2.69.0",
49
+ "@ox-content/binding-darwin-arm64": "2.69.0",
50
+ "@ox-content/binding-linux-x64-gnu": "2.69.0",
51
+ "@ox-content/binding-linux-arm64-gnu": "2.69.0",
52
+ "@ox-content/binding-win32-x64-msvc": "2.69.0"
53
53
  }
54
54
  }