JSON in database - what DTO property type?

Hi, I am storing Json in a database. To date, I have been using a DTO property with a type of JsonObject and it’s worked fine.

I’m now migrating the client application to Typescript, and using the wonderful “add Typescript reference” feature of the VS plugin.

The problem is that when the dto.d.ts file is generated, the following statement is generated:

interface JsonObject extends any{


Extending “any” isn’t valid TS apparently. This doesn’t pose a problem in Visual studio - error in file, but intellisence works. But when automating typescript compilation via grunt-ts, this errors.

Any suggestions on how I can leave the JsonObject properties in place but get rid of this error?


I have found a workaround - I created my own interface JsonObject and used ExcludeTypes to remove that definition.

Note when adding a TypeScript reference you can uncheck “Only TypeScript definitions” checkbox to generate concrete classes instead of interface definitions.