how to customize properties

Topics: Language Specification
Oct 2, 2012 at 6:50 PM

say I'm using TypeScript to generate library code that will be consumed by external clients.

today, I use the following code to create customized properties:

Object.defineProperties(this, {
    view: {
        value: view,
        enumerable: false,
        writable: false,
        configurable: false
    },
});
it seems that this type of flexibility isn't currently supported by TypeScript.

1) are there plans to support this kind of thing in the future?

2) until then, how can we define such a property so it is also visible from within TypeScript and retains the correct semantics (hasOwnProperty, for...in, etc...) ?

Oct 4, 2012 at 4:15 AM

I believe the post at http://stackoverflow.com/questions/12696250/typescript-how-to-customize-properties answered your question.  Thanks!

Oct 4, 2012 at 4:44 AM

i don't think so. it doesn't show how to set 

 

    enumerable: false,
    writable: false,
    configurable: false