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/Property/spec.ts

📦 Imports

Name Source
AST_NODE_TYPES ../../ast-node-types
BaseNode ../../base/BaseNode
TSEmptyBodyFunctionExpression ../../expression/TSEmptyBodyFunctionExpression/spec
AssignmentPattern ../../parameter/AssignmentPattern/spec
BindingName ../../unions/BindingName
Expression ../../unions/Expression
PropertyName ../../unions/PropertyName
PropertyNameComputed ../../unions/PropertyName
PropertyNameNonComputed ../../unions/PropertyName

Interfaces

PropertyBase

Interface Code
interface PropertyBase extends BaseNode {
  type: AST_NODE_TYPES.Property;
  computed: boolean;
  key: PropertyName;
  kind: 'get' | 'init' | 'set';
  method: boolean;
  optional: boolean;
  shorthand: boolean;
  value:
    | AssignmentPattern
    | BindingName
    | Expression
    | TSEmptyBodyFunctionExpression;
}

Properties

Name Type Optional Description
type AST_NODE_TYPES.Property
computed boolean
key PropertyName
kind 'get' | 'init' | 'set'
method boolean
optional boolean
shorthand boolean
value ` AssignmentPattern
BindingName
Expression
TSEmptyBodyFunctionExpression`

PropertyComputedName

Interface Code
export interface PropertyComputedName extends PropertyBase {
  computed: true;
  key: PropertyNameComputed;
}

Properties

Name Type Optional Description
computed true
key PropertyNameComputed

PropertyNonComputedName

Interface Code
export interface PropertyNonComputedName extends PropertyBase {
  computed: false;
  key: PropertyNameNonComputed;
}

Properties

Name Type Optional Description
computed false
key PropertyNameNonComputed

Type Aliases

Property

type Property = PropertyComputedName | PropertyNonComputedName;