Skip to content

Lists of objects parsed as "any" #32

@gcecc

Description

@gcecc

Installed product versions

  • Visual Studio: 2019 Professional
  • This extension: 1.2.38
  • Options override: none

Description

When I generate a new .d.ts file, the lists of non-primitive objects are parsed as "any", even with the Class definition inside the same file

Steps to recreate

  1. Create a class file with inside two classes: TodoItem and TodoList.
  2. Make TodoList a class with inside a list of TodoItems, like this:
    public class TodoItemVM
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public boolean Done{ get; set; }
    }
    public class TodoListVM
    {
        public TodoListVM()
        {
            TodoItems = new List<TodoItemVM>();
        }
        List<TodoItemVM> TodoItems { get; set; }
    }

  1. Generate the .d.ts file.

Current behavior

The generation will not mantain the "TodoItemVM" type for the generated "TodoItems" array and it will become "any"

Expected behavior

I would like to mantain that type, it would be much practical in the moment I'll need to use that list.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions