@vue-storefront/middleware
Advanced tools
Comparing version 3.6.0-rc.2 to 3.6.0-rc.4
@@ -27,6 +27,2 @@ import { TObject } from "./base"; | ||
} | ||
/** | ||
* @deprecated | ||
* Use `ApiClient` instead. | ||
*/ | ||
export interface ApiInstance<CONFIG, API, CLIENT> { | ||
@@ -37,6 +33,14 @@ api: API; | ||
} | ||
/** | ||
* All available API methods without first argument - `context`, because this prop is set automatically. | ||
*/ | ||
export type ContextualizedApi<API> = { | ||
[T in keyof API]: API[T] extends (context: any, ...arguments_: infer P) => infer R ? (...arguments_: P) => R : never; | ||
}; | ||
export interface ApiClient<API = any, CONFIG = any, CLIENT = any> { | ||
api: API; | ||
api: ContextualizedApi<API>; | ||
client: CLIENT; | ||
settings: CONFIG; | ||
settings: CONFIG & { | ||
integrationName: string; | ||
}; | ||
} | ||
@@ -49,3 +53,3 @@ export interface ApiClientConfig<CLIENT = any> { | ||
export type CreateApiClientFn<CONFIG extends ApiClientConfig, API extends ApiMethods> = { | ||
<T extends ApiClientConfig, C>(givenConfig: CONFIG, customApi?: ApiMethods): ApiClient<API & ApiMethods, T, C>; | ||
<T extends ApiClientConfig, C>(givenConfig: CONFIG, customApi?: ApiMethods): ApiInstance<T, API & ApiMethods, C>; | ||
_predefinedExtensions?: ApiClientExtension<API>[]; | ||
@@ -69,3 +73,3 @@ }; | ||
} | ||
export type CreateApiProxyFn = <CONFIG, API, CLIENT>(givenConfig: any, customApi?: any) => ApiClient<API, CONFIG, CLIENT>; | ||
export type CreateApiProxyFn = <CONFIG, API, CLIENT>(givenConfig: any, customApi?: any) => ApiInstance<CONFIG, API, CLIENT>; | ||
//# sourceMappingURL=server.d.ts.map |
{ | ||
"name": "@vue-storefront/middleware", | ||
"version": "3.6.0-rc.2", | ||
"version": "3.6.0-rc.4", | ||
"main": "lib/index.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "lib/index.es.js", |
Sorry, the diff of this file is not supported yet
70242
1150