Types
The types of @poltura/theme-sdk/routing.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/routing';LinkProps
Props of Link.
type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'children'> & {
href: string | LinkValue;
children?: ReactNode;
className?: string;
replace?: boolean;
prefetch?: boolean;
ref?: Ref<HTMLAnchorElement>;
}Router
Navigation actions for code that moves the visitor without a link.
pushrequired(href: string) => voidGoes to `href`, adding a history entry.
replacerequired(href: string) => voidGoes to `href`, replacing the current history entry.
backrequired() => voidGoes back one history entry.
refreshrequired() => voidLoads the current page's data again.
prefetchrequired(href: string) => voidLoads `href` ahead of a likely visit.
PageParams
The params a theme page's route captured, such as slug; a catch-all's rest is under $.
type PageParams = Readonly<Record<string, string>>SitePageRef
A link to one of the merchant's site pages.
titlerequiredstringThe page title, in the page language.
pathrequiredstringThe page's path.
SitePage
One of the merchant's site pages, with its place among the others.
titlerequiredstringThe page title, in the page language.
contentHtmlrequiredstringThe page body as sanitised HTML.
pathrequiredstringThe page's path.
parentrequiredSitePageRef | nullThe page this one sits under, or null at the top level.
childrenrequiredreadonly SitePageRef[]The pages under this one, in the merchant's order.
NotFoundPageTexts
The store's wording on its not-found page, in the page language.
titlerequiredstringThe page heading.
descriptionrequiredstringThe line under the heading.
backToHomerequiredstringThe label of the link back to the home page.
browseProductsrequiredstringThe label of the link to every product.
categoriesTitlerequiredstringThe heading over the suggested categories.
categoriesDescriptionrequiredstringThe line under that heading.
NotFoundPage
What the store's not-found page shows: its wording and the categories it suggests instead.
textsrequiredNotFoundPageTextsThe page's wording.
categoriesrequiredreadonly CategoryRef[]The top-level categories, in the merchant's order.