import { AuthActionResponse, AuthProvider, DataProvider, LiveProvider, useTranslate } from "@refinedev/core"; import PocketBase, { CommonOptions, OAuth2AuthConfig, RecordOptions } from "pocketbase"; //#region src/authProvider/forgotPassword.d.ts interface ForgotPasswordArgs { email: string; translate?: TranslateFn; } declare const forgotPassword: (pb: PocketBase, options: RequiredAuthOptions) => ({ email, translate }: ForgotPasswordArgs) => Promise; //#endregion //#region src/hooks/useOtp.d.ts type OtpHandler = ReturnType; declare const useOtp: () => { isPending: boolean; request: () => Promise; reject: () => void; resolve: (otp: string) => void; }; //#endregion //#region src/authProvider/login.d.ts interface LoginWithProvider extends OAuth2AuthConfig { providerName?: string; translate?: TranslateFn; } interface LoginWithEmail { email: string; password?: string; otpHandler?: OtpHandler; otpOptions?: CommonOptions; options?: RecordOptions; translate?: TranslateFn; } type LoginArgs = LoginWithProvider | LoginWithEmail; declare const login: (pb: PocketBase, options: RequiredAuthOptions) => ({ translate, ...loginArgs }: LoginArgs) => Promise; //#endregion //#region src/authProvider/register.d.ts interface RegisterArgs { email: string; password: string; username?: string; name?: string; requestVerification?: boolean; translate?: TranslateFn; } declare const register: (pb: PocketBase, options: RequiredAuthOptions) => ({ email, password, username, name, translate }: RegisterArgs) => Promise; //#endregion //#region src/authProvider/updatePassword.d.ts interface UpdatePasswordArgs { token: string; password: string; translate?: TranslateFn; } declare const updatePassword: (pb: PocketBase, options: RequiredAuthOptions) => ({ token, password, translate }: UpdatePasswordArgs) => Promise; //#endregion //#region src/authProvider/index.d.ts interface AuthOptions { collection?: string; requestVerification?: boolean; registerRedirectTo?: string; registerErrorRedirectTo?: string; forgotPasswordRedirectTo?: string; forgotPasswordErrorRedirectTo?: string; updatePasswordRedirectTo?: string; updatePasswordErrorRedirectTo?: string; loginRedirectTo?: string; loginErrorRedirectTo?: string; logoutRedirectTo?: string; authenticatedRedirectTo?: string; unauthenticatedRedirectTo?: string; identityAvatarThumb?: string; debug?: (...args: unknown[]) => void; } type RequiredAuthOptions = AuthOptions & Pick, "collection" | "requestVerification">; type TranslateFn = ReturnType; declare const authProvider: (pb: PocketBase, authOptions?: AuthOptions) => AuthProvider; //#endregion //#region src/dataProvider.d.ts declare const dataProvider: (pb: PocketBase) => Omit, "createMany" | "updateMany" | "deleteMany" | "getMany">; //#endregion //#region src/liveProvider.d.ts declare const liveProvider: (pb: PocketBase) => LiveProvider; //#endregion export { AuthOptions, ForgotPasswordArgs, LoginArgs, LoginWithEmail, LoginWithProvider, OtpHandler, RegisterArgs, RequiredAuthOptions, TranslateFn, UpdatePasswordArgs, authProvider, dataProvider, forgotPassword, liveProvider, login, register, updatePassword, useOtp };