It would be much simpler for users if you added a second generic to BaseComponent and then did your voodoo ts plugin shit to automatically add a type guard to the component
import { Component, BaseComponent, OnStart, Flamework } from "@rbxts/flamework";
interface Attributes {}
@Component({
tag: "Structure",
})
export class Structure extends BaseComponent<Attributes, Model> implements OnStart {
onStart() {
print(this.instance.PrimaryPart) //wooo this is legal because this.instance is a model
}
}
the current solution for guarding the type of a component looks a little akward:
It would be much simpler for users if you added a second generic to BaseComponent and then did your voodoo ts plugin shit to automatically add a type guard to the component