// // Copyright 2021 DXOS.org // import { type MulticastObservable } from '@dxos/async'; import { type PublicKey } from '@dxos/keys'; import { type Contact, type Device, type Identity, type Invitation } from '@dxos/protocols/proto/dxos/client/services'; import { type DeviceProfileDocument, type Credential, type Presentation, type ProfileDocument, } from '@dxos/protocols/proto/dxos/halo/credentials'; import { type AuthenticatingInvitation, type CancellableInvitation } from './invitations'; /** * TODO(burdon): Public API (move comments here). */ export interface Halo { get identity(): MulticastObservable; get devices(): MulticastObservable; get device(): Device | undefined; get contacts(): MulticastObservable; get invitations(): MulticastObservable; get credentials(): MulticastObservable; createIdentity(options?: ProfileDocument, deviceProfile?: DeviceProfileDocument): Promise; recoverIdentity(args: { recoveryCode: string }): Promise; updateProfile(profile: ProfileDocument): Promise; share(options?: Partial): CancellableInvitation; join(invitation: Invitation, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation; /* * query Credentials currently known to the identity. * Note: Will return an empty or incomplete result if called before credentials have been loaded. * @experimental */ queryCredentials(options?: { ids?: PublicKey[]; type?: string }): Credential[]; writeCredentials(credentials: Credential[]): Promise; presentCredentials(options: { ids: PublicKey[]; nonce?: Uint8Array }): Promise; }