unyt-org / datex-core-js-legacy

DATEX Core Library for JavaScript (legacy), fully implemented in TypeScript, used by the UIX Framework
https://unyt.org
3 stars 0 forks source link

Improved sync class constructors #46

Closed benStre closed 10 months ago

benStre commented 10 months ago

Adds better typing for constructors in sync classes.

Before:

@sync class MyClass {
   // for typing 
   constructor(a: number, b: string){}
   // actual constructor
   @constructor construct(a: number, b: string){
      // ...
    }
}

Now:

@sync class MyClass {
   // actual constructor
   @constructor construct(a: number, b: string){
      // ...
    }
}

(The constructor must be named construct)

Also updated the docs for sync classes