import type { PetrusCredentials } from '../../../types'; export declare type LoginRequestPayload = PetrusCredentials; export declare type LoginSuccessPayload = void; export declare type LoginFailurePayload = Error; /** * @ignore */ export declare const login: { readonly types: { readonly REQUEST: "@@petrus/LOGIN_REQUEST"; readonly SUCCESS: "@@petrus/LOGIN_SUCCESS"; readonly FAILURE: "@@petrus/LOGIN_FAILURE"; readonly RESET: "@@petrus/LOGIN_RESET"; readonly CANCEL: "@@petrus/LOGIN_CANCEL"; }; readonly request: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"@@petrus/LOGIN_REQUEST">; readonly success: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"@@petrus/LOGIN_SUCCESS">; readonly failure: import("@reduxjs/toolkit").ActionCreatorWithPayload; readonly reset: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"@@petrus/LOGIN_RESET">; readonly cancel: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"@@petrus/LOGIN_CANCEL">; }; /** * The credentials object is passed to the `authenticate` handler you've provided in the `configure` method. * @category Redux Action Creator * @example * ```ts * import { loginRequest } from '@ackee/petrus'; * * function* login() { * yield put(loginRequest({ * email: 'user@test.com', * password: 'password123' * })) * } * * // ... * // in `authenticate` handler: * configure({ * // ... * handlers: { * // ... * authenticate: function* authenticateHandler({ email, password }) { * // Use the credentials to sign-in user * } * } * }) * ``` */ export declare const loginRequest: (payload: LoginRequestPayload) => { payload: undefined; type: "@@petrus/LOGIN_REQUEST"; }; /** * @category Redux Action Type */ export declare const loginReset: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"@@petrus/LOGIN_RESET">; /** * Triggered on successful login. * * @category Redux Action Type * * @example * ```ts * function* handleLogin() { * // dispatch login request to '@ackee/petrus' * yield put(loginRequest({ * email: 'user@test.com', * password: 'supersecret', * })); * * // wait for the request to resolve * const result = yield take([LOGIN_SUCCESS, LOGIN_FAILURE]); * * // and then do something (e.g. display login error, redirect user to auth. content) * } * ``` */ export declare const LOGIN_SUCCESS: "@@petrus/LOGIN_SUCCESS"; /** * * Triggered on failed login. * @category Redux Action Type */ export declare const LOGIN_FAILURE: "@@petrus/LOGIN_FAILURE";