Module

x/ts_morph/mod.ts>DecoratableNode

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

Methods

getDecorator(name: string): Decorator | undefined

Gets a decorator or undefined if it doesn't exist.

getDecorator(findFunction: (declaration: Decorator) => boolean): Decorator | undefined

Gets a decorator or undefined if it doesn't exist.

getDecoratorOrThrow(name: string): Decorator

Gets a decorator or throws if it doesn't exist.

getDecoratorOrThrow(findFunction: (declaration: Decorator) => boolean): Decorator

Gets a decorator or throws if it doesn't exist.

getDecorators(): Decorator[]

Gets all the decorators of the node.

addDecorator(structure: OptionalKind<DecoratorStructure>): Decorator

Adds a decorator.

addDecorators(structures: ReadonlyArray<OptionalKind<DecoratorStructure>>): Decorator[]

Adds decorators.

insertDecorator(index: number, structure: OptionalKind<DecoratorStructure>): Decorator

Inserts a decorator.

insertDecorators(index: number, structures: ReadonlyArray<OptionalKind<DecoratorStructure>>): Decorator[]

Insert decorators.

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

Type Parameters

T extends Constructor<DecoratableNodeExtensionType>