UNPKG

@vtaits/form-schema

Version:

Serialization and parsing form values by schema

29 lines (23 loc) 861 B
export { D as DateBaseSchema } from './schema-iT5UCVWs.js'; import './types-BSr5Y0bw.js'; import './types-DafXrhi5.js'; /** * Store date as javascript `Date` */ declare const DATE_FORMAT_DATE = "@DATE"; /** * Store date as javascript timestamp */ declare const DATE_FORMAT_TS = "@TS_JS"; /** * Store date as unix timestamp */ declare const DATE_FORMAT_UNIX = "@TS_UNIX"; /** * Store date in ISO format */ declare const DATE_FORMAT_ISO = "@DATE_FORMAT_ISO"; declare function parseValue(rawValue: unknown, dateFormat: string): Date | null; declare function parseValueAndValidate(rawValue: unknown, dateFormat: string): Date | null; declare function serializeDate(date: Date, dateFormat: string): string | number | Date; export { DATE_FORMAT_DATE, DATE_FORMAT_ISO, DATE_FORMAT_TS, DATE_FORMAT_UNIX, parseValue, parseValueAndValidate, serializeDate };