How can I declare an object with properties that I will be passing around inside of my function using Typescript?

Posted by Marilou on Stack Overflow See other posts from Stack Overflow or by Marilou
Published on 2012-10-28T16:56:39Z Indexed on 2012/10/28 17:00 UTC
Read the original article Hit count: 159

Filed under:

I've been using the following:

var modal = {
    content: '',
    form: '',
    href: ''
}

But now I have started to use Typescript is there a better way I can declare an object and how can I declare the types of my properties. The reason I am using this object is that it's inside of a function and inside that function I have other functions that set and use the values of the properties. Is this the best way for me to do this or is there another way I could better do this with typescript?

© Stack Overflow or respective owner

Related posts about TypeScript