UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

40 lines (39 loc) 1.86 kB
import * as ts from "typescript"; import { ConstructorDeclarationOverloadStructure, ConstructorDeclarationStructure } from "./../../structures"; import { Node } from "./../common"; import { ScopedNode, BodyableNode, TextInsertableNode } from "./../base"; import { FunctionLikeDeclaration, OverloadableNode } from "./../function"; export declare const ConstructorDeclarationBase: (new (...args: any[]) => TextInsertableNode) & (new (...args: any[]) => OverloadableNode) & (new (...args: any[]) => ScopedNode) & (new (...args: any[]) => FunctionLikeDeclaration) & (new (...args: any[]) => BodyableNode) & typeof Node; export declare class ConstructorDeclaration extends ConstructorDeclarationBase<ts.ConstructorDeclaration> { /** * Fills the node from a structure. * @param structure - Structure to fill. */ fill(structure: Partial<ConstructorDeclarationStructure>): this; /** * Add a constructor overload. * @param structure - Structure to add. */ addOverload(structure: ConstructorDeclarationOverloadStructure): ConstructorDeclaration; /** * Add constructor overloads. * @param structures - Structures to add. */ addOverloads(structures: ConstructorDeclarationOverloadStructure[]): ConstructorDeclaration[]; /** * Inserts a constructor overload. * @param index - Index to insert at. * @param structure - Structures to insert. */ insertOverload(index: number, structure: ConstructorDeclarationOverloadStructure): ConstructorDeclaration; /** * Inserts constructor overloads. * @param index - Index to insert at. * @param structures - Structures to insert. */ insertOverloads(index: number, structures: ConstructorDeclarationOverloadStructure[]): ConstructorDeclaration[]; /** * Remove the constructor. */ remove(): void; }