Module

x/ts_morph/mod.ts>ModifierableNode

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
interface ModifierableNode
import { type ModifierableNode } from "https://dotland.deno.dev/x/ts_morph@18.0.0/mod.ts";

Methods

getModifiers(): Node<ts.Modifier>[]

Gets the node's modifiers.

getFirstModifierByKindOrThrow<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind]

Gets the first modifier of the specified syntax kind or throws if none found.

getFirstModifierByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined

Gets the first modifier of the specified syntax kind or undefined if none found.

hasModifier(kind: SyntaxKind): boolean

Gets if it has the specified modifier.

hasModifier(text: ModifierTexts): boolean

Gets if it has the specified modifier.

toggleModifier(text: ModifierTexts, value?: boolean): this

Toggles a modifier.

function ModifierableNode
import { ModifierableNode } from "https://dotland.deno.dev/x/ts_morph@18.0.0/mod.ts";

Type Parameters

T extends Constructor<ModifierableNodeExtensionType>