import { Access } from "./Access"; import { Annotation } from "./Annotation"; import { ClassReference } from "./ClassReference"; import { CodeBlock } from "./CodeBlock"; import { AstNode } from "../core/AstNode"; import { Writer } from "../core/Writer"; import { Field } from "./Field"; import { Method } from "./Method"; /** * Namespace containing interfaces for Enum configuration. */ export declare namespace Enum { /** * Interface defining the arguments required to create a new Enum instance. * * @interface Args */ interface Args { /** The name of the Java enum */ name: string; /** The package of the Java enum */ packageName: string; /** The access level of the Java enum */ access: Access; /** Any interfaces the enum implements */ implements_?: ClassReference[]; /** Whether this is a nested enum */ isNestedEnum?: boolean; /** Enum annotations */ annotations?: Annotation[]; /** Documentation/JavaDoc for the enum */ javadoc?: string; /** Simple string values for enum constants */ values?: string[]; /** Enum constants with values */ constantsWithStringValues?: { name: string; value: string; }[]; } /** * Interface defining the configuration for an enum constant. * * @interface Value */ interface Value { /** The name of the enum constant */ name: string; /** Arguments to pass to the enum constructor */ arguments_?: CodeBlock; /** Annotations for the enum constant */ annotations?: Annotation[]; /** Documentation/JavaDoc for the enum constant */ javadoc?: string; } } /** * Represents a Java enum in the AST. * This class handles the generation of Java enum declarations including constants, * fields, methods, and other enum-related elements. * * @class * @extends {AstNode} */ export declare class Enum extends AstNode { /** The name of the enum */ readonly name: string; /** The package name of the enum */ readonly packageName: string; /** The access level of the enum */ readonly access: Access; /** The class reference for this enum */ readonly reference: ClassReference; /** Whether this is a nested enum */ readonly isNestedEnum: boolean; /** The interfaces implemented by this enum */ readonly implements_: ClassReference[]; /** The annotations applied to the enum */ private annotations; /** The JavaDoc documentation for the enum */ private javadoc?; /** The enum constants */ private values; /** The fields declared in this enum */ private fields; /** The methods declared in this enum */ private methods; /** The constructor parameter types */ private constructorParameters; /** * Creates a new Enum instance with the specified configuration. * * @param {Enum.Args} args - The arguments for creating the enum */ constructor({ name, packageName, access, implements_, isNestedEnum, annotations, javadoc, values, constantsWithStringValues, }: Enum.Args); /** * Adds an enum constant to the enum. * * @param {Enum.Value} value - The enum constant to add */ addValue(value: Enum.Value): void; /** * Adds a field to the enum. * * @param {Field} field - The field to add */ addField(field: Field): void; /** * Adds a method to the enum. * * @param {Method} method - The method to add */ addMethod(method: Method): void; /** * Sets the constructor parameters for enum constants. * * @param {string[]} parameters - The constructor parameter types */ setConstructorParameters(parameters: string[]): void; /** * Writes the enum declaration and its contents to the writer. * This includes package declaration, JavaDoc, annotations, constants, * fields, and methods. * * @param {Writer} writer - The writer to write to */ write(writer: Writer): void; }