What do you want to achieve? Keep it simple and clear!
Get the autocomplete to autocomplete an argument as if it was an object returned by a function from a different module.
What is the issue? Include screenshots / videos if possible!
Just a question. Will doing arg : typeof(require(module).new() actuallly require the module, call the function and see the outcome? Will this be inefficient and is there a better way to do this? Perhaps by exporting types but I don’t have the patience to do that.
My code:
local debug = {}
function debug.init(ws:typeof(require(script.Parent).create()))
-- code
end
return debug
i like to think of type annotations as just a guide for the script editor, and because of that no runtime code is actually affected by it
i’d personally go with exporting the type if possible instead (similar to typescript), see luau documentation for details: