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:
type AllProperties = CreatableInstances[keyof CreatableInstances];
type AllProperties = CreatableInstances[keyof CreatableInstances];
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
No description
15 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
PepeElToro41
PepeElToro41OP3y ago
@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
No description
PepeElToro41
PepeElToro41OP3y ago
this works fine
No description
PepeElToro41
PepeElToro41OP3y ago
this is the error
No description
PepeElToro41
PepeElToro41OP3y ago
also that's how I defied those types
type PropertiesTable<T extends Instance> = Partial<WritableInstanceProperties<T>>;
type Write<T> = WritablePropertyNames<T>;
type PropertiesTable<T extends Instance> = Partial<WritableInstanceProperties<T>>;
type Write<T> = WritablePropertyNames<T>;
PepeElToro41
PepeElToro41OP3y ago
found the solution of adding as never at the end, I guess there's no way to set it with correct types thanks :DD
PepeElToro41
PepeElToro41OP3y ago
yeah I always try to typecheck and workaround with another way, but Im pretty happy with this autocompletition tho, I started liking ts
No description
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@214262712753061889>
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@214262712753061889>
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@214262712753061889>
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@214262712753061889>
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@214262712753061889>
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@259237045593964554>
roblox-ts
roblox-ts3y ago
Playground link
Posted by <@214262712753061889>

Did you find this page helpful?