How can I create a variant value using the generated TypeScript code?

Answering my own question:

TypeScript doesn’t have constructors, it just offers type annotations for objects, so this is how we can express one of the values above:

let published : BookAttribute = {"tag": "Published","value":{"year":"1865", "publisher":"Macmillan"}};