Skip to content

⬅️ Back to Table of Contents

📄 spec.ts

📊 Analysis Summary

Metric Count
📦 Imports 5
📐 Interfaces 1

📚 Table of Contents

🛠️ File Location:

📂 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts

📦 Imports

Name Source
AST_NODE_TYPES ../../ast-node-types
BaseNode ../../base/BaseNode
Identifier ../../expression/Identifier/spec
TSTypeParameterDeclaration ../../special/TSTypeParameterDeclaration/spec
TypeNode ../../unions/TypeNode

Interfaces

TSTypeAliasDeclaration

Interface Code
export interface TSTypeAliasDeclaration extends BaseNode {
  type: AST_NODE_TYPES.TSTypeAliasDeclaration;
  /**
   * Whether the type was `declare`d.
   * @example
   * ```ts
   * declare type T = 1;
   * ```
   */
  declare: boolean;
  /**
   * The name of the type.
   */
  id: Identifier;
  /**
   * The "value" (type) of the declaration
   */
  typeAnnotation: TypeNode;
  /**
   * The generic type parameters declared for the type. Empty declaration
   * (`<>`) is different from no declaration.
   */
  typeParameters: TSTypeParameterDeclaration | undefined;
}

Properties

Name Type Optional Description
type AST_NODE_TYPES.TSTypeAliasDeclaration
declare boolean
id Identifier
typeAnnotation TypeNode
typeParameters TSTypeParameterDeclaration | undefined