#Adding class properties using stage 3 decorators

1 messages · Page 1 of 1 (latest)

indigo relic
#
GitHub

Decorators for ES6 classes. Contribute to tc39/proposal-decorators development by creating an account on GitHub.

safe templeBOT
#

@indigo relic Here's a shortened URL of your playground link! You can remove the full link from your message.

blodir#0

Preview:```ts
interface ExtraProperties {
extraProperty: string
}

const AddProperties = <
T extends new (...args: any[]) => {}

(
constructor: T,
context: ClassDecoratorContext
) => {
return class
extends constructor
implements ExtraProperties
{
extraProperty = "Extra property
...```

random sundial
#

Decorators cannot modify types by definition iirc