UNPKG

@light-auth/core

Version:

light auth core framework agnostic, using arctic

27 lines (26 loc) 1.98 kB
import { type LightAuthConfig, type BaseResponse, type LightAuthSession, type LightAuthUser } from "./models"; export declare function createSigninServerFunction<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (args?: { providerName?: string; callbackUrl?: string; [key: string]: unknown; }) => Promise<BaseResponse>; export declare function createSignoutServerFunction<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (args?: { revokeToken?: boolean; callbackUrl?: string; [key: string]: unknown; }) => Promise<BaseResponse>; export declare function createFetchSessionServerFunction<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (args?: { [key: string]: unknown; }) => Promise<Session | null | undefined>; export declare function createSetSessionServerFunction<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (args?: { session: Session; [key: string]: unknown; }) => Promise<Session | null | undefined>; export declare function createSetUserServerFunction<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (args?: { user: User; [key: string]: unknown; }) => Promise<User | null | undefined>; export declare function createFetchUserServerFunction<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (args?: { providerUserId?: string; [key: string]: unknown; }) => Promise<User | null>;