Type file for Yazi's API #2121
hankertrix
started this conversation in
2. Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hopefully, this will be useful to other plugin developers. I made it to have type-checking for my plugin, which is probably the most complex plugin currently available for Yazi, so static typing is a must to catch bugs.
You can find it here:
https://github.com/hankertrix/augment-command.yazi/blob/main/yazi_types.lua
To use it, you need to have Lua Language Server installed and set up and have the file in the directory where you are developing your plugin. It doesn't need to be included in your plugin.
I only typed the parts of the API that are documented, or that I know how to use. Yazi exposes quite a bit more, but I have no idea how to use those APIs, so it's impossible to type them.
I will try to update it to keep up with Yazi API changes, but I won't have much time to do so after this month, so it may be slow to update and might be outdated at some points.
Beta Was this translation helpful? Give feedback.
All reactions