/** * Parsed content. */ export interface ParsedContent { /** * Constants of the form "CONSTANT_NAME: number_as_string". */ constants: { [key: string]: string; }; /** * DomainSeparatorEnum. */ domainSeparatorEnum: { [key: string]: number; }; } /** * Raw expressions parsed from a Noir file, prior to evaluation. Keeping expressions unevaluated lets callers merge * constants from multiple files and resolve cross-file references in a single evaluation pass. */ export interface ParsedExpressions { /** Ordered list of constant name and expression pairs. */ constantsExpressions: [string, string][]; /** DomainSeparatorEnum members. */ domainSeparatorEnum: { [key: string]: number; }; } /** * Processes a collection of constants and generates code to export them as TypeScript constants. * * @param constants - An object containing key-value pairs representing constants. * @returns A string containing code that exports the constants as TypeScript constants. */ export declare function processConstantsTS(constants: { [key: string]: string; }): string; /** * Processes a collection of constants and generates code to export them as cpp constants. * Required to ensure consistency between the constants used in pil and used in the vm witness generator. * * @param constants - An object containing key-value pairs representing constants. * @returns A string containing code that exports the constants as cpp constants. */ export declare function processConstantsCpp(constants: { [key: string]: string; }, generatorIndices: { [key: string]: number; }): string; /** * Processes a collection of constants and generates code to export them as PIL constants. * Required to ensure consistency between the constants used in pil and used in the vm witness generator. * * @param constants - An object containing key-value pairs representing constants. * @returns A string containing code that exports the constants as cpp constants. */ export declare function processConstantsPil(constants: { [key: string]: string; }, generatorIndices: { [key: string]: number; }): string; /** * Processes an enum and generates code to export it as a TypeScript enum. * * @param enumName - The name of the enum. * @param enumValues - An object containing key-value pairs representing enum values. * @returns A string containing code that exports the enum as a TypeScript enum. */ export declare function processEnumTS(enumName: string, enumValues: { [key: string]: number; }): string; /** * Processes a collection of constants and generates code to export them as Solidity constants. * * @param constants - An object containing key-value pairs representing constants. * @param generatorIndices - An object containing key-value pairs representing domain separator indices. * @param prefix - A prefix to add to the constant names. * @returns A string containing code that exports the constants as Noir constants. */ export declare function processConstantsSolidity(constants: { [key: string]: string; }, generatorIndices: { [key: string]: number; }, prefix?: string): string; /** * Processes a collection of constants and generates code to export them as Rust constants. * * @param constants - An object containing key-value pairs representing constants. * @param generatorIndices - An object containing key-value pairs representing domain separator indices. * @returns A string containing code that exports the constants as Rust constants. */ export declare function processConstantsRust(constants: { [key: string]: string; }, generatorIndices: { [key: string]: number; }): string; /** * Generate the constants file in Typescript. */ export declare function generateTypescriptConstants({ constants, domainSeparatorEnum }: ParsedContent, targetPath: string): void; /** * Generate the constants file in C++. */ export declare function generateCppConstants({ constants, domainSeparatorEnum }: ParsedContent, targetPath: string): void; /** * Generate the constants file in PIL. */ export declare function generatePilConstants({ constants, domainSeparatorEnum }: ParsedContent, targetPath: string): void; /** * Generate the constants file in Solidity. */ export declare function generateSolidityConstants({ constants, domainSeparatorEnum }: ParsedContent, targetPath: string): void; /** * Generate the constants file in Rust. */ export declare function generateRustConstants({ constants, domainSeparatorEnum }: ParsedContent, targetPath: string): void; /** * Parse the content of the constants file in Noir. */ export declare function parseNoirFile(fileContent: string): ParsedExpressions; /** * Converts constants defined as expressions to constants with actual values. * @param expressions Ordered list of expressions of the type: "CONSTANT_NAME: expression". * where the expression is a string that can be evaluated to a number. * For example: "CONSTANT_NAME: 2 + 2" or "CONSTANT_NAME: CONSTANT_A * CONSTANT_B". * @returns Parsed expressions of the form: "CONSTANT_NAME: number_as_string". */ export declare function evaluateExpressions(expressions: [string, string][]): { [key: string]: string; };