anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
55 lines • 1.28 kB
TypeScript
/**
* Context document type
*/
export interface ContextDocument {
'@context': any;
[key: string]: any;
}
/**
* Context loader configuration
*/
export interface ContextLoaderOptions {
maxCacheSize?: number;
cacheTTL?: number;
customLoaders?: Map<string, () => Promise<ContextDocument>>;
allowRemote?: boolean;
}
/**
* JSON-LD Context Loader with caching
*/
export declare class ContextLoader {
private cache;
private customLoaders;
private allowRemote;
constructor(options?: ContextLoaderOptions);
/**
* Load a context document by URL
*/
loadContext(url: string): Promise<ContextDocument>;
/**
* Fetch a context document
*/
private fetchContext;
/**
* Add a custom context
*/
addContext(url: string, document: ContextDocument): void;
/**
* Clear the context cache
*/
clearCache(): void;
/**
* Get cache statistics
*/
getCacheStats(): {
size: number;
hits: number;
misses: number;
};
/**
* Create a document loader function for jsonld library
*/
createDocumentLoader(): (url: string) => Promise<any>;
}
export declare const defaultContextLoader: ContextLoader;
//# sourceMappingURL=context-loader.d.ts.map