diff --git a/.changeset/spotty-students-pump.md b/.changeset/spotty-students-pump.md new file mode 100644 index 0000000000..6b0c9074ae --- /dev/null +++ b/.changeset/spotty-students-pump.md @@ -0,0 +1,5 @@ +--- +"@vue-storefront/multistore": patch +--- + +[UPDATED] Set the return type of the createMultistoreExtension helper to `ApiClientExtension`. diff --git a/.changeset/strong-scissors-accept.md b/.changeset/strong-scissors-accept.md new file mode 100644 index 0000000000..d462589539 --- /dev/null +++ b/.changeset/strong-scissors-accept.md @@ -0,0 +1,5 @@ +--- +"@vue-storefront/middleware": major +--- + +[CHANGED] Updated the type of the `hooks` property in the `ApiClientExtension` interface so that the hooks' `configuration` param is typed properly. This is a breaking change if you are using `@vue-storefront/middleware` version `4.1.2` or lower. diff --git a/packages/middleware/src/types/common.ts b/packages/middleware/src/types/common.ts index fb72c9b51b..51146db368 100644 --- a/packages/middleware/src/types/common.ts +++ b/packages/middleware/src/types/common.ts @@ -108,7 +108,7 @@ export interface ApiClientExtension { req: AlokaiRequest, res: AlokaiResponse, hooksContext: AlokaiContainer - ) => ApiClientExtensionHooks; + ) => ApiClientExtensionHooks; } export type ErrorHandler = ( @@ -129,7 +129,7 @@ export interface Integration< extensions: ApiClientExtension[] // TODO(IN-4338): There is a bug in the types here // we're not able to verify if the methods are namespaced or not with this implementation. - ) => ApiClientExtension[]; + ) => ApiClientExtension[]; customQueries?: Record; initConfig?: TObject; /** diff --git a/packages/multistore/src/extension.ts b/packages/multistore/src/extension.ts index f75857f9dd..c6ae34a1ff 100644 --- a/packages/multistore/src/extension.ts +++ b/packages/multistore/src/extension.ts @@ -8,7 +8,7 @@ import { fetchConfigWithCache } from "./cache/fetchConfigWithCache"; export const createMultistoreExtension = ( multistoreConfig: MultistoreExtensionMethods -) => { +): ApiClientExtension => { const cacheManager = multistoreConfig.cacheManagerFactory(); return { @@ -37,5 +37,5 @@ export const createMultistoreExtension = ( }, }; }, - } satisfies ApiClientExtension; + }; };