Skip to main content
Module

x/ts_morph/ts_morph.d.ts>TypeParameterDeclaration

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class TypeParameterDeclaration
extends TypeParameterDeclarationBase<ts.TypeParameterDeclaration>
import { TypeParameterDeclaration } from "https://deno.land/x/ts_morph@15.1.0/ts_morph.d.ts";

Methods

getConstraint(): TypeNode | undefined

Gets the constraint of the type parameter.

Gets the constraint of the type parameter or throws if it doesn't exist.

getDefault(): TypeNode | undefined

Gets the default node of the type parameter.

getDefaultOrThrow(): TypeNode<ts.TypeNode>

Gets the default node of the type parameter or throws if it doesn't exist.

getParent(): NodeParentType<ts.TypeParameterDeclaration>
getParentOrThrow(): NonNullable<NodeParentType<ts.TypeParameterDeclaration>>

Gets the structure equivalent to this node.

Gets the variance of the type parameter.

remove(): void

Removes this type parameter.

Removes the constraint type node.

Removes the default type node.

set(structure: Partial<TypeParameterDeclarationStructure>): this

Sets the node from a structure.

setConstraint(text: string | WriterFunction): this

Sets the type parameter constraint.

setDefault(text: string | WriterFunction): this

Sets the type parameter default type node.

Set the variance of the type parameter.