Skip to main content
Module

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

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

Properties

private
_getInnerExpression

Methods

addArgument(argumentText: string | WriterFunction): Node<ts.Node>

Adds an argument.

addArguments(argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction): Node<ts.Node>[]

Adds arguments.

addTypeArgument(argumentText: string): TypeNode<ts.TypeNode>

Adds a type argument.

addTypeArguments(argumentTexts: ReadonlyArray<string>): TypeNode<ts.TypeNode>[]

Adds type arguments.

Gets the decorator's arguments from its call expression.

Gets the call expression if a decorator factory.

getCallExpressionOrThrow(message?: string | (() => string)): CallExpression

Gets the call expression if a decorator factory, or throws.

getFullName(): string

Gets the full decorator name.

getName(): string

Gets the decorator name.

Gets the name node of the decorator.

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

Gets the structure equivalent to this node.

Gets the decorator's type arguments from its call expression.

insertArgument(index: number, argumentText: string | WriterFunction): Node<ts.Node>

Inserts an argument.

insertArguments(index: number, argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction): Node<ts.Node>[]

Inserts arguments.

insertTypeArgument(index: number, argumentText: string): TypeNode<ts.TypeNode>

Inserts a type argument.

insertTypeArguments(index: number, argumentTexts: ReadonlyArray<string>): TypeNode<ts.TypeNode>[]

Inserts type arguments.

Gets if the decorator is a decorator factory.

remove(): void

Removes this decorator.

removeArgument(node: Node): this

Removes an argument based on the node.

removeArgument(index: number): this

Removes an argument based on the specified index.

removeTypeArgument(typeArg: Node): this

Removes a type argument.

removeTypeArgument(index: number): this

Removes a type argument.

set(structure: Partial<DecoratorStructure>): this

Sets the node from a structure.

setIsDecoratorFactory(isDecoratorFactory: boolean): this

Set if this decorator is a decorator factory.