First of all, thank you very much for your work.
I tried migrating to v2 on a project using vue-cli, and unfortunately got an error during compilation, specifically:
ERROR in node_modules/vuex-class-component/dist/proxy.d.ts
5:101 Type 'T' does not satisfy the constraint 'new (...args: any) => any'.
3 | export declare function createProxy<T extends typeof VuexModule>($store: any, cls: T): ProxyWatchers & InstanceType<T>;
4 | export declare function createLocalProxy<T extends typeof VuexModule>(cls: T, $store: any): InstanceType<T>;
> 5 | export declare function _createProxy<T>(cls: T, $store: any, namespacedPath?: string): InstanceType<T>;
| ^
6 |
and:
ERROR in node_modules/vuex-class-component/dist/proxy.d.ts
5:101 Type 'T' does not satisfy the constraint 'new (...args: any) => any'.
3 | export declare function createProxy<T extends typeof VuexModule>($store: any, cls: T): ProxyWatchers & InstanceType<T>;
4 | export declare function createLocalProxy<T extends typeof VuexModule>(cls: T, $store: any): InstanceType<T>;
> 5 | export declare function _createProxy<T>(cls: T, $store: any, namespacedPath?: string): InstanceType<T>;
| ^
6 |
I tracked those errors to a missing extends in the declaration files of proxy and submodule classes.
Changing:
export declare function createSubModule<T>(Cls: T): InstanceType<T>;
to:
export declare function createSubModule<T extends typeof VuexModule>(Cls: T): InstanceType<T>;
and doing the same for proxy seems to fix my problem.
Hello,
First of all, thank you very much for your work. I tried migrating to v2 on a project using vue-cli, and unfortunately got an error during compilation, specifically:
and:
I tracked those errors to a missing
extends
in the declaration files of proxy and submodule classes.Changing:
to:
and doing the same for proxy seems to fix my problem.