import type { KeyValueStore } from '@tbd54566975/common'; import type { PublicKeyJwk, PrivateKeyJwk } from '@tbd54566975/crypto'; export type DidResolutionResult = { '@context'?: 'https://w3id.org/did-resolution/v1' | string | string[]; didResolutionMetadata: DidResolutionMetadata; didDocument?: DidDocument; didDocumentMetadata: DidDocumentMetadata; }; export type DidResolutionMetadata = { contentType?: string; error?: 'invalidDid' | 'notFound' | 'representationNotSupported' | 'unsupportedDidMethod' | string; }; export type DidDocumentMetadata = { created?: string; updated?: string; deactivated?: boolean; versionId?: string; nextUpdate?: string; nextVersionId?: string; equivalentId?: string; canonicalId?: string; }; export type DidDocument = { '@context'?: 'https://www.w3.org/ns/did/v1' | string | string[]; id: string; alsoKnownAs?: string[]; controller?: string | string[]; verificationMethod?: VerificationMethod[]; service?: ServiceEndpoint[]; authentication?: VerificationMethod[] | string[]; assertionMethod?: VerificationMethod[] | string[]; keyAgreement?: VerificationMethod[] | string[]; capabilityInvocation?: VerificationMethod[] | string[]; capabilityDelegation?: VerificationMethod[] | string[]; }; export type ServiceEndpoint = { id: string; type: string; serviceEndpoint: string | DwnServiceEndpoint; description?: string; }; export type DwnServiceEndpoint = { messageAttestationKeys?: string[]; messageAuthorizationKeys?: string[]; nodes: string[]; recordEncryptionKeys?: string[]; }; export type VerificationMethod = { id: string; type: string; controller: string; publicKeyJwk?: PublicKeyJwk; }; /** * implement this interface to provide your own cache for did resolution results. can be plugged in through Web5 API */ export type DidResolverCache = KeyValueStore; /** * implement this interface to include support for different did methods. can be plugged in through Web5 API */ export interface DidMethodApi extends DidMethodCreator, DidMethodResolver { } /** * implement this interface to include support for resolving different dids. can be plugged in through Web5 API */ export interface DidMethodResolver { get methodName(): string; resolve(did: string): Promise; } /** * implement this interface to include support for creating different dids. can be plugged in through Web5 API */ export interface DidMethodCreator { get methodName(): string; create(options: any): Promise; } export type DidState = { id: string; internalId: string; didDocument?: DidDocument; keys: VerificationMethodWithPrivateKeyJwk[]; methodData: { [prop: string]: any; }; }; export type VerificationMethodWithPrivateKeyJwk = VerificationMethod & { privateKeyJwk: PrivateKeyJwk; }; //# sourceMappingURL=types.d.ts.map