UNPKG

@duplojs/zod-accelerator

Version:

[![NPM version](https://img.shields.io/npm/v/@duplojs/zod-accelerator)](https://www.npmjs.com/package/@duplojs/zod-accelerator)

141 lines (140 loc) 3.59 kB
import type * as zod from "zod"; import { ZodAccelerator } from "../accelerator"; import type { ZodAcceleratorContent } from "../content"; export declare class ZodStringAccelerator extends ZodAccelerator { get support(): typeof zod.ZodString; makeAcceleratorContent(zodSchema: zod.ZodString, zac: ZodAcceleratorContent): ZodAcceleratorContent; static stringPart: { coerce: () => { content: string; }; typeof: () => { if: string; message: string; }; min: ({ value }: { value: number; }) => { if: string; message: string; }; max: ({ value }: { value: number; }) => { if: string; message: string; }; length: ({ value }: { value: number; }) => { if: string; message: string; }; email: () => { if: string; message: string; ctx: { duploj$RegexEmail: RegExp; }; }; url: () => string; emoji: () => { if: string; message: string; ctx: { duploj$RegexEmoji: RegExp; }; }; uuid: () => { if: string; message: string; ctx: { duploj$RegexUuid: RegExp; }; }; cuid: () => { if: string; message: string; ctx: { duploj$RegexCuid: RegExp; }; }; includes: ({ value, position }: { value: string; position?: number; }) => { if: string; message: string; }; cuid2: () => { if: string; message: string; ctx: { duploj$RegexCuid2: RegExp; }; }; ulid: () => { if: string; message: string; ctx: { duploj$RegexUlid: RegExp; }; }; startsWith: ({ value }: { value: string; }) => { if: string; message: string; }; endsWith: ({ value }: { value: string; }) => { if: string; message: string; }; regex: ({ regex }: { regex: RegExp; }) => { if: string; message: string; ctx: { regexCustom: RegExp; }; }; trim: () => string; toUpperCase: () => string; toLowerCase: () => string; datetime: ({ precision, offset }: { precision: number | null; offset: boolean; }) => { if: string; message: string; ctx: Record<string | number | symbol, any>; }; ip: ({ version }: { version?: string; }) => { if: string; message: string; ctx: { duploj$RegexIpv4: RegExp; duploj$RegexIpv6?: undefined; }; } | { if: string; message: string; ctx: { duploj$RegexIpv6: RegExp; duploj$RegexIpv4?: undefined; }; } | { if: string; message: string; ctx: { duploj$RegexIpv4: RegExp; duploj$RegexIpv6: RegExp; }; }; }; }