mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
CC: Change type definitions of built-in schemas
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user