This project is read-only.

how to customize properties

Topics: Language Specification
Oct 2, 2012 at 7: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,, etc...) ?

Oct 4, 2012 at 5:15 AM

I believe the post at answered your question.  Thanks!

Oct 4, 2012 at 5:44 AM

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


    enumerable: false,
    writable: false,
    configurable: false