Skip to content

⬅️ Back to Table of Contents

📄 spec.ts

📊 Analysis Summary

Metric Count
📦 Imports 9
📐 Interfaces 3
📑 Type Aliases 1

📚 Table of Contents

🛠️ File Location:

📂 packages/ast-spec/src/element/TSMethodSignature/spec.ts

📦 Imports

Name Source
AST_NODE_TYPES ../../ast-node-types
Accessibility ../../base/Accessibility
BaseNode ../../base/BaseNode
TSTypeAnnotation ../../special/TSTypeAnnotation/spec
TSTypeParameterDeclaration ../../special/TSTypeParameterDeclaration/spec
Parameter ../../unions/Parameter
PropertyName ../../unions/PropertyName
PropertyNameComputed ../../unions/PropertyName
PropertyNameNonComputed ../../unions/PropertyName

Interfaces

TSMethodSignatureBase

Interface Code
interface TSMethodSignatureBase extends BaseNode {
  type: AST_NODE_TYPES.TSMethodSignature;
  accessibility: Accessibility | undefined;
  computed: boolean;
  key: PropertyName;
  kind: 'get' | 'method' | 'set';
  optional: boolean;
  params: Parameter[];
  readonly: boolean;
  returnType: TSTypeAnnotation | undefined;
  static: boolean;
  typeParameters: TSTypeParameterDeclaration | undefined;
}

Properties

Name Type Optional Description
type AST_NODE_TYPES.TSMethodSignature
accessibility Accessibility | undefined
computed boolean
key PropertyName
kind 'get' | 'method' | 'set'
optional boolean
params Parameter[]
readonly boolean
returnType TSTypeAnnotation | undefined
static boolean
typeParameters TSTypeParameterDeclaration | undefined

TSMethodSignatureComputedName

Interface Code
export interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
  computed: true;
  key: PropertyNameComputed;
}

Properties

Name Type Optional Description
computed true
key PropertyNameComputed

TSMethodSignatureNonComputedName

Interface Code
export interface TSMethodSignatureNonComputedName
  extends TSMethodSignatureBase {
  computed: false;
  key: PropertyNameNonComputed;
}

Properties

Name Type Optional Description
computed false
key PropertyNameNonComputed

Type Aliases

TSMethodSignature

type TSMethodSignature = | TSMethodSignatureComputedName
  | TSMethodSignatureNonComputedName;