Skip to content

Const strings are not converted #66

@matthew-dean

Description

@matthew-dean

We have C# files that define what looks like dictionaries?

That is, it has code like this:

public class Foo {
  public const string AConstant = "A string constant";
  public const string AnotherConstant = "Another string constant";
}

This was converted by the plugin to a structure like this:

export interface Foo {
  aConstant: string;
  anotherConstant: string;
}

So, for one, I'm not sure how it is useful to convert the casing. In my case, I'm converting Razor templates into Vue ones, and they have bindings into these constants, so it's a matter of converting '@Foo.AnotherConstant' to Foo.AnotherConstant, but the casing conversion would make that impossible.

Secondly, of course, the values are missing. I don't understand this kind of conversion because TypeScript has classes, and classes can be used as interfaces, so why isn't the output just:

export class Foo {
  static AConstant = "A string constant";
  static AnotherConstant = "Another string constant";
}

That would be a direct representation of the class.

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