refire-react
Version:
React components and helpers for Refire
44 lines (43 loc) • 1.26 kB
TypeScript
/// <reference types="react" />
/// <reference types="react-redux" />
import * as React from "react";
import * as ReactRedux from "react-redux";
export interface Status {
errors: {
resetPassword: string;
};
processing: {
resetPassword: boolean;
};
completed: {
resetPassword: boolean;
};
}
export interface ResetPasswordOptions {
validator?: (email: string) => boolean;
}
export interface ResetPasswordProps {
readonly _status?: Status;
readonly dispatch?: ReactRedux.Dispatch<{}>;
readonly children?: React.ReactNode;
readonly context?: any;
}
export interface ExtraProps {
email?: string;
submit?: (event: React.FormEvent<HTMLElement>) => void;
updateEmail?: (event: React.FormEvent<HTMLInputElement>) => void;
validInput?: boolean;
error?: string;
processing?: boolean;
completed?: boolean;
}
export default function (options?: ResetPasswordOptions): <P>(WrappedComponent: React.ComponentType<P>) => React.ComponentClass<Pick<ResetPasswordProps & P, ({
[P in keyof (ResetPasswordProps & P)]: P;
} & {
children: never;
_status: never;
dispatch: never;
context: never;
} & {
[x: string]: never;
})[keyof (ResetPasswordProps & P)]> & P>;