-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin
interface is renamed to Plugin$1
and breaks stuff
#97
Comments
@unxok I don't see an issue with the code you provided. Please prepare a full example including |
There wouldn't be anything wrong with the code example I provided if obsidian-typings was correct. The issue is obsidian-typings definition for "Plugin" is renamed to "Plugin$1" by dts-bundle-generator. Because of this, the code example I provided will have typescript errors. |
I don't have typescript errors with your code that's why I asked for a complete example |
@unxok I was finally able to reproduce the issue. Working on the fix |
Opened a corresponding issue timocov/dts-bundle-generator#335 |
Nice thanks for that! |
Description of issue
It looks like the problem is with dts-bundle-generator, but I couldn't find an existing issue that fully matches this problem.
It appears that the tool is renaming it to
Plugin$1
due to it detecting a conflict with the (deprecated) global Plugin. I'm guessing the tool detects the conflict and renames it in the assumption that the obsidian-typings' interface is meaning to extend the global interface or that you will export it with something (in which case it will export it correctly with its true name).Due to this rename, typescript is only aware that
Plugin$1
extends theComponent
interface and not that it is supposed to be merged with thePlugin
class from obsidian.Minimal repro
Workaround
The easiest fix is just to replace all occurrences of "Plugin$1" with "Plugin" and remove the renaming of "Plugin" in the import statement within the
types.d.ts
file. Obviously this isn't preferred, but I'm guessing the true solution will take some time since it likely is dts-bundle-generator's problem.The text was updated successfully, but these errors were encountered: