Skip to content

Commit dca42cd

Browse files
committed
🏷️ Add additional typing
1 parent a9dacfe commit dca42cd

File tree

6 files changed

+27
-23
lines changed

6 files changed

+27
-23
lines changed

test/heading.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("Headings", () => {
1414
it("adds IDs and exports headings even when a custom heading is included", async () => {
1515
const result = (await markdocPreprocess({
1616
headingIds: true,
17-
nodes: { heading: basicHeadingNode.heading },
17+
nodes: { heading: basicHeadingNode },
1818
} as Options).markup!({
1919
content: markdocWithHeadings,
2020
filename: "test.md",
@@ -26,7 +26,7 @@ describe("Headings", () => {
2626
it("adds IDs and exports headings even when the custom heading is a custom component", async () => {
2727
const result = (await markdocPreprocess({
2828
headingIds: true,
29-
nodes: { heading: customComponentNode.heading },
29+
nodes: { heading: customComponentNode },
3030
} as Options).markup!({
3131
content: markdocWithHeadings,
3232
filename: "test.md",
@@ -49,7 +49,7 @@ describe("Headings", () => {
4949
it("adds IDs when passed a custom slugifying function even for custom headings", async () => {
5050
const result = (await markdocPreprocess({
5151
headingIds: customSlugger,
52-
nodes: { heading: basicHeadingNode.heading },
52+
nodes: { heading: basicHeadingNode },
5353
} as Options).markup!({
5454
content: markdocWithHeadings,
5555
filename: "test.md",
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default {};
1+
import type { Config } from "@markdoc/markdoc";
2+
3+
export default {} satisfies Config["nodes"];

test/markdoc/empty-schemas/tags.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default {};
1+
import type { Config } from "@markdoc/markdoc";
2+
3+
export default {} satisfies Config["tags"];
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
import type { Schema } from "@markdoc/markdoc";
12
import { headingNode } from "../../../src/index.ts";
23

34
export default {
4-
heading: {
5-
render: "h1",
6-
attributes: {
7-
class: { type: String, default: "custom-heading" },
8-
...headingNode.attributes,
9-
},
10-
children: headingNode.children,
11-
transform: headingNode.transform,
5+
render: "h1",
6+
attributes: {
7+
class: { type: String, default: "custom-heading" },
8+
...headingNode.attributes,
129
},
13-
};
10+
children: headingNode.children,
11+
transform: headingNode.transform,
12+
} satisfies Schema;
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
import type { Schema } from "@markdoc/markdoc";
12
import { headingNode } from "../../../src/index.ts";
23

34
export default {
4-
heading: {
5-
render: "HeadingComponent",
6-
attributes: {
7-
...headingNode.attributes,
8-
},
9-
children: headingNode.children,
10-
transform: headingNode.transform,
5+
render: "HeadingComponent",
6+
attributes: {
7+
...headingNode.attributes,
118
},
12-
};
9+
children: headingNode.children,
10+
transform: headingNode.transform,
11+
} satisfies Schema;

test/markdoc/shared-schema/nodes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import Markdoc from "@markdoc/markdoc";
2+
import type { Config } from "@markdoc/markdoc";
3+
24
export default {
35
heading: {
46
render: "h1",
@@ -8,4 +10,4 @@ export default {
810
},
911
children: Markdoc.nodes.heading.children,
1012
},
11-
} satisfies Markdoc.Config["nodes"];
13+
} satisfies Config["nodes"];

0 commit comments

Comments
 (0)