import { Aci } from '../../Address.js'; import * as uuid from '../../uuid.js'; import { RequestOptions } from '../Chat.js'; declare module '../Chat' { interface UnauthenticatedChatConnection extends UnauthUsernamesService { } } type Uuid = uuid.Uuid; export interface UnauthUsernamesService { /** * Looks up a username hash on the service, like that computed by {@link usernames.hash}. * * Returns the corresponding account's ACI, or `null` if the username doesn't correspond to an * account. * * Throws / completes with failure only if the request can't be completed, potentially including * if the hash is structurally invalid. */ lookUpUsernameHash: (request: { hash: Uint8Array; }, options?: RequestOptions) => Promise; /** * Looks up a username link on the service by UUID. * * Returns a decrypted, validated username, or `null` if the UUID does not correspond to a * username link (perhaps the user rotated their link). * * Throws / completes with failure if the request can't be completed. Specifically throws * {@link InvalidEntropyDataLength} if the entropy is invalid, and * {@link InvalidUsernameLinkEncryptedData} if the data fetched from the service could not be * decrypted or did not contain a valid username. `uuid` should be validated ahead of time. */ lookUpUsernameLink: (request: { uuid: Uuid; entropy: Uint8Array; }, options?: RequestOptions) => Promise<{ username: string; hash: Uint8Array; } | null>; } export {};