@better-auth-ui/core
Version:
Authentication components and data utilities for [Better Auth](https://better-auth.com), available for React and Solid.
70 lines (69 loc) • 2.32 kB
TypeScript
import { MutationOptions } from '@tanstack/query-core';
import { BetterFetchError } from 'better-auth/client';
import { AuthClient } from '../lib/auth-client';
export type ChangePasswordParams<TAuthClient extends AuthClient> = Parameters<TAuthClient["changePassword"]>[0];
export type ChangePasswordOptions<TAuthClient extends AuthClient> = Omit<ReturnType<typeof changePasswordOptions<TAuthClient>>, "mutationKey" | "mutationFn">;
/**
* Mutation options factory for changing the authenticated user's password.
*
* @param authClient - The Better Auth client.
*/
export declare function changePasswordOptions<TAuthClient extends AuthClient>(authClient: TAuthClient): MutationOptions<Awaited<ReturnType<(params: ChangePasswordParams<TAuthClient>) => Promise<Omit<{
token: string | null;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
} & Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
}, "user"> & {
user: import('better-auth').StripEmptyObjects<{
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
}>;
}>>>, BetterFetchError, Parameters<(params: ChangePasswordParams<TAuthClient>) => Promise<Omit<{
token: string | null;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
} & Record<string, any> & {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
}, "user"> & {
user: import('better-auth').StripEmptyObjects<{
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
}>;
}>>[0]>;