Types: AccountSettingsPartProps to BusinessSignUp
The types of @poltura/theme-sdk/customer, AccountSettingsPartProps to BusinessSignUp.
On this page
import { … } from '@poltura/theme-sdk/customer';AccountSettingsPartProps
Props of the settings parts, from PersonalInfoForm to AccountDeletion.
classNamestringClasses added to the part.
AccountNavItem
One entry of the account navigation.
idrequiredstringThe entry's id, stable across languages.
kindrequiredAccountNavKindWhether the page is the account's own, an installed app's, or a store feature's.
hrefrequiredstringWhere the entry goes.
labelrequiredstringThe entry's text in the page language.
descriptionrequiredstringA line about the page in the page language.
AccountNavKind
Which kind of page an account navigation entry opens.
type AccountNavKind = 'core' | 'app' | 'feature'AccountView
The account area's shell: the shopper and the account navigation.
customerrequiredCustomer | nullThe signed-in shopper, or null.
navigationrequiredreadonly AccountNavItem[]The account navigation, in order.
isSignedInrequiredbooleanWhether a shopper is signed in.
isLoadingrequiredbooleanWhether the shopper is still loading.
Address
A postal address from the shopper's address book or an order.
idrequiredstringThe address's id.
givenNamerequiredstringThe recipient's given name.
familyNamerequiredstringThe recipient's family name.
companyNamerequiredstring | nullThe company, or null.
line1requiredstringThe street address.
line2requiredstring | nullThe apartment, suite or floor, or null.
cityrequiredstringThe city.
postalCoderequiredstringThe postal code.
regionrequiredstring | nullThe state, province or county as free text, or null.
countryCoderequiredCountryCodeThe country.
phonerequiredstring | nullThe phone number, or null.
taxIdrequiredstring | nullThe business buyer's tax id, or null.
isDefaultShippingrequiredbooleanWhether orders ship here by default.
isDefaultBillingrequiredbooleanWhether invoices go here by default.
AddressBookState
The signed-in shopper's address book with the actions that change it; the host stores every change.
addressesrequiredreadonly Address[]The saved addresses.
statusrequired'loading' | 'ready' | 'error'Whether the addresses are loading, ready, or failed to load.
isBusyrequiredbooleanWhether a change is being saved.
addrequired(input: AddressInput) => Promise<AddressResult>Saves a new address.
updaterequired(id: string, input: AddressInput) => Promise<AddressResult>Changes a saved address.
removerequired(id: string) => Promise<AddressResult>Deletes a saved address.
setDefaultrequired(id: string, use: AddressUse) => Promise<AddressResult>Makes a saved address the default for shipping or billing.
AddressInput
A postal address as the shopper enters it, before the address book stores it.
givenNamerequiredstringThe recipient's given name.
familyNamerequiredstringThe recipient's family name.
companyNamerequiredstring | nullThe company, or null for a personal address.
line1requiredstringThe street address.
line2requiredstring | nullThe apartment, suite or floor, or null.
cityrequiredstringThe city.
postalCoderequiredstringThe postal code.
regionrequiredstring | nullThe state, province or county as free text, or null.
countryCoderequiredCountryCodeThe country; one the store sells to.
phonerequiredstring | nullThe phone number, or null.
taxIdrequiredstring | nullThe business buyer's tax id, or null.
AddressResult
The outcome of an address book action.
okrequiredtrueThe action worked.
AddressUse
What an address book default is set for.
type AddressUse = 'shipping' | 'billing'AuthField
A field of the sign-in, registration and password forms.
type AuthField = 'email' | 'password' | 'confirmPassword' | 'givenName' | 'familyName' | 'phone'AuthFormState
A sign-in, registration or password form's values, errors and submit; credentials, captcha and sessions stay with the host.
moderequiredAuthModeWhich form it is.
fieldsrequiredreadonly AuthField[]The fields this form asks for, in order.
valuesrequiredReadonly<Record<AuthField, string>>What the shopper typed, per field.
setValuerequired(field: AuthField, value: string) => voidChanges one field and clears its error.
fieldErrorsrequiredReadonly<Partial<Record<AuthField, string>>>Why a field is not valid, in the page language.
termsrequiredAuthTerms | nullThe terms checkbox, or null when the form has none.
businessrequiredBusinessSignUp | nullCompany sign-up on a registration form, or null when the form or the store has none.
errorrequiredstring | nullWhy the last submit failed, in the page language, or null.
statusrequired'idle' | 'submitting' | 'done'Whether the form is being filled, sent, or done; a done form shows its confirmation.
blurrequired(field: AuthField) => Promise<void>Checks a field the shopper left, including the checks that need the network.
failrequired(message: string) => voidShows a message as the form's error, for a way of signing in that runs outside the form.
resetrequired() => voidClears the error and takes a finished form back to editing.
submitrequired() => Promise<void>Validates the fields and sends the form; signing in also moves on to the page the shopper came from.
AuthMode
Which sign-in form is shown.
type AuthMode = 'signIn' | 'magicLink' | 'register' | 'forgotPassword' | 'resetPassword'AuthTerms
The terms checkbox a registration form needs ticked before it sends.
acceptedrequiredbooleanWhether the shopper accepted the terms and the privacy policy.
setAcceptedrequired(accepted: boolean) => voidTicks or clears the checkbox and clears its error.
errorrequiredstring | nullWhy the form did not send for want of it, in the page language, or null.
BusinessSignUp
Signing up as a company on a registration form: the buyer type, company and tax number the host checks, and the tier applications.
requiredrequiredbooleanWhether the store asks every new account for company details, rather than offering them.
enabledrequiredbooleanWhether the shopper signs up as a company.
checkingrequiredbooleanWhether the tax number is being checked; the form does not send until it settles.