@aws-amplify/ui 3.0.4 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -9,10 +9,12 @@ declare type ValidationError = Record<string, string>;
9
9
  * Return type of validator. This is `null` if there are no error, and `ValidationError` otherwise.
10
10
  */
11
11
  declare type ValidatorResult = void | null | ValidationError;
12
+ declare type SignInResult = string;
12
13
  /**
13
14
  * Validates the given formData. This can be synchronous or asynchronous.
14
15
  */
15
16
  declare type Validator = (formData: AuthFormData, touchData?: AuthFormData) => ValidatorResult | Promise<ValidatorResult>;
17
+ declare type SignInTypes = (user: string, code: string, mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA) => SignInResult | Promise<SignInResult>;
16
18
 
17
19
  declare type AuthFormData = Record<string, string>;
18
20
  interface AuthContext {
@@ -23,6 +25,17 @@ interface AuthContext {
23
25
  socialProviders?: SocialProvider[];
24
26
  };
25
27
  user?: CognitoUserAmplify;
28
+ username?: string;
29
+ password?: string;
30
+ code?: string;
31
+ mfaType?: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA;
32
+ }
33
+ interface ServicesContext {
34
+ username?: string;
35
+ password?: string;
36
+ user?: string;
37
+ code?: string;
38
+ mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA;
26
39
  }
27
40
  interface BaseFormContext {
28
41
  authAttributes?: Record<string, any>;
@@ -294,6 +307,26 @@ declare const translations: Record<string, Dict>;
294
307
  declare const defaultServices: {
295
308
  getAmplifyConfig(): Promise<{}>;
296
309
  getCurrentUser(): Promise<any>;
310
+ handleSignUp(formData: any): Promise<any>;
311
+ handleSignIn({ username, password, }: {
312
+ username: string;
313
+ password: string;
314
+ }): Promise<any>;
315
+ handleConfirmSignIn({ user, code, mfaType, }: {
316
+ user: any;
317
+ code: string;
318
+ mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA;
319
+ }): Promise<any>;
320
+ handleConfirmSignUp({ username, code, }: {
321
+ username: string;
322
+ code: string;
323
+ }): Promise<any>;
324
+ handleForgotPasswordSubmit({ username, code, password, }: {
325
+ username: string;
326
+ code: string;
327
+ password: string;
328
+ }): Promise<SignInResult>;
329
+ handleForgotPassword(formData: any): Promise<any>;
297
330
  validateCustomSignUp(formData: any, touchData: any): Promise<ValidatorResult>;
298
331
  validateConfirmPassword<Validator>(formData: any, touchData: any): Promise<ValidatorResult>;
299
332
  validatePreferredUsername(formData: any, touchData: any): Promise<ValidatorResult>;
@@ -792,4 +825,4 @@ declare function createTheme(theme?: Theme, baseTheme?: BaseTheme): WebTheme;
792
825
 
793
826
  declare const defaultTheme: WebTheme;
794
827
 
795
- export { ActorContextWithForms, AuthActorContext, AuthActorState, AuthChallengeNames, AuthContext, AuthEvent, AuthEventData, AuthEventTypes, AuthFieldsWithDefaults, AuthFormData, AuthInputAttributes, AuthInterpreter, AuthMachineState, AuthenticatorMachineOptions, BaseTheme, BorderWidthValue, CognitoUserAmplify, ColorModeOverride, ColorValue, ContactMethod, DefaultTexts, DesignToken, Dict, FederatedIdentityProviders, FontSizeValue, FontValue, FontWeightValue, InputAttributes, InvokeActorEventTypes, LineHeightValue, LoginMechanism, LoginMechanismArray, MediaQueryOverride, NoInfer, OpacityValue, OutlineOffsetValue, OutlineWidthValue, Override, Phrase, RadiusValue, ResetPasswordContext, ResetPasswordState, SelectorOverride, ShadowValue, SignInContext, SignInState, SignOutContext, SignOutState, SignUpAttribute, SignUpContext, SignUpFieldsWithDefaults, SignUpFieldsWithoutDefaults, SignUpState, SocialProvider, SpaceValue, Theme, TimeValue, TransformValue, ValidationError, Validator, ValidatorResult, WebDesignToken, WebTheme, authInputAttributes, censorAllButFirstAndLast, censorPhoneNumber, countryDialCodes, createAuthenticatorMachine, createTheme, defaultTheme, getActorContext, getActorState, getAliasInfoFromContext, getConfiguredAliases, getSendEventAliases, getServiceContextFacade, getServiceFacade, isDesignToken, signUpFieldsWithDefault, signUpFieldsWithoutDefault, translate, translations };
828
+ export { ActorContextWithForms, AuthActorContext, AuthActorState, AuthChallengeNames, AuthContext, AuthEvent, AuthEventData, AuthEventTypes, AuthFieldsWithDefaults, AuthFormData, AuthInputAttributes, AuthInterpreter, AuthMachineState, AuthenticatorMachineOptions, BaseTheme, BorderWidthValue, CognitoUserAmplify, ColorModeOverride, ColorValue, ContactMethod, DefaultTexts, DesignToken, Dict, FederatedIdentityProviders, FontSizeValue, FontValue, FontWeightValue, InputAttributes, InvokeActorEventTypes, LineHeightValue, LoginMechanism, LoginMechanismArray, MediaQueryOverride, NoInfer, OpacityValue, OutlineOffsetValue, OutlineWidthValue, Override, Phrase, RadiusValue, ResetPasswordContext, ResetPasswordState, SelectorOverride, ServicesContext, ShadowValue, SignInContext, SignInResult, SignInState, SignInTypes, SignOutContext, SignOutState, SignUpAttribute, SignUpContext, SignUpFieldsWithDefaults, SignUpFieldsWithoutDefaults, SignUpState, SocialProvider, SpaceValue, Theme, TimeValue, TransformValue, ValidationError, Validator, ValidatorResult, WebDesignToken, WebTheme, authInputAttributes, censorAllButFirstAndLast, censorPhoneNumber, countryDialCodes, createAuthenticatorMachine, createTheme, defaultTheme, getActorContext, getActorState, getAliasInfoFromContext, getConfiguredAliases, getSendEventAliases, getServiceContextFacade, getServiceFacade, isDesignToken, signUpFieldsWithDefault, signUpFieldsWithoutDefault, translate, translations };