import { Code } from './code'; export interface ObjectField { renderedField: string; propertyRegex?: string; } export declare class ToJsonFunction { private readonly baseType; private readonly internal; /** * The name the toJson function for a struct. */ readonly functionName: string; private readonly fields; constructor(baseType: string, internal?: boolean); /** * Adds a field to the struct. * * @param schemaName The name of the property in the schema ("to") * @param propertyName The name of the TypeScript property ("from") * @param toJson A function used to convert a value from JavaScript to schema * format. This could be `x => x` if no conversion is required. */ addField(schemaName: string, propertyName: string, toJson: ToJson, propertyRegex?: string): void; emit(code: Code): void; } /** * A function that converts an expression from JavaScript to schema format. * * @example x => x * @example x => x?.map(y => toJson_Foo(y)) */ export type ToJson = (expression: string) => string;