import { Account, Session } from "next-auth";
import { AdapterUser } from "next-auth/adapters";
import { JWT } from "next-auth/jwt";
import { CredentialInput } from "next-auth/providers/credentials";

export type Credentials = {
  user: string;
  password: string;
  isAuth?: boolean;
};

export type SessionUser = AdapterUser & {
  id: string;
  tId: string;
  permissions: string;
  isVerify?: true;
};

export type TSignIn = {
  user?: SessionUser;
  credentials?: Record<string, CredentialInput>;
  account?: Account;
  session?: Session & {
    user?: SessionUser;
  };
  token?: JWT;
  trigger?: "signIn" | "signUp" | "update";
};
