How can I set properties by a given table of properties
This might be a dumb question but Im new on roblox-ts, so, I basically have this function that creates a new roblox object and additionally, you are able to give a table of properties to set with the structure: {propertyName = propertyValue}
example New("Blur", {Size = 10},Camera)
AllProperties type is defined as:
I ran out of ideas, this stills red, if you can also explain me a little I would appreciate it a lot
here's a playground https://roblox-ts.com/playground/#code/C4TwDgpgBAggNnACgJwPaWcAlhAzlAXigGFkIBDYcgIzggEkA7XKxgYzwG0BrCEVAGYkylGnSYty7PAF0AUHIEBXdtlSMoAOQgB3ABRs45XLk3kAthABcUXvyGkKVWg2asOuADRQwaDNjwAfhsAbygePhs7QVgEFHQITBxcGRsVbkZUHUYAX28wcjJGYGCoCXcIAEobcqkOKBC5AEg2dRYoRl1a6UIO3TK3OogDIxMzS08CouBKgG5mpqwhPV8EpLxKhoWmgVRkKAM24HDV-xBx6Hy-RNAANXI4JQgZKBiCrGRcFev13ErNxpNIFNMBsB5wPR6TYEAB8W2BTU6Om6HE4pxu5ws0GMtj4MXgSB+ARSvXRmBA90eEG2OTmCxyzQZTTIwCUyA0SJREHmOSAA

15 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
@Noire ☕ @Dionysusnu so, I somehow managed to set the type for the properties table, it has correct autocompletition, most of that mess for properties type was because I got crazy trying a bunch of things
but still telling me that last error

this works fine

this is the error

also that's how I defied those types
found the solution of adding as never at the end, I guess there's no way to set it with correct types
thanks :DD
yeah I always try to typecheck and workaround with another way, but Im pretty happy with this autocompletition tho, I started liking ts

Playground link
Posted by <@214262712753061889>
Playground link
Posted by <@214262712753061889>
Playground link
Posted by <@214262712753061889>
Playground link
Posted by <@214262712753061889>
Playground link
Posted by <@214262712753061889>
Playground link
Posted by <@259237045593964554>
Playground link
Posted by <@214262712753061889>