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

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

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

Methods

getConstraint(): TypeNode | undefined

Gets the constraint of the type parameter.

getConstraintOrThrow(message?: string | (() => string)): TypeNode<ts.TypeNode>

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(message?: string | (() => string)): TypeNode<ts.TypeNode>

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

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

Gets the structure equivalent to this node.

Gets the variance of the type parameter.

isConst(): boolean

Gets if this is a const 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.

setIsConst(value: boolean): this

Sets if this is a const type parameter or not.

Set the variance of the type parameter.