@ox-content/napi 2.66.0 → 2.68.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 +318 -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
 
@@ -540,33 +568,69 @@ export interface JsDocsOutputOptions {
540
568
 
541
569
  /** Docs-as-tests extraction options. */
542
570
  export interface JsDocsTestOptions {
543
- /** Enable docs test extraction. */
571
+ /**
572
+ * Enable docs test extraction.
573
+ *
574
+ * Default: `false` when the whole option is omitted.
575
+ */
544
576
  enabled?: boolean
545
- /** Languages that can be emitted as test cases. */
577
+ /**
578
+ * Languages that can be emitted as test cases.
579
+ *
580
+ * Default: `["js", "jsx", "ts", "tsx", "mjs", "mts"]`.
581
+ */
546
582
  languages?: Array<string>
547
- /** Require fence meta such as `test`, `runnable`, or `vitest`. */
583
+ /**
584
+ * Require fence meta such as `test`, `runnable`, or `vitest`.
585
+ *
586
+ * Default: `true`.
587
+ */
548
588
  requireMeta?: boolean
549
589
  }
550
590
 
551
591
  /** Edit-this-page link options. */
552
592
  export interface JsEditThisPageOptions {
553
- /** Enable edit link generation. */
593
+ /**
594
+ * Enable edit link generation.
595
+ *
596
+ * Default: `false` unless `repo_url` is provided by the JavaScript resolver.
597
+ */
554
598
  enabled?: boolean
555
599
  /** GitHub repository URL, e.g. `https://github.com/owner/repo`. */
556
600
  repoUrl?: string
557
- /** Branch used in edit URLs. */
601
+ /**
602
+ * Branch used in edit URLs.
603
+ *
604
+ * Default: `"main"`.
605
+ */
558
606
  branch?: string
559
- /** Root directory used to relativize `sourcePath`. */
607
+ /**
608
+ * Root directory used to relativize `sourcePath`.
609
+ *
610
+ * Default: no extra root prefix.
611
+ */
560
612
  rootDir?: string
561
- /** Link label. */
613
+ /**
614
+ * Link label.
615
+ *
616
+ * Default: `"Edit this page"`.
617
+ */
562
618
  label?: string
563
619
  }
564
620
 
565
621
  /** Emoji-shortcode transform options. */
566
622
  export interface JsEmojiShortcodeOptions {
567
- /** Enable `:shortcode:` expansion. */
623
+ /**
624
+ * Enable `:shortcode:` expansion.
625
+ *
626
+ * Default: `false`.
627
+ */
568
628
  enabled?: boolean
569
- /** Custom shortcode map. Values are emitted verbatim. */
629
+ /**
630
+ * Custom shortcode map. Values are emitted verbatim.
631
+ *
632
+ * Default: `{}`.
633
+ */
570
634
  custom?: Record<string, string>
571
635
  }
572
636
 
@@ -821,15 +885,35 @@ export interface JsMarkdownLintRuleOptions {
821
885
 
822
886
  /** Built-in media embed transform switches. */
823
887
  export interface JsMediaEmbedsOptions {
824
- /** Render `<Spotify>` embeds. */
888
+ /**
889
+ * Render `<Spotify>` embeds.
890
+ *
891
+ * Default: `false`.
892
+ */
825
893
  spotify?: boolean
826
- /** Render `<StackBlitz>` embeds. */
894
+ /**
895
+ * Render `<StackBlitz>` embeds.
896
+ *
897
+ * Default: `false`.
898
+ */
827
899
  stackBlitz?: boolean
828
- /** Render `<Tweet>` / `<XPost>` static cards. */
900
+ /**
901
+ * Render `<Tweet>` / `<XPost>` static cards.
902
+ *
903
+ * Default: `false`.
904
+ */
829
905
  twitter?: boolean
830
- /** Render `<Bluesky>` static cards. */
906
+ /**
907
+ * Render `<Bluesky>` static cards.
908
+ *
909
+ * Default: `false`.
910
+ */
831
911
  bluesky?: boolean
832
- /** Render `<WebContainer>` lazy placeholder blocks. */
912
+ /**
913
+ * Render `<WebContainer>` lazy placeholder blocks.
914
+ *
915
+ * Default: `false`.
916
+ */
833
917
  webContainer?: boolean
834
918
  }
835
919
 
@@ -861,19 +945,47 @@ export interface JsOgImageData {
861
945
  author?: string
862
946
  }
863
947
 
864
- /** Parser options for JavaScript. */
948
+ /**
949
+ * Parser options for JavaScript.
950
+ *
951
+ * When `gfm` is `true`, omitted extension flags inherit the GFM profile.
952
+ */
865
953
  export interface JsParserOptions {
866
- /** Enable GFM extensions. */
954
+ /**
955
+ * Enable the GFM convenience profile.
956
+ *
957
+ * Default: `false`.
958
+ */
867
959
  gfm?: boolean
868
- /** Enable footnotes. */
960
+ /**
961
+ * Enable footnote references and definitions.
962
+ *
963
+ * Default: `false`, or `true` when `gfm` is `true`.
964
+ */
869
965
  footnotes?: boolean
870
- /** Enable task lists. */
966
+ /**
967
+ * Enable GFM task-list item markers.
968
+ *
969
+ * Default: `false`, or `true` when `gfm` is `true`.
970
+ */
871
971
  taskLists?: boolean
872
- /** Enable tables. */
972
+ /**
973
+ * Enable GFM pipe tables.
974
+ *
975
+ * Default: `false`, or `true` when `gfm` is `true`.
976
+ */
873
977
  tables?: boolean
874
- /** Enable strikethrough. */
978
+ /**
979
+ * Enable GFM strikethrough spans.
980
+ *
981
+ * Default: `false`, or `true` when `gfm` is `true`.
982
+ */
875
983
  strikethrough?: boolean
876
- /** Enable autolinks. */
984
+ /**
985
+ * Enable GFM autolinks.
986
+ *
987
+ * Default: `false`, or `true` when `gfm` is `true`.
988
+ */
877
989
  autolinks?: boolean
878
990
  }
879
991
 
@@ -915,13 +1027,29 @@ export interface JsResolvedModule {
915
1027
 
916
1028
  /** HTML sanitizer options. */
917
1029
  export interface JsSanitizeOptions {
918
- /** Enable sanitizer. When omitted, passing this object enables it. */
1030
+ /**
1031
+ * Enable sanitizer. When omitted, passing this object enables it.
1032
+ *
1033
+ * Default: `false` when the whole option is omitted; `true` when this object is present.
1034
+ */
919
1035
  enabled?: boolean
920
- /** Allowed tag names. Omit for safe defaults. */
1036
+ /**
1037
+ * Allowed tag names. Omit for safe defaults.
1038
+ *
1039
+ * Default: built-in safe tag allow list.
1040
+ */
921
1041
  allowedTags?: Array<string>
922
- /** Allowed attribute names. Omit for safe defaults. */
1042
+ /**
1043
+ * Allowed attribute names. Omit for safe defaults.
1044
+ *
1045
+ * Default: built-in safe attribute allow list.
1046
+ */
923
1047
  allowedAttributes?: Array<string>
924
- /** Allowed URL schemes for URL-bearing attributes. Omit for safe defaults. */
1048
+ /**
1049
+ * Allowed URL schemes for URL-bearing attributes. Omit for safe defaults.
1050
+ *
1051
+ * Default: built-in safe URL scheme allow list.
1052
+ */
925
1053
  allowedUrlSchemes?: Array<string>
926
1054
  }
927
1055
 
@@ -1052,7 +1180,11 @@ export interface JsSourceDocTag {
1052
1180
 
1053
1181
  /** Source preparation options for JavaScript. */
1054
1182
  export interface JsSourceOptions {
1055
- /** Parse YAML frontmatter before returning the content payload. */
1183
+ /**
1184
+ * Parse YAML frontmatter before returning the content payload.
1185
+ *
1186
+ * Default: `false`.
1187
+ */
1056
1188
  frontmatter?: boolean
1057
1189
  }
1058
1190
 
@@ -1109,6 +1241,7 @@ export interface JsSsgNavGroup {
1109
1241
  /** Navigation items. */
1110
1242
  items: Array<JsSsgNavItem>
1111
1243
  collapsed?: boolean
1244
+ stickyCollapsed?: boolean
1112
1245
  }
1113
1246
 
1114
1247
  /** Manual SSG navigation group supplied by user configuration. */
@@ -1134,6 +1267,7 @@ export interface JsSsgNavItem {
1134
1267
  href: string
1135
1268
  children?: Array<JsSsgNavItem>
1136
1269
  collapsed?: boolean
1270
+ stickyCollapsed?: boolean
1137
1271
  }
1138
1272
 
1139
1273
  /** Page data for SSG. */
@@ -1188,6 +1322,8 @@ export interface JsSsgSidebarItem {
1188
1322
  items?: Array<JsSsgSidebarItem>
1189
1323
  /** Whether this group is collapsed by default. */
1190
1324
  collapsed?: boolean
1325
+ /** Whether this group's open state persists across page navigations. */
1326
+ stickyCollapsed?: boolean
1191
1327
  }
1192
1328
 
1193
1329
  /** Result of [`transform_tabs_embeds`]. */
@@ -1319,70 +1455,166 @@ export interface JsThemeLayout {
1319
1455
  maxContentWidth?: string
1320
1456
  }
1321
1457
 
1322
- /** Transform options for JavaScript. */
1458
+ /**
1459
+ * Transform options for JavaScript.
1460
+ *
1461
+ * Omitted parser flags inherit the GFM profile when `gfm` is `true`; otherwise
1462
+ * they use the parser defaults.
1463
+ */
1323
1464
  export interface JsTransformOptions {
1324
- /** Enable GFM extensions. */
1465
+ /**
1466
+ * Enable the GFM convenience profile.
1467
+ *
1468
+ * Default: `false`.
1469
+ */
1325
1470
  gfm?: boolean
1326
- /** Enable footnotes. */
1471
+ /**
1472
+ * Enable footnote references and definitions.
1473
+ *
1474
+ * Default: `false`, or `true` when `gfm` is `true`.
1475
+ */
1327
1476
  footnotes?: boolean
1328
- /** Enable task lists. */
1477
+ /**
1478
+ * Enable GFM task-list item markers.
1479
+ *
1480
+ * Default: `false`, or `true` when `gfm` is `true`.
1481
+ */
1329
1482
  taskLists?: boolean
1330
- /** Enable tables. */
1483
+ /**
1484
+ * Enable GFM pipe tables.
1485
+ *
1486
+ * Default: `false`, or `true` when `gfm` is `true`.
1487
+ */
1331
1488
  tables?: boolean
1332
- /** Enable strikethrough. */
1489
+ /**
1490
+ * Enable GFM strikethrough spans.
1491
+ *
1492
+ * Default: `false`, or `true` when `gfm` is `true`.
1493
+ */
1333
1494
  strikethrough?: boolean
1334
- /** Enable autolinks. */
1495
+ /**
1496
+ * Enable GFM autolinks.
1497
+ *
1498
+ * Default: `false`, or `true` when `gfm` is `true`.
1499
+ */
1335
1500
  autolinks?: boolean
1336
- /** Parse YAML frontmatter before transforming. */
1501
+ /**
1502
+ * Parse YAML frontmatter before transforming.
1503
+ *
1504
+ * Default: `false`.
1505
+ */
1337
1506
  frontmatter?: boolean
1338
- /** Maximum TOC depth (1-6). */
1507
+ /**
1508
+ * Maximum TOC depth (1-6).
1509
+ *
1510
+ * Default: `3`.
1511
+ */
1339
1512
  tocMaxDepth?: number
1340
- /** Convert `.md` links to `.html` links for SSG output. */
1513
+ /**
1514
+ * Convert `.md` links to `.html` links for SSG output.
1515
+ *
1516
+ * Default: `false`.
1517
+ */
1341
1518
  convertMdLinks?: boolean
1342
- /** Base URL for absolute link conversion (e.g., "/" or "/docs/"). */
1519
+ /**
1520
+ * Base URL for absolute link conversion (e.g., "/" or "/docs/").
1521
+ *
1522
+ * Default: `"/"`.
1523
+ */
1343
1524
  baseUrl?: string
1344
- /** Source file path for relative link resolution. */
1525
+ /**
1526
+ * Source file path for relative link resolution.
1527
+ *
1528
+ * Default: empty string.
1529
+ */
1345
1530
  sourcePath?: string
1346
- /** Enable line annotations for code blocks using fence meta. */
1531
+ /**
1532
+ * Enable line annotations for code blocks using fence meta.
1533
+ *
1534
+ * Default: `false`.
1535
+ */
1347
1536
  codeAnnotations?: boolean
1348
- /** Fence meta key used to read code annotations. */
1537
+ /**
1538
+ * Fence meta key used to read code annotations.
1539
+ *
1540
+ * Default: `"annotate"`.
1541
+ */
1349
1542
  codeAnnotationMetaKey?: string
1350
- /** Code annotation syntax mode. */
1543
+ /**
1544
+ * Code annotation syntax mode.
1545
+ *
1546
+ * Default: `"attribute"`.
1547
+ */
1351
1548
  codeAnnotationSyntax?: string
1352
- /** Enable line numbers for all code blocks by default. */
1549
+ /**
1550
+ * Enable line numbers for all code blocks by default.
1551
+ *
1552
+ * Default: `false`.
1553
+ */
1353
1554
  codeAnnotationDefaultLineNumbers?: boolean
1354
1555
  /**
1355
1556
  * Auto-link bare URLs in text. When enabled, the renderer wraps any
1356
1557
  * text occurrence starting with a registered pattern (default `http://`
1357
1558
  * and `https://`) in an `<a>` tag.
1559
+ *
1560
+ * Default: `false`.
1358
1561
  */
1359
1562
  autolinkUrls?: boolean
1360
1563
  /**
1361
1564
  * URL prefix patterns for [`Self::autolink_urls`]. Overrides the
1362
1565
  * default `["http://", "https://"]` when set.
1566
+ *
1567
+ * Default: `["http://", "https://"]`.
1363
1568
  */
1364
1569
  autolinkPatterns?: Array<string>
1365
1570
  /**
1366
1571
  * Add `target="_blank" rel="noopener noreferrer"` to auto-linked URLs.
1367
- * Defaults to true; ignored when [`Self::autolink_urls`] is off.
1572
+ *
1573
+ * Default: `true`; ignored when [`Self::autolink_urls`] is off.
1368
1574
  */
1369
1575
  autolinkTargetBlank?: boolean
1370
- /** Opt-in Obsidian-style wiki links. */
1576
+ /**
1577
+ * Opt-in Obsidian-style wiki links.
1578
+ *
1579
+ * Default: disabled.
1580
+ */
1371
1581
  wikiLinks?: JsWikiLinkOptions
1372
- /** Opt-in emoji shortcode expansion. */
1582
+ /**
1583
+ * Opt-in emoji shortcode expansion.
1584
+ *
1585
+ * Default: disabled.
1586
+ */
1373
1587
  emojiShortcodes?: JsEmojiShortcodeOptions
1374
- /** Opt-in markdown-it-attrs style attributes. */
1588
+ /**
1589
+ * Opt-in markdown-it-attrs style attributes.
1590
+ *
1591
+ * Default: disabled.
1592
+ */
1375
1593
  attributes?: JsAttrsOptions
1376
1594
  /**
1377
1595
  * Opt-in CJK emphasis compatibility flag. The parser is already CJK-friendly;
1378
1596
  * this keeps the feature explicit in the public API.
1597
+ *
1598
+ * Default: `false`.
1379
1599
  */
1380
1600
  cjkEmphasis?: boolean
1381
- /** Opt-in VitePress-style code import/snippet injection. */
1601
+ /**
1602
+ * Opt-in VitePress-style code import/snippet injection.
1603
+ *
1604
+ * Default: disabled.
1605
+ */
1382
1606
  codeImports?: JsCodeImportOptions
1383
- /** Opt-in HTML sanitizer. */
1607
+ /**
1608
+ * Opt-in HTML sanitizer.
1609
+ *
1610
+ * Default: disabled.
1611
+ */
1384
1612
  sanitize?: JsSanitizeOptions
1385
- /** Opt-in edit-this-page link generation. */
1613
+ /**
1614
+ * Opt-in edit-this-page link generation.
1615
+ *
1616
+ * Default: disabled.
1617
+ */
1386
1618
  editThisPage?: JsEditThisPageOptions
1387
1619
  }
1388
1620
 
@@ -1396,9 +1628,17 @@ export interface JsTypeParam {
1396
1628
 
1397
1629
  /** Wiki-link transform options. */
1398
1630
  export interface JsWikiLinkOptions {
1399
- /** Enable `[[target]]` and `[[target|label]]` expansion. */
1631
+ /**
1632
+ * Enable `[[target]]` and `[[target|label]]` expansion.
1633
+ *
1634
+ * Default: `false`.
1635
+ */
1400
1636
  enabled?: boolean
1401
- /** Base URL used for site-relative wiki links. */
1637
+ /**
1638
+ * Base URL used for site-relative wiki links.
1639
+ *
1640
+ * Default: `"/"`.
1641
+ */
1402
1642
  baseUrl?: string
1403
1643
  }
1404
1644
 
@@ -1407,13 +1647,29 @@ export interface JsWikiLinkOptions {
1407
1647
  * `YouTubeOptions` defaults when omitted.
1408
1648
  */
1409
1649
  export interface JsYouTubeOptions {
1410
- /** Use privacy-enhanced mode (youtube-nocookie.com). Default: true. */
1650
+ /**
1651
+ * Use privacy-enhanced mode (`youtube-nocookie.com`).
1652
+ *
1653
+ * Default: `true`.
1654
+ */
1411
1655
  privacyEnhanced?: boolean
1412
- /** Default aspect ratio. Default: "16/9". */
1656
+ /**
1657
+ * Default iframe aspect ratio.
1658
+ *
1659
+ * Default: `"16/9"`.
1660
+ */
1413
1661
  aspectRatio?: string
1414
- /** Allow fullscreen. Default: true. */
1662
+ /**
1663
+ * Allow fullscreen playback.
1664
+ *
1665
+ * Default: `true`.
1666
+ */
1415
1667
  allowFullscreen?: boolean
1416
- /** Lazy-load the iframe. Default: true. */
1668
+ /**
1669
+ * Lazy-load the iframe.
1670
+ *
1671
+ * Default: `true`.
1672
+ */
1417
1673
  lazyLoad?: boolean
1418
1674
  }
1419
1675
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "2.66.0",
3
+ "version": "2.68.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.66.0",
49
- "@ox-content/binding-darwin-arm64": "2.66.0",
50
- "@ox-content/binding-linux-x64-gnu": "2.66.0",
51
- "@ox-content/binding-linux-arm64-gnu": "2.66.0",
52
- "@ox-content/binding-win32-x64-msvc": "2.66.0"
48
+ "@ox-content/binding-darwin-x64": "2.68.0",
49
+ "@ox-content/binding-darwin-arm64": "2.68.0",
50
+ "@ox-content/binding-linux-x64-gnu": "2.68.0",
51
+ "@ox-content/binding-linux-arm64-gnu": "2.68.0",
52
+ "@ox-content/binding-win32-x64-msvc": "2.68.0"
53
53
  }
54
54
  }