import { ICachingModuleService, MedusaContainer } from "@medusajs/types"; /** * This function is used to cache the result of a function call. * * @param cb - The callback to execute. * @param options - The options for the cache. * @returns The result of the callback. */ export declare function useCache(cb: (...args: any[]) => Promise, options: { enable?: boolean; key: string | any[]; tags?: string[]; ttl?: number; /** * Whethere the default strategy should auto invalidate the cache whenever it is possible. */ autoInvalidate?: boolean; providers?: string[]; container: MedusaContainer; }): Promise; type TargetMethodArgs = Target[PropertyKey & keyof Target] extends (...args: any[]) => any ? Parameters : never; /** * This function is used to cache the result of a method call. * * @param options - The options for the cache. * @returns The original method with the cache applied. */ export declare function Cached(options: { /** * The key to use for the cache. * If a function is provided, it will be called with the arguments as the first argument and the * container as the second argument. */ key?: string | ((args: TargetMethodArgs, cachingModule: ICachingModuleService) => string | Promise | Promise | any[]); /** * Whether to enable the cache. This is only useful if you want to enable without providing any * other options. */ enable?: boolean | ((args: TargetMethodArgs) => boolean | undefined); /** * The tags to use for the cache. */ tags?: string[] | ((args: TargetMethodArgs) => string[] | undefined); /** * The time-to-live (TTL) value in seconds. */ ttl?: number | ((args: TargetMethodArgs) => number | undefined); /** * Whether to auto invalidate the cache whenever it is possible. */ autoInvalidate?: boolean | ((args: TargetMethodArgs) => boolean | undefined); /** * The providers to use for the cache. */ providers?: string[] | ((args: TargetMethodArgs) => string[] | undefined); container: MedusaContainer | ((this: Target) => MedusaContainer); }): (target: Target, propertyKey: PropertyKey, descriptor: PropertyDescriptor) => PropertyDescriptor; export {}; //# sourceMappingURL=index.d.ts.map