Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

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

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

Methods

Adds a member to the enum.

Adds a member to the enum.

addMembers(structures: ReadonlyArray<OptionalKind<EnumMemberStructure>>): EnumMember[]

Adds members to the enum.

addMembers(structures: ReadonlyArray<OptionalKind<EnumMemberStructure> | WriterFunction | string> | string | WriterFunction): (EnumMember | CommentEnumMember)[]

Adds members to the enum.

getConstKeyword(): Node<ts.Node> | undefined

Gets the const enum keyword or undefined if not exists.

getMember(name: string): EnumMember | undefined

Gets an enum member.

getMember(findFunction: (declaration: EnumMember) => boolean): EnumMember | undefined

Gets an enum member.

Gets an enum member or throws if not found.

getMemberOrThrow(findFunction: (declaration: EnumMember) => boolean): EnumMember

Gets an enum member or throws if not found.

Gets the enum's members.

Gets the enum's members with comment enum members.

getParent(): NodeParentType<ts.EnumDeclaration>
getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.EnumDeclaration>>

Gets the structure equivalent to this node.

Inserts a member to the enum.

Inserts a member to the enum.

insertMembers(index: number, structures: ReadonlyArray<OptionalKind<EnumMemberStructure>>): EnumMember[]

Inserts members to an enum.

insertMembers(index: number, structures: ReadonlyArray<OptionalKind<EnumMemberStructure> | WriterFunction | string> | WriterFunction | string): (EnumMember | CommentEnumMember)[]

Inserts members to an enum.

isConstEnum(): boolean

Gets if it's a const enum.

set(structure: Partial<EnumDeclarationStructure>): this

Sets the node from a structure.

setIsConstEnum(value: boolean): this

Toggle if it's a const enum.