export type FormatTypes = "hh-zkit-artifacts-1"; export type ProtocolType = "groth16" | "plonk"; export type SignalType = "Output" | "Input" | "Intermediate"; export type VisibilityType = "Public" | "Private"; /** * Represents a circuit artifact generated by the `CircuitArtifactGenerator`. * * @param {string} _format - The format version of the circuit artifact. * @param {string} circuitFileName - The filename of the compiled circuit (without extension). * @param {string} circuitTemplateName - The name of the main component in the circuit. * @param {string} circuitSourceName - The circuit file path relative to the project root. * @param {BaseCircuitInfo} baseCircuitInfo - The base circuit information. * @param {Record} compilerOutputFiles - Map of compiler output file types to their metadata. */ export type CircuitArtifact = { _format: FormatTypes; circuitFileName: string; circuitTemplateName: string; circuitSourceName: string; baseCircuitInfo: BaseCircuitInfo; compilerOutputFiles: Record; }; /** * Represents the base circuit information. * * @param {string} protocol - The proving system protocol used in the circuit. * Set by the package itself from provided constructor arguments. * @param {number} constraintsNumber - The number of constraints in the circuit. * @param {SignalInfo[]} signals - The array of `input` and `output` signals used in the circuit. */ export type BaseCircuitInfo = { protocol?: ProtocolType[]; constraintsNumber: number; signals: SignalInfo[]; }; /** * Represents metadata for a file generated by the Circom compiler. * * @property {string} fileSourcePath - Absolute path to the generated file on disk. * @property {string} fileHash - Hash of the file contents for integrity verification. */ export type CompilerOutputFile = { fileSourcePath: string; fileHash: string; }; /** * Represents a signal used in a circuit. * * @param {string} name - The name of the signal. * @param {SignalType} type - The type of the signal (possible values: `Input`, `Output`). * @param {VisibilityType} visibility - The visibility of the signal (possible values: `Public`, `Private`). * @param {string} dimensions - The array of dimensions of the signal. If the signal is a scalar, the value is `[]`. * For example for a signal a[2][3], the value is `[2, 3]`. */ export type SignalInfo = { name: string; dimension: string[]; type: SignalType; visibility: VisibilityType; };