@ox-content/napi 2.90.0 → 3.0.0-alpha.2

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 +423 -2
  2. package/index.js +3 -0
  3. package/package.json +8 -8
package/index.d.ts CHANGED
@@ -70,7 +70,7 @@ export declare function buildSearchIndex(documents: Array<JsSearchDocument>): st
70
70
  * File discovery, Markdown parsing, search document extraction, and index
71
71
  * construction all run on the Rust side.
72
72
  */
73
- export declare function buildSearchIndexFromDirectory(srcDir: string, base: string, extensions: Array<string>): string
73
+ export declare function buildSearchIndexFromDirectory(srcDir: string, base: string, extensions: Array<string>, options?: JsSearchIndexBuildOptions | undefined | null): string
74
74
 
75
75
  /** Builds SSG navigation groups from markdown files. */
76
76
  export declare function buildSsgNavItems(markdownFiles: Array<string>, srcDir: string, base: string, extension: string): Array<JsSsgNavGroup>
@@ -96,6 +96,9 @@ export declare function checkI18n(dictDir: string, usedKeys: Array<string>): I18
96
96
  */
97
97
  export declare function checkI18nProject(dictDir: string, srcDirs: Array<string>, functionNames: Array<string>, defaultLocale: string): I18NCheckResult
98
98
 
99
+ /** Classifies already-parsed frontmatter JSON against publish-state options. */
100
+ export declare function classifyPublishState(frontmatterJson: string, options?: JsPublishStateOptions | undefined | null): JsPublishDecision
101
+
99
102
  /** Collects source files for generated API documentation. */
100
103
  export declare function collectDocsSourceFiles(srcDir: string, include: Array<string>, exclude: Array<string>): Array<string>
101
104
 
@@ -195,6 +198,9 @@ export declare function generateSsgBarePage(page: JsSsgBarePage): string
195
198
  /** Generates SSG HTML page with navigation and search. */
196
199
  export declare function generateSsgHtml(pageData: JsSsgPageData, navGroups: Array<JsSsgNavGroup>, config: JsSsgConfig): string
197
200
 
201
+ /** Returns unique git authors for a file. Empty when git is missing or fails. */
202
+ export declare function getGitContributors(filePath: string, root?: string | undefined | null): Array<JsGitContributor>
203
+
198
204
  /** Returns the last git commit timestamp for a file in milliseconds. */
199
205
  export declare function getGitLastUpdated(filePath: string, root?: string | undefined | null): number | null
200
206
 
@@ -323,6 +329,12 @@ export interface IncrementalMarkdownRenderResult {
323
329
  errors: Array<string>
324
330
  }
325
331
 
332
+ /** Opt-in skip link and print styles. Presence of the object enables the feature. */
333
+ export interface JsA11y {
334
+ /** Override for the skip-link label. Empty / omitted uses "Skip to content". */
335
+ skipLinkLabel?: string
336
+ }
337
+
326
338
  /** Attribute syntax transform options. */
