Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/routing/Types

Types

Ez az oldal még csak angolul érhető el.

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) => void

Goes to `href`, adding a history entry.

replacerequired(href: string) => void

Goes to `href`, replacing the current history entry.

backrequired() => void

Goes back one history entry.

refreshrequired() => void

Loads the current page's data again.

prefetchrequired(href: string) => void

Loads `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.

titlerequiredstring

The page title, in the page language.

pathrequiredstring

The page's path.

SitePage

One of the merchant's site pages, with its place among the others.

titlerequiredstring

The page title, in the page language.

contentHtmlrequiredstring

The page body as sanitised HTML.

pathrequiredstring

The page's path.

parentrequiredSitePageRef | null

The 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.

titlerequiredstring

The page heading.

descriptionrequiredstring

The line under the heading.

backToHomerequiredstring

The label of the link back to the home page.

browseProductsrequiredstring

The label of the link to every product.

categoriesTitlerequiredstring

The heading over the suggested categories.

categoriesDescriptionrequiredstring

The line under that heading.

NotFoundPage

What the store's not-found page shows: its wording and the categories it suggests instead.

textsrequiredNotFoundPageTexts

The page's wording.

categoriesrequiredreadonly CategoryRef[]

The top-level categories, in the merchant's order.

Utoljára frissítve