UNPKG

@light-auth/sveltekit

Version:

light auth framework for sveltekit, using arctic

15 lines (14 loc) 1.51 kB
import { type LightAuthConfig, type LightAuthSession, type LightAuthUser } from "@light-auth/core/client"; export declare function createSignin<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (providerName?: string, callbackUrl?: string) => Promise<any>; export declare function createSignout<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): (revokeToken?: boolean, callbackUrl?: string) => Promise<any>; type LightAuthConfigClient = Pick<LightAuthConfig<LightAuthSession, LightAuthUser<LightAuthSession>>, "basePath" | "env">; export declare function CreateLightAuthClient<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config?: LightAuthConfigClient | undefined): { basePath: string; getAuthSession: () => Promise<LightAuthSession | null | undefined>; setAuthSession: (session: LightAuthSession) => Promise<LightAuthSession | null | undefined>; getUser: (providerUserId?: string) => Promise<LightAuthUser<LightAuthSession> | null>; setUser: (user: LightAuthUser<LightAuthSession>) => Promise<LightAuthUser<LightAuthSession> | null | undefined>; signIn: (providerName?: string, callbackUrl?: string) => Promise<any>; signOut: (revokeToken?: boolean, callbackUrl?: string) => Promise<any>; }; export {};