import type { RequireOnly } from '@web5/common'; import type { AgentDataStore } from './store-data.js'; import type { Web5PlatformAgent } from './types/agent.js'; import type { DidMethodCreateOptions } from './did-api.js'; import type { AgentKeyManager } from './types/key-manager.js'; import type { IdentityMetadata, PortableIdentity } from './types/identity.js'; import { BearerIdentity } from './bearer-identity.js'; export interface IdentityApiParams { agent?: Web5PlatformAgent; store?: AgentDataStore; } export interface IdentityCreateParams = keyof DidMethodCreateOptions> { metadata: RequireOnly; didMethod?: TMethod; didOptions?: DidMethodCreateOptions[TMethod]; store?: boolean; } export declare function isPortableIdentity(obj: unknown): obj is PortableIdentity; /** * This API is used to manage and interact with Identities within the Web5 Agent framework. * An Identity is a DID that is associated with metadata that describes the Identity. * Metadata includes A name(label), and whether or not the Identity is connected (delegated to act on the behalf of another DID). * * A KeyManager is used to manage the cryptographic keys associated with the Identities. * * The `DidApi` is used internally to create, store, and manage DIDs. * When a DWN Data Store is used, the Identity and DID information are stored under the Agent DID's tenant. */ export declare class AgentIdentityApi { /** * Holds the instance of a `Web5PlatformAgent` that represents the current execution context for * the `AgentIdentityApi`. This agent is used to interact with other Web5 agent components. It's * vital to ensure this instance is set to correctly contextualize operations within the broader * Web5 Agent framework. */ private _agent?; private _store; constructor({ agent, store }?: IdentityApiParams); /** * Retrieves the `Web5PlatformAgent` execution context. * * @returns The `Web5PlatformAgent` instance that represents the current execution context. * @throws Will throw an error if the `agent` instance property is undefined. */ get agent(): Web5PlatformAgent; set agent(agent: Web5PlatformAgent); get tenant(): string; create({ metadata, didMethod, didOptions, store }: IdentityCreateParams): Promise; export({ didUri }: { didUri: string; }): Promise; get({ didUri }: { didUri: string; }): Promise; import({ portableIdentity }: { portableIdentity: PortableIdentity; }): Promise; list({ tenant }?: { tenant?: string; }): Promise; delete({ didUri }: { didUri: string; }): Promise; /** * Returns the DWN endpoints for the given DID. * * @param didUri - The DID URI to get the DWN endpoints for. * @returns An array of DWN endpoints. * @throws An error if the DID is not found, or no DWN service exists. */ getDwnEndpoints({ didUri }: { didUri: string; }): Promise; /** * Sets the DWN endpoints for the given DID. * * @param didUri - The DID URI to set the DWN endpoints for. * @param endpoints - The array of DWN endpoints to set. * @throws An error if the DID is not found, or if an update cannot be performed. */ setDwnEndpoints({ didUri, endpoints }: { didUri: string; endpoints: string[]; }): Promise; /** * Updates the Identity's metadata name field. * * @param didUri - The DID URI of the Identity to update. * @param name - The new name to set for the Identity. * * @throws An error if the Identity is not found, name is not provided, or no changes are detected. */ setMetadataName({ didUri, name }: { didUri: string; name: string; }): Promise; /** * Returns the connected Identity, if one is available. * * Accepts optional `connectedDid` parameter to filter the a specific connected identity, * if none is provided the first connected identity is returned. */ connectedIdentity({ connectedDid }?: { connectedDid?: string; }): Promise; } //# sourceMappingURL=identity-api.d.ts.map