spraypaint.js
spraypaint.js copied to clipboard
Multiple TypeScript decorators mentioned in documentation produce TypeScript errors
When used exactly as described in the tutorial at https://www.graphiti.dev/js:
@Model() used as a class decorator produces this error:
TS1238: Unable to resolve signature of class decorator when used as expression. The runtime will invoke the decorator with 2 arguments, but the decorator expects 1
@Attr() used as a property decorator produces this error:
TS1240: Unable to resolve signature of property decorator when used as expression. Argument of type 'undefined' is not assignable to parameter of type 'Object'
@HasOne() used as a property decorator produces this error:
TS1240: Unable to resolve signature of property decorator when used as expression. Argument of type 'undefined' is not assignable to parameter of type 'SprayPaintBase'
As it turns out this is a documentation issue: the errors are resolved by adding "experimentalDecorators": true to my tsconfig.json