JoplinClipboard.d.ts is for type definition and you shouldn't manually write them (they are automatically generated). You should instead create a JoplinClipboard.ts. But where are you creating this file by the way? It should be on the main repo, so here. Basically you are adding a functionality to the main app plugin system.
Thanks but there's no need to show step by step what you've done. So far, it's pretty much just what I wrote above since the check for null/undefined shouldn't be there, but you also need to compile and make sure it works with your plugin (or a simple text plugin). Could you maybe try to get it working and then create the pull request?
The first step is to build the desktop application and after that it's just like testing any plugin for development, as documented in the Getting Started page: Getting started with plugin development | Joplin
To disable type checking errors in the plugin, you can cast to any. For example, await (joplin as any).clipboard.readText()
As far as I understand (Laurent and others, please correct me if I'm wrong), it makes weback assume electron will be available at runtime and not try to package it with your plugin even if you have a dependency on it.
It worked for me with fs , will it work for electron I'm not sure.