@tmlmobilidade/types
Version:
This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.
14 lines (13 loc) • 583 B
TypeScript
import { z } from 'zod';
export declare const OPERATIONAL_DATE_FORMAT = "yyyyMMdd";
export type OperationalDate = string & {
__brand: 'OperationalDate';
};
export declare const operationalDateSchema: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
/**
* This function validates if a string is a valid operational date.
* Throws an error if the date is invalid.
* @param date - The date to be validated.
* @returns The given string as an OperationalDate.
*/
export declare function validateOperationalDate(date: string): OperationalDate;