UNPKG

@happykit/auth-email

Version:

- A `useAuth` hook which returns the current user - An optional `getServerSideAuth` for server-side rendering - HappyAuth is tiny - it adds only 4.6 kB to the first load JS - it adds less than 0.04 kB if you're transitioning from another page - Extremely

29 lines (28 loc) 1.09 kB
import * as React from "react"; import { StateMachine, EventObject } from "@xstate/fsm"; export declare const InputGroup: React.FunctionComponent<{ id: Exclude<React.InputHTMLAttributes<HTMLInputElement>["id"], undefined>; label: string; error?: string | null; touched?: boolean; } & React.InputHTMLAttributes<HTMLInputElement>>; export declare function hasValidationErrors(values: object): boolean; export declare function inputAssigner<V, P, TC extends { values: V; }, TE extends EventObject & { payload?: P; }>(validate: (values: TC["values"]) => object): StateMachine.Assigner<TC, TE>; export declare function touchedAssigner<T, V, P, TC extends { touched: T; values: V; }, TE extends EventObject & { payload?: P; }>(validate: (values: TC["values"]) => object): StateMachine.Assigner<TC, TE>; export declare function submitAssigner<T extends { [key: string]: boolean; }, V, P, TC extends { touched: T; values: V; }, TE extends EventObject & { payload?: P; }>(validate: (values: TC["values"]) => object): StateMachine.Assigner<TC, TE>;