Deman
Deman

Reputation: 51

Control how web essential generates d.ts files from .cs files

For example "Guid" types are ganerated as "any" type.

Uri type is generated as complex type:

{
    AbsolutePath: string;
    AbsoluteUri: string;
    Authority: string;
    DnsSafeHost: string;
    Fragment: string;
    Host: string;
    HostNameType: any;
    IsAbsoluteUri: boolean;
    IsDefaultPort: boolean;
    IsFile: boolean;
    IsLoopback: boolean;
    IsUnc: boolean;
    LocalPath: string;
    OriginalString: string;
    PathAndQuery: string;
    Port: number;
    Query: string;
    Scheme: string;
    Segments: string[];
    UserEscaped: boolean;
    UserInfo: string;
}

but in reality it is serialized as string.

So... Is it possible somehow to tell WebEssentials, how to serialize property types, either globally:

Guid -> string
Uri -> string

or locally property by property:

[TypescriptType(typeof(string))]
Guid Id {get; set;};

Of course, globally by project or solution is better.

Upvotes: 4

Views: 943

Answers (1)

Milan Jaros
Milan Jaros

Reputation: 1147

It seems that Web Essentials can't do this (yet?). I'd suggest you two things:

Upvotes: 2

Related Questions