I’m currently modifying a plugin that was created by another author called « Menu Items ».
The plugin uses the client hook « filter:left-menu.links.create.result » to modify the left menu links shown in peertube. If you look in the « client » folder under « common-client-plugin.ts », you will see that the author of the plugin intended to allow an icon to be added to each new link, but never finished the project.
It is my goal to add this ability to specify an icon for each link in the plugin. Here is my quesiton:
I’ve found the docs at Plugins & Themes API | PeerTube documentation where all the available client hooks are listed, my problem is that I don’t know where it is documented what values are expected to be returned for each client hook.
Maybe another way to say this is: The author of this plugin knew to return « icon », « label », « path », and « shortLabel » values for each new menu item. How did he know that? Where is it documented what values are expected to be returned for the « filter:left-menu.links.create.result » hook?
For plugin using Typescript, maybe you will have the correct type provided by @peertube/types (i did not check, and i can’t for now).
But you can also check this declaration in the Peertube code:
For the record, the url attribute came with Peertube 7.1.0 (check the release changelogs). So if you are using it, be sure to mark your plugin as compatible only with Peertube >= 7.1.0.