import { Imm } from 'ts-imm';
import { CodeBlock, Dictionary } from './CodeBlock';
import { CodeWriter } from './CodeWriter';
import { DecoratorSpec } from './DecoratorSpec';
import { Modifier } from './Modifier';
import { ParameterSpec } from './ParameterSpec';
import { SymbolSpec } from './SymbolSpecs';
import { TypeName, TypeNameOrString, TypeVariable } from './TypeNames';
export declare enum Encloser {
    HASH = 0,
    CLASS = 1,
    INTERFACE = 2
}
/** A generated function declaration. */
export declare class FunctionSpec extends Imm<FunctionSpec> {
    static create(name: string): FunctionSpec;
    static createConstructor(): FunctionSpec;
    static createCallable(): FunctionSpec;
    static createIndexable(): FunctionSpec;
    readonly name: string;
    readonly javaDoc: CodeBlock;
    readonly decorators: DecoratorSpec[];
    readonly modifiers: Modifier[];
    readonly typeVariables: TypeVariable[];
    readonly returnType?: TypeName;
    readonly parameters: ParameterSpec[];
    readonly restParameter: ParameterSpec | undefined;
    readonly body: CodeBlock;
    readonly encloser?: Encloser;
    abstract(): FunctionSpec;
    parameter(name: string): ParameterSpec | undefined;
    emit(codeWriter: CodeWriter, implicitModifiers?: Modifier[]): void;
    addJavadoc(format: string, ...args: any[]): this;
    addJavadocBlock(block: CodeBlock): this;
    addDecorators(...decoratorSpecs: DecoratorSpec[]): this;
    addDecorator(name: string | SymbolSpec, data?: Partial<DecoratorSpec>): this;
    addDecorator(decorator: DecoratorSpec): this;
    addModifiers(...modifiers: Modifier[]): this;
    addTypeVariables(...typeVariables: TypeVariable[]): this;
    addTypeVariable(typeVariable: TypeVariable): this;
    returns(returnType: TypeNameOrString): this;
    addParameters(...parameterSpecs: ParameterSpec[]): this;
    addParameter(name: string, type: TypeName | string, data?: Partial<ParameterSpec>): this;
    addParameter(parameterSpec: ParameterSpec): this;
    rest(name: string, type: TypeName | string): this;
    rest(parameterSpec: ParameterSpec): this;
    addCode(format: string, ...args: unknown[]): this;
    addNamedCode(format: string, args: Dictionary<any>): this;
    addCodeBlock(codeBlock: CodeBlock): this;
    addComment(format: string, ...args: any[]): this;
    /**
     * @param controlFlow the control flow construct and its code, such as "if (foo == 5)".
     * * Shouldn't contain braces or newline characters.
     */
    beginControlFlow(controlFlow: string, ...args: any[]): this;
    /**
     * @param controlFlow the control flow construct and its code, such as "else if (foo == 10)".
     * *     Shouldn't contain braces or newline characters.
     */
    nextControlFlow(controlFlow: string, ...args: any[]): this;
    endControlFlow(): this;
    beginLambda(controlFlow: string, ...args: any[]): this;
    endLambda(closing: string, ...args: any[]): this;
    indent(): this;
    unindent(): this;
    addStatement(format: string, ...args: any[]): this;
    isConstructor(): boolean;
    isAccessor(): boolean;
    isCallable(): boolean;
    isIndexable(): boolean;
    setEnclosed(encloser: Encloser): this;
    toString(): string;
    private emitSignature;
}
