Skip to content

Commit d95379e

Browse files
fix: type in multistore (#7050)
* fix: type in multistore * fix: get could also be undefined * update changeset * apply review feedback
1 parent 99227ae commit d95379e

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

Diff for: .changeset/twenty-drinks-tickle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-storefront/multistore": patch
3+
---
4+
5+
[FIXED] Type issue in multistore package. Cache control `set` method returns `any` type and `get` returns `StoreConfig | undefined`. Also, `MiddlewareConfiguration` type has been removed as it is no longer necessary.

Diff for: packages/multistore/src/types.ts

+2-14
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export interface CacheManager {
1010
/**
1111
* Gets a store configuration from cache storage based on the `key` value.
1212
*/
13-
get(key: string): StoreConfig;
13+
get(key: string): StoreConfig | undefined;
1414

1515
/**
1616
* Sets a store configuration in the cache storage with identifier equals `key` value.
1717
*/
18-
set(key: string, value: StoreConfig): StoreConfig;
18+
set(key: string, value: StoreConfig): unknown;
1919
}
2020

2121
/**
@@ -43,18 +43,6 @@ export interface MultistoreExtensionMethods {
4343
}) => Record<string, StoreConfig>;
4444
}
4545

46-
export interface MiddlewareConfiguration {
47-
/**
48-
* Multistore configuration.
49-
*/
50-
multistore: MultistoreExtensionMethods;
51-
52-
/**
53-
* Other configration entries, that are not being used by the multistore extension.
54-
*/
55-
[key: string]: any;
56-
}
57-
5846
/**
5947
* Parameters for updateConfig utility function.
6048
*/

0 commit comments

Comments
 (0)