UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

1 lines • 1.59 kB
{"version":3,"file":"CacheModuleConfig.mjs","names":[],"sources":["../../../src/modules/cache/CacheModuleConfig.ts"],"sourcesContent":["import type { Cache } from './Cache'\n\n/**\n * CacheModuleConfigOptions defines the interface for the options of the CacheModuleConfig class.\n */\nexport interface CacheModuleConfigOptions {\n /**\n *\n * Implementation of the {@link Cache} interface.\n *\n */\n cache: Cache\n\n /**\n *\n * @default 60\n *\n */\n defaultExpiryInSeconds?: number\n\n /**\n *\n * Uses a caching registry before talking to the storage service when a Record has the `useCache` set to `true`\n *\n * @default false\n *\n */\n useCachedStorageService?: boolean\n}\n\nexport class CacheModuleConfig {\n private options: CacheModuleConfigOptions\n\n public constructor(options: CacheModuleConfigOptions) {\n this.options = options\n }\n\n /** See {@link CacheModuleConfigOptions.cache} */\n public get cache() {\n return this.options.cache\n }\n\n /** See {@link CacheModuleConfigOptions.defaultExpiryInSeconds} */\n public get defaultExpiryInSeconds() {\n return this.options.defaultExpiryInSeconds ?? 60\n }\n\n /** See {@link CacheModuleConfigOptions.useCachedStorageService} */\n public get useCachedStorageService() {\n return this.options.useCachedStorageService ?? false\n }\n}\n"],"mappings":";AA8BA,IAAa,oBAAb,MAA+B;CAG7B,YAAmB,SAAmC;EACpD,KAAK,UAAU;CACjB;;CAGA,IAAW,QAAQ;EACjB,OAAO,KAAK,QAAQ;CACtB;;CAGA,IAAW,yBAAyB;EAClC,OAAO,KAAK,QAAQ,0BAA0B;CAChD;;CAGA,IAAW,0BAA0B;EACnC,OAAO,KAAK,QAAQ,2BAA2B;CACjD;AACF"}