UNPKG

@dfinity/zod-schemas

Version:

A collection of reusable Zod schemas and validators for common data patterns in ICP applications

16 lines (15 loc) 551 B
import * as z from "zod"; /** * Zod schema to validate a string as a valid textual representation of a Principal. * * This schema checks if the provided string can be converted into a `Principal` instance. * If the conversion fails, validation will return an error message. * * @example * ```typescript * const result = PrincipalTextSchema.safeParse('aaaaa-aa'); * console.log(result.success); // true or false * ``` */ export declare const PrincipalTextSchema: z.ZodString; export type PrincipalText = z.infer<typeof PrincipalTextSchema>;