Skip to content
Twilight React Playground
ثيم رائدaren

Every export

Each import path of @salla.sa/twilight-theme-engine and what it exports, read from the engine's package.json and built type declarations. Nothing on this page is written by hand.

engine v1.0.52import paths 90exports 736

@salla.sa/twilight-theme-engine

29
ExportKindSignature and summary
Componentcomponent({ name, fallback, ...props }: ComponentProps): React.ReactNode
TwilightProvidercomponent({ children, debug, skeleton, translations: themeTranslations, onReady, onError, client, toast, toastMobilePosition, addToCartToast, routeClass, layout: LayoutComponent, }: TwilightProviderProps): React.ReactElement
useComponenthook<P = Record<string, unknown>>(name: string): ComponentType<P> | null
useIsBloghook(): boolean
Check if current page is blog related
useIsBrandshook(): boolean
Check if current page is brands related
useIsCarthook(): boolean
Check if current page is cart
useIsCustomerhook(): boolean
Check if current page is in customer area
useIsHomehook(): boolean
Check if current page is homepage
useIsProducthook(): boolean
Check if current page is product detail
useIsSearchhook(): boolean
Check if current page is search
useOriginalComponenthook<P = Record<string, unknown>>(name: string): ComponentType<P> | null
useRouteIdhook(): string
Get the current route ID. Used for route detection (isHome, isProduct, etc.)
useTwilighthook(): TwilightContextValue
defineComponentfunction<P = Record<string, unknown>>(config: DefineComponentConfig<P>): ComponentType<P>
overrideComponentsfunction(components: Record<string, ComponentType>): void
registerComponentsfunction(components: Record<string, ComponentType>): void
ComponentRegistryclassComponentRegistry
SettingsErrorclassSettingsError
registryobjectComponentRegistry
RouteIdobject{ readonly INDEX: 'index'; readonly CART: 'cart'; readonly SEARCH: 'product.index.search'; readonly PRODUCT_INDEX: 'product.index'; readonly PRODUCT_INDEX_LATEST: 'product.index.latest'; readonly PRODUCT_INDEX_SALES: 'product.index.sales'; readonly PRODUCT_INDEX_OFFERS: 'product…
Route ID constants for identifying routes throughout the application. Used for route matching, analytics, and conditional rendering based on route.
HookNameenumHookName
Predefined hook names for type-safe hook registration.
ComponentPropsinterfaceComponentProps
HookDefinitioninterfaceHookDefinition
Hook definition with handler and priority.
TwilightConfiginterfaceTwilightConfig
TwilightContextValueinterfaceTwilightContextValue
TwilightProviderPropsinterfaceTwilightProviderProps
HookHandlertypeHookHandler<T>
Hook handler function type.
HookHandlerstypeHookHandlers
Hook handlers map for bulk registration.
RouteIdTypetypeRouteIdType

@salla.sa/twilight-theme-engine/i18n

13
ExportKindSignature and summary
I18nProvidercomponent({ i18nInstance, themeTranslations, children, }: I18nProviderProps): React.ReactElement
useTranslationhook(ns?: string | string[]): { t: TFunction<string | string[], undefined>; i18n: i18n; ready: boolean; locale: string; direction: 'ltr' | 'rtl'; isRTL: boolean; isLTR: boolean; languageName: string; }
getLanguageInfofunction(locale: string): { readonly code: string; readonly name: string; readonly dir: 'rtl' | 'ltr'; }
isLocalefunction(value?: string): value is Locale
FALLBACK_DIRconstant'rtl'
FALLBACK_LANGUAGE_NAMEconstant'العربية'
FALLBACK_LOCALEconstant'ar'
Pure locale constants and helpers — no virtual modules, safe to import from Vite config context (e.g. vite plugins, head adapters).
RTL_LOCALESconstantstring[]
SUPPORTED_LOCALESconstantreadonly ['ar', 'bg', 'bn', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fa', 'fi', 'fr', 'ga', 'he', 'hi', 'hr', 'hu', 'hy', 'ind', 'it', 'ja', 'ko', 'lv', 'ms', 'mt', 'nl', 'pl', 'pt', 'ro', 'ru', 'sl', 'sq', 'sv', 'tl', 'tr', 'uk', 'ur', 'zh']
I18nContextValueinterfaceI18nContextValue
I18nProviderPropsinterfaceI18nProviderProps
Localetype'ar' | 'bg' | 'bn' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'es' | 'et' | 'fa' | 'fi' | 'fr' | 'ga' | 'he' | 'hi' | 'hr' | 'hu' | 'hy' | 'ind' | 'it' | 'ja' | 'ko' | 'lv' | 'ms' | 'mt' | 'nl' | 'pl' | 'pt' | 'ro' | 'ru' | 'sl' | 'sq' | 'sv' | 'tl' | 'tr' | 'uk' | 'ur' | 'zh'
TranslationMessagestypeTranslationMessages

@salla.sa/twilight-theme-engine/hooks

60
ExportKindSignature and summary
HookSlotcomponent({ name, context, fallback, ssr, }: HookSlotProps): React.JSX.Element | null
useAssethook(): UseAssetResult
useAsset - Hook for generating asset and CDN URLs
useAsyncFnhook<T extends FunctionReturningPromise>(fn: T, deps?: DependencyList, initialState?: StateFromFunctionReturningPromise<T>): AsyncFnReturn<T>
useAsyncFn - Hook for managing async operations with loading/error states
useBlogLikehook(blogId: number, initialCount?: number): UseBlogLikeResult
useBreadcrumbshook(page?: Page | null): Breadcrumb[]
useCommentshook(): UseCommentsResult
useComments - Hook for managing salla-comments web component re-renders
useCouponhook(): UseCouponResult
useCoupon - Hook for managing cart coupons
useDatehook(): UseDateResult
useDate - Hook for formatting dates
useDocumentClasshook(descriptor: DocumentElementDescriptor): void
useDocumentClass - Hook for managing HTML and body element attributes
useGtmhook(): UseGtmResult
useGtm - Google Tag Manager hook for tracking events
useHookhook<T = Record<string, unknown>>(name: string, handler: HookHandler<T>, priority?: number): void
useHook - Registers a hook handler in the hook registry
useIsClienthook(): boolean
Returns true only after the component mounts on the client. Useful for avoiding hydration mismatches with browser-only APIs or web components that inject DOM content before React hydrates.
useMoneyhook(): UseMoneyResult
useMoney - Hook for formatting monetary values
useNumberhook(): UseNumberResult
useNumber - Hook for number formatting
useOpeningHourshook(settings?: OpeningHoursSettings): UseOpeningHoursResult
useOpeningHours - Hook for checking store opening status and next open time.
usePageConfighook(pageData: PageConfigData): void
usePageConfig - Centralized hook for setting salla.config.page
useProducthook(initialProduct: Product, options?: UseProductOptions): UseProductResult
useProduct - Hook for managing product state with live updates
useStorehook(): UseStoreResult
useStore - Hook for accessing and managing store state
useThemehook(): UseThemeResult
useTheme - Hook for accessing theme configuration
useUserhook(): UseUserReturn
useWishlisthook(): UseWishlistResult
defineHooksfunction(hooks: HookHandlers): void
registerDefaultHooksfunction(): void
Register all default hooks from theme-engine. Called automatically on module import.
HookRegistryclassHookRegistry
HookRegistry - Manages hook handlers for the extension system
hookRegistryobjectHookRegistry
HookNameenumHookName
Predefined hook names for type-safe hook registration.
ApplyActionsinterfaceApplyActions<T>
Simple apply/remove actions (e.g., coupon)
AsyncStateinterfaceAsyncState
Base async state for operations with loading and error states
AsyncStateWithValueinterfaceAsyncStateWithValue<T>
Async state with a value
FetchStateinterfaceFetchState<T>
State for data fetching hooks
FetchStateWithRefreshinterfaceFetchStateWithRefresh<T>
State for data fetching with refresh capability
HookContextinterfaceHookContext
Hook context with full twilight context merged in. Use this type for hook handlers to get proper DX.
HookDefinitioninterfaceHookDefinition
Hook definition with handler and priority.
HookSlotPropsinterfaceHookSlotProps
PageConfigDatainterfacePageConfigData
Page config data structure for salla.config.set('page', ...)
ToggleActionsinterfaceToggleActions
Toggle actions without parameters (e.g., blog like)
ToggleActionsWithIteminterfaceToggleActionsWithItem<T>
Toggle actions with item parameter (e.g., wishlist item)
UseApplyinterfaceUseApply<T>
Hook return for apply/remove operations (coupon)
UseAssetResultinterfaceUseAssetResult
UseAssetResult - Return type for useAsset hook
UseCommentsResultinterfaceUseCommentsResult
UseCommentsResult - Return type for useComments hook
UseDateResultinterfaceUseDateResult
UseGtmResultinterfaceUseGtmResult
UseMoneyResultinterfaceUseMoneyResult
UseMoneyResult - Return type for useMoney hook
UseNumberResultinterfaceUseNumberResult
UseNumberResult - Return type for useNumber hook
UseOpeningHoursResultinterfaceUseOpeningHoursResult
UseProductOptionsinterfaceUseProductOptions
UseProductResultinterfaceUseProductResult
UseProductResult - Return type for useProduct hook
UseStoreResultinterfaceUseStoreResult
UseStoreResult - Return type for useStore hook
UseThemeResultinterfaceUseThemeResult
UseThemeResult - Return type for useTheme hook
UseToggleinterfaceUseToggle
Hook return for simple toggle operations (blog like)
UseToggleWithItemsinterfaceUseToggleWithItems<T>
Hook return for toggle operations with item (wishlist, etc.)
AsyncActiontypeAsyncAction
Standard async action that returns success boolean
AsyncActionWithParamtypeAsyncActionWithParam<T>
Standard async action with parameter
AsyncFnReturntypeAsyncFnReturn<T>
AsyncFnReturn - Return type for useAsyncFn hook
AsyncFnStatetypeAsyncState<T>
AsyncState - State type for async operations
HookHandlertypeHookHandler<T>
Hook handler function type.
HookHandlerstypeHookHandlers
Hook handlers map for bulk registration.
UseBlogLikeResulttypeUseToggle
UseBlogLikeResult - Return type for useBlogLike hook
UseCouponResulttypeUseCouponResult
UseCouponResult - Return type for useCoupon hook
UseWishlistResulttypeUseWishlistResult

@salla.sa/twilight-theme-engine/hooks/useAsyncFn

3
ExportKindSignature and summary
useAsyncFnhook<T extends FunctionReturningPromise>(fn: T, deps?: DependencyList, initialState?: StateFromFunctionReturningPromise<T>): AsyncFnReturn<T>
useAsyncFn - Hook for managing async operations with loading/error states
AsyncFnReturntypeAsyncFnReturn<T>
AsyncFnReturn - Return type for useAsyncFn hook
AsyncStatetypeAsyncState<T>
AsyncState - State type for async operations

@salla.sa/twilight-theme-engine/hooks/useUser

2
ExportKindSignature and summary
useUserhook(): UseUserReturn
UseUserReturntypeUseUserReturn

@salla.sa/twilight-theme-engine/hooks/useStore

2
ExportKindSignature and summary
useStorehook(): UseStoreResult
useStore - Hook for accessing and managing store state
UseStoreResultinterfaceUseStoreResult
UseStoreResult - Return type for useStore hook

@salla.sa/twilight-theme-engine/hooks/useTheme

2
ExportKindSignature and summary
useThemehook(): UseThemeResult
useTheme - Hook for accessing theme configuration
UseThemeResultinterfaceUseThemeResult
UseThemeResult - Return type for useTheme hook

@salla.sa/twilight-theme-engine/hooks/useMoney

2
ExportKindSignature and summary
useMoneyhook(): UseMoneyResult
useMoney - Hook for formatting monetary values
UseMoneyResultinterfaceUseMoneyResult
UseMoneyResult - Return type for useMoney hook

@salla.sa/twilight-theme-engine/hooks/useAsset

2
ExportKindSignature and summary
useAssethook(): UseAssetResult
useAsset - Hook for generating asset and CDN URLs
UseAssetResultinterfaceUseAssetResult
UseAssetResult - Return type for useAsset hook

@salla.sa/twilight-theme-engine/hooks/useProduct

3
ExportKindSignature and summary
useProducthook(initialProduct: Product, options?: UseProductOptions): UseProductResult
useProduct - Hook for managing product state with live updates
UseProductOptionsinterfaceUseProductOptions
UseProductResultinterfaceUseProductResult
UseProductResult - Return type for useProduct hook

@salla.sa/twilight-theme-engine/hooks/useDocumentClass

1
ExportKindSignature and summary
useDocumentClasshook(descriptor: DocumentElementDescriptor): void
useDocumentClass - Hook for managing HTML and body element attributes

@salla.sa/twilight-theme-engine/hooks/useCoupon

2
ExportKindSignature and summary
useCouponhook(): UseCouponResult
useCoupon - Hook for managing cart coupons
UseCouponResulttypeUseCouponResult
UseCouponResult - Return type for useCoupon hook

@salla.sa/twilight-theme-engine/hooks/useWishlist

3
ExportKindSignature and summary
useWishlisthook(): UseWishlistResult
resetWishlistStorefunction(): void
UseWishlistResulttypeUseWishlistResult

@salla.sa/twilight-theme-engine/hooks/useBlogLike

2
ExportKindSignature and summary
useBlogLikehook(blogId: number, initialCount?: number): UseBlogLikeResult
UseBlogLikeResulttypeUseToggle
UseBlogLikeResult - Return type for useBlogLike hook

@salla.sa/twilight-theme-engine/hooks/useComments

2
ExportKindSignature and summary
useCommentshook(): UseCommentsResult
useComments - Hook for managing salla-comments web component re-renders
UseCommentsResultinterfaceUseCommentsResult
UseCommentsResult - Return type for useComments hook

@salla.sa/twilight-theme-engine/hooks/HookRegistry

3
ExportKindSignature and summary
defineHooksfunction(hooks: HookHandlers): void
HookRegistryclassHookRegistry
HookRegistry - Manages hook handlers for the extension system
hookRegistryobjectHookRegistry

@salla.sa/twilight-theme-engine/hooks/HookSlot

3
ExportKindSignature and summary
HookSlotcomponent({ name, context, fallback, ssr, }: HookSlotProps): React.JSX.Element | null
HookContextinterfaceHookContext
Hook context with full twilight context merged in. Use this type for hook handlers to get proper DX.
HookSlotPropsinterfaceHookSlotProps

@salla.sa/twilight-theme-engine/hooks/useHook

1
ExportKindSignature and summary
useHookhook<T = Record<string, unknown>>(name: string, handler: HookHandler<T>, priority?: number): void
useHook - Registers a hook handler in the hook registry

@salla.sa/twilight-theme-engine/hooks/useGtm

2
ExportKindSignature and summary
useGtmhook(): UseGtmResult
useGtm - Google Tag Manager hook for tracking events
UseGtmResultinterfaceUseGtmResult

@salla.sa/twilight-theme-engine/contexts

10
ExportKindSignature and summary
CartContextcomponent(props: React.ProviderProps<CartContextValue | null>): React.ReactNode
CartContextProvidercomponent({ children, value, }: CartContextProviderProps): React.ReactElement
ProductContextcomponent(props: React.ProviderProps<ProductContextValue | null>): React.ReactNode
ProductContextProvidercomponent({ children, value, }: ProductContextProviderProps): React.ReactElement
useCartContexthook(): CartContextValue | null
useProductContexthook(): ProductContextValue | null
CartContextProviderPropsinterfaceCartContextProviderProps
CartContextValueinterfaceCartContextValue
CartContext - Provides cart data to hooks with `cart:*` prefix
ProductContextProviderPropsinterfaceProductContextProviderProps
ProductContextValueinterfaceProductContextValue
ProductContext - Provides product data to hooks with `product:*` prefix

@salla.sa/twilight-theme-engine/utils

41
ExportKindSignature and summary
applyAppScopeMocksfunction(appScopeId: string, mocks: AppConfigBag): boolean
Overlay preview mocks onto one app's bucket (over its pristine values). Delegates to the bootstrap's `__appScopeMock`, so it works for both install paths. False if unknown/uninstalled.
assetfunction(path: string): string
Generate asset URL for local files
buildBaseHeadfunction(settings: StoreContext | null | undefined, locale?: string, path?: string): HeadDescriptor
Builds a base {@link HeadDescriptor} with store-wide OG and Twitter defaults. Used in __root.tsx to set base metadata that can be overridden by child routes.
buildHreflangAlternatesfunction(settings: StoreContext | null | undefined, path?: string): HeadDescriptor['alternateLanguages']
Builds hreflang alternate links for multilingual SEO.
cdnfunction(url: string | null | undefined, width?: number, height?: number): string
Generate a CDN URL with optional image optimization
clearAuthTokenCookiefunction(): void
Deletes the auth `token` cookie. This cookie is written client-side by the theme (TwilightProvider), not by the SDK — `salla.cookie.clearAll()` only clears its own allowlist and leaves `token` behind — so logout must clear it here. Client-…
colorfunction(primary: string): { primary: string; text: string; isDark: boolean; darken: (amount: number) => string; lighten: (amount: number) => string; invert: () => string; rgb: () => { r: number; g: number; b: number; }; }
Create a color helper object for manipulation
dispatchRouteChangedfunction(): void
Dispatch the `route::changed` Salla SDK event with the current page config.
extractTokenFromCookiesfunction(cookieHeader: string | null, cookieName: string): string | null
formatSallaPluralfunction(template: unknown, count: number): string
Resolve a Salla / Laravel-style pluralized translation for a given count.
getMobileOSfunction(): MobileOS
Detects the current mobile OS from the User-Agent. Returns `'other'` on the server (no `navigator`) and on desktop/unknown agents.
getSallaSDKfunction(): typeof window.salla | undefined
Get Salla SDK instance if available
getStoreIdentifierfunction(explicit?: string): string
Which store to ask the API about — see {@link resolveStoreIdentifier }.
isPlaceholderfunction(url: string | null | undefined): boolean
Check if a URL is the placeholder image
localeToOgLocalefunction(locale: string): string
Converts an ISO-639-1 locale string to the og:locale format (e.g. `ar` → `ar_AR`).
mergeDocumentDescriptorsfunction(...descriptors: DocumentElementDescriptor[]): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Merge multiple `DocumentElementDescriptor`s into React-ready props.
mergeElementAttrsfunction(descriptors: DocumentElementAttrs[]): Record<string, string>
Merge an ordered array of `DocumentElementAttrs` into a flat `Record<string, string>`.
mergeHeadfunction(base: HeadDescriptor, extension: Partial<HeadDescriptor>): HeadDescriptor
normalizeClassesfunction(input: string | string[] | undefined): string[]
registerThemeHookSlotsfunction(...names: string[]): void
Declare hook slots the theme renders itself so apps may mount into them.
resolveAppStoreUrlfunction(apps?: StoreApps, os?: MobileOS): string | undefined
Picks the mobile-app store URL for the given OS: - `ios` → App Store, falling back to Google Play - `android` → Google Play, falling back to App Store - `other` → App Store, falling back to Google Play
resolveHeadfunction(descriptor: HeadDescriptor): HeadResult
setHeadAdapterfunction(adapter: HeadAdapter): void
sortOptionsfunction(currentSort: string, t: TranslateFn): { id: string; name: string; is_selected: boolean; }[]
stripUnsafeHtmlfunction(html: string): string
syncAttrsToElementfunction(element: Element, next: Record<string, string>): void
Apply a merged attrs record to a real DOM element, tracking managed attribute names so a subsequent call cleanly removes stale values without touching attributes set by other systems.
toReactPropsfunction(attrs: Record<string, string>): Record<string, string>
Convert a merged attrs record (using HTML attribute names like `class`) to React JSX prop names (e.g. `class` → `className`).
AUTH_TOKEN_COOKIE_NAMEconstant'token'
AppScopeContextsinterfaceAppScopeContexts
One public `app.*` bucket per app, keyed by appScopeId. Everything else is read from the real `salla.config` at runtime.
DocumentElementAttrsinterfaceDocumentElementAttrs
Attributes to apply to a single HTML element (`<body>` or `<html>`).
DocumentElementDescriptorinterfaceDocumentElementDescriptor
Descriptor that a route or component passes to `useDocumentClass`. Each field maps to the corresponding HTML element.
HeadDescriptorinterfaceHeadDescriptor
LinkDescriptorinterfaceLinkDescriptor
Typed `<link>` descriptor — covers SEO, preload, prefetch, and resource hints.
OpenGraphImageinterfaceOpenGraphImage
ScriptDescriptorinterfaceScriptDescriptor
Typed `<script>` descriptor — for injecting scripts into the document head.
StoreContextinterfaceStoreContext
Central settings context - single source of truth for all API data. Contains everything from the settings endpoint response after processing.
StyleDescriptorinterfaceStyleDescriptor
Typed `<style>` descriptor — for injecting inline CSS into the document head.
AppConfigBagtypeAppConfigBag
One app's private `app.*` bag, keyed without the `app.` prefix (`app.color` → `color`).
HeadResulttypeHeadResult
MobileOStypeMobileOS
The visitor's mobile operating system, or `'other'` (desktop/unknown/server).
RouteChangedEventtypePageContext
Payload dispatched via `salla.event.dispatch('route::changed', payload)` after each client-side navigation completes.

@salla.sa/twilight-theme-engine/utils/baseHead

3
ExportKindSignature and summary
buildBaseHeadfunction(settings: StoreContext | null | undefined, locale?: string, path?: string): HeadDescriptor
Builds a base {@link HeadDescriptor} with store-wide OG and Twitter defaults. Used in __root.tsx to set base metadata that can be overridden by child routes.
buildHreflangAlternatesfunction(settings: StoreContext | null | undefined, path?: string): HeadDescriptor['alternateLanguages']
Builds hreflang alternate links for multilingual SEO.
localeToOgLocalefunction(locale: string): string
Converts an ISO-639-1 locale string to the og:locale format (e.g. `ar` → `ar_AR`).

@salla.sa/twilight-theme-engine/utils/cdn-image

3
ExportKindSignature and summary
getCdnImageSrcSetfunction(url: string | undefined, widths: readonly number[], options?: Omit<CdnImageOptions, 'width' | 'height'>): string | undefined
getCdnImageUrlfunction(url: string | undefined, options?: CdnImageOptions): string | undefined
CdnImageOptionsinterfaceCdnImageOptions

@salla.sa/twilight-theme-engine/utils/head

9
ExportKindSignature and summary
mergeHeadfunction(base: HeadDescriptor, extension: Partial<HeadDescriptor>): HeadDescriptor
resolveHeadfunction(descriptor: HeadDescriptor): HeadResult
setHeadAdapterfunction(adapter: HeadAdapter): void
HeadDescriptorinterfaceHeadDescriptor
LinkDescriptorinterfaceLinkDescriptor
Typed `<link>` descriptor — covers SEO, preload, prefetch, and resource hints.
OpenGraphImageinterfaceOpenGraphImage
ScriptDescriptorinterfaceScriptDescriptor
Typed `<script>` descriptor — for injecting scripts into the document head.
StyleDescriptorinterfaceStyleDescriptor
Typed `<style>` descriptor — for injecting inline CSS into the document head.
HeadResulttypeHeadResult

@salla.sa/twilight-theme-engine/types

65
ExportKindSignature and summary
HookNameenumHookName
Predefined hook names for type-safe hook registration.
AffiliateConfiginterfaceAffiliateConfig
BootDatainterfaceBootData
BrandinterfaceBrand
BreadcrumbinterfaceBreadcrumb
CartinterfaceCart
CartIteminterfaceCartItem
CartItemAttachmentinterfaceCartItemAttachment
CartItemOfferinterfaceCartItemOffer
CartItemOptioninterfaceCartItemOption
CartOptioninterfaceCartOption
CategoryinterfaceCategory
ComponentDefinitioninterfaceComponentDefinition
CurrencyConfiginterfaceCurrencyConfig
ExternalServicesinterfaceExternalServices
FeatureinterfaceFeature
FreeShippingBarinterfaceFreeShippingBar
HomeComponentinterfaceHomeComponent
HomeComponentConfiginterfaceHomeComponentConfig
HomeComponentDatainterfaceHomeComponentData
Home component data from Salla API Used by HomePage to render dynamic components
HookDefinitioninterfaceHookDefinition
Hook definition with handler and priority.
JitsuConfiginterfaceJitsuConfig
LanguageinterfaceLanguage
LanguageConfiginterfaceLanguageConfig
LayoutPropsinterfaceLayoutProps
LoginConfiginterfaceLoginConfig
MenuIteminterfaceMenuItem
Menu item structure from Salla API
MoneyinterfaceMoney
NotifyAvailabilityinterfaceNotifyAvailability
OpeningHoursSettingsinterfaceOpeningHoursSettings
Opening hours settings for receiving orders. Uses the Spatie\OpeningHours format (day names as keys). TODO: add to API response
PageinterfacePage
ProductinterfaceProduct
ProductBrandinterfaceProductBrand
ProductCategoryinterfaceProductCategory
ProductDonationinterfaceProductDonation
ProductImageinterfaceProductImage
ProductOptioninterfaceProductOption
ProductOptionDetailinterfaceProductOptionDetail
ProductOptionValueinterfaceProductOptionValue
ProductRatinginterfaceProductRating
ProductSkuinterfaceProductSku
Variant rows from `products/{id}/details?with[]=skus`.
ProductTaginterfaceProductTag
ResponseHeadersinterfaceResponseHeaders
SliderinterfaceSlider
StoreinterfaceStore
StoreAppsinterfaceStoreApps
Mobile app download URLs for the store
StoreContactsinterfaceStoreContacts
StoreScopeinterfaceStoreScope
StoreSettingsinterfaceStoreSettings
StoreSocialinterfaceStoreSocial
TestimonialinterfaceTestimonial
ThemeinterfaceTheme
ThemeColorinterfaceThemeColor
ThemeFontinterfaceThemeFont
ThemeSettingsinterfaceThemeSettings
TranslationMapinterfaceTranslationMap
UserinterfaceUser
UserPreferencesinterfaceUserPreferences
UserSocialAccountinterfaceUserSocialAccount
ComponentTypetypeComponentType<P>
HookHandlertypeHookHandler<T>
Hook handler function type.
HookHandlerstypeHookHandlers
Hook handlers map for bulk registration.
JsonObjecttypeJsonObject
Utility type for JSON-like objects. Using `{ [key: string]: {} }` to be compatible with TanStack Router's type inference, which expects all values to be non-null.
ProductStatustypeProductStatus
ProductTypetypeProductType

@salla.sa/twilight-theme-engine/types/hooks

4
ExportKindSignature and summary
HookNameenumHookName
Predefined hook names for type-safe hook registration.
HookDefinitioninterfaceHookDefinition
Hook definition with handler and priority.
HookHandlertypeHookHandler<T>
Hook handler function type.
HookHandlerstypeHookHandlers
Hook handlers map for bulk registration.

@salla.sa/twilight-theme-engine/eslint

1
ExportKindSignature and summary
twilightEslintConfigobjectEslintConfig[]

@salla.sa/twilight-theme-engine/vite

19
ExportKindSignature and summary
bestPracticesPluginfunction(options?: BestPracticesOptions): Plugin
describeThemeTypeIssuefunction(raw: unknown, fileLabel?: string): string | null
Dev-time diagnostic for the `type` field, or `null` when it is correct.
getFrameworkAdapterfunction(framework: Framework): FrameworkAdapter
Get framework adapter by name
getThemeTypefunction(raw: unknown): string | undefined
Read the declared theme type, tolerating any hand-edited shape.
isReactThemeManifestfunction(raw: unknown): boolean
Whether a parsed manifest declares itself a React/SSR theme.
twilightReactfunction(options?: TwilightReactOptions): Promise<PluginOption[]>
Main Twilight Vite plugin.
nextjsobjectFrameworkAdapter
Next.js framework adapter (placeholder for future implementation)
tanstackobjectFrameworkAdapter
REACT_THEME_TYPEconstant'react'
Value of `twilight.json`'s `type` for a React/SSR theme.
BestPracticesOptionsinterfaceBestPracticesOptions
FrameworkAdapterinterfaceFrameworkAdapter
Framework adapter interface for extensibility
NextJsRouterOptionsinterfaceNextJsRouterOptions
Options for Next.js router configuration (for future support)
ReactPluginOptionsinterfaceReactPluginOptions
Options for React plugin configuration
TanStackRouterOptionsinterfaceTanStackRouterOptions
Options for TanStack Router plugin configuration
TwilightManifestinterfaceTwilightManifest
The top-level shape of `twilight.json` that the engine cares about.
TwilightReactOptionsinterfaceTwilightReactOptions
TwilightRouteinterfaceTwilightRoute
FrameworktypeFramework
Supported frameworks for twilightReact plugin
RouterOptionstypeRouterOptions
Router configuration based on framework

@salla.sa/twilight-theme-engine/dev

7
ExportKindSignature and summary
DevSettingsWidgetcomponent({ schema }: DevSettingsWidgetProps): ReactElement | null
DevSchemainterfaceDevSchema
DevSchemaComponentinterfaceDevSchemaComponent
DevSchemaFieldinterfaceDevSchemaField
DevSchemaOptioninterfaceDevSchemaOption
DevSettingsWidgetPropsinterfaceDevSettingsWidgetProps
DevFieldKindtypeDevFieldKind
How a single setting/field is rendered in the dev widget.

@salla.sa/twilight-theme-engine/routes

67
ExportKindSignature and summary
getLanguageInfofunction(locale: string): { readonly code: string; readonly name: string; readonly dir: 'rtl' | 'ltr'; }
isLocalefunction(value?: string): value is Locale
slugBrandRedirectLoaderfunction(ctx: { params: SlugBrandParams; }): Promise<never>
FALLBACK_LOCALEconstant'ar'
Pure locale constants and helpers — no virtual modules, safe to import from Vite config context (e.g. vite plugins, head adapters).
SUPPORTED_LOCALESconstantreadonly ['ar', 'bg', 'bn', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fa', 'fi', 'fr', 'ga', 'he', 'hi', 'hr', 'hu', 'hy', 'ind', 'it', 'ja', 'ko', 'lv', 'ms', 'mt', 'nl', 'pl', 'pt', 'ro', 'ru', 'sl', 'sq', 'sv', 'tl', 'tr', 'uk', 'ur', 'zh']
ArticleDetailinterfaceArticleDetail
ArticleMetainterfaceArticleMeta
ArticleStatsinterfaceArticleStats
ArticleSummaryinterfaceArticleSummary
BlogAuthorLoaderDatainterfaceBlogAuthorLoaderData
BlogAuthorTypeinterfaceBlogAuthor
BlogCategoryLoaderDatainterfaceBlogCategoryLoaderData
BlogCategoryTypeinterfaceBlogCategory
BlogPagePropsinterfaceBlogPageProps
BlogSinglePagePropsinterfaceBlogSinglePageProps
BlogTagLoaderDatainterfaceBlogTagLoaderData
BlogTagTypeinterfaceBlogTag
BrandinterfaceBrand
BrandsGroupinterfaceBrandsGroup
BrandsPagePropsinterfaceBrandsPageProps
CartPagePropsinterfaceCartPageProps
CategoryMetainterfaceCategoryMeta
CategoryPagePropsinterfaceCategoryPageProps
Props for Category/Collection Page component
HeadDescriptorinterfaceHeadDescriptor
HomeLoaderDatainterfaceHomeLoaderData
HomePagePropsinterfaceHomePageProps
Props for HomePage component
IdParamsinterfaceIdParams
LoaderContextinterfaceLoaderContext
LoyaltyPagePropsinterfaceLoyaltyPageProps
LoyaltyPointinterfaceLoyaltyPoint
LoyaltyPrizeinterfaceLoyaltyPrize
LoyaltyPrizeIteminterfaceLoyaltyPrizeItem
NotFoundPagePropsinterfaceNotFoundPageProps
NotificationsPagePropsinterfaceNotificationsPageProps
OrderinterfaceOrder
OrderIteminterfaceOrderItem
OrderListIteminterfaceOrderListItem
OrderSinglePagePropsinterfaceOrderSinglePageProps
OrdersPagePropsinterfaceOrdersPageProps
OrdersQueryinterfaceOrdersQuery
URL query parameters for orders page
PageQueryinterfacePageQuery
PageSinglePropsinterfacePageSingleProps
ProductListLoaderContextinterfaceProductListLoaderContext
ProductListLoaderDatainterfaceProductListLoaderData
Unified loader data for all product listing pages
ProductListLoaderParamsinterfaceProductListLoaderParams
ProductListPageMetainterfaceProductListPageMeta
Static page metadata
ProductListQueryinterfaceProductListQuery
URL query parameters — no page field, product list uses cursor-based pagination
ProductListSourceConfiginterfaceProductListSourceConfig
Source configuration
ProductListTaginterfaceProductListTag
Tag entity - products can be filtered by tags
ProductPagePropsinterfaceProductPageProps
ProfilePagePropsinterfaceProfilePageProps
RouteModuleinterfaceRouteModule<TData, TParams, TProps>
RoutePaginationinterfaceRoutePagination
SlugBrandParamsinterfaceSlugBrandParams
SlugIdParamsinterfaceSlugIdParams
StaticPageinterfaceStaticPage
TestimonialsPagePropsinterfaceTestimonialsPageProps
ThankYouLoaderParamsinterfaceThankYouLoaderParams
ThankYouPagePropsinterfaceThankYouPageProps
WalletPagePropsinterfaceWalletPageProps
WishlistPagePropsinterfaceWishlistPageProps
AnyHomeComponenttypeAnyHomeComponent
HomeComponentsPropstypeHomeComponentsProps
Localetype'ar' | 'bg' | 'bn' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'es' | 'et' | 'fa' | 'fi' | 'fr' | 'ga' | 'he' | 'hi' | 'hr' | 'hu' | 'hy' | 'ind' | 'it' | 'ja' | 'ko' | 'lv' | 'ms' | 'mt' | 'nl' | 'pl' | 'pt' | 'ro' | 'ru' | 'sl' | 'sq' | 'sv' | 'tl' | 'tr' | 'uk' | 'ur' | 'zh'
OrdersSearchParamstypeOrdersQuery
URL search params for orders routes - aliases OrdersQuery
ProductListEntitytypeProductListEntity
Entity union type for source metadata
ProductListSourcetypeProductListSource
Unified source type matching API sources directly

@salla.sa/twilight-theme-engine/routes/home

11
ExportKindSignature and summary
HomeSkeletoncomponent(props: unknown): ReactNode
homeLoaderfunction(ctx?: { locale?: string; }): Promise<HomeLoaderData>
registerHomeComponentConfigfunction(config: Record<string, HomeComponentConfig>): void
Register render-shell config for home blocks a theme owns (height, placeholder, className, id). Merges by path and overwrites existing keys, so it is safe to call more than once and idempotent for the same keys.
registerHomeComponentsfunction(components?: Record<string, AnyHomeComponent | null>, prefix?: string): void
DefaultHomeComponentsobjectRecord<string, AnyHomeComponent | null>
Homeobject{ readonly id: 'index'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: MemoExoticComponent<({ components }: HomePageProps) => JSX.Element>; }
HomeLoaderDatainterfaceHomeLoaderData
HomePagePropsinterfaceHomePageProps
Props for HomePage component
AnyHomeComponenttypeAnyHomeComponent
HomeComponentConfigtypeHomeComponentConfig
Render-shell config for a home block: the values the lazy-load wrapper (`RenderWhenVisible`) needs *before* the block mounts — reserved height, the skeleton placeholder, and the wrapper's className/id.
HomeComponentsPropstypeHomeComponentsProps

@salla.sa/twilight-theme-engine/routes/cart

4
ExportKindSignature and summary
CartPagecomponent(props: CartPageProps): JSX.Element
cartLoaderfunction(): CartPageProps
SSR-safe loader that returns only page metadata. Cart data is fetched client-side via React Query since the cart ID lives in localStorage (unavailable during SSR).
Cartobject{ readonly id: 'cart'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: typeof CartPage; }
CartPagePropsinterfaceCartPageProps

@salla.sa/twilight-theme-engine/routes/product

3
ExportKindSignature and summary
productLoaderfunction({ params }: { params: IdParams; }): Promise<ProductPageProps>
Productobject{ readonly id: 'product.single'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: typeof ProductPage; }
ProductPagePropsinterfaceProductPageProps

@salla.sa/twilight-theme-engine/routes/product-listing

17
ExportKindSignature and summary
ProductListPagecomponent({ page, source, query, products, pagination, filters, }: ProductListLoaderData): JSX.Element
Product List Page - Unified component for all product listing pages
useAppliedFiltershook(source: Source, sort: string, enabled: boolean): { filters: ProductListFilters | null; page: FilteredPage | null; lastPage: FilteredPage | null; status: AppliedFiltersStatus; retry: () => void; }
Applies the `<salla-filters>` selection to the product list.
headfunction(ctx: TwilightContext, data: ProductListLoaderData): HeadDescriptor
parseFiltersFromSearchfunction(search: string): ProductListFilters | null
Reads the `filters[...]` selection `<salla-filters>` writes to the address bar (`filters[k]=v`, `filters[k][]=v`, `filters[k][sub]=v`) back into an object, so a filtered link can be opened directly.
productListLoaderfunction(ctx: ProductListLoaderContext): Promise<ProductListLoaderData>
ProductListingobject{ readonly id: 'product.index'; readonly loader: typeof productListLoader; readonly head: typeof head; readonly Component: typeof ProductListPage; }
CategoryPagePropsinterfaceCategoryPageProps
Props for Category/Collection Page component
ProductListLoaderContextinterfaceProductListLoaderContext
ProductListLoaderDatainterfaceProductListLoaderData
Unified loader data for all product listing pages
ProductListLoaderParamsinterfaceProductListLoaderParams
ProductListPageMetainterfaceProductListPageMeta
Static page metadata
ProductListQueryinterfaceProductListQuery
URL query parameters — no page field, product list uses cursor-based pagination
ProductListSourceConfiginterfaceProductListSourceConfig
Source configuration
ProductListTaginterfaceProductListTag
Tag entity - products can be filtered by tags
AppliedFiltersStatustypeAppliedFiltersStatus
ProductListEntitytypeProductListEntity
Entity union type for source metadata
ProductListSourcetypeProductListSource
Unified source type matching API sources directly

@salla.sa/twilight-theme-engine/routes/blog

28
ExportKindSignature and summary
BlogAuthorPagecomponent(props: BlogAuthorLoaderData): ReactNode
BlogCategoryPagecomponent(props: BlogCategoryLoaderData): ReactNode
BlogPagecomponent(props: BlogPageProps): ReactNode
BlogSinglePagecomponent(props: BlogSinglePageProps): ReactNode
BlogTagPagecomponent(props: BlogTagLoaderData): ReactNode
blogAuthorLoaderfunction({ params, }: { params: IdParams; }): Promise<BlogAuthorLoaderData>
blogCategoryLoaderfunction({ params, }: { params: SlugIdParams; }): Promise<BlogCategoryLoaderData>
blogLoaderfunction(): Promise<BlogPageProps>
blogSingleLoaderfunction({ params, }: { params: SlugIdParams; }): Promise<BlogSinglePageProps>
blogTagLoaderfunction({ params, }: { params: SlugIdParams; }): Promise<BlogTagLoaderData>
Blogobject{ readonly id: 'blog.index'; readonly loader: typeof blogLoaderWithExtend; readonly head: typeof blogHead; readonly Component: LazyExoticComponent<typeof BlogPage>; }
BlogAuthorRouteobject{ readonly id: 'blog.index.author'; readonly loader: typeof blogAuthorLoaderWithExtend; readonly head: typeof blogAuthorHead; readonly Component: LazyExoticComponent<typeof BlogAuthorPage>; }
BlogCategoryRouteobject{ readonly id: 'blog.index.category'; readonly loader: typeof blogCategoryLoaderWithExtend; readonly head: typeof blogCategoryHead; readonly Component: LazyExoticComponent<typeof BlogCategoryPage>; }
BlogSingleobject{ readonly id: 'blog.single'; readonly loader: typeof blogSingleLoaderWithExtend; readonly head: typeof blogSingleHead; readonly Component: LazyExoticComponent<typeof BlogSinglePage>; }
BlogTagRouteobject{ readonly id: 'blog.index.tag'; readonly loader: typeof blogTagLoaderWithExtend; readonly head: typeof blogTagHead; readonly Component: LazyExoticComponent<typeof BlogTagPage>; }
ArticleDetailinterfaceArticleDetail
ArticleMetainterfaceArticleMeta
ArticleStatsinterfaceArticleStats
ArticleSummaryinterfaceArticleSummary
BlogAuthorLoaderDatainterfaceBlogAuthorLoaderData
BlogAuthorTypeinterfaceBlogAuthor
BlogCategoryLoaderDatainterfaceBlogCategoryLoaderData
BlogCategoryTypeinterfaceBlogCategory
BlogPagePropsinterfaceBlogPageProps
BlogSinglePagePropsinterfaceBlogSinglePageProps
BlogTagLoaderDatainterfaceBlogTagLoaderData
BlogTagTypeinterfaceBlogTag
CategoryMetainterfaceCategoryMeta

@salla.sa/twilight-theme-engine/routes/brands

6
ExportKindSignature and summary
BrandsPagecomponent(props: BrandsPageProps): ReactNode
brandsLoaderfunction(): Promise<BrandsPageProps>
Brandsobject{ readonly id: 'brands.index'; readonly loader: typeof brandsLoaderWithExtend; readonly head: typeof brandsHead; readonly Component: LazyExoticComponent<MemoExoticComponent<({ page, brands }: BrandsPageProps) => JSX.Element>>; }
BrandinterfaceBrand
BrandsGroupinterfaceBrandsGroup
BrandsPagePropsinterfaceBrandsPageProps

@salla.sa/twilight-theme-engine/routes/account

34
ExportKindSignature and summary
NotificationsPagecomponent(props: NotificationsPageProps): ReactNode
OrderSinglePagecomponent(props: OrderSinglePageProps): ReactNode
OrdersPagecomponent(props: OrdersPageProps): ReactNode
ProfilePagecomponent(props: ProfilePageProps): ReactNode
SettingsPagecomponent(props: SettingsPageProps): ReactNode
WalletPagecomponent(props: WalletPageProps): ReactNode
WishlistPagecomponent(props: WishlistPageProps): ReactNode
notificationsLoaderfunction(_ctx: { locale: string; }): Promise<NotificationsPageProps>
orderSingleLoaderfunction({ params, }: { params: IdParams; }): Promise<OrderSinglePageProps>
ordersLoaderfunction(ctx: { query?: OrdersQuery; with_items?: boolean | number; }, extend?: (data: OrdersPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>): Promise<OrdersPageProps>
profileLoaderfunction(_ctx: { locale: string; }): Promise<ProfilePageProps>
settingsLoaderfunction(_ctx: { locale: string; }): Promise<SettingsPageProps>
walletLoaderfunction(ctx: LoaderContext): Promise<WalletPageProps>
wishlistLoaderfunction(ctx: LoaderContext): Promise<WishlistPageProps>
Notificationsobject{ readonly id: 'customer.notifications'; readonly loader: (_ctx: { locale?: string; }, extend?: (data: NotificationsPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>) => Promise<NotificationsPageProps>; readonly hea…
Ordersobject{ readonly id: 'customer.orders.index'; readonly loader: typeof ordersLoaderWithExtend; readonly head: typeof ordersHead; readonly Component: LazyExoticComponent<typeof OrdersPage>; }
OrderSingleobject{ readonly id: 'customer.orders.single'; readonly loader: typeof orderSingleLoaderWithExtend; readonly head: typeof orderSingleHead; readonly Component: LazyExoticComponent<typeof OrderSinglePage>; }
Profileobject{ readonly id: 'customer.profile'; readonly loader: (_ctx: { locale?: string; }, extend?: (data: ProfilePageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>) => Promise<ProfilePageProps>; readonly head: (ctx: TwilightC…
Settingsobject{ readonly id: 'customer.settings'; readonly loader: (_ctx: { locale?: string; }, extend?: (data: SettingsPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>) => Promise<SettingsPageProps>; readonly head: (ctx: Twilig…
Walletobject{ readonly id: 'customer.wallet'; readonly loader: (ctx: LoaderContext, extend?: (data: WalletPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>) => Promise<WalletPageProps>; readonly head: (ctx: TwilightContext, dat…
Wishlistobject{ readonly id: 'customer.wishlist'; readonly loader: (ctx: LoaderContext, extend?: (data: WishlistPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>) => Promise<WishlistPageProps>; readonly head: (ctx: TwilightContex…
NotificationinterfaceNotification
NotificationsPagePropsinterfaceNotificationsPageProps
OrderinterfaceOrder
OrderIteminterfaceOrderItem
OrderListIteminterfaceOrderListItem
OrderSinglePagePropsinterfaceOrderSinglePageProps
OrdersPagePropsinterfaceOrdersPageProps
OrdersQueryinterfaceOrdersQuery
URL query parameters for orders page
ProfilePagePropsinterfaceProfilePageProps
SettingsPagePropsinterfaceSettingsPageProps
WalletPagePropsinterfaceWalletPageProps
WishlistPagePropsinterfaceWishlistPageProps
OrdersSearchParamstypeOrdersQuery
URL search params for orders routes - aliases OrdersQuery

@salla.sa/twilight-theme-engine/routes/account/orders

10
ExportKindSignature and summary
OrderSinglePagecomponent(props: OrderSinglePageProps): ReactNode
OrdersPagecomponent(props: OrdersPageProps): ReactNode
orderSingleLoaderfunction({ params, }: { params: IdParams; }): Promise<OrderSinglePageProps>
ordersLoaderfunction(ctx: { query?: OrdersQuery; with_items?: boolean | number; }, extend?: (data: OrdersPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>): Promise<OrdersPageProps>
Ordersobject{ readonly id: 'customer.orders.index'; readonly loader: typeof ordersLoaderWithExtend; readonly head: typeof ordersHead; readonly Component: LazyExoticComponent<typeof OrdersPage>; }
OrderSingleobject{ readonly id: 'customer.orders.single'; readonly loader: typeof orderSingleLoaderWithExtend; readonly head: typeof orderSingleHead; readonly Component: LazyExoticComponent<typeof OrderSinglePage>; }
OrderSinglePagePropsinterfaceOrderSinglePageProps
OrdersPagePropsinterfaceOrdersPageProps
OrdersQueryinterfaceOrdersQuery
URL query parameters for orders page
OrdersSearchParamstypeOrdersQuery
URL search params for orders routes - aliases OrdersQuery

@salla.sa/twilight-theme-engine/routes/loyalty

7
ExportKindSignature and summary
LoyaltyPagecomponent(props: LoyaltyPageProps): ReactNode
loyaltyLoaderfunction(): Promise<LoyaltyPageProps>
Loyaltyobject{ readonly id: 'loyalty'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof LoyaltyPage>; }
LoyaltyPagePropsinterfaceLoyaltyPageProps
LoyaltyPointinterfaceLoyaltyPoint
LoyaltyPrizeinterfaceLoyaltyPrize
LoyaltyPrizeIteminterfaceLoyaltyPrizeItem

@salla.sa/twilight-theme-engine/routes/page

5
ExportKindSignature and summary
PageSingleLazycomponent(props: PageSingleProps): ReactNode
pageSingleLoaderfunction({ params }: { params: IdParams; }): Promise<PageSingleProps>
PageSingleobject{ readonly id: 'page-single'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof PageSingle>; }
PageSinglePropsinterfacePageSingleProps
StaticPageinterfaceStaticPage

@salla.sa/twilight-theme-engine/routes/testimonials

4
ExportKindSignature and summary
TestimonialsPagecomponent(props: TestimonialsPageProps): ReactNode
testimonialsLoaderfunction(_ctx: { locale: string; }): Promise<TestimonialsPageProps>
Testimonialsobject{ readonly id: 'testimonials'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof TestimonialsPage>; }
TestimonialsPagePropsinterfaceTestimonialsPageProps

@salla.sa/twilight-theme-engine/routes/thank-you

5
ExportKindSignature and summary
ThankYouPagecomponent(props: ThankYouPageProps): ReactNode
thankYouLoaderfunction({ params, }: { params: ThankYouLoaderParams; }): Promise<ThankYouPageProps>
ThankYouobject{ readonly id: 'thank-you'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof ThankYouPage>; }
ThankYouLoaderParamsinterfaceThankYouLoaderParams
ThankYouPagePropsinterfaceThankYouPageProps

@salla.sa/twilight-theme-engine/routes/seo-redirects

4
ExportKindSignature and summary
pendingOrdersRedirectLoaderfunction(ctx?: { params: PendingOrdersRedirectParams; }): Promise<never>
slugBrandRedirectLoaderfunction(ctx: { params: SlugBrandParams; }): Promise<never>
PendingOrdersRedirectParamsinterfacePendingOrdersRedirectParams
SlugBrandParamsinterfaceSlugBrandParams

@salla.sa/twilight-theme-engine/skeleton

12
ExportKindSignature and summary
BlogSkeletoncomponent(props: object): ReactNode
BreadcrumbSkeletoncomponent({ className }?: SkeletonProps): React.JSX.Element
CartSkeletoncomponent(props: object): ReactNode
CustomerLayoutSkeletoncomponent(props: object): ReactNode
CustomerPageSkeletoncomponent(props: object): ReactNode
HomeSkeletoncomponent(props: unknown): ReactNode
PageSkeletoncomponent(props: PageSkeletonProps): ReactNode
ProductCardSkeletoncomponent({ className }?: SkeletonProps): React.JSX.Element
ProductDetailSkeletoncomponent(props: object): ReactNode
ProductGridSkeletoncomponent(props?: SkeletonProps & { count?: number; }): React.JSX.Element
SkeletonPulsecomponent(props: { className?: string; circle?: boolean; style?: React.CSSProperties; }): ReactNode
PageSkeletonPropsinterfacePageSkeletonProps

@salla.sa/twilight-theme-engine/tanstack

19
ExportKindSignature and summary
TanStackLinkAdaptercomponent(props: Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>): ReactNode
TanStack Router Link adapter. Translates framework-agnostic props to TanStack Router Link props.
TanStackNavigationProvider deprecatedcomponent({ children }: { children: ReactNode; }): JSX.Element
useAttrshook(): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Read and merge `<body>` / `<html>` attributes from all currently active route matches (via `staticData.documentAttrs`).
attrsfunction(descriptor: DocumentElementDescriptor): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Pure adapter: converts a `DocumentElementDescriptor` to React-ready props.
createRouterfunction(routeTree: any, options?: CreateRouterOptions): RouterCore<any, 'never', false, RouterHistory, Record<string, any>>
Creates and configures the TanStack Router instance for the Twilight theme.
createTanStackLinkAdapterfunction(): ForwardRefExoticComponent<Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>>
Create a TanStack Router Link adapter component.
createTwilightRootRoutefunction(): (options: any) => RootRoute<Register, undefined, RouterInitialContext, AnyContext, AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>
Creates the root route pre-configured with RouterInitialContext. beforeLoad will fetch settings/translations, loader returns serializable data.
earlyHintsMiddlewarefunction(): AnyRequestMiddleware
getTwilightContextfunction(): TwilightContext
headfunction(descriptor: HeadDescriptor): { meta: Record<string, unknown>[]; links: Record<string, unknown>[]; styles: Record<string, unknown>[]; scripts: Record<string, unknown>[]; }
mergeAttrsfunction(...descriptors: DocumentElementDescriptor[]): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Merge multiple `DocumentElementDescriptor`s into React-ready props.
runWithTwilightContextfunction<T>(partial: Partial<TwilightContext>, fn: () => T): T
twilightMiddlewarefunction(options?: TwilightMiddlewareOptions): AnyRequestMiddleware
updateTwilightContextfunction(partial: Partial<TwilightContext>): void
withHeadfunction<T>(route: { head: (ctx: TwilightContext, data: T) => HeadDescriptor; }, extend?: (result: HeadDescriptor, _ctx: TwilightContext, data: T) => HeadDescriptor): (_ctx: Record<string, unknown>) => Record<string, unknown>
Wraps a route module's head function for TanStack Router.
CreateRouterOptionsinterfaceCreateRouterOptions
Options for creating the TanStack Router instance.
RouterInitialContextinterfaceRouterInitialContext
Initial router context passed from createRouter to beforeLoad.
TwilightContextinterfaceTwilightContext
TwilightLocationinterfaceTwilightLocation<TSearch>

@salla.sa/twilight-theme-engine/nextjs

4
ExportKindSignature and summary
NextJsLinkAdaptercomponent(props: Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>): ReactNode
Next.js Link adapter. Translates framework-agnostic props to Next.js Link props.
attrsfunction(descriptor: DocumentElementDescriptor): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Next.js App Router document element adapter.
headfunction(descriptor: HeadDescriptor): { alternates: { canonical: string | undefined; languages: Record<string, string> | undefined; }; twitter?: { card: any; title: string | undefined; description: string | undefined; images: string[] | undefined; site: string | undefined; creator: stri…
mergeAttrsfunction(...descriptors: DocumentElementDescriptor[]): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Merge multiple `DocumentElementDescriptor`s into React-ready props.

@salla.sa/twilight-theme-engine/dom

2
ExportKindSignature and summary
attrsfunction(descriptor: DocumentElementDescriptor): void
Apply `<body>` and `<html>` attributes directly to the DOM.
clearAttrsfunction(): void
Remove all attributes previously applied by `domDocumentAdapter`.

@salla.sa/twilight-theme-engine/sentry/client

1
ExportKindSignature and summary
initThemeSentryfunction(theme: string, dsn?: string): void
Browser-side Sentry init for storefront themes. No-op (dead-code eliminated) unless VITE_SENTRY_DSN is set at build time.

@salla.sa/twilight-theme-engine/sentry/server

1
ExportKindSignature and summary
withThemeSentryfunction<T extends FetchHandler>(handler: T, theme: string): T
Wrap a worker fetch handler with Sentry for a given theme. DSN from runtime SENTRY_DSN or build-time VITE_SENTRY_DSN; no-op if unset.

@salla.sa/twilight-theme-engine/components/modal

7
ExportKindSignature and summary
ImageModalcomponent(props: ImageModalProps): ReactNode
Lazy-loaded modal components ImageModal is lazy-loaded since it's a standalone component. Modal is kept eager because it uses compound component pattern.
Modalcomponent({ isOpen, onClose, children, closeOnBackdropClick, closeOnEscape, preventBodyScroll, size, position, className, }: ModalProps): React.ReactPortal | null
ImageModalPropsinterfaceImageModalProps
ModalBodyPropsinterfaceModalBodyProps
ModalFooterPropsinterfaceModalFooterProps
ModalHeaderPropsinterfaceModalHeaderProps
ModalPropsinterfaceModalProps

@salla.sa/twilight-theme-engine/components/drawer

5
ExportKindSignature and summary
Drawercomponent({ isOpen, onClose, children, size, closeOnBackdropClick, closeOnEscape, preventBodyScroll, className, }: DrawerProps): React.ReactPortal | null
DrawerBodyPropsinterfaceDrawerBodyProps
DrawerFooterPropsinterfaceDrawerFooterProps
DrawerHeaderPropsinterfaceDrawerHeaderProps
DrawerPropsinterfaceDrawerProps

@salla.sa/twilight-theme-engine/components/dropdown

5
ExportKindSignature and summary
Dropdowncomponent({ isOpen, onClose, children, className }: DropdownProps): JSX.Element
DropdownItemPropsinterfaceDropdownItemProps
DropdownMenuPropsinterfaceDropdownMenuProps
DropdownPropsinterfaceDropdownProps
DropdownTriggerPropsinterfaceDropdownTriggerProps

@salla.sa/twilight-theme-engine/components/collapse

4
ExportKindSignature and summary
Collapsecomponent({ children, className }: CollapseProps): JSX.Element
CollapseContentPropsinterfaceCollapseContentProps
CollapsePropsinterfaceCollapseProps
CollapseTriggerPropsinterfaceCollapseTriggerProps

@salla.sa/twilight-theme-engine/components/toast

9
ExportKindSignature and summary
Toastercomponent({ mobilePosition, addToCartToast, }: { mobilePosition?: ToastPosition; addToCartToast?: boolean; }): JSX.Element
useToasthook(title: string, options?: ToastOptions): string | number
toastfunction(title: string, options?: ToastOptions): string | number
ToastFninterfaceToastFn
ToastOptionsinterfaceToastOptions
ToastPromiseOptionsinterfaceToastPromiseOptions<T>
ToastUpdateOptionsinterfaceToastUpdateOptions
ToastPositiontypeToastPosition
ToastTypetypeToastType

@salla.sa/twilight-theme-engine/components/cart

4
ExportKindSignature and summary
CartItemcomponent(props: CartItemProps): ReactNode
Lazy-loaded cart components Use these for code-splitting cart sections
CartSummarycomponent(props: CartSummaryProps): ReactNode
SeoCartWidgetcomponent(props: SeoCartWidgetProps): ReactNode
SeoCartWidgetPropsinterfaceSeoCartWidgetProps

@salla.sa/twilight-theme-engine/components/product

7
ExportKindSignature and summary
AddToCartFormcomponent(props: AddToCartFormProps): ReactNode
ProductCardcomponent(props: ProductCardProps): ReactNode
ProductDetailscomponent(props: ProductDetailsProps): ReactNode
ProductGallerycomponent(props: ProductGalleryProps): JSX.Element
ProductCardPropsinterfaceProductCardProps
ProductGalleryPropsinterfaceProductGalleryProps
ProductCardLayouttypeProductCardLayout
Product card layout variants - mutually exclusive

@salla.sa/twilight-theme-engine/components/layout

8
ExportKindSignature and summary
Copyrightcomponent(props: CopyrightProps): ReactNode
CustomerLayoutcomponent(props: CustomerLayoutProps): ReactNode
Footercomponent(props: unknown): ReactNode
Headercomponent(props: HeaderProps): ReactNode
Lazy-loaded layout components Use these for code-splitting layout sections
MasterLayoutcomponent(props: LayoutProps): ReactNode
WidgetHeadcomponent(props: unknown): ReactNode
pushEqualHeightConfigfunction(settings: Record<string, unknown>): void
Pushes the equal-height product card configuration to the GTM dataLayer. Mirrors PHP `HeadWidget::run()` -> `GoogleTagManager::set('equalHeight', ...)`.
LayoutPropsinterfaceLayoutProps
Base props for layout components with children

@salla.sa/twilight-theme-engine/components/home

22
ExportKindSignature and summary
BundleComponentcomponent(props: BundleComponentProps): ReactNode
FeaturedProductsStyle1component(props: FeaturedProductsStyle1Props): ReactNode
FeaturedProductsStyle2component(props: FeaturedProductsStyle2Props): ReactNode
FeaturedProductsStyle3component(props: FeaturedProductsStyle3Props): ReactNode
FixedBannercomponent(props: FixedBannerComponentProps): ReactNode
FixedProductscomponent({ data }: FixedProductsProps): JSX.Element | null
HomeComponentRenderercomponent(props: { data: HomeComponentData; index: number; }): ReactNode
Memoized component renderer with scroll-based lazy loading Components only mount when scrolled into view - preventing API calls until needed
ParallaxBackgroundcomponent(props: ParallaxBackgroundProps): ReactNode
PhotosSlidercomponent(props: PhotosSliderProps): ReactNode
ProductsSlidercomponent({ data }: ProductsSliderProps): JSX.Element
SquarePhotoscomponent(props: SquarePhotosProps): ReactNode
StoreFeaturescomponent(props: StoreFeaturesProps): ReactNode
Testimonialscomponent(props: TestimonialsProps): ReactNode
Youtubecomponent(props: YoutubeProps): ReactNode
registerHomeComponentConfigfunction(config: Record<string, HomeComponentConfig>): void
Register render-shell config for home blocks a theme owns (height, placeholder, className, id). Merges by path and overwrites existing keys, so it is safe to call more than once and idempotent for the same keys.
registerHomeComponentsfunction(components?: Record<string, AnyHomeComponent | null>, prefix?: string): void
ComponentErrorBoundaryclassComponentErrorBoundary
DefaultHomeComponentsobjectRecord<string, AnyHomeComponent | null>
BundleComponentPropsinterfaceBundleComponentProps
AnyHomeComponenttypeAnyHomeComponent
HomeComponentConfigtypeHomeComponentConfig
Render-shell config for a home block: the values the lazy-load wrapper (`RenderWhenVisible`) needs *before* the block mounts — reserved height, the skeleton placeholder, and the wrapper's className/id.
HomeComponentsPropstypeHomeComponentsProps

@salla.sa/twilight-theme-engine/components/common

22
ExportKindSignature and summary
BlogSkeletoncomponent(props: object): ReactNode
Breadcrumbcomponent(props: BreadcrumbProps): ReactNode
Lazy-loaded common components Use these for code-splitting non-critical components
BreadcrumbSkeletoncomponent({ className }?: SkeletonProps): React.JSX.Element
CurrencySymbolcomponent(props: { currency: string; }): ReactNode
CustomerLayoutSkeletoncomponent(props: object): ReactNode
CustomerPageSkeletoncomponent(props: object): ReactNode
DeferredDatacomponent<T>({ promise, fallback, children }: DeferredDataProps<T>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> …
ErrorPagecomponent(props: ErrorPageProps): ReactNode
Imagecomponent(props: ImageProps): ReactNode
Optimized Image component with native browser lazy loading.
Linkcomponent(props: Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>): ReactNode
Framework-agnostic Link component.
NoContentcomponent(props: NoContentProps): ReactNode
PageSkeletoncomponent(props: PageSkeletonProps): ReactNode
ProductCardSkeletoncomponent({ className }?: SkeletonProps): React.JSX.Element
ProductDetailSkeletoncomponent(props: object): ReactNode
ProductGridSkeletoncomponent(props?: SkeletonProps & { count?: number; }): React.JSX.Element
RenderWhenVisiblecomponent(props: RenderWhenVisibleProps): ReactNode
SkeletonPulsecomponent(props: { className?: string; circle?: boolean; style?: React.CSSProperties; }): ReactNode
resolveDeferredfunction<T>(promiseOrValue: Promise<T> | T | undefined): T | Promise<T> | undefined
DeferredDataPropsinterfaceDeferredDataProps<T>
LinkPropsinterfaceBaseLinkProps
Framework-agnostic Link props. Supported across TanStack Router, Next.js, and other React frameworks.
PageSkeletonPropsinterfacePageSkeletonProps
LinkPreloadtypeLinkPreload
Preload behavior for Link component

@salla.sa/twilight-theme-engine/providers

40
ExportKindSignature and summary
DocumentClassProvidercomponent({ children }: DocumentClassProviderProps): JSX.Element
LinkProvidercomponent({ adapter, children }: { adapter: LinkAdapter; children: ReactNode; }): FunctionComponentElement<ProviderProps<LinkContextValue | null>>
Provider that configures the framework-specific Link adapter. Used internally by TwilightProvider based on client.framework setting.
NavigationInterceptorcomponent(): null
NavigationInterceptor - Framework-agnostic SPA navigation interceptor.
NavigationProvidercomponent({ navigate, children, }: { navigate: NavigateFn; children: ReactNode; }): FunctionComponentElement<ProviderProps<NavigationContextValue>>
TwilightProvidercomponent({ children, debug, skeleton, translations: themeTranslations, onReady, onError, client, toast, toastMobilePosition, addToCartToast, routeClass, layout: LayoutComponent, }: TwilightProviderProps): React.ReactElement
useDocumentClassContexthook(): DocumentClassContextValue | null
useDocumentClassOutputhook(): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }
Returns computed React prop objects for `<body>` and `<html>` built from all active `useDocumentClass` registrations.
useIsBloghook(): boolean
Check if current page is blog related
useIsBrandshook(): boolean
Check if current page is brands related
useIsCarthook(): boolean
Check if current page is cart
useIsCustomerhook(): boolean
Check if current page is in customer area
useIsHomehook(): boolean
Check if current page is homepage
useIsProducthook(): boolean
Check if current page is product detail
useIsSearchhook(): boolean
Check if current page is search
useLinkAdapterhook(): LinkAdapter
Hook to access the Link adapter from context. Throws if used outside LinkProvider.
useLocationhook<TSearch = Record<string, unknown>>(): TwilightLocation<TSearch>
Get the current location (TanStack Router compatible). Reads from the router context for SSR compatibility.
useNavigatehook(): NavigateFn
Get the navigate function. Matches React Router, TanStack Router, and Remix naming convention.
useRouteIdhook(): string
Get the current route ID. Used for route detection (isHome, isProduct, etc.)
useTwilighthook(): TwilightContextValue
configureNavigationfunction(config: { notFound?: (message?: string) => never; redirect?: (path: string, opts?: { replace?: boolean; }) => never; unauthorized?: (_message?: string) => never; }): void
Configure navigation functions for a specific framework. Called by framework adapters during setup.
createLinkWithAdapterfunction(adapter: LinkAdapter): ComponentType<BaseLinkProps>
Higher-order function to create a Link component bound to a specific adapter. Useful for framework-specific exports.
notFoundfunction(message?: string): never
Throw a notFound error. Use in route loaders. Framework adapters will override this to throw framework-specific errors.
orThrowfunction<T>(promise: Promise<T>): Promise<T>
Wraps an API promise with error handling for route loaders. On any error, logs debug info and throws notFound() for clean UX.
orUnauthorizedfunction<T>(promise: Promise<T>): Promise<T>
Wraps an API promise with error handling for authenticated route loaders. On a 401/403 response throws unauthorized(); other errors propagate.
redirectfunction(path: string, opts?: { replace?: boolean; }): never
Throw a redirect. Use in route loaders. Framework adapters will override this to throw framework-specific redirects.
registerDocumentSyncfunction(framework: string, component: LazyExoticComponent<FC>): void
Register a framework-specific document sync component. Convenience function for adding new frameworks to the registry.
unauthorizedfunction(message?: string): never
Throw an unauthorized error. Use in route loaders to protect authenticated routes. Framework adapters will override this to throw framework-specific errors.
LinkProviderErrorclassLinkProviderError
Error thrown when Link is used outside of LinkProvider
NotFoundErrorclassNotFoundError
NotFound error - thrown to trigger 404
RedirectErrorclassRedirectError
Redirect error - thrown to trigger a redirect
SettingsErrorclassSettingsError
UnauthorizedErrorclassUnauthorizedError
Unauthorized error - thrown to trigger 401
routeDocumentSyncsobjectRecord<string, LazyExoticComponent<FC>>
Registry for framework-specific document sync components. Each framework (tanstack, nextjs, etc.) can register its own sync component. Used by TwilightProvider to automatically apply route-based body classes.
RouteIdobject{ readonly INDEX: 'index'; readonly CART: 'cart'; readonly SEARCH: 'product.index.search'; readonly PRODUCT_INDEX: 'product.index'; readonly PRODUCT_INDEX_LATEST: 'product.index.latest'; readonly PRODUCT_INDEX_SALES: 'product.index.sales'; readonly PRODUCT_INDEX_OFFERS: 'product…
Route ID constants for identifying routes throughout the application. Used for route matching, analytics, and conditional rendering based on route.
DocumentClassProviderPropsinterfaceDocumentClassProviderProps
LocationinterfaceTwilightLocation<TSearch>
TwilightProviderPropsinterfaceTwilightProviderProps
NavigateFntypeNavigateFn
NavigateOptionstypeNavigateOptions
RouteIdTypetypeRouteIdType

@salla.sa/twilight-theme-engine/api/types

2
ExportKindSignature and summary
PaginatedResultinterfacePaginatedResult<T>
Generic paginated result type for API responses that work with loader functions. Matches the `ItemsLoaderFn<T>` interface expected by `ItemsList` component.
PaginationinterfacePagination
Cursor-based pagination response for paginated API endpoints.

@salla.sa/twilight-theme-engine/api/client

6
ExportKindSignature and summary
apifunction<T>(url: Input, options?: Options): ResponsePromise<T>
Store API base. `VITE_API_URL` override points a preview at a branch backend; unset → prod `api.salla.dev`. Resolution order matters: the value the SSR worker resolved (published into the head, since worker `vars` are server-only `process.…
cdnfunction<T>(url: Input, options?: Options): ResponsePromise<T>
getActiveScopefunction(): ActiveScope | null
Active scope: the market plus its branch allocation, as the SDK stores it. On the client it comes from `salla.storage.get('scope')`; before the SDK hydrates storage it falls back to the `scope` cookie the theme mirrors that selection into …
getActiveScopeIdfunction(): string | null
{@link getActiveScope} reduced to the market id.
getAuthTokenfunction(): string | null
The auth token as the api client sees it: twilight context first, cookie/storage fallback. Use this (not `getTwilightContext().authToken`, which is often null for logged-in users — see the note above) to decide whether an authenticated-onl…
STORE_IDENTIFIER_HEADERconstant'store-identifier'
The header every Salla API call is answered by store.

@salla.sa/twilight-theme-engine/api/store

3
ExportKindSignature and summary
resolveStoreIdentifierfunction(explicit?: string): string
Which store to ask about, in the order the answers can be trusted.
storeobject{ settings: (storeIdentifier?: string) => Promise<StoreContext | null>; queries: { settings: (storeIdentifier?: string) => OmitKeyof<UseQueryOptions<StoreContext | null, Error, StoreContext | null, readonly unknown[]>, 'queryFn'> & { queryFn?: QueryFunction<StoreContext | null, …
StoreContextinterfaceStoreContext
Central settings context - single source of truth for all API data. Contains everything from the settings endpoint response after processing.

@salla.sa/twilight-theme-engine/api/translations

1
ExportKindSignature and summary
translationsobject{ get: () => Promise<TranslationMessages | null>; queries: { byLocale: () => OmitKeyof<UseQueryOptions<TranslationMessages | null, Error, TranslationMessages | null, string[]>, 'queryFn'> & { queryFn?: QueryFunction<TranslationMessages | null, string[], never> | undefined; } & {…

@salla.sa/twilight-theme-engine/api/cart

2
ExportKindSignature and summary
cartobject{ get: (cartId: number) => Promise<Cart>; getOrThrow: (cartId: number) => Promise<Cart>; queries: { detail: (cartId: number) => OmitKeyof<UseQueryOptions<Cart, Error, Cart, (string | number)[]>, 'queryFn'> & { queryFn?: QueryFunction<Cart, (string | number)[], never> | undefined…
CartApiResponseinterfaceCartApiResponse

@salla.sa/twilight-theme-engine/api/product

15
ExportKindSignature and summary
getProductPreviewfunction(id: string): Product | undefined
List-card product for `placeholderData`. Prefers the preview key; if that was dropped on SSR dehydrate, rebuilds it from the current-scope list/wishlist.
isProductPreviewQueryfunction(query: { queryKey: readonly unknown[]; }): boolean
True when this query is a list-card stand-in — skip it when dehydrating SSR.
productDetailQueryKeyfunction(id: string): readonly ['products', 'detail', string, { readonly scope: ActiveScope | null; }]
productPreviewQueryKeyfunction(id: string): readonly ['products', 'preview', string, { readonly scope: ActiveScope | null; }]
rememberProductPreviewfunction(product: Product): void
Remember a list/card product so `product.queries.detail(id)` can use it as `placeholderData` while details load. No-op if details for this id are already cached. Themes that fetch products outside `product.list` should call this.
shouldDehydrateQueryfunction(query: Parameters<typeof defaultShouldDehydrateQuery>[0]): boolean
Default dehydrate policy (success) plus pending SSR-stream queries, minus list-card stand-ins. Replacing the default wholesale would ship error states.
productobject{ find: (id: string) => Promise<Product>; findOrThrow: (id: string) => Promise<Product>; list: (params: ProductsListParams) => Promise<ProductsListResult>; queries: { detail: (id: string) => OmitKeyof<UseQueryOptions<Product, Error, Product, readonly ['products', 'detail', strin…
FilterinterfaceFilter
FilterValueinterfaceFilterValue
ProductsListParamsinterfaceProductsListParams
ProductsListResponseinterfaceProductsListResponse
ProductListFilterstypeProductListFilters
A `<salla-filters>` selection, i.e. the `salla-filters::changed` payload.
ProductListFilterValuetypeProductListFilterValue
One `<salla-filters>` value: a scalar, a list, or a nested `{ sub-key: value }` (variants).
ProductsListResulttypeProductsListResult
ProductsListSourcetypeProductsListSource

@salla.sa/twilight-theme-engine/api/home

1
ExportKindSignature and summary
homeobject{ components: () => Promise<HomeComponentData[]>; queries: { components: () => OmitKeyof<UseQueryOptions<HomeComponentData[], Error, HomeComponentData[], string[]>, 'queryFn'> & { queryFn?: QueryFunction<HomeComponentData[], string[], never> | undefined; } & { queryKey: string[]…

@salla.sa/twilight-theme-engine/api/brands

1
ExportKindSignature and summary
brandobject{ list: () => Promise<BrandsGroup>; find: (id: string) => Promise<Brand>; findOrThrow: (id: string) => Promise<Brand>; queries: { list: () => OmitKeyof<UseQueryOptions<BrandsGroup, Error, BrandsGroup, string[]>, 'queryFn'> & { queryFn?: QueryFunction<BrandsGroup, string[], never…

@salla.sa/twilight-theme-engine/api/loyalty

1
ExportKindSignature and summary
loyaltyobject{ get: () => Promise<Loyalty>; getOrThrow: () => Promise<Loyalty>; getPointsBalance: () => Promise<number>; queries: { detail: () => OmitKeyof<UseQueryOptions<Loyalty, Error, Loyalty, string[]>, 'queryFn'> & { queryFn?: QueryFunction<Loyalty, string[], never> | undefined; } & { …

@salla.sa/twilight-theme-engine/api/order

5
ExportKindSignature and summary
orderobject{ list: (params?: OrdersListParams) => Promise<OrdersListResponse>; find: (id: string) => Promise<OrderDetailResponse>; shipments: (orderId: string) => Promise<OrderShipmentItem[]>; ratings: (orderId: string) => Promise<OrderRatingItem[]>; findOrThrow: (id: string) => Promise<Or…
CheckoutThankYouDatainterfaceCheckoutThankYouData
OrderDetailResponseinterfaceOrderDetailResponse
OrdersListParamsinterfaceOrdersListParams
OrdersListResponseinterfaceOrdersListResponse

@salla.sa/twilight-theme-engine/api/category

1
ExportKindSignature and summary
categoryobject{ find: (id: string) => Promise<Category>; findOrThrow: (id: string) => Promise<Category>; list: () => Promise<Category[]>; queries: { detail: (id: string) => OmitKeyof<UseQueryOptions<Category, Error, Category, string[]>, 'queryFn'> & { queryFn?: QueryFunction<Category, string[…

@salla.sa/twilight-theme-engine/api/page

1
ExportKindSignature and summary
pageobject{ find: (slug: string) => Promise<ApiPageResponse>; findOrThrow: (slug: string) => Promise<ApiPageResponse>; queries: { detail: (slug: string) => OmitKeyof<UseQueryOptions<ApiPageResponse, Error, ApiPageResponse, string[]>, 'queryFn'> & { queryFn?: QueryFunction<ApiPageResponse,…

@salla.sa/twilight-theme-engine/api/menu

1
ExportKindSignature and summary
menuobject{ header: () => Promise<MenuItem[]>; footer: () => Promise<MenuItem[]>; queries: { header: () => OmitKeyof<UseQueryOptions<MenuItem[], Error, MenuItem[], string[]>, 'queryFn'> & { queryFn?: QueryFunction<MenuItem[], string[], never> | undefined; } & { queryKey: string[] & {}; };…

@salla.sa/twilight-theme-engine/api/notification

2
ExportKindSignature and summary
notificationobject{ list: () => Promise<NotificationsListResponse>; markAsRead: (id: number) => Promise<void>; markAllAsRead: () => Promise<void>; queries: { list: () => OmitKeyof<UseQueryOptions<NotificationsListResponse, Error, NotificationsListResponse, string[]>, 'queryFn'> & { queryFn?: Quer…
NotificationsListResponseinterfaceNotificationsListResponse

@salla.sa/twilight-theme-engine/api/wishlist

2
ExportKindSignature and summary
wishlistobject{ list: (params?: WishlistListParams) => Promise<ProductsListResult>; queries: { list: (params: Omit<WishlistListParams, 'signal'>) => OmitKeyof<UseQueryOptions<ProductsListResult, Error, ProductsListResult, (string | Omit<WishlistListParams, 'signal'> | { scope: ActiveScope | n…
Wishlist API — page-based pagination only. Kept separate from product.list to avoid mixing cursor and page pagination strategies.
WishlistListParamsinterfaceWishlistListParams

@salla.sa/twilight-theme-engine/api/user

1
ExportKindSignature and summary
userobject{ get: () => Promise<User | null>; queries: { current: () => OmitKeyof<UseQueryOptions<User | null, Error, User | null, readonly unknown[]>, 'queryFn'> & { queryFn?: QueryFunction<User | null, readonly unknown[], never> | undefined; } & { queryKey: readonly unknown[] & {}; }; };…

@salla.sa/twilight-theme-engine/api/profile

1
ExportKindSignature and summary
profileobject{ delete: () => Promise<void>; updateSettings: (name: string, value: boolean) => Promise<void>; }

@salla.sa/twilight-theme-engine/api/apps

4
ExportKindSignature and summary
appsobject{ snippets: () => Promise<AppSnippet[]>; settings: () => Promise<AppSettings>; queries: { snippets: () => OmitKeyof<UseQueryOptions<AppSnippet[], Error, AppSnippet[], string[]>, 'queryFn'> & { queryFn?: QueryFunction<AppSnippet[], string[], never> | undefined; } & { queryKey: st…
AppSettingsinterfaceAppSettings
Per-app public `app.*` buckets for CDN snippets, keyed by encoded app id (== `AppSnippet.id`, the `Salla.appScope` scope id). One isolated bucket per app; reads within a scope are bare `app.*`.
AppSnippetinterfaceAppSnippet
AppSnippetRowinterfaceAppSnippetRow

@salla.sa/twilight-theme-engine/tracking

7
ExportKindSignature and summary
GoogleTagBodycomponent({ gtmIds }: GoogleTagBodyProps): null
GoogleTagBody - Injects GTM script and noscript iframe.
LazyGoogleTagBodycomponent(props: GoogleTagBodyProps): ReactNode
Lazy-loaded GoogleTagBody component.
LazySiftSnippetcomponent(props: SiftSnippetProps): ReactNode
Lazy-loaded SiftSnippet component.
SiftSnippetcomponent({ beaconKey, customerId }: SiftSnippetProps): null
SiftSnippet - Injects Sift Science fraud detection script.
TwilightBundlescomponent(): null
TwilightBundles - Injects twilight bundles script when custom components are detected.
GoogleTagBodyPropsinterfaceGoogleTagBodyProps
SiftSnippetPropsinterfaceSiftSnippetProps

@salla.sa/twilight-theme-engine/store

3
ExportKindSignature and summary
LazyStoreClosedNotificationcomponent(props: StoreClosedNotificationProps): ReactNode
Lazy-loaded StoreClosedNotification component.
StoreClosedNotificationcomponent(_props: StoreClosedNotificationProps): JSX.Element | null
StoreClosedNotification - Shows a notification bar when the store is closed.
StoreClosedNotificationPropsinterfaceStoreClosedNotificationProps

Short aliases

These import paths export exactly the same thing as a longer one.

@salla.sa/twilight-theme-engine/modalsame as ./components/modal
@salla.sa/twilight-theme-engine/drawersame as ./components/drawer
@salla.sa/twilight-theme-engine/dropdownsame as ./components/dropdown
@salla.sa/twilight-theme-engine/collapsesame as ./components/collapse
@salla.sa/twilight-theme-engine/toastsame as ./components/toast
@salla.sa/twilight-theme-engine/cartsame as ./components/cart
@salla.sa/twilight-theme-engine/productsame as ./components/product
@salla.sa/twilight-theme-engine/layoutsame as ./components/layout
@salla.sa/twilight-theme-engine/homesame as ./components/home
@salla.sa/twilight-theme-engine/commonsame as ./components/common