import { DtoProductParamsWithLang, DtoValidateRequest } from "./CatalogueAPI.js"; import { CfgProductResponse, CfgValidateResponse } from "./utilitiesCatalogueData.js"; export declare type GetProduct = (params: DtoProductParamsWithLang) => Promise; export declare type PostValidate = (params: DtoProductParamsWithLang, body: DtoValidateRequest) => Promise; export declare type ProductLoader = { getProduct: GetProduct; postValidate: PostValidate; }; /** * Wraps a getProduct function so that it caches for the time it lives. * * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there * indefinitely. For this reason we recommend using this with caution. * * In our Example App we use it to cache the internal calls in additional products as in such a * product you tend to frequently get calls to same sub-product. Such as loading the same table leg * four times. */ export declare function wrapWithGetProductCache(getProduct: GetProduct): GetProduct; /** * Wraps a postValidate function so that it caches for the time it lives. * * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there * indefinitely. We recommend you do not use this unless you are really, really sure what you are * doing. * * The SDK uses it for additional products to avoid validating for example the same table legs four * times at the same time. There we make sure the this cache only stays in scope for one user * interaction. No longer than the actions caused by a user clicking an option. */ export declare function wrapWithPostValidateCache(postValidate: PostValidate): PostValidate; /** Does both wrapWithGetProductCache and wrapWithPostValidateCache. */ export declare function wrapWithCache(loader: ProductLoader): ProductLoader; //# sourceMappingURL=productLoader.d.ts.map