How is the Instance.new() function typed? For example, when you type ‘Part’ as the argument, you get autocomplete suggestions for the Part class. I need to implement something similar for my own constructor
I need like this:
type musket = {
Fire: (self: musket) -> (),
Reload: (self: musket) -> (),
}
type sword = {
Attack: (self: sword) -> (),
Block: (self: sword) -> ()
}
function contructor(class: string): any
-- code
end
contructor('musket') --> musket class
contructor('sword') --> sword class