import { OpenRPCSpec } from '../../types'; import { LanguageGenerator } from '../interfaces'; import { PythonTypeMapper } from './python-type-mapper'; /** * Implements the LanguageGenerator interface for Python. * This generator produces a FastAPI web server that serves an OpenRPC API, * utilizing the types generated by PythonTypeMapper and an annotation-based * approach similar to Rust's procedural macros using the `python-openrpc` library. */ export declare class PythonGenerator implements LanguageGenerator { readonly language = "python"; readonly aliases: string[]; readonly typeMapper: PythonTypeMapper; private readonly templateBasePath; /** * Generates a Python FastAPI server from an OpenRPC specification. * * @param openrpc The OpenRPC specification object. * @param specFileName The name of the OpenRPC specification file. * @param outputDir The directory where the generated server code will be placed. * @returns A promise that resolves when the server generation is complete. */ generateServer(openrpc: OpenRPCSpec, specFileName: string, outputDir: string, interfaceFileName?: string): Promise; /** * Generates Python type definitions (dataclasses) from an OpenRPC spec. * The generated types are placed in `types.py` in the source directory. * * @param spec The OpenRPC specification object. * @param srcDir The source directory where the types.py file will be written. */ private emitPythonTypes; /** * Generates the main Python FastAPI application, requirements, Dockerfile, and README. * This method prepares the template data and renders the Mustache templates. * * @param spec The OpenRPC specification object. * @param specFileName The name of the OpenRPC specification file. * @param paths An object containing the root and source output directories. */ private emitPythonImpl; /** * Prepares template data from an OpenRPC specification for rendering Python code. * This includes server details, transformed method information, and import requirements. * * @param spec The OpenRPC specification object. * @param specFileName The name of the OpenRPC specification file. * @returns An object containing data to be used by Mustache templates. */ private prepareTemplateData; /** * Helper function to render a template */ private render; /** * Removes rpc.discover and abi.discover methods from the spec, * as they are typically handled by the server framework itself or custom implementations. */ private cleanSpec; } //# sourceMappingURL=python-generator.d.ts.map