@ox-content/napi 2.27.0 → 2.28.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 +33 -0
  2. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -575,6 +575,29 @@ export interface JsParserOptions {
575
575
  autolinks?: boolean
576
576
  }
577
577
 
578
+ /** Options for [`transform_pm_embeds`]. */
579
+ export interface JsPmOptions {
580
+ /**
581
+ * Enable opt-in synced package-manager tab groups. When `true`, a
582
+ * `data-ox-tab-group="pkg-manager"` attribute is emitted so the client
583
+ * runtime keeps every pm tab group on the page in sync via `localStorage`.
584
+ * Off by default; when omitted/`false` the output has no group attribute
585
+ * and behaves exactly like a standalone tab group.
586
+ */
587
+ sync?: boolean
588
+ }
589
+
590
+ /** Result of [`transform_pm_embeds`]. */
591
+ export interface JsPmTransformResult {
592
+ /** HTML with every `<pm>` block expanded into a package-manager tab widget. */
593
+ html: string
594
+ /**
595
+ * Number of tab groups expanded; the caller advances its shared tab-group
596
+ * counter by this amount.
597
+ */
598
+ groupCount: number
599
+ }
600
+
578
601
  /** Public export metadata. */
579
602
  export interface JsPublicExport {
580
603
  name: string
@@ -1211,6 +1234,16 @@ export declare function transformMdastRaw(source: string, options?: JsTransformO
1211
1234
  */
1212
1235
  export declare function transformMermaid(html: string, mmdcPath: string): MermaidTransformResult
1213
1236
 
1237
+ /**
1238
+ * Expand `<pm>` blocks in rendered HTML into npm/pnpm/yarn/bun install tabs.
1239
+ *
1240
+ * The single npm-style command inside each `<pm>` element is converted to the
1241
+ * equivalent command for every package manager and rendered into the shared
1242
+ * `ox-tabs` widget. Groups are numbered from `start_group`. Syncing is opt-in
1243
+ * via `options.sync` and off by default.
1244
+ */
1245
+ export declare function transformPmEmbeds(html: string, startGroup: number, options?: JsPmOptions | undefined | null): JsPmTransformResult
1246
+
1214
1247
  /** Transform result containing HTML, frontmatter, and TOC. */
1215
1248
  export interface TransformResult {
1216
1249
  /** The rendered HTML. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "2.27.0",
3
+ "version": "2.28.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.27.0",
49
- "@ox-content/binding-darwin-arm64": "2.27.0",
50
- "@ox-content/binding-linux-x64-gnu": "2.27.0",
51
- "@ox-content/binding-linux-arm64-gnu": "2.27.0",
52
- "@ox-content/binding-win32-x64-msvc": "2.27.0"
48
+ "@ox-content/binding-darwin-x64": "2.28.0",
49
+ "@ox-content/binding-darwin-arm64": "2.28.0",
50
+ "@ox-content/binding-linux-x64-gnu": "2.28.0",
51
+ "@ox-content/binding-linux-arm64-gnu": "2.28.0",
52
+ "@ox-content/binding-win32-x64-msvc": "2.28.0"
53
53
  }
54
54
  }