next-rest-framework
Version:
Next REST Framework - write type-safe, self-documenting REST APIs in Next.js
19 lines (18 loc) • 752 B
TypeScript
import { type OpenAPIV3_1 } from 'openapi-types';
import { type ZodSchema } from 'zod';
import { type BaseObjectSchemaType, type BaseSchemaType } from '../types';
export declare const isZodSchema: (schema: unknown) => schema is ZodSchema<any, import("zod").ZodTypeDef, any>;
export declare const convertZodSchema: (schema: ZodSchema) => Record<string, unknown>;
export declare const validateSchema: ({ schema, obj }: {
schema: BaseSchemaType;
obj: unknown;
}) => Promise<{
valid: boolean;
errors: string[] | null;
}>;
export declare const getJsonSchema: ({ schema }: {
schema: BaseSchemaType;
}) => OpenAPIV3_1.SchemaObject;
export declare const getSchemaKeys: ({ schema }: {
schema: import("zod").AnyZodObject;
}) => string[];