Skip to main content
Module

x/deno2node/src/deps.deno.ts>ObjectLiteralExpression

Compile your Deno project to run on Node.js.
Go to Latest
class ObjectLiteralExpression
extends ObjectLiteralExpressionBase<ts.ObjectLiteralExpression>
import { ObjectLiteralExpression } from "https://deno.land/x/deno2node@v1.6.0/src/deps.deno.ts";

Methods

addGetAccessor(structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration

Adds a get accessor.

addGetAccessors(structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]

Adds get accessors.

addMethod(structure: OptionalKind<MethodDeclarationStructure>): MethodDeclaration

Adds a method.

addMethods(structures: ReadonlyArray<OptionalKind<MethodDeclarationStructure>>): MethodDeclaration[]

Adds methods.

addProperties(structures: string | WriterFunction | ReadonlyArray<string | WriterFunction | ObjectLiteralExpressionPropertyStructures>): (CommentObjectLiteralElement | ObjectLiteralElementLike)[]

Adds the specified properties to the object literal expression.

Note: If you only want to add property assignments, then it might be more convenient to use #addPropertyAssignments.

addProperty(structure: string | WriterFunction | ObjectLiteralExpressionPropertyStructures): CommentObjectLiteralElement | ObjectLiteralElementLike

Adds the specified property to the object literal expression.

Note: If you only want to add a property assignment, then it might be more convenient to use #addPropertyAssignment.

addPropertyAssignment(structure: OptionalKind<PropertyAssignmentStructure>): PropertyAssignment

Adds a property assignment.

addPropertyAssignments(structures: ReadonlyArray<OptionalKind<PropertyAssignmentStructure>>): PropertyAssignment[]

Adds property assignments.

addSetAccessor(structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration

Adds a set accessor.

addSetAccessors(structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]

Adds set accessors.

addShorthandPropertyAssignment(structure: OptionalKind<ShorthandPropertyAssignmentStructure>): ShorthandPropertyAssignment

Adds a shorthand property assignment.

addShorthandPropertyAssignments(structures: ReadonlyArray<OptionalKind<ShorthandPropertyAssignmentStructure>>): ShorthandPropertyAssignment[]

Adds shorthand property assignments.

addSpreadAssignment(structure: OptionalKind<SpreadAssignmentStructure>): SpreadAssignment

Adds a spread assignment.

addSpreadAssignments(structures: ReadonlyArray<OptionalKind<SpreadAssignmentStructure>>): SpreadAssignment[]

Adds spread assignments.

getParent(): NodeParentType<ts.ObjectLiteralExpression>
getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ObjectLiteralExpression>>
getProperties(): ObjectLiteralElementLike[]

Gets the properties.

getPropertiesWithComments(): (ObjectLiteralElementLike | CommentObjectLiteralElement)[]

Gets the properties with comment object literal elements.

getProperty(name: string): ObjectLiteralElementLike | undefined

Gets the first property by the provided name or returns undefined.

getProperty(findFunction: (property: ObjectLiteralElementLike) => boolean): ObjectLiteralElementLike | undefined

Gets the first property that matches the provided find function or returns undefined.

getPropertyOrThrow(name: string): ObjectLiteralElementLike

Gets the first property by the provided name or throws.

getPropertyOrThrow(findFunction: (property: ObjectLiteralElementLike) => boolean): ObjectLiteralElementLike

Gets the first property that matches the provided find function or throws.

insertGetAccessor(index: number, structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration

Inserts a get accessor at the specified index.

insertGetAccessors(index: number, structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]

Inserts get accessors at the specified index.

insertMethod(index: number, structure: OptionalKind<MethodDeclarationStructure>): MethodDeclaration

Inserts a method at the specified index.

insertMethods(index: number, structures: ReadonlyArray<OptionalKind<MethodDeclarationStructure>>): MethodDeclaration[]

Inserts methods at the specified index.

insertProperties(index: number, structures: string | WriterFunction | ReadonlyArray<string | WriterFunction | ObjectLiteralExpressionPropertyStructures>): (CommentObjectLiteralElement | ObjectLiteralElementLike)[]

Inserts the specified properties to the object literal expression.

Note: If you only want to insert property assignments, then it might be more convenient to use #insertPropertyAssignments.

insertProperty(index: number, structure: string | WriterFunction | ObjectLiteralExpressionPropertyStructures): CommentObjectLiteralElement | ObjectLiteralElementLike

Inserts the specified property to the object literal expression.

Note: If you only want to insert a property assignment, then it might be more convenient to use #insertPropertyAssignment.

insertPropertyAssignment(index: number, structure: OptionalKind<PropertyAssignmentStructure>): PropertyAssignment

Inserts a property assignment at the specified index.

insertPropertyAssignments(index: number, structures: ReadonlyArray<OptionalKind<PropertyAssignmentStructure>>): PropertyAssignment[]

Inserts property assignments at the specified index.

insertSetAccessor(index: number, structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration

Inserts a set accessor at the specified index.

insertSetAccessors(index: number, structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]

Inserts set accessors at the specified index.

insertShorthandPropertyAssignment(index: number, structure: OptionalKind<ShorthandPropertyAssignmentStructure>): ShorthandPropertyAssignment

Inserts a shorthand property assignment at the specified index.

insertShorthandPropertyAssignments(index: number, structures: ReadonlyArray<OptionalKind<ShorthandPropertyAssignmentStructure>>): ShorthandPropertyAssignment[]

Inserts shorthand property assignments at the specified index.

insertSpreadAssignment(index: number, structure: OptionalKind<SpreadAssignmentStructure>): SpreadAssignment

Inserts a spread assignment at the specified index.

insertSpreadAssignments(index: number, structures: ReadonlyArray<OptionalKind<SpreadAssignmentStructure>>): SpreadAssignment[]

Inserts spread assignments at the specified index.