/** * Farm.js Query State Parsers * * Shared parsers that can be used in both client and server contexts */ interface Parser { parse: (value: string) => T | null; serialize: (value: T) => string; withDefault?: (defaultValue: T) => Parser; } declare const asString: Parser; declare const asInteger: Parser; declare const asFloat: Parser; declare const asBoolean: Parser; interface ArrayParserOptions { /** Preserve comma URLs by default; opt in when item delimiters must round-trip. */ format?: "comma" | "structured"; } declare function asArrayOf(itemParser: Parser, options?: ArrayParserOptions): Parser; declare function asJson(): Parser; declare const asIsoDate: Parser; declare const asIsoDateTime: Parser; declare function createParser(config: { parse: (value: string) => T | null; serialize: (value: T) => string; }): Parser; type inferParserType = T extends Parser ? U : never; export { type ArrayParserOptions, type Parser, asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, type inferParserType };