@nitor/aws-react-components
Version:
A library with React component for AWS
39 lines (38 loc) • 1.61 kB
TypeScript
/// <reference types="react" />
import * as React from 'react';
import { CognitoUser, CognitoUserAttribute, CognitoUserSession } from 'amazon-cognito-identity-js';
import { LoginForm } from './LoginForm';
import { ResetPasswordForm } from './ResetPasswordForm';
export declare namespace AWSCognitoWrapper {
interface Props extends React.Props<AWSCognitoWrapper> {
awsRegion: string;
awsUserPoolId: string;
awsIdentityPoolId: string;
awsClientId: string;
overrideLoginForm?: LoginForm<LoginForm.Props, any>;
overrideResetPassword?: ResetPasswordForm<ResetPasswordForm.Props, any>;
returnAccessToken?: (token: string) => void;
returnAttributes?: (attributes: CognitoUserAttribute[]) => void;
returnUserSession?: (session: CognitoUserSession) => void;
returnUser?: (session: CognitoUser) => void;
}
interface State {
requiredPasswordChange: boolean;
error?: string;
userAttributes?: CognitoUserAttribute[];
self?: any;
cognitoUser?: CognitoUser;
awsUserAttributes?: CognitoUserAttribute[];
}
}
export declare class AWSCognitoWrapper extends React.Component<AWSCognitoWrapper.Props, AWSCognitoWrapper.State> {
private userPool;
private checkForPropsAndWarn(props);
constructor(props: AWSCognitoWrapper.Props);
setAwsCredentials(token: string): void;
componentDidMount(): void;
getSessionData(): void;
loginHandler(username: string, password: string): void;
submitForcedNewPassword(newPassword: string): void;
render(): JSX.Element;
}