UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

41 lines (40 loc) 1.32 kB
import * as ts from "typescript"; import { Expression } from "./Expression"; export declare class ArrayLiteralExpression extends Expression<ts.ArrayLiteralExpression> { /** * Gets the array's elements. */ getElements(): Expression[]; /** * Adds an element to the array. * @param text - Text to add as an element. */ addElement(text: string): Expression<ts.Expression>; /** * Adds elements to the array. * @param texts - Texts to add as elements. */ addElements(texts: string[]): Expression<ts.Expression>[]; /** * Insert an element into the array. * @param index - Index to insert at. * @param text - Text to insert as an element. */ insertElement(index: number, text: string): Expression<ts.Expression>; /** * Insert elements into the array. * @param index - Index to insert at. * @param texts - Texts to insert as elements. */ insertElements(index: number, texts: string[]): Expression<ts.Expression>[]; /** * Removes an element from the array. * @param index - Index to remove from. */ removeElement(index: number): void; /** * Removes an element from the array. * @param element - Element to remove. */ removeElement(element: Expression): void; }