spraypaint.js icon indicating copy to clipboard operation
spraypaint.js copied to clipboard

Multiple TypeScript decorators mentioned in documentation produce TypeScript errors

Open quickdudley opened this issue 1 year ago • 1 comments

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'

quickdudley avatar Nov 01 '24 22:11 quickdudley

As it turns out this is a documentation issue: the errors are resolved by adding "experimentalDecorators": true to my tsconfig.json

quickdudley avatar Nov 01 '24 22:11 quickdudley