local Class = {}
Class.__index = Class
function Class.new(name: string)
local self = {
Name = name,
}
return setmetatable(self, Class)
end
type Class = typeof(Class.new()) --> Huh ???
The type class actually works here even though I passed in a method?
Is this intended behavior? also is the method called? What’s goind on here
The easiest way would be to define the class and self manually:
local Class = {}
Class.__index = Class
function Class.new(name: string)
local self = {
Name = name,
}
return setmetatable(self, Class)
end
function Class.method(self: Class, ...)
self.f --> 'foo' autocompletes
end
function Class.foo(self: Class, bar: number)
end
type Class = typeof(Class) &{ Name: string } --> Define the class properties here