import { SudoUserClient } from './user-client-interface'; import { SudoPlatformSignInCallback } from './sign-in-callback'; export { SudoPlatformSignInCallback }; /** * A reusable helper class that provides sign-in checking functionality for Sudo Platform libraries. * * This class encapsulates the logic for checking if a user is signed in and invoking a callback * to handle sign-in when needed. It is designed to be used by any SudoPlatform Client * to provide consistent sign-in callback behavior across the platform. */ export declare class SignInGuard { private readonly userClient; private callbackRef?; constructor(userClient: SudoUserClient, callback?: SudoPlatformSignInCallback); /** * Sets the callback to be invoked when sign-in is required. * * @param callback A callback implementing {@link SudoPlatformSignInCallback}, * or undefined to disable sign-in checking. */ setCallback(callback?: SudoPlatformSignInCallback): void; /** * Checks if the user is signed in and invokes the callback if needed. * * This method performs the following: * 1. If no callback is set, returns immediately (backward-compatible behaviour). * 2. Checks if the user is signed in using {@link SudoUserClient.isSignedIn}. * 3. If not signed in, invokes the callback's {@link SudoPlatformSignInCallback.signIn} method. * * @throws Any error thrown by the callback's signIn() method, or errors from * checking sign-in status (sign-in status errors are swallowed and treated as * "not signed in"). */ ensureSignedIn(): Promise; }