Skip to content

⬅️ Back to Table of Contents

📄 ClassBase.ts

📊 Analysis Summary

Metric Count
📦 Imports 8
📐 Interfaces 1

📚 Table of Contents

🛠️ File Location:

📂 packages/ast-spec/src/base/ClassBase.ts

📦 Imports

Name Source
Identifier ../expression/Identifier/spec
ClassBody ../special/ClassBody/spec
Decorator ../special/Decorator/spec
TSClassImplements ../special/TSClassImplements/spec
TSTypeParameterDeclaration ../special/TSTypeParameterDeclaration/spec
TSTypeParameterInstantiation ../special/TSTypeParameterInstantiation/spec
LeftHandSideExpression ../unions/LeftHandSideExpression
BaseNode ./BaseNode

Interfaces

ClassBase

Interface Code
export interface ClassBase extends BaseNode {
  /**
   * Whether the class is an abstract class.
   * @example
   * ```ts
   * abstract class Foo {}
   * ```
   */
  abstract: boolean;
  /**
   * The class body.
   */
  body: ClassBody;
  /**
   * Whether the class has been `declare`d:
   * @example
   * ```ts
   * declare class Foo {}
   * ```
   */
  declare: boolean;
  /**
   * The decorators declared for the class.
   * @example
   * ```ts
   * @deco
   * class Foo {}
   * ```
   */
  decorators: Decorator[];
  /**
   * The class's name.
   * - For a `ClassExpression` this may be `null` if the name is omitted.
   * - For a `ClassDeclaration` this may be `null` if and only if the parent is
   *   an `ExportDefaultDeclaration`.
   */
  id: Identifier | null;
  /**
   * The implemented interfaces for the class.
   */
  implements: TSClassImplements[];
  /**
   * The super class this class extends.
   */
  superClass: LeftHandSideExpression | null;
  /**
   * The generic type parameters passed to the superClass.
   */
  superTypeArguments: TSTypeParameterInstantiation | undefined;
  /**
   * The generic type parameters declared for the class.
   */
  typeParameters: TSTypeParameterDeclaration | undefined;
}

Properties

Name Type Optional Description
abstract boolean
body ClassBody
declare boolean
decorators Decorator[]
id Identifier | null
implements TSClassImplements[]
superClass LeftHandSideExpression | null
superTypeArguments TSTypeParameterInstantiation | undefined
typeParameters TSTypeParameterDeclaration | undefined