UNPKG

@aws-amplify/ui

Version:

`@aws-amplify/ui` contains low-level logic & styles for stand-alone usage or re-use in framework-specific implementations.

125 lines (124 loc) • 4.51 kB
/** * Contains translatable strings that authenticator provides by default. Customers * can use this to add custom vocabularies: * * ``` * I18n.putVocabulariesForLanguage("en", { * [DefaultTexts.SIGN_IN]: "Custom Sign In Text", * [DefaultTexts.SIGN_IN_BUTTON]: "Custom Click Here to Sign In" * }); * ``` */ export declare const DefaultTexts: { readonly ADD_PROFILE: string; readonly ADD_WEBSITE: string; readonly BACK_SIGN_IN: string; readonly BIRTHDATE: string; readonly CHANGE_PASSWORD: string; readonly CHANGING_PASSWORD: string; readonly CODE: string; readonly CODE_ARRIVAL: string; readonly CODE_EMAILED: string; readonly CODE_SENT: string; readonly CODE_TEXTED: string; readonly CONFIRM_PASSWORD: string; readonly CONFIRM_PASSWORD_PLACEHOLDER: string; readonly CONFIRM_RESET_PASSWORD_HEADING: string; readonly CONFIRM_SIGNUP_HEADING: string; readonly CONFIRM_SMS: string; readonly CONFIRM_EMAIL: string; readonly CONFIRM_MFA_DEFAULT: string; readonly CONFIRM_TOTP: string; readonly CONFIRM: string; readonly CONFIRMATION_CODE: string; readonly CONFIRMING: string; readonly CREATE_ACCOUNT: string; readonly CREATING_ACCOUNT: string; readonly EMAIL_ADDRESS: string; readonly EMAIL_OTP: string; readonly ENTER_BIRTHDATE: string; readonly ENTER_CODE: string; readonly ENTER_CONFIRMATION_CODE: string; readonly ENTER_EMAIL: string; readonly ENTER_FAMILY_NAME: string; readonly ENTER_GIVEN_NAME: string; readonly ENTER_MIDDLE_NAME: string; readonly ENTER_NAME: string; readonly ENTER_NICK_NAME: string; readonly ENTER_PASSWORD: string; readonly ENTER_PHONE_NUMBER: string; readonly ENTER_PREFERRED_USERNAME: string; readonly ENTER_USERNAME: string; readonly FAMILY_NAME: string; readonly GIVEN_NAME: string; readonly FORGOT_PASSWORD: string; readonly FORGOT_YOUR_PASSWORD: string; readonly HIDE_PASSWORD: string; readonly LOADING: string; readonly LOGIN_NAME: string; readonly MIDDLE_NAME: string; readonly MFA_SETUP_SELECTION: string; readonly MFA_SELECTION: string; readonly NAME: string; readonly NICKNAME: string; readonly NEW_PASSWORD: string; readonly OR: string; readonly PASSWORD: string; readonly PHONE_NUMBER: string; readonly PREFERRED_USERNAME: string; readonly PROFILE: string; readonly RESEND_CODE: string; readonly RESET_PASSWORD_HEADING: string; readonly RESET_PASSWORD: string; readonly SEND_CODE: string; readonly SENDING: string; readonly SELECT_MFA_TYPE: string; readonly SETUP_EMAIL: string; readonly SETUP_TOTP: string; readonly SHOW_PASSWORD: string; readonly SIGN_IN_BUTTON: string; readonly SIGN_IN_TAB: string; readonly SIGN_IN_WITH_AMAZON: string; readonly SIGN_IN_WITH_APPLE: string; readonly SIGN_IN_WITH_FACEBOOK: string; readonly SIGN_IN_WITH_GOOGLE: string; readonly SIGN_IN: string; readonly SIGN_UP_BUTTON: string; readonly SIGNING_IN_BUTTON: string; readonly SKIP: string; readonly SMS_MFA: string; readonly SUBMIT: string; readonly SUBMITTING: string; readonly SOFTWARE_TOKEN_MFA: string; readonly UPPERCASE_COPY: string; readonly VERIFY_CONTACT: string; readonly VERIFY_HEADING: string; readonly VERIFY: string; readonly WE_EMAILED: string; readonly WE_SENT_CODE: string; readonly WE_TEXTED: string; readonly WEBSITE: string; }; export type Phrase = (typeof DefaultTexts)[keyof typeof DefaultTexts]; /** * TODO: Translation keys for dictionaries can be inferred from DefaultTexts * by typing it to Partial<Record<Phrase, string>>. * * But this requires error string keys to be standarized as well, and can be a * limiting factor for custom translation keys. Marking it as TODO until we see * a reason to strongly type this. */ export type Dict = Record<string, string>; /** * This helper type checks that given phrase is one of the texts @aws-amplify/ui * provides by default. This enables vscode autocompletion to help catch typos * during development. * * You can also use translate<string> to handle custom strings or dynamic content. */ export declare function translate<T extends string>(phrase: T): string; /** * Whether I18n has a translation entry for given phrase */ export declare function hasTranslation(phrase: string): boolean; export declare const translations: Record<string, Dict>;