this PR adds an option to the ExportEnumAttribute to define it as UnionType
[AttributeUsage(AttributeTargets.Enum)]
public class ExportTsEnumAttribute : ExportAttribute
{
/// <summary>
/// Specifies whether an enum should be exported as TypeScript const enum
/// </summary>
public bool IsConst { get; set; }
/// <summary>
/// Specifies whether the enum should be exported as a TypeScript UnionType
/// </summary>
public bool AsUnionType { get; set; }
}
Feature 2: define output path on cli
I am not working with a config file, because i don't have a need for one. The only thing that I needed, that wasn't available on the cli is the option to define an output path when generating using the cli. I need this for my build pipelines, where I generate npm packages during build and deployment.
for this a new commandline option was added -o or --output-path. this will be preferred, over the output path in the config, if set.
2 new features in this PR
Feature 1: Enum UnionTypes
I had a need to export Enums as (Union-)Types. So for the following Enum:
I needed a typescript type to be generated:
this PR adds an option to the ExportEnumAttribute to define it as UnionType
Feature 2: define output path on cli
I am not working with a config file, because i don't have a need for one. The only thing that I needed, that wasn't available on the cli is the option to define an output path when generating using the cli. I need this for my build pipelines, where I generate npm packages during build and deployment.
for this a new commandline option was added
-o
or--output-path
. this will be preferred, over the output path in the config, if set.