UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

38 lines (37 loc) 1.67 kB
import * as ts from "typescript"; import { Node } from "./../common"; import { ParameterDeclarationStructure } from "./../../structures"; import { DeclarationNamedNode, InitializerExpressionableNode, TypedNode, ModifierableNode, ScopeableNode, ReadonlyableNode, DecoratableNode, QuestionTokenableNode } from "./../base"; export declare const ParameterDeclarationBase: (new (...args: any[]) => QuestionTokenableNode) & (new (...args: any[]) => DecoratableNode) & (new (...args: any[]) => ScopeableNode) & (new (...args: any[]) => ReadonlyableNode) & (new (...args: any[]) => ModifierableNode) & (new (...args: any[]) => TypedNode) & (new (...args: any[]) => InitializerExpressionableNode) & (new (...args: any[]) => DeclarationNamedNode) & typeof Node; export declare class ParameterDeclaration extends ParameterDeclarationBase<ts.ParameterDeclaration> { /** * Fills the node from a structure. * @param structure - Structure to fill. */ fill(structure: Partial<ParameterDeclarationStructure>): this; /** * Gets the dot dot dot token (...) for a rest parameter. */ getDotDotDotToken(): Node<ts.Token<ts.SyntaxKind.DotDotDotToken>> | undefined; /** * Gets if it's a rest parameter. */ isRestParameter(): boolean; /** * Gets if this is a parameter property. */ isParameterProperty(): boolean; /** * Sets if it's a rest parameter. * @param value - Sets if it's a rest parameter or not. */ setIsRestParameter(value: boolean): this; /** * Gets if it's optional. */ isOptional(): boolean; /** * Remove this parameter. */ remove(): void; }