@hz-9/a5-crud-zod
Version:
Zod validation and CRUD utilities for the @hz-9/a5-* series of repositories.
57 lines (56 loc) • 1.35 kB
TypeScript
import { z } from 'zod';
/**
* @public
*
* 通用响应 DTO 类型接口
*/
export interface CommonResDtoType<T> {
code: string;
message: string;
traceId: string;
timestamp: number;
data: T;
}
/**
* @public
*
* 响应 DTO Schema 包装函数
*
* 用于包装任意 Schema 成为标准响应格式
*/
export declare const ResDtoSchemaWrap: (schema: z.ZodTypeAny) => z.ZodObject<{
code: z.ZodString;
message: z.ZodString;
traceId: z.ZodString;
timestamp: z.ZodNumber;
data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
}, z.core.$strip>;
/**
* @public
*
* 通用响应 DTO Schema
*/
export declare const CommonResDtoSchema: z.ZodObject<{
code: z.ZodString;
message: z.ZodString;
traceId: z.ZodString;
timestamp: z.ZodNumber;
data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
}, z.core.$strip>;
declare const CommonResDto_base: import("nestjs-zod").ZodDto<z.ZodObject<{
code: z.ZodString;
message: z.ZodString;
traceId: z.ZodString;
timestamp: z.ZodNumber;
data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
}, z.core.$strip>> & {
io: "input";
};
/**
* @public
*
* 通用响应 DTO 类
*/
export declare class CommonResDto extends CommonResDto_base {
}
export {};