diff --git a/src/shared/types/class.lua b/src/shared/types/class.lua new file mode 100644 index 0000000..43c4e66 --- /dev/null +++ b/src/shared/types/class.lua @@ -0,0 +1,11 @@ +-- type AccountImpl = { +-- __index: AccountImpl, +-- new: (name: string, balance: number) -> Account, +-- deposit: (self: Account, credit: number) -> (), +-- withdraw: (self: Account, debit: number) -> (), +-- } + +-- type Account = typeof(setmetatable({} :: { name: string, balance: number }, {} :: AccountImpl)) + +type hself = {__index: T} & U +export type constructor = typeof(setmetatable({} :: T & hself, {} :: U)) \ No newline at end of file