import type { AppProvider, BuiltInProviderType } from 'next-auth/providers/index'; import type { CommonUseAuthReturn, GetSessionOptions, SecondarySignInOptions, SignOutOptions } from '../../types.js'; import type { SessionData } from './useAuthState.js'; /** * Utility type that allows autocompletion for a mix of literal, primitiva and non-primitive values. * @source https://github.com/microsoft/TypeScript/issues/29729#issuecomment-832522611 */ type LiteralUnion = T | (U & Record); export type SupportedProviders = LiteralUnion | undefined; interface SignInResult { error: string | null; status: number; ok: boolean; url: any; /** * Result returned by `navigateToAuthPage`, which needs to be passed back to vue-router by the middleware. * @see https://github.com/sidebase/nuxt-auth/pull/1057 */ navigationResult: boolean | string | void | undefined; } export interface SignInFunc { (provider: SupportedProviders, signInOptions?: SecondarySignInOptions, paramsOptions?: Record, headersOptions?: Record): Promise; } export interface SignOutFunc { (options?: SignOutOptions): Promise; } export interface GetSessionFunc { (getSessionOptions?: GetSessionOptions): Promise; } export interface GetCsrfTokenFunc { (): Promise; } export type GetProvidersResult = Record, Omit | undefined>; export interface GetProvidersFunc { (): Promise; } interface UseAuthReturn extends CommonUseAuthReturn { getCsrfToken: GetCsrfTokenFunc; getProviders: GetProvidersFunc; } export declare function useAuth(): UseAuthReturn; export default useAuth;