export type KeyCapabilitySection = | 'authentication' | 'assertionMethod' | 'keyAgreement' | 'capabilityInvocation' | 'capabilityDelegation'; export type ServiceEndpoint = string | Record; export interface Service { id: string; type: string; serviceEndpoint: ServiceEndpoint | ServiceEndpoint[]; [x: string]: any; } export interface ConditionWeightedThreshold { condition: VerificationMethod; weight: number; } export type Extensible = Record; export interface JsonWebKey extends Extensible { alg?: string; crv?: string; e?: string; ext?: boolean; key_ops?: string[]; kid?: string; kty: string; n?: string; use?: string; x?: string; y?: string; } export interface VerificationMethod { id: string; type: string; controller: string; publicKeyBase58?: string; publicKeyBase64?: string; publicKeyJwk?: JsonWebKey; publicKeyHex?: string; publicKeyMultibase?: string; blockchainAccountId?: string; ethereumAddress?: string; // ConditionalProof2022 subtypes conditionOr?: VerificationMethod[]; conditionAnd?: VerificationMethod[]; threshold?: number; conditionThreshold?: VerificationMethod[]; conditionWeightedThreshold?: ConditionWeightedThreshold[]; conditionDelegated?: string; relationshipParent?: string[]; relationshipChild?: string[]; relationshipSibling?: string[]; } export type DIDDocument = { '@context'?: 'https://www.w3.org/ns/did/v1' | string | string[]; id?: string; alsoKnownAs?: string[]; controller?: string | string[]; verificationMethod?: VerificationMethod[]; service?: Service[]; /** * @deprecated */ publicKey?: VerificationMethod[]; } & { [x in KeyCapabilitySection]?: (string | VerificationMethod)[]; };