TS Class Decorator


```typefunction classDecorator() {  return function <T extends {new(...args:any[]):{}}> (constructor:T) {    return class extends constructor {      newProperty = "new property";      hello = "override";    }  }}@classDecorator()class Test {  property = "property";  hello: string;  constructor(m: string) {      this.hello = m;  }}let t = new Test("world")console.log(t)Test {  property: 'property',  hello: 'override',  newProperty: 'new property'}```

`<T extends {new(...args:any[]):{}}>` - You are basically saying that your class need a constructor in its definition through this `(new...)`

### 정적 타이핑 확장 안댐
> [Request: Class Decorator Mutation · Issue #4881 · microsoft/TypeScript](https://github.com/microsoft/TypeScript/issues/4881)


> [What does (constructor:T) mean in typescript?](https://stackoverflow.com/questions/58057916/what-does-t-extends-new-args-any-constructort-mean-in-typescr)

> [[typescript] 타입스크립트 데코레이터 1편 - 데코레이터 4가지 기본구조 알아보기](https://m.blog.naver.com/pjt3591oo/222120496022)






