/** * Lazy memoized factories for the default service implementations the * `Verifier` falls back to when the caller doesn't pass overrides. * * Memoization is per-process and only of *construction* — never of * mutable state. * * - `defaultHttpGetService()` returns a memoized * `BuiltinHttpGetService` (stateless adapter; safe to share). * - `defaultCryptoSuites()` and `defaultCryptoServices()` cache the * constructed instances so we don't pay for repeated module setup; * the suites/services themselves carry no cross-call state. * - `defaultDocumentLoaderFor()` always derives a JSON-LD loader * from the given `httpGetService` (so all remote fetches share the * verifier's cache); the per-service loader is memoized via a * `WeakMap` so repeat calls reuse the same `CachedResolver` and * protocol handlers. * - `createDefaultCacheService()` returns a **fresh** * `InMemoryCacheService` on every call so two independent * `createVerifier()` calls do not share cache state. Callers who * want cross-verifier sharing pass an explicit `cacheService`. * * Internal module — not exported from `index.ts`. */ import type { CryptoService } from './types/crypto-service.js'; import type { CryptoSuite } from './types/crypto-suite.js'; import type { DocumentLoader } from './types/context.js'; import type { HttpGetService } from './services/http-get-service/http-get-service.js'; import type { CacheService } from './services/cache-service/cache-service.js'; /** Default {@link HttpGetService}. Memoized per process (stateless adapter). */ export declare function defaultHttpGetService(): HttpGetService; /** * Construct the default {@link CacheService} — a fresh * `InMemoryCacheService` on every call. * * Each `createVerifier()` invocation that doesn't pass an explicit * `cacheService` therefore owns an isolated in-memory cache. To share * cache state across verifiers, construct one `InMemoryCacheService` * (or any `CacheService` adapter) and pass it as * `createVerifier({ cacheService })` to each verifier. */ export declare function createDefaultCacheService(): CacheService; /** * Default crypto suites: Ed25519Signature2020 + EdDSA/RDFC 2022 + * ECDSA/RDFC 2019. * * Ed25519Signature2020 and eddsa-rdfc-2022 are both included because * credentials in the wild use either the older Linked Data Proof or the newer * Data Integrity Proof. ecdsa-rdfc-2019 covers ECDSA (P-256 / P-384) Data * Integrity credentials. */ export declare function defaultCryptoSuites(): CryptoSuite[]; /** Default {@link CryptoService} stack — one Data Integrity adapter using {@link defaultCryptoSuites}. */ export declare function defaultCryptoServices(): CryptoService[]; /** * Build a {@link DocumentLoader} for the given {@link HttpGetService}. * * Always derives the loader via {@link documentLoaderFromHttpGet} so * every remote fetch (JSON-LD contexts, did:web docs, status list * credentials) flows through the verifier's cached HTTP service. * * Per-service loaders are memoized via a module-local `WeakMap` keyed * on the `HttpGetService` instance: the default service is itself * memoized, so its loader persists for the process; caller-provided * services map to one entry each, GC'd when the caller drops the * reference. The standalone `verifyCredential` / `verifyPresentation` * wrappers (which build a fresh verifier per call) reuse the same * loader for the default service via this map — no per-call * `CachedResolver` / did-driver re-allocation. */ export declare function defaultDocumentLoaderFor(httpGetService: HttpGetService): DocumentLoader; //# sourceMappingURL=default-services.d.ts.map