There's a type declaration file for the vim global that's defined by default in Neovim: https://github.com/teal-language/teal-types/blob/master/type...
to be used via `global_env_def` described in https://teal-language.org/book/declaration_files.html
And though they mention it as being for third party libraries, this also seems a way to declare types for your own code in an external file, thus keeping your code as runnable Lua and benefiting from type checking too. That seems like a neat workflow for developing Neovim plugins with this: instead of having to constantly regenerate Lua from .tl files so Neovim can pick up your changes during development.
Edit: or maybe https://github.com/teal-language/tl#loading-teal-code-from-l... this is the easier way to do it. `require` and use `loader` during development, generate the Lua once things are somewhat stable.
> this also seems a way to declare types for your own code in an external file, thus keeping your code as runnable Lua and benefiting from type checking too
The declaration file isn't used to typecheck the code the declaration is for. It is only for consumers of the code.
Ah that's a shame. I was hoping it would work via sidecar files like Ruby's RBS [1] or Python's stub files [2]
I was editing my comment during your reply, and added this:
> or maybe https://github.com/teal-language/tl#loading-teal-code-from-l... this is the easier way to do it. `require` and use `loader` during development, generate the Lua once things are somewhat stable.
Does that sound like the right idea then?
[1] https://github.com/ruby/rbs [2] https://mypy.readthedocs.io/en/stable/stubs.html