Skip to content

Commit 352a64d

Browse files
committed
Add attacher type
1 parent 8d6b952 commit 352a64d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/mdx/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { transform as remarkCodeHike } from "./remark/transform"
1+
export { attacher as remarkCodeHike } from "./remark/transform"
22

33
export { highlight } from "./highlighter"

packages/mdx/src/remark/transform.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { valueToEstree } from "./to-estree"
1010
import { CH_CODE_CONFIG_VAR_NAME } from "./unist-utils"
1111
import { JsxNode, SuperNode, visit } from "./nodes"
1212
import { addConfigDefaults, CodeHikeConfig } from "./config"
13+
import { Attacher } from "unified"
1314

1415
const transforms = [
1516
transformPreviews,
@@ -20,7 +21,9 @@ const transforms = [
2021
transformInlineCodes,
2122
transformCodes,
2223
]
23-
export function transform(unsafeConfig: CodeHikeConfig) {
24+
export const attacher: Attacher<
25+
[CodeHikeConfig?]
26+
> = unsafeConfig => {
2427
return async (tree: SuperNode, file: any) => {
2528
const config = addConfigDefaults(
2629
unsafeConfig,

0 commit comments

Comments
 (0)