import { AuthError, Result } from "./utils.js";

//#region src/auth/methods/signInMethod.d.ts
type SignInMethod = "password" | "emailCode" | "google" | "sso";
/**
 * How a visitor with this email signs in, for a login page that asks for the
 * email first and routes from there.
 *
 * `account` is `none` when the email has no account, and `deactivated` for a
 * deactivated one. For an `active` account, `methods` lists what the app
 * offers and also works for that account, in the order to prefer them.
 * `passwordSet` is false when the account has no password yet: `password` is
 * then listed after the methods that work right away, and the visitor sets
 * one through the password reset first. `methods` can be empty when nothing
 * the app offers works for the account.
 *
 * It tells anyone who asks whether an email has an account.
 */
declare function signInMethod(details: {
  email: string;
}): Promise<Result<{
  account: "none" | "deactivated" | "active";
  methods: SignInMethod[];
  passwordSet: boolean;
}, AuthError>>;
//#endregion
export { signInMethod };