import { StandardSchemaV1 } from '@standard-schema/spec'; import { JsonSchema } from './utils/types.js'; type PipeFn = (input: I) => O | PipeError; type PipeCompiledFn> = (input: unknown) => PipeOutput | PipeError; type PipeErrorHandlerType = 'return' | 'throw' | 'assign'; type PipeErrorHandler = ((errorCondition: string, error: string) => (lines: string[]) => string[]) & { type: PipeErrorHandlerType; format: (error: string) => string; }; type PipeInput = T extends Pipe ? I : never; type PipeOutput = T extends Pipe ? O : never; type PipeMeta = Pick; type Context = Record; type JsonSchemaBuilder = JsonSchema; type Entry = Pipe | PipeFn; type PipeChain = { (fn1: Entry): Pipe; (fn1: Entry, fn2: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry, f5: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry, f5: Entry, f6: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry, f5: Entry, f6: Entry, f7: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry, f5: Entry, f6: Entry, f7: Entry, f8: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry, f5: Entry, f6: Entry, f7: Entry, f8: Entry, f9: Entry): Pipe; (fn1: Entry, fn2: Entry, f3: Entry, f4: Entry, f5: Entry, f6: Entry, f7: Entry, f8: Entry, f9: Entry, f10: Entry): Pipe; }; type Arrayable = T | T[]; interface Pipe extends StandardSchemaV1 { readonly context: () => Context; readonly schema: (context: Context) => JsonSchema; readonly pipe: PipeChain; readonly compile: (names: { input: string; context: string; path: string; }, opts: { rootContext: Context; failEarly: boolean; path: string; wrapError: PipeErrorHandler; }) => Arrayable>; prev?: Pipe; __compiled?: PipeCompiledFn; } type PipeErrorMessage = { message: string; path?: string; value: unknown; }; declare class PipeError { messages: PipeErrorMessage[]; constructor(messages: PipeErrorMessage[]); toString(): string; static root(message: string, value: unknown, path?: string): PipeError; static rootFrom(errors: PipeError[]): PipeError; static path(path: PropertyKey, key: string, error: PipeError): PipeError; static wrap(path: PropertyKey, error: PipeError): PipeError; } declare function createErrorHandler(input: string, type: 'return' | 'throw' | 'assign'): PipeErrorHandler; export { type Context as C, type Entry as E, type JsonSchemaBuilder as J, PipeError as P, type PipeFn as a, type PipeCompiledFn as b, createErrorHandler as c, type PipeErrorHandlerType as d, type PipeErrorHandler as e, type PipeInput as f, type PipeOutput as g, type PipeMeta as h, type Pipe as i };