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://dotland.deno.dev/x/ts_morph@17.0.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(message?: string | (() => string)): 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.