Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to have all lualib functions accessed through object #1548

Open
jake-stewart opened this issue Mar 18, 2024 · 1 comment
Open

option to have all lualib functions accessed through object #1548

jake-stewart opened this issue Mar 18, 2024 · 1 comment

Comments

@jake-stewart
Copy link

lua only has up to 200 local variables but typescripttolua creates many local variables for the lualib

instead of

local ____lualib = require("lualib_bundle")
local Error = ____lualib.Error
local RangeError = ____lualib.RangeError
local ReferenceError = ____lualib.ReferenceError
local SyntaxError = ____lualib.SyntaxError
local TypeError = ____lualib.TypeError
local URIError = ____lualib.URIError
local __TS__New = ____lualib.__TS__New

it would make more sense to just have

local ____lualib = require("lualib_bundle")

and then access the various features with ____lualib.Error.

@jake-stewart
Copy link
Author

same applies for named imports

import { foo, bar } from './baz'

becomes

local baz = require("baz")
local foo = baz.foo
local bar = baz.bar

but could only declare baz and then access properties of baz when used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant