import { MulticastObservable, type Observable, type Subscriber } from '@dxos/async'; import { Invitation } from '@dxos/protocols/proto/dxos/client/services'; export declare const AUTHENTICATION_CODE_LENGTH = 6; export declare const INVITATION_TIMEOUT: number; export interface Invitations { created: MulticastObservable; accepted: MulticastObservable; share(options?: Partial): CancellableInvitation; join(invitation: Invitation): AuthenticatingInvitation; } /** * Base class for all invitation observables and providers. */ export declare class CancellableInvitation extends MulticastObservable { private readonly _onCancel; constructor({ subscriber, initialInvitation, onCancel, }: { subscriber: Observable | Subscriber; initialInvitation: Invitation; onCancel: () => Promise; }); cancel(): Promise; get expired(): boolean | undefined; get expiry(): Date | undefined; } /** * Cancelable observer that relays authentication requests. */ export declare class AuthenticatingInvitation extends CancellableInvitation { private readonly _onAuthenticate; constructor({ subscriber, initialInvitation, onCancel, onAuthenticate, }: { subscriber: Observable | Subscriber; initialInvitation: Invitation; onCancel: () => Promise; onAuthenticate: (authCode: string) => Promise; }); authenticate(authCode: string): Promise; } /** * Testing util to wrap non-authenticating observable with promise. * Don't use this in production code. * @deprecated */ export declare const wrapObservable: (observable: CancellableInvitation) => Promise; export declare const getExpirationTime: (invitation: Partial) => Date | undefined; //# sourceMappingURL=invitations.d.ts.map