import { type FixDeepFunctionInfer, type NeverCoalescing } from "../../../common"; import { type DataParserDefinition } from "../../base"; import { type DataParserError, type SymbolDataParserError } from "../../../dataParser/error"; import { type DataParserChecker } from "../../baseChecker"; import { type ApplyRefinementOfDefinition, type GetEligibleChecker, type AddCheckersToDefinition, type MergeDefinition, type Output, type PrepareDataParserDefinition } from "../../types"; import * as DDate from "../../../date"; export * from "./checkers"; export type DataParserTimeCheckers = GetEligibleChecker; export interface DataParserDefinitionTime extends DataParserDefinition { readonly coerce: boolean; } export declare const timeKind: import("../../../common").KindHandler>; declare const DataParserTime_base: import("../..").DataParserBaseInit>>; export declare class DataParserTime extends DataParserTime_base, ApplyRefinementOfDefinition | number | DDate.SerializedTheTime> { get classConstructor(): typeof DataParserTime & import("../..").CheckedConstructorKind; addChecker: >, ...DataParserChecker>[] ]>(...args: FixDeepFunctionInfer>, ...DataParserChecker>[] ], GenericChecker>) => DataParserTime>; static execParse(self: DataParserTime, data: unknown, error: DataParserError): (DDate.TheTime | typeof SymbolDataParserError); static dataParserIsAsynchronous(self: DataParserTime): boolean; static prepareDefinition(definition?: Partial): DataParserDefinitionTime; /** * Creates a classic parser for `TheTime` values. * * Signature: `DP.time(definition?)` → `DataParserTime` * * The parser accepts `TheTime`, `SerializedTheTime`, and safe numeric time values. * With `coerce: true`, ISO-like time strings are also supported. * * ```ts * const parser = DP.time(); * const result = parser.parse("time0+"); * if (E.isRight(result)) { * const value = unwrap(result); * // value: TheTime * } * * const withCheckers = DP.time({ * checkers: [DP.checkerRefine((value) => value.toNative() !== 0)], * }); * const checked = withCheckers.parse("time1000+"); * // checked: E.Error | E.Success * * const coerceParser = DP.coerce.time(); * const coerceResult = coerceParser.parse("10:20:00"); * // coerceResult: E.Error | E.Success * ``` * * @remarks * - Parsed output is always `TheTime`. * - Use `DP.coerce.time()` when you want string coercion enabled by default. * * @see https://utils.duplojs.dev/en/v1/api/dataParser/time * * @namespace DP * */ static create = never>(definition?: FixDeepFunctionInfer, GenericDefinition>): DataParserTime>>; } /** * Creates a classic parser for `TheTime` values. * * Signature: `DP.time(definition?)` → `DataParserTime` * * The parser accepts `TheTime`, `SerializedTheTime`, and safe numeric time values. * With `coerce: true`, ISO-like time strings are also supported. * * ```ts * const parser = DP.time(); * const result = parser.parse("time0+"); * if (E.isRight(result)) { * const value = unwrap(result); * // value: TheTime * } * * const withCheckers = DP.time({ * checkers: [DP.checkerRefine((value) => value.toNative() !== 0)], * }); * const checked = withCheckers.parse("time1000+"); * // checked: E.Error | E.Success * * const coerceParser = DP.coerce.time(); * const coerceResult = coerceParser.parse("10:20:00"); * // coerceResult: E.Error | E.Success * ``` * * @remarks * - Parsed output is always `TheTime`. * - Use `DP.coerce.time()` when you want string coercion enabled by default. * * @see https://utils.duplojs.dev/en/v1/api/dataParser/time * * @namespace DP * */ export declare const time: typeof DataParserTime.create;