CC: Change type definitions of built-in schemas

This commit is contained in:
fuma-nama
2024-07-06 22:46:58 +08:00
parent 26a0fa68f7
commit dd1e4f3503
2 changed files with 9 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@fumadocs/content-collections': patch
'create-fumadocs-app': patch
---
Change type definitions of built-in schemas
@@ -14,7 +14,7 @@ import {
remarkHeading,
remarkStructure,
} from 'fumadocs-core/mdx-plugins';
import { type z as Zod } from 'zod';
import type { z as Zod } from 'zod';
import rehypeImgSize from 'rehype-img-size';
export interface TransformOptions extends MDXOptions {
@@ -112,7 +112,7 @@ export async function compileMDX(
}
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- The type is dynamically generated by Zod
export function createDocSchema<Z extends typeof Zod>(z: Z) {
export function createDocSchema(z: typeof Zod) {
return {
title: z.string(),
description: z.string().optional(),
@@ -122,7 +122,7 @@ export function createDocSchema<Z extends typeof Zod>(z: Z) {
}
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- The type is dynamically generated by Zod
export function createMetaSchema<Z extends typeof Zod>(z: Z) {
export function createMetaSchema(z: typeof Zod) {
return {
title: z.string().optional(),
pages: z.array(z.string()).optional(),