@aws-amplify/ui 3.0.4 → 3.0.8

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>;
@@ -236,6 +249,7 @@ declare const DefaultTexts: {
236
249
  readonly FAMILY_NAME: string;
237
250
  readonly GIVEN_NAME: string;
238
251
  readonly FORGOT_YOUR_PASSWORD: string;
252
+ readonly FORGOT_YOUR_PASSWORD_LEGACY: string;
239
253
  readonly HIDE_PASSWORD: string;
240
254
  readonly LOADING: string;
241
255
  readonly LOGIN_NAME: string;
@@ -289,11 +303,35 @@ declare type Dict = Record<string, string>;
289
303
  * You can also use translate<string> to handle custom strings or dynamic content.
290
304
  */
291
305
  declare function translate<T = Phrase>(phrase: NoInfer<T>): string;
306
+ /**
307
+ * Whether I18n has a translation entry for given phrase
308
+ */
309
+ declare function hasTranslation(phrase: string): boolean;
292
310
  declare const translations: Record<string, Dict>;
293
311
 
294
312
  declare const defaultServices: {
295
313
  getAmplifyConfig(): Promise<{}>;
296
314
  getCurrentUser(): Promise<any>;
315
+ handleSignUp(formData: any): Promise<any>;
316
+ handleSignIn({ username, password, }: {
317
+ username: string;
318
+ password: string;
319
+ }): Promise<any>;
320
+ handleConfirmSignIn({ user, code, mfaType, }: {
321
+ user: any;
322
+ code: string;
323
+ mfaType: AuthChallengeNames.SMS_MFA | AuthChallengeNames.SOFTWARE_TOKEN_MFA;
324
+ }): Promise<any>;
325
+ handleConfirmSignUp({ username, code, }: {
326
+ username: string;
327
+ code: string;
328
+ }): Promise<any>;
329
+ handleForgotPasswordSubmit({ username, code, password, }: {
330
+ username: string;
331
+ code: string;
332
+ password: string;
333
+ }): Promise<SignInResult>;
334
+ handleForgotPassword(formData: any): Promise<any>;
297
335
  validateCustomSignUp(formData: any, touchData: any): Promise<ValidatorResult>;
298
336
  validateConfirmPassword<Validator>(formData: any, touchData: any): Promise<ValidatorResult>;
299
337
  validatePreferredUsername(formData: any, touchData: any): Promise<ValidatorResult>;
@@ -670,7 +708,6 @@ interface Breakpoints {
670
708
  xl: number;
671
709
  xxl: number;
672
710
  };
673
- unit: string;
674
711
  defaultBreakpoint: string;
675
712
  }
676
713
 
@@ -792,4 +829,4 @@ declare function createTheme(theme?: Theme, baseTheme?: BaseTheme): WebTheme;
792
829
 
793
830
  declare const defaultTheme: WebTheme;
794
831
 
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 };
832
+ 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, hasTranslation, isDesignToken, signUpFieldsWithDefault, signUpFieldsWithoutDefault, translate, translations };