327
339
  export interface JsAttrsOptions {
328
340
  /**
@@ -333,6 +345,16 @@ export interface JsAttrsOptions {
333
345
  enabled?: boolean
334
346
  }
335
347
 
348
+ /** Opt-in `{badge:variant}` inline badges. */
349
+ export interface JsBadgeOptions {
350
+ /**
351
+ * Enable `{badge:variant}text{/badge}` expansion.
352
+ *
353
+ * Default: `false`.
354
+ */
355
+ enabled?: boolean
356
+ }
357
+
336
358
  export interface JsBuildCollectionManifestOptions {
337
359
  /** Source directory containing Markdown files. */
338
360
  srcDir: string
@@ -346,6 +368,16 @@ export interface JsBuildCollectionManifestOptions {
346
368
  transformOptions?: JsTransformOptions
347
369
  }
348
370
 
371
+ /** Opt-in `::: card` / `::: link-card` / `::: card-grid` blocks. */
372
+ export interface JsCardOptions {
373
+ /**
374
+ * Enable card, link-card, and card-grid containers.
375
+ *
376
+ * Default: `false`.
377
+ */
378
+ enabled?: boolean
379
+ }
380
+
349
381
  /** Extracted fenced code block. */
350
382
  export interface JsCodeBlock {
351
383
  language: string
@@ -420,6 +452,26 @@ export interface JsCollectionDefinition {
420
452
  include: Array<string>
421
453
  }
422
454
 
455
+ /** Opt-in `::: tip` custom containers. */
456
+ export interface JsContainerOptions {
457
+ /**
458
+ * Enable `::: type` containers.
459
+ *
460
+ * Default: `false`.
461
+ */
462
+ enabled?: boolean
463
+ /** Extra or overriding container types. */
464
+ types?: Record<string, JsContainerTypeOptions>
465
+ }
466
+
467
+ /** Custom container transform options. */
468
+ export interface JsContainerTypeOptions {
469
+ /** Title used when the opener does not set one. */
470
+ title?: string
471
+ /** `"details"` renders `<details>`/`<summary>`; anything else is a `<div>`. */
472
+ tag?: string
473
+ }
474
+
423
475
  /** Normalized documentation entry used by generated API docs. */
424
476
  export interface JsDocEntry {
425
477
  name: string
@@ -815,6 +867,36 @@ export interface JsFeatureConfig {
815
867
  linkText?: string
816
868
  }
817
869
 
870
+ /** Opt-in static `file-tree` fences. */
871
+ export interface JsFileTreeOptions {
872
+ /**
873
+ * Enable `file-tree` fences.
874
+ *
875
+ * Default: `false`.
876
+ */
877
+ enabled?: boolean
878
+ /**
879
+ * Open directory `<details>` by default.
880
+ *
881
+ * Default: `true`.
882
+ */
883
+ defaultOpen?: boolean
884
+ /**
885
+ * Render folder and file icons.
886
+ *
887
+ * Default: `true`.
888
+ */
889
+ icons?: boolean
890
+ /** Trusted SVG markup or class tokens for collapsed folders. */
891
+ iconFolder?: string
892
+ /** Trusted SVG markup or class tokens for open folders. */
893
+ iconFolderOpen?: string
894
+ /** Trusted SVG markup or class tokens for files. */
895
+ iconFile?: string
896
+ /** Trusted SVG markup or class tokens keyed by file extension. */
897
+ iconFiles?: Record<string, string>
898
+ }
899
+
818
900
  export interface JsFrameworkComponentIsland {
819
901
  name: string
820
902
  props: Record<string, any>
@@ -822,6 +904,16 @@ export interface JsFrameworkComponentIsland {
822
904
  content?: string
823
905
  }
824
906
 
907
+ /** One unique git author returned by `getGitContributors`. */
908
+ export interface JsGitContributor {
909
+ /** Author name from `%an`. */
910
+ name: string
911
+ /** Author email from `%ae`. Never rendered into `href`. */
912
+ email?: string
913
+ /** Number of commits attributed to this author on the file. */
914
+ commits?: number
915
+ }
916
+
825
917
  /** Export graph resolution options. */
826
918
  export interface JsGraphOptions {
827
919
  root?: string
@@ -830,6 +922,16 @@ export interface JsGraphOptions {
830
922
  externalPackageSources?: Array<JsExternalPackageSource>
831
923
  }
832
924
 
925
+ /** Header nav link or dropdown. */
926
+ export interface JsHeaderNavItem {
927
+ /** Display label. */
928
+ text: string
929
+ /** Link URL. */
930
+ link?: string
931
+ /** Dropdown children. */
932
+ items?: Array<JsHeaderNavItem>
933
+ }
934
+
833
935
  /** Hero action for entry page. */
834
936
  export interface JsHeroAction {
835
937
  /** Button theme: "brand" or "alt". */
@@ -918,6 +1020,38 @@ export interface JsI18NRuntimeLocale {
918
1020
  dir?: string
919
1021
  }
920
1022
 
1023
+ /** Opt-in figures, captions, and lazy images. */
1024
+ export interface JsImageOptions {
1025
+ /**
1026
+ * Enable figure captions, lazy loading, and safe dimensions.
1027
+ *
1028
+ * Default: `false`.
1029
+ */
1030
+ enabled?: boolean
1031
+ /**
1032
+ * Add `loading="lazy"` to transformed images.
1033
+ *
1034
+ * Default: `true`.
1035
+ */
1036
+ lazy?: boolean
1037
+ }
1038
+
1039
+ /** Markdown file include options. */
1040
+ export interface JsIncludeOptions {
1041
+ /**
1042
+ * Enable `<!-- @include: PATH -->` expansion.
1043
+ *
1044
+ * Default: `false`.
1045
+ */
1046
+ enabled?: boolean
1047
+ /**
1048
+ * Root directory used for `@/` and absolute include paths.
1049
+ *
1050
+ * Default: project root from the JavaScript caller.
1051
+ */
1052
+ rootDir?: string
1053
+ }
1054
+
921
1055
  /** Options for appending to an incremental parser. */
922
1056
  export interface JsIncrementalParseOptions {
923
1057
  /** Treat this append as the final stream chunk. */
@@ -938,6 +1072,24 @@ export interface JsIncrementalRenderOptions {
938
1072
  completeInline?: boolean
939
1073
  }
940
1074
 
1075
+ /** Opt-in JSON-LD structured data. Presence of the object enables the feature. */
1076
+ export interface JsJsonLd {
1077
+ /** When false, omit BreadcrumbList even if a visible trail exists. */
1078
+ breadcrumbs?: boolean
1079
+ /** Optional publisher. Missing fields are not invented. */
1080
+ publisher?: JsJsonLdPublisher
1081
+ /** Site origin used for `@id` / `url`. */
1082
+ siteUrl?: string
1083
+ }
1084
+
1085
+ /** Optional JSON-LD publisher. Only configured fields are emitted. */
1086
+ export interface JsJsonLdPublisher {
1087
+ /** Organization name. */
1088
+ name?: string
1089
+ /** Organization URL. Unsafe schemes are dropped. */
1090
+ url?: string
1091
+ }
1092
+
941
1093
  /** Locale information for the locale switcher. */
942
1094
  export interface JsLocaleInfo {
943
1095
  /** BCP 47 locale tag. */
@@ -948,6 +1100,16 @@ export interface JsLocaleInfo {
948
1100
  dir: string
949
1101
  }
950
1102
 
1103
+ /** Sibling page or locale-root href for one locale. */
1104
+ export interface JsLocalePath {
1105
+ /** BCP 47 locale tag. */
1106
+ code: string
1107
+ /** Href of the same page in this locale, when that translation exists. */
1108
+ href?: string
1109
+ /** Locale home href used when `href` is missing. */
1110
+ root?: string
1111
+ }
1112
+
951
1113
  export interface JsMarkdownLintDiagnostic {
952
1114
  ruleId: string
953
1115
  severity: string
@@ -975,6 +1137,8 @@ export interface JsMarkdownLintOptions {
975
1137
  languages?: Array<string>
976
1138
  rules?: JsMarkdownLintRuleOptions
977
1139
  dictionary?: JsMarkdownLintDictionaryOptions
1140
+ /** Enable MDX-aware syntax masking while linting visible prose. */
1141
+ mdx?: boolean
978
1142
  }
979
1143
 
980
1144
  export interface JsMarkdownLintResult {
@@ -995,6 +1159,16 @@ export interface JsMarkdownLintRuleOptions {
995
1159
  trailingSpaces?: boolean
996
1160
  }
997
1161
 
1162
+ /** Opt-in `$…$` inline and `$$…$$` block math. */
1163
+ export interface JsMathOptions {
1164
+ /**
1165
+ * Enable `$…$` inline and `$$…$$` block math.
1166
+ *
1167
+ * Default: `false` when the whole option is omitted; `true` when this object is present.
1168
+ */
1169
+ enabled?: boolean
1170
+ }
1171
+
998
1172
  /** Built-in media embed transform switches. */
999
1173
  export interface JsMediaEmbedsOptions {
1000
1174
  /**
@@ -1057,6 +1231,27 @@ export interface JsOgImageData {
1057
1231
  author?: string
1058
1232
  }
1059
1233
 
1234
+ /** Per-page frontmatter chrome flags. */
1235
+ export interface JsPageChromeFlags {
1236
+ sidebar?: boolean
1237
+ outline?: boolean
1238
+ aside?: boolean
1239
+ footer?: boolean
1240
+ navbar?: boolean
1241
+ lastUpdated?: boolean
1242
+ editLink?: boolean
1243
+ }
1244
+
1245
+ /** Frontmatter override for one previous/next pager side. */
1246
+ export interface JsPagerOverride {
1247
+ /** Hide this side when true. */
1248
+ hidden?: boolean
1249
+ /** Replacement title. */
1250
+ text?: string
1251
+ /** Replacement href. */
1252
+ href?: string
1253
+ }
1254
+
1060
1255
  /**
1061
1256
  * Parser options for JavaScript.
1062
1257
  *
@@ -1069,6 +1264,12 @@ export interface JsParserOptions {
1069
1264
  * Default: `false`.
1070
1265
  */
1071
1266
  gfm?: boolean
1267
+ /**
1268
+ * Enable MDX JSX, ESM, and expression nodes.
1269
+ *
1270
+ * Default: `false`.
1271
+ */
1272
+ mdx?: boolean
1072
1273
  /**
1073
1274
  * Enable footnote references and definitions.
1074
1275
  *
@@ -1139,6 +1340,34 @@ export interface JsPublicExport {
1139
1340
  source: JsExportSource
1140
1341
  }
1141
1342
 
1343
+ /** Whether a page should be written and listed. */
1344
+ export interface JsPublishDecision {
1345
+ /** Write HTML for this page. */
1346
+ output: boolean
1347
+ /** Include the page in nav, sitemap, and search. */
1348
+ listed: boolean
1349
+ }
1350
+
1351
+ /** JavaScript publish-state options. */
1352
+ export interface JsPublishStateOptions {
1353
+ /** When false, every page stays published and listed. */
1354
+ enabled?: boolean
1355
+ /** Injected ISO-8601 clock used for scheduled / expiry comparison. */
1356
+ now?: string
1357
+ /** Keep draft and not-yet-scheduled pages visible (dev preview). */
1358
+ includeDrafts?: boolean
1359
+ }
1360
+
1361
+ /** Opt-in reader chrome flags. Presence of the object enables the feature. */
1362
+ export interface JsReaderChrome {
1363
+ /** Copy button on fenced code blocks. */
1364
+ copy?: boolean
1365
+ /** Icon and `rel` on outbound links. */
1366
+ externalLinks?: boolean
1367
+ /** Back-to-top control that appears after scroll. */
1368
+ backToTop?: boolean
1369
+ }
1370
+
1142
1371
  /** Resolved source module. */
1143
1372
  export interface JsResolvedModule {
1144
1373
  path: string
@@ -1197,6 +1426,14 @@ export interface JsSearchDocument {
1197
1426
  code: Array<string>
1198
1427
  }
1199
1428
 
1429
+ /** Optional filters for directory search-index construction. */
1430
+ export interface JsSearchIndexBuildOptions {
1431
+ /** Publish-state filter applied while walking Markdown files. */
1432
+ publishState?: JsPublishStateOptions
1433
+ /** Explicit MDX parser override. When omitted, `.mdx` files enable MDX. */
1434
+ mdx?: boolean
1435
+ }
1436
+
1200
1437
  /** Search options for JavaScript. */
1201
1438
  export interface JsSearchOptions {
1202
1439
  /** Maximum number of results. */
@@ -1239,6 +1476,16 @@ export interface JsSearchRuntimeOptions {
1239
1476
  hotkey: string
1240
1477
  }
1241
1478
 
1479
+ /** One child link on a generated section index. */
1480
+ export interface JsSectionIndexItem {
1481
+ /** Visible title. Escaped in HTML. */
1482
+ title: string
1483
+ /** Destination. `javascript:` and other schemes are rejected. */
1484
+ href: string
1485
+ /** Optional card description. Escaped in HTML. */
1486
+ description?: string
1487
+ }
1488
+
1242
1489
  /** Custom social link for JavaScript. */
1243
1490
  export interface JsSocialLink {
1244
1491
  /** Icon label. */
@@ -1357,6 +1604,8 @@ export interface JsSsgConfig {
1357
1604
  siteName: string
1358
1605
  /** Base URL path. */
1359
1606
  base: string
1607
+ /** Optional site-root href for breadcrumbs. */
1608
+ breadcrumbRootHref?: string
1360
1609
  /** OG image URL. */
1361
1610
  ogImage?: string
1362
1611
  /** Theme configuration. */
@@ -1365,6 +1614,32 @@ export interface JsSsgConfig {
1365
1614
  locale?: string
1366
1615
  /** Available locales for locale switcher. */
1367
1616
  availableLocales?: Array<JsLocaleInfo>
1617
+ /** When true, render previous/next page links after the article. */
1618
+ pagination?: boolean
1619
+ /** When true, render a breadcrumb trail above the article. */
1620
+ breadcrumbs?: boolean
1621
+ /** Opt-in copy, external-link, and back-to-top chrome. */
1622
+ readerChrome?: JsReaderChrome
1623
+ /** Opt-in header locale switcher. */
1624
+ localeSwitcher?: boolean
1625
+ /** Existing sibling hrefs and locale roots. */
1626
+ localePaths?: Array<JsLocalePath>
1627
+ /** Opt-in skip link and print styles. Presence enables the feature. */
1628
+ a11y?: JsA11y
1629
+ /** Opt-in team / members page. Omitted stays off. */
1630
+ team?: JsTeamOptions
1631
+ /** When true, honor per-page frontmatter chrome flags. */
1632
+ pageChrome?: boolean
1633
+ /** Opt-in JSON-LD structured data. Presence enables the feature. */
1634
+ jsonLd?: JsJsonLd
1635
+ }
1636
+
1637
+ /** One rendered git author on an SSG page. */
1638
+ export interface JsSsgContributor {
1639
+ /** Display name. Escaped in HTML. */
1640
+ name: string
1641
+ /** Optional `https:` avatar URL. Emails are never accepted here. */
1642
+ avatar?: string
1368
1643
  }
1369
1644
 
1370
1645
  /** Result of SSG shared asset extraction. */
@@ -1433,10 +1708,22 @@ export interface JsSsgPageData {
1433
1708
  toc: Array<TocEntry>
1434
1709
  /** Last updated timestamp in milliseconds since the Unix epoch. */
1435
1710
  lastUpdated?: number
1711
+ /** Unique git authors for this page. Empty unless the site opted in. */
1712
+ contributors?: Array<JsSsgContributor>
1436
1713
  /** URL path. */
1437
1714
  path: string
1438
1715
  /** Entry page configuration (if layout: entry). */
1439
1716
  entryPage?: JsEntryPageConfig
1717
+ /** Frontmatter override for the previous-page link. */
1718
+ prev?: JsPagerOverride
1719
+ /** Frontmatter override for the next-page link. */
1720
+ next?: JsPagerOverride
1721
+ /** Frontmatter `breadcrumbs: false` hides the trail on this page. */
1722
+ breadcrumbs?: boolean
1723
+ /** Frontmatter `layout`. `team` renders member cards when the option is on. */
1724
+ layout?: string
1725
+ /** Per-page chrome flags. Honored only when page chrome is enabled. */
1726
+ chrome?: JsPageChromeFlags
1440
1727
  }
1441
1728
 
1442
1729
  /** Resolved SSG output and public route paths. */
@@ -1477,6 +1764,11 @@ export interface JsSsgSidebarItem {
1477
1764
  stickyCollapsed?: boolean
1478
1765
  }
1479
1766
 
1767
+ /** Opt-in `::: steps` wrappers. `enabled` defaults to `false`. */
1768
+ export interface JsStepsOptions {
1769
+ enabled?: boolean
1770
+ }
1771
+
1480
1772
  /** Result of [`super::transform_tabs_embeds`]. */
1481
1773
  export interface JsTabsTransformResult {
1482
1774
  /** HTML with every `<tabs>` block expanded. */
@@ -1488,6 +1780,44 @@ export interface JsTabsTransformResult {
1488
1780
  groupCount: number
1489
1781
  }
1490
1782
 
1783
+ /** One link on a team member card. */
1784
+ export interface JsTeamLink {
1785
+ /** Visible label. */
1786
+ label: string
1787
+ /** Destination URL. */
1788
+ href: string
1789
+ }
1790
+
1791
+ /** One person on the team page. */
1792
+ export interface JsTeamMember {
1793
+ /** Display name. */
1794
+ name: string
1795
+ /** Optional role or title. */
1796
+ role?: string
1797
+ /** Avatar URL. */
1798
+ avatar?: string
1799
+ /** Optional profile or social links. */
1800
+ links?: Array<JsTeamLink>
1801
+ }
1802
+
1803
+ /** Opt-in team / members page. Presence of the object enables the feature. */
1804
+ export interface JsTeamOptions {
1805
+ /** When false, `layout: team` is ignored. */
1806
+ enabled?: boolean
1807
+ /** Members rendered as static cards. */
1808
+ members?: Array<JsTeamMember>
1809
+ }
1810
+
1811
+ /** Announcement bar for JavaScript. */
1812
+ export interface JsThemeAnnouncement {
1813
+ /** Escaped bar text. */
1814
+ text: string
1815
+ /** Optional https or same-origin link. */
1816
+ link?: string
1817
+ /** localStorage key used to persist dismiss. */
1818
+ dismissKey?: string
1819
+ }
1820
+
1491
1821
  /** Theme colors for JavaScript. */
1492
1822
  export interface JsThemeColors {
1493
1823
  /** Primary accent color. */
@@ -1514,6 +1844,12 @@ export interface JsThemeColors {
1514
1844
 
1515
1845
  /** Theme configuration for JavaScript. */
1516
1846
  export interface JsThemeConfig {
1847
+ /** Progressive cross-document transitions for same-origin MPA navigation. */
1848
+ viewTransitions?: boolean
1849
+ /** Right-hand "On this page" outline. Omitted and `false` hide it. */
1850
+ aside?: boolean
1851
+ /** Breadcrumb trail from the site root through sidebar ancestors. */
1852
+ breadcrumbs?: boolean
1517
1853
  /** Light mode colors. */
1518
1854
  colors?: JsThemeColors
1519
1855
  /** Dark mode colors. */
@@ -1526,6 +1862,10 @@ export interface JsThemeConfig {
1526
1862
  layout?: JsThemeLayout
1527
1863
  /** Header configuration. */
1528
1864
  header?: JsThemeHeader
1865
+ /** Opt-in header nav items. */
1866
+ nav?: Array<JsHeaderNavItem>
1867
+ /** Opt-in announcement bar. */
1868
+ announcement?: JsThemeAnnouncement
1529
1869
  /** Footer configuration. */
1530
1870
  footer?: JsThemeFooter
1531
1871
  /** Social links configuration. */
@@ -1621,6 +1961,12 @@ export interface JsTransformOptions {
1621
1961
  * Default: `false`.
1622
1962
  */
1623
1963
  gfm?: boolean
1964
+ /**
1965
+ * Enable MDX JSX, ESM, and expression nodes.
1966
+ *
1967
+ * Default: `false`.
1968
+ */
1969
+ mdx?: boolean
1624
1970
  /**
1625
1971
  * Enable footnote references and definitions.
1626
1972
  *
@@ -1782,6 +2128,54 @@ export interface JsTransformOptions {
1782
2128
  * Default: disabled.
1783
2129
  */
1784
2130
  editThisPage?: JsEditThisPageOptions
2131
+ /**
2132
+ * Opt-in `::: tip` custom containers.
2133
+ *
2134
+ * Default: disabled.
2135
+ */
2136
+ containers?: JsContainerOptions
2137
+ /**
2138
+ * Opt-in Markdown file includes via `<!-- @include: PATH -->`.
2139
+ *
2140
+ * Default: disabled.
2141
+ */
2142
+ includes?: JsIncludeOptions
2143
+ /**
2144
+ * Opt-in `::: steps` ordered lists.
2145
+ *
2146
+ * Default: disabled.
2147
+ */
2148
+ steps?: JsStepsOptions
2149
+ /**
2150
+ * Opt-in `{badge:variant}` inline badges.
2151
+ *
2152
+ * Default: disabled.
2153
+ */
2154
+ badges?: JsBadgeOptions
2155
+ /**
2156
+ * Opt-in figures, captions, and lazy images.
2157
+ *
2158
+ * Default: disabled.
2159
+ */
2160
+ images?: JsImageOptions
2161
+ /**
2162
+ * Opt-in `::: card` / `::: link-card` / `::: card-grid` blocks.
2163
+ *
2164
+ * Default: disabled.
2165
+ */
2166
+ cards?: JsCardOptions
2167
+ /**
2168
+ * Opt-in `$…$` inline and `$$…$$` block math.
2169
+ *
2170
+ * Default: disabled.
2171
+ */
2172
+ math?: boolean | JsMathOptions
2173
+ /**
2174
+ * Opt-in static `file-tree` fences.
2175
+ *
2176
+ * Default: disabled.
2177
+ */
2178
+ fileTree?: JsFileTreeOptions
1785
2179
  }
1786
2180
 
1787
2181
  /** Type parameter documentation (`<T extends C = D>`) used by generated API docs. */
@@ -1865,6 +2259,24 @@ export declare function loadDictionariesFlat(dir: string): Record<string, Record
1865
2259
  /** Returns true when a document belongs to at least one requested search scope. */
1866
2260
  export declare function matchesSearchScopes(id: string, url: string, scopes: Array<string>): boolean
1867
2261
 
2262
+ /** One `import` statement collected from MDX ESM. */
2263
+ export interface MdxImport {
2264
+ /** Module specifier string. */
2265
+ source: string
2266
+ /** Bindings created by the import. */
2267
+ specifiers: Array<MdxImportSpecifier>
2268
+ }
2269
+
2270
+ /** How a specifier was imported. */
2271
+ export interface MdxImportSpecifier {
2272
+ /** Imported name (`default`, `*`, or the named export). */
2273
+ imported: string
2274
+ /** Local binding name. */
2275
+ local: string
2276
+ /** `default`, `named`, or `namespace`. */
2277
+ kind: 'default' | 'named' | 'namespace'
2278
+ }
2279
+
1868
2280
  /** Restores code block metadata after JavaScript-side syntax highlighting. */
1869
2281
  export declare function mergeHighlightedCodeBlocks(originalHtml: string, highlightedHtml: string): string
1870
2282
 
@@ -1967,6 +2379,9 @@ export interface RenderResult {
1967
2379
  errors: Array<string>
1968
2380
  }
1969
2381
 
2382
+ /** Renders escaped section-index listing HTML. Hostile hrefs are dropped. */
2383
+ export declare function renderSsgSectionIndex(title: string, items: Array<JsSectionIndexItem>, style: string): string
2384
+
1970
2385
  /** Resolves manual SSG navigation groups. */
1971
2386
  export declare function resolveSsgNavigationGroups(navigation: Array<JsSsgNavigationGroup>, base: string, extension: string): Array<JsSsgNavGroup>
1972
2387
 
@@ -2033,7 +2448,7 @@ export declare function transformMermaid(html: string, mmdcPath: string): Mermai
2033
2448
  */
2034
2449
  export declare function transformPmEmbeds(html: string, startGroup: number, options?: JsPmOptions | undefined | null): JsPmTransformResult
2035
2450
 
2036
- /** Transform result containing HTML, frontmatter, and TOC. */
2451
+ /** Transform result containing HTML, frontmatter, TOC, and MDX metadata. */
2037
2452
  export interface TransformResult {
2038
2453
  /** The rendered HTML. */
2039
2454
  html: string
@@ -2043,6 +2458,12 @@ export interface TransformResult {
2043
2458
  toc: Array<TocEntry>
2044
2459
  /** Parse/render errors, if any. */
2045
2460
  errors: Array<string>
2461
+ /** MDX `import` statements (empty when MDX is off or no ESM nodes). */
2462
+ imports: Array<MdxImport>
2463
+ /** Export names from MDX ESM (empty when MDX is off or no exports). */
2464
+ exports: Array<string>
2465
+ /** Unique JSX component names in document order (empty when none). */
2466
+ components: Array<string>
2046
2467
  }
2047
2468
 
2048
2469
  /**
package/index.js CHANGED
@@ -197,6 +197,7 @@ module.exports.mergeHighlightedCodeBlocks = binding.mergeHighlightedCodeBlocks;
197
197
  module.exports.generateOgImageSvg = binding.generateOgImageSvg;
198
198
  module.exports.buildSearchIndex = binding.buildSearchIndex;
199
199
  module.exports.buildSearchIndexFromDirectory = binding.buildSearchIndexFromDirectory;
200
+ module.exports.classifyPublishState = binding.classifyPublishState;
200
201
  module.exports.writeSearchIndex = binding.writeSearchIndex;
201
202
  module.exports.searchIndex = binding.searchIndex;
202
203
  module.exports.extractSearchContent = binding.extractSearchContent;
@@ -217,6 +218,7 @@ module.exports.supportsHighlightLanguage = binding.supportsHighlightLanguage;
217
218
  module.exports.nativeHighlightLanguages = binding.nativeHighlightLanguages;
218
219
  module.exports.generateSsgBarePage = binding.generateSsgBarePage;
219
220
  module.exports.getGitLastUpdated = binding.getGitLastUpdated;
221
+ module.exports.getGitContributors = binding.getGitContributors;
220
222
  module.exports.resolveSsgRoutePaths = binding.resolveSsgRoutePaths;
221
223
  module.exports.getSsgOutputPath = binding.getSsgOutputPath;
222
224
  module.exports.getSsgUrlPath = binding.getSsgUrlPath;
@@ -238,4 +240,5 @@ module.exports.checkI18n = binding.checkI18n;
238
240
  module.exports.checkI18nProject = binding.checkI18nProject;
239
241
  module.exports.extractTranslationKeys = binding.extractTranslationKeys;
240
242
  module.exports.renderFrameworkComponentCode = binding.renderFrameworkComponentCode;
243
+ module.exports.renderSsgSectionIndex = binding.renderSsgSectionIndex;
241
244
  module.exports.escapeSvelteMarkup = binding.escapeSvelteMarkup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "2.90.0",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "Node.js bindings for Ox Content - High-performance Markdown parser",
5
5
  "keywords": [
6
6
  "markdown",
@@ -47,12 +47,12 @@
47
47
  ]
48
48
  },
49
49
  "optionalDependencies": {
50
- "@ox-content/binding-darwin-x64": "2.90.0",
51
- "@ox-content/binding-darwin-arm64": "2.90.0",
52
- "@ox-content/binding-linux-x64-gnu": "2.90.0",
53
- "@ox-content/binding-linux-x64-musl": "2.90.0",
54
- "@ox-content/binding-linux-arm64-gnu": "2.90.0",
55
- "@ox-content/binding-linux-arm64-musl": "2.90.0",
56
- "@ox-content/binding-win32-x64-msvc": "2.90.0"
50
+ "@ox-content/binding-darwin-x64": "3.0.0-alpha.2",
51
+ "@ox-content/binding-darwin-arm64": "3.0.0-alpha.2",
52
+ "@ox-content/binding-linux-x64-gnu": "3.0.0-alpha.2",
53
+ "@ox-content/binding-linux-x64-musl": "3.0.0-alpha.2",
54
+ "@ox-content/binding-linux-arm64-gnu": "3.0.0-alpha.2",
55
+ "@ox-content/binding-linux-arm64-musl": "3.0.0-alpha.2",
56
+ "@ox-content/binding-win32-x64-msvc": "3.0.0-alpha.2"
57
57
  }
58
58
  }