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 AddCheckersToDefinition, type GetEligibleChecker, type MergeDefinition, type Output, type PrepareDataParserDefinition } from "../types"; export type DataParserNilCheckers = GetEligibleChecker; export interface DataParserDefinitionNil extends DataParserDefinition { readonly coerce: boolean; } export declare const nilKind: import("../../common").KindHandler>; declare const DataParserNil_base: import("..").DataParserBaseInit>>; export declare class DataParserNil extends DataParserNil_base, ApplyRefinementOfDefinition> { get classConstructor(): typeof DataParserNil & import("..").CheckedConstructorKind; addChecker: >, ...DataParserChecker>[] ]>(...args: FixDeepFunctionInfer>, ...DataParserChecker>[] ], GenericChecker>) => DataParserNil>; static execParse(self: DataParserNil, data: unknown, error: DataParserError): null | typeof SymbolDataParserError; static dataParserIsAsynchronous(self: DataParserNil): boolean; static prepareDefinition(definition?: Partial): DataParserDefinitionNil; /** * Creates a data parser that accepts null. * * **Supported call styles:** * - Classic: `DP.nil(definition?)` -> returns a nil parser * - Curried: not available * * Accepts null (or the string "null" when coerce is enabled) and rejects other inputs. * * ```ts * const parser = DP.nil(); * const result = parser.parse(null); * if (E.isRight(result)) { * const value = unwrap(result); * // value: null * } * * const withCheckers = DP.nil({ * checkers: [DP.checkerRefine((value) => value === null)], * }); * * const coerceParser = DP.coerce.nil(); * const coerceResult = coerceParser.parse("null"); * ``` * * @see https://utils.duplojs.dev/en/v1/api/dataParser/nil * * @namespace DP * */ static create = never>(definition?: FixDeepFunctionInfer, GenericDefinition>): DataParserNil>>; } /** * Creates a data parser that accepts null. * * **Supported call styles:** * - Classic: `DP.nil(definition?)` -> returns a nil parser * - Curried: not available * * Accepts null (or the string "null" when coerce is enabled) and rejects other inputs. * * ```ts * const parser = DP.nil(); * const result = parser.parse(null); * if (E.isRight(result)) { * const value = unwrap(result); * // value: null * } * * const withCheckers = DP.nil({ * checkers: [DP.checkerRefine((value) => value === null)], * }); * * const coerceParser = DP.coerce.nil(); * const coerceResult = coerceParser.parse("null"); * ``` * * @see https://utils.duplojs.dev/en/v1/api/dataParser/nil * * @namespace DP * */ export declare const nil: typeof DataParserNil.create; export {};