import * as Generator from '@postxl/generator';
import { Field } from '@postxl/schema';
import { ContextResult, ModelResult } from './decoders.generator';
/**
 * # Naming convention
 *
 * ## Decoder composition/elements
 *
 * - *RawDecoder*: Examples: `z.string()`, `z.number()`, `z.boolean()`
 * - *Modifier*: Examples: `.nullable()`, `.optional()`, `.max(10)`
 * - *Transformer*: Examples: `toUserId(${name})`
 *
 * ## Generated elements
 *
 * - *Raw* prefix: only the raw decoders and modifiers are used. Example: `zRawUserDecoder`
 *    Note: This allows inferring the underlying, serialized type of the decoder.
 * - *Flattened* suffix: nested objects (discriminated unions) are flattened to a column structure.
 * - *Transformer* suffix: function that transforms the raw input to the model/discriminated union type.
 * - *Decoder* suffix: Zod decoder that combines the raw decoder and the transformer.
 * - *decode* prefix: function that applies the decoder to the raw input.
 * - *encode* prefix: function that converts the model to the flattened object.
 *
 */
type FieldDecoderParams<T extends Field = Field> = {
    field: T;
    model: ModelResult;
    context: ContextResult;
    imports: Generator.ImportGenerator;
};
export declare function getFieldDecoder(params: FieldDecoderParams): string;
export type FieldDecoderElements = {
    rawDecoder: RawDecoder;
    modifiers: Set<Modifier>;
    transformer?: Transformer;
};
export type RawDecoder = string;
export type Modifier = string;
/**
 * Should return a small transformer function that can be applied to a field's raw decoder.
 * Examples:
 *
 * ```
 * (name) => `toPostId(${name})` // will result in `.transform((v) => toPostId(v))` and `item.next_post_id ? toPostId(item.next_post_id) : null,`
 *
 * ```
 */
export type Transformer = (name: string) => string;
export declare const defaultTransformer: (name: string) => string;
export declare function getFieldElements(params: FieldDecoderParams): FieldDecoderElements;
export {};
