Skip to main content
Module

x/ts_morph/ts_morph.d.ts>ArrayLiteralExpression

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class ArrayLiteralExpression
extends PrimaryExpression<ts.ArrayLiteralExpression>
import { ArrayLiteralExpression } from "https://deno.land/x/ts_morph@15.1.0/ts_morph.d.ts";

Methods

addElement(textOrWriterFunction: string | WriterFunction, options?: { useNewLines?: boolean; }): Expression<ts.Expression>

Adds an element to the array.

addElements(textsOrWriterFunction: ReadonlyArray<string | WriterFunction> | WriterFunction, options?: { useNewLines?: boolean; }): Expression<ts.Expression>[]

Adds elements to the array.

Gets the array's elements.

getParent(): NodeParentType<ts.ArrayLiteralExpression>
getParentOrThrow(): NonNullable<NodeParentType<ts.ArrayLiteralExpression>>
insertElement(
index: number,
textOrWriterFunction: string | WriterFunction,
options?: { useNewLines?: boolean; },
): Expression<ts.Expression>

Insert an element into the array.

insertElements(
index: number,
textsOrWriterFunction: ReadonlyArray<string | WriterFunction> | WriterFunction,
options?: { useNewLines?: boolean; },
): Expression<ts.Expression>[]

Insert elements into the array.

removeElement(index: number): void

Removes an element from the array.

removeElement(element: Expression): void

Removes an element from the array.