Skip to content

Inconsistent ast types in introspectΒ #721

@ekarademir

Description

@ekarademir

Bug Report πŸ›

Types of ast fields are sometimes string, sometimes any. Instead maybe they should conform to the generated types.

Expected Behavior

If I use ast property of a ClassDeclaration, it should have the type IDeclaration instead of string.

Current Behavior

If I use ast property of a ClassDeclaration, it has the type string instead of IDeclaration.

Possible Solution

Steps to Reproduce

  1. Create a ModelFile that has declarations
  2. Obtain one of the declarations with for instance modelFile.getAllDeclarations().at(0)
  3. Now access the ast property of that declaration and check type with typeof declaration (no pun intended)
  4. typeof myDeclaration is object but TypeScript assumes that it's string, because of the type definition file.

Context (Environment)

Desktop

  • OS: macOS Ventura
  • Browser: NodeJS
  • Version: 18.17.1

Detailed Description

Possible Implementation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions