Skip to content
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

Wrongly typed options object in plugin.d.ts #1

Open
arv-asommer opened this issue Jul 17, 2024 · 0 comments
Open

Wrongly typed options object in plugin.d.ts #1

arv-asommer opened this issue Jul 17, 2024 · 0 comments

Comments

@arv-asommer
Copy link

Hi there :)

I came across an issue with the static options object that you can define inside a JavaScript plugin (typed by plugin.d.ts). It was typed as only object, which doesn't account for any custom keys inside the object.

Here is the diff that solved my problem:

diff --git a/node_modules/@shopware-ag/storefront-types/plugin-system/plugin.d.ts b/node_modules/@shopware-ag/storefront-types/plugin-system/plugin.d.ts
index dddd594..d6f3559 100644
--- a/node_modules/@shopware-ag/storefront-types/plugin-system/plugin.d.ts
+++ b/node_modules/@shopware-ag/storefront-types/plugin-system/plugin.d.ts
@@ -6,8 +6,12 @@ export default interface PluginBaseClass {
     el: HTMLElement;
     $emitter: NativeEventEmitter;
     _pluginName: String;
-    initialOptions: object;
-    options: object;
+    initialOptions: {
+        [key: string]: any;
+    };
+    options: {
+        [key: string]: any;
+    };
     _initialized: boolean;
     init(): void;
     _update(): void;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant