{"version":3,"file":"W3cCredentialsModuleConfig.mjs","names":[],"sources":["../../../src/modules/vc/W3cCredentialsModuleConfig.ts"],"sourcesContent":["import type { DocumentLoaderWithContext } from './data-integrity/libraries/documentLoader'\n\nimport { defaultDocumentLoader } from './data-integrity/libraries/documentLoader'\n\n/**\n * W3cCredentialsModuleConfigOptions defines the interface for the options of the W3cCredentialsModuleConfig class.\n * This can contain optional parameters that have default values in the config class itself.\n */\nexport interface W3cCredentialsModuleConfigOptions {\n  /**\n   * Document loader to use for resolving JSON-LD objects. Takes a {@link AgentContext} as parameter,\n   * and must return a {@link DocumentLoader} function.\n   *\n   * @example\n   * ```\n   * const myDocumentLoader = (agentContext: AgentContext) => {\n   *   return async (url) => {\n   *     if (url !== 'https://example.org') throw new Error(\"I don't know how to load this document\")\n   *\n   *     return {\n   *       contextUrl: null,\n   *       documentUrl: url,\n   *       document: null\n   *     }\n   *   }\n   * }\n   * ```\n   *\n   *\n   * @default {@link defaultDocumentLoader}\n   */\n  documentLoader?: DocumentLoaderWithContext\n}\n\nexport class W3cCredentialsModuleConfig {\n  private options: W3cCredentialsModuleConfigOptions\n\n  public constructor(options?: W3cCredentialsModuleConfigOptions) {\n    this.options = options ?? {}\n  }\n\n  /** See {@link W3cCredentialsModuleConfigOptions.documentLoader} */\n  public get documentLoader() {\n    return this.options.documentLoader ?? defaultDocumentLoader\n  }\n}\n"],"mappings":";;;;;AAkCA,IAAa,6BAAb,MAAwC;CAGtC,AAAO,YAAY,SAA6C;AAC9D,OAAK,UAAU,WAAW,EAAE;;;CAI9B,IAAW,iBAAiB;AAC1B,SAAO,KAAK,QAAQ,kBAAkB"}