import { parseExpressionString } from "./helpers/parse-expression-string.js"; /** * Full `JSONConfiguration` input accepted by the constructor and `merge()`. */ export type JSONConfigurationProps = JSONConfigurationDataProps & { /** Optional override for accessor-string compilation. */ convertFunction?: ConvertFunction; /** Optional hook for mutating props before class/component instantiation. */ preProcessClassProps?: PreProcessClassProps; /** Optional hook for mutating the converted result before it is returned. */ postProcessConvertedJson?: PostProcessConvertedJson; }; /** * Serializable configuration entries consumed directly by the JSON conversion pipeline. */ type JSONConfigurationDataProps = { /** Logger used for non-fatal conversion warnings. */ log?: any; /** Key used to resolve class instances from JSON objects. */ typeKey?: string; /** Key used to resolve callable functions from JSON objects. */ functionKey?: string; /** Class catalog used to resolve `@@type` references. */ classes?: Record) => unknown>; /** Enumeration catalog used to resolve `@@#GROUP.VALUE` references. */ enumerations?: Record; /** Constant catalog used to resolve `@@#CONSTANT` references. */ constants?: Record; /** Function catalog used to resolve `@@function` references. */ functions?: Record; /** React runtime used when instantiating configured React components. */ React?: { createElement: (Component: any, props: any, children: any) => any; }; /** React component catalog used to resolve `@@type` references. */ reactComponents?: Record; }; /** * Function used to compile `@@=` expression strings into accessors. */ type ConvertFunction = typeof parseExpressionString; /** * Hook that can rewrite props before a configured class or component is instantiated. */ type PreProcessClassProps = (Class: unknown, props: Record) => Record; /** * Hook that can rewrite the fully converted JSON payload before it is returned. */ type PostProcessConvertedJson = (json: unknown) => unknown; /** * Stores the catalogs and hooks used by `JSONConverter` to resolve JSON into runtime values. */ export declare class JSONConfiguration { /** Default values used when a configuration key is omitted. */ static defaultProps: Required; /** Normalized configuration catalogs consumed by the conversion helpers. */ config: Required; /** Hook used to compile `@@=` accessor strings into executable functions. */ convertFunction: ConvertFunction; /** Hook used to rewrite props before class/component instantiation. */ preProcessClassProps: PreProcessClassProps; /** Hook used to rewrite the converted JSON result before it is returned. */ postProcessConvertedJson: PostProcessConvertedJson; /** * Creates a configuration from a single plain object. * @param configuration Configuration catalogs and hooks to register. */ constructor(configuration: JSONConfigurationProps); /** * Merges additional configuration catalogs and hooks into the current instance. * @param configuration Additional configuration values to merge. */ merge(configuration: JSONConfigurationProps): void; /** * Returns a plain-object snapshot of the current configuration, including hooks. * @returns A complete configuration object suitable for cloning or re-use. */ getProps(): JSONConfigurationProps; } export {}; //# sourceMappingURL=json-configuration.d.ts.map