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| Export | Kind | Signature and summary |
|---|---|---|
Component | component | ({ name, fallback, ...props }: ComponentProps): React.ReactNode |
TwilightProvider | component | ({ children, debug, skeleton, translations: themeTranslations, onReady, onError, client, toast, toastMobilePosition, addToCartToast, routeClass, layout: LayoutComponent, }: TwilightProviderProps): React.ReactElement |
useComponent | hook | <P = Record<string, unknown>>(name: string): ComponentType<P> | null |
useIsBlog | hook | (): booleanCheck if current page is blog related |
useIsBrands | hook | (): booleanCheck if current page is brands related |
useIsCart | hook | (): booleanCheck if current page is cart |
useIsCustomer | hook | (): booleanCheck if current page is in customer area |
useIsHome | hook | (): booleanCheck if current page is homepage |
useIsProduct | hook | (): booleanCheck if current page is product detail |
useIsSearch | hook | (): booleanCheck if current page is search |
useOriginalComponent | hook | <P = Record<string, unknown>>(name: string): ComponentType<P> | null |
useRouteId | hook | (): stringGet the current route ID. Used for route detection (isHome, isProduct, etc.) |
useTwilight | hook | (): TwilightContextValue |
defineComponent | function | <P = Record<string, unknown>>(config: DefineComponentConfig<P>): ComponentType<P> |
overrideComponents | function | (components: Record<string, ComponentType>): void |
registerComponents | function | (components: Record<string, ComponentType>): void |
ComponentRegistry | class | ComponentRegistry |
SettingsError | class | SettingsError |
registry | object | ComponentRegistry |
RouteId | object | { 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. |
HookName | enum | HookNamePredefined hook names for type-safe hook registration. |
ComponentProps | interface | ComponentProps |
HookDefinition | interface | HookDefinitionHook definition with handler and priority. |
TwilightConfig | interface | TwilightConfig |
TwilightContextValue | interface | TwilightContextValue |
TwilightProviderProps | interface | TwilightProviderProps |
HookHandler | type | HookHandler<T>Hook handler function type. |
HookHandlers | type | HookHandlersHook handlers map for bulk registration. |
RouteIdType | type | RouteIdType |
@salla.sa/twilight-theme-engine/i18n
13| Export | Kind | Signature and summary |
|---|---|---|
I18nProvider | component | ({ i18nInstance, themeTranslations, children, }: I18nProviderProps): React.ReactElement |
useTranslation | hook | (ns?: string | string[]): { t: TFunction<string | string[], undefined>; i18n: i18n; ready: boolean; locale: string; direction: 'ltr' | 'rtl'; isRTL: boolean; isLTR: boolean; languageName: string; } |
getLanguageInfo | function | (locale: string): { readonly code: string; readonly name: string; readonly dir: 'rtl' | 'ltr'; } |
isLocale | function | (value?: string): value is Locale |
FALLBACK_DIR | constant | 'rtl' |
FALLBACK_LANGUAGE_NAME | constant | 'العربية' |
FALLBACK_LOCALE | constant | 'ar'Pure locale constants and helpers — no virtual modules, safe to import from Vite config context (e.g. vite plugins, head adapters). |
RTL_LOCALES | constant | string[] |
SUPPORTED_LOCALES | constant | readonly ['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'] |
I18nContextValue | interface | I18nContextValue |
I18nProviderProps | interface | I18nProviderProps |
Locale | type | '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' |
TranslationMessages | type | TranslationMessages |
@salla.sa/twilight-theme-engine/hooks
60| Export | Kind | Signature and summary |
|---|---|---|
HookSlot | component | ({ name, context, fallback, ssr, }: HookSlotProps): React.JSX.Element | null |
useAsset | hook | (): UseAssetResultuseAsset - Hook for generating asset and CDN URLs |
useAsyncFn | hook | <T extends FunctionReturningPromise>(fn: T, deps?: DependencyList, initialState?: StateFromFunctionReturningPromise<T>): AsyncFnReturn<T>useAsyncFn - Hook for managing async operations with loading/error states |
useBlogLike | hook | (blogId: number, initialCount?: number): UseBlogLikeResult |
useBreadcrumbs | hook | (page?: Page | null): Breadcrumb[] |
useComments | hook | (): UseCommentsResultuseComments - Hook for managing salla-comments web component re-renders |
useCoupon | hook | (): UseCouponResultuseCoupon - Hook for managing cart coupons |
useDate | hook | (): UseDateResultuseDate - Hook for formatting dates |
useDocumentClass | hook | (descriptor: DocumentElementDescriptor): voiduseDocumentClass - Hook for managing HTML and body element attributes |
useGtm | hook | (): UseGtmResultuseGtm - Google Tag Manager hook for tracking events |
useHook | hook | <T = Record<string, unknown>>(name: string, handler: HookHandler<T>, priority?: number): voiduseHook - Registers a hook handler in the hook registry |
useIsClient | hook | (): booleanReturns 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. |
useMoney | hook | (): UseMoneyResultuseMoney - Hook for formatting monetary values |
useNumber | hook | (): UseNumberResultuseNumber - Hook for number formatting |
useOpeningHours | hook | (settings?: OpeningHoursSettings): UseOpeningHoursResultuseOpeningHours - Hook for checking store opening status and next open time. |
usePageConfig | hook | (pageData: PageConfigData): voidusePageConfig - Centralized hook for setting salla.config.page |
useProduct | hook | (initialProduct: Product, options?: UseProductOptions): UseProductResultuseProduct - Hook for managing product state with live updates |
useStore | hook | (): UseStoreResultuseStore - Hook for accessing and managing store state |
useTheme | hook | (): UseThemeResultuseTheme - Hook for accessing theme configuration |
useUser | hook | (): UseUserReturn |
useWishlist | hook | (): UseWishlistResult |
defineHooks | function | (hooks: HookHandlers): void |
registerDefaultHooks | function | (): voidRegister all default hooks from theme-engine. Called automatically on module import. |
HookRegistry | class | HookRegistryHookRegistry - Manages hook handlers for the extension system |
hookRegistry | object | HookRegistry |
HookName | enum | HookNamePredefined hook names for type-safe hook registration. |
ApplyActions | interface | ApplyActions<T>Simple apply/remove actions (e.g., coupon) |
AsyncState | interface | AsyncStateBase async state for operations with loading and error states |
AsyncStateWithValue | interface | AsyncStateWithValue<T>Async state with a value |
FetchState | interface | FetchState<T>State for data fetching hooks |
FetchStateWithRefresh | interface | FetchStateWithRefresh<T>State for data fetching with refresh capability |
HookContext | interface | HookContextHook context with full twilight context merged in. Use this type for hook handlers to get proper DX. |
HookDefinition | interface | HookDefinitionHook definition with handler and priority. |
HookSlotProps | interface | HookSlotProps |
PageConfigData | interface | PageConfigDataPage config data structure for salla.config.set('page', ...) |
ToggleActions | interface | ToggleActionsToggle actions without parameters (e.g., blog like) |
ToggleActionsWithItem | interface | ToggleActionsWithItem<T>Toggle actions with item parameter (e.g., wishlist item) |
UseApply | interface | UseApply<T>Hook return for apply/remove operations (coupon) |
UseAssetResult | interface | UseAssetResultUseAssetResult - Return type for useAsset hook |
UseCommentsResult | interface | UseCommentsResultUseCommentsResult - Return type for useComments hook |
UseDateResult | interface | UseDateResult |
UseGtmResult | interface | UseGtmResult |
UseMoneyResult | interface | UseMoneyResultUseMoneyResult - Return type for useMoney hook |
UseNumberResult | interface | UseNumberResultUseNumberResult - Return type for useNumber hook |
UseOpeningHoursResult | interface | UseOpeningHoursResult |
UseProductOptions | interface | UseProductOptions |
UseProductResult | interface | UseProductResultUseProductResult - Return type for useProduct hook |
UseStoreResult | interface | UseStoreResultUseStoreResult - Return type for useStore hook |
UseThemeResult | interface | UseThemeResultUseThemeResult - Return type for useTheme hook |
UseToggle | interface | UseToggleHook return for simple toggle operations (blog like) |
UseToggleWithItems | interface | UseToggleWithItems<T>Hook return for toggle operations with item (wishlist, etc.) |
AsyncAction | type | AsyncActionStandard async action that returns success boolean |
AsyncActionWithParam | type | AsyncActionWithParam<T>Standard async action with parameter |
AsyncFnReturn | type | AsyncFnReturn<T>AsyncFnReturn - Return type for useAsyncFn hook |
AsyncFnState | type | AsyncState<T>AsyncState - State type for async operations |
HookHandler | type | HookHandler<T>Hook handler function type. |
HookHandlers | type | HookHandlersHook handlers map for bulk registration. |
UseBlogLikeResult | type | UseToggleUseBlogLikeResult - Return type for useBlogLike hook |
UseCouponResult | type | UseCouponResultUseCouponResult - Return type for useCoupon hook |
UseWishlistResult | type | UseWishlistResult |
@salla.sa/twilight-theme-engine/hooks/useAsyncFn
3| Export | Kind | Signature and summary |
|---|---|---|
useAsyncFn | hook | <T extends FunctionReturningPromise>(fn: T, deps?: DependencyList, initialState?: StateFromFunctionReturningPromise<T>): AsyncFnReturn<T>useAsyncFn - Hook for managing async operations with loading/error states |
AsyncFnReturn | type | AsyncFnReturn<T>AsyncFnReturn - Return type for useAsyncFn hook |
AsyncState | type | AsyncState<T>AsyncState - State type for async operations |
@salla.sa/twilight-theme-engine/hooks/useUser
2| Export | Kind | Signature and summary |
|---|---|---|
useUser | hook | (): UseUserReturn |
UseUserReturn | type | UseUserReturn |
@salla.sa/twilight-theme-engine/hooks/useStore
2| Export | Kind | Signature and summary |
|---|---|---|
useStore | hook | (): UseStoreResultuseStore - Hook for accessing and managing store state |
UseStoreResult | interface | UseStoreResultUseStoreResult - Return type for useStore hook |
@salla.sa/twilight-theme-engine/hooks/useTheme
2| Export | Kind | Signature and summary |
|---|---|---|
useTheme | hook | (): UseThemeResultuseTheme - Hook for accessing theme configuration |
UseThemeResult | interface | UseThemeResultUseThemeResult - Return type for useTheme hook |
@salla.sa/twilight-theme-engine/hooks/useMoney
2| Export | Kind | Signature and summary |
|---|---|---|
useMoney | hook | (): UseMoneyResultuseMoney - Hook for formatting monetary values |
UseMoneyResult | interface | UseMoneyResultUseMoneyResult - Return type for useMoney hook |
@salla.sa/twilight-theme-engine/hooks/useAsset
2| Export | Kind | Signature and summary |
|---|---|---|
useAsset | hook | (): UseAssetResultuseAsset - Hook for generating asset and CDN URLs |
UseAssetResult | interface | UseAssetResultUseAssetResult - Return type for useAsset hook |
@salla.sa/twilight-theme-engine/hooks/useProduct
3| Export | Kind | Signature and summary |
|---|---|---|
useProduct | hook | (initialProduct: Product, options?: UseProductOptions): UseProductResultuseProduct - Hook for managing product state with live updates |
UseProductOptions | interface | UseProductOptions |
UseProductResult | interface | UseProductResultUseProductResult - Return type for useProduct hook |
@salla.sa/twilight-theme-engine/hooks/useDocumentClass
1| Export | Kind | Signature and summary |
|---|---|---|
useDocumentClass | hook | (descriptor: DocumentElementDescriptor): voiduseDocumentClass - Hook for managing HTML and body element attributes |
@salla.sa/twilight-theme-engine/hooks/useCoupon
2| Export | Kind | Signature and summary |
|---|---|---|
useCoupon | hook | (): UseCouponResultuseCoupon - Hook for managing cart coupons |
UseCouponResult | type | UseCouponResultUseCouponResult - Return type for useCoupon hook |
@salla.sa/twilight-theme-engine/hooks/useWishlist
3| Export | Kind | Signature and summary |
|---|---|---|
useWishlist | hook | (): UseWishlistResult |
resetWishlistStore | function | (): void |
UseWishlistResult | type | UseWishlistResult |
@salla.sa/twilight-theme-engine/hooks/useBlogLike
2| Export | Kind | Signature and summary |
|---|---|---|
useBlogLike | hook | (blogId: number, initialCount?: number): UseBlogLikeResult |
UseBlogLikeResult | type | UseToggleUseBlogLikeResult - Return type for useBlogLike hook |
@salla.sa/twilight-theme-engine/hooks/useComments
2| Export | Kind | Signature and summary |
|---|---|---|
useComments | hook | (): UseCommentsResultuseComments - Hook for managing salla-comments web component re-renders |
UseCommentsResult | interface | UseCommentsResultUseCommentsResult - Return type for useComments hook |
@salla.sa/twilight-theme-engine/hooks/HookRegistry
3| Export | Kind | Signature and summary |
|---|---|---|
defineHooks | function | (hooks: HookHandlers): void |
HookRegistry | class | HookRegistryHookRegistry - Manages hook handlers for the extension system |
hookRegistry | object | HookRegistry |
@salla.sa/twilight-theme-engine/hooks/HookSlot
3| Export | Kind | Signature and summary |
|---|---|---|
HookSlot | component | ({ name, context, fallback, ssr, }: HookSlotProps): React.JSX.Element | null |
HookContext | interface | HookContextHook context with full twilight context merged in. Use this type for hook handlers to get proper DX. |
HookSlotProps | interface | HookSlotProps |
@salla.sa/twilight-theme-engine/hooks/useHook
1| Export | Kind | Signature and summary |
|---|---|---|
useHook | hook | <T = Record<string, unknown>>(name: string, handler: HookHandler<T>, priority?: number): voiduseHook - Registers a hook handler in the hook registry |
@salla.sa/twilight-theme-engine/hooks/useGtm
2| Export | Kind | Signature and summary |
|---|---|---|
useGtm | hook | (): UseGtmResultuseGtm - Google Tag Manager hook for tracking events |
UseGtmResult | interface | UseGtmResult |
@salla.sa/twilight-theme-engine/contexts
10| Export | Kind | Signature and summary |
|---|---|---|
CartContext | component | (props: React.ProviderProps<CartContextValue | null>): React.ReactNode |
CartContextProvider | component | ({ children, value, }: CartContextProviderProps): React.ReactElement |
ProductContext | component | (props: React.ProviderProps<ProductContextValue | null>): React.ReactNode |
ProductContextProvider | component | ({ children, value, }: ProductContextProviderProps): React.ReactElement |
useCartContext | hook | (): CartContextValue | null |
useProductContext | hook | (): ProductContextValue | null |
CartContextProviderProps | interface | CartContextProviderProps |
CartContextValue | interface | CartContextValueCartContext - Provides cart data to hooks with `cart:*` prefix |
ProductContextProviderProps | interface | ProductContextProviderProps |
ProductContextValue | interface | ProductContextValueProductContext - Provides product data to hooks with `product:*` prefix |
@salla.sa/twilight-theme-engine/utils
41| Export | Kind | Signature and summary |
|---|---|---|
applyAppScopeMocks | function | (appScopeId: string, mocks: AppConfigBag): booleanOverlay 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. |
asset | function | (path: string): stringGenerate asset URL for local files |
buildBaseHead | function | (settings: StoreContext | null | undefined, locale?: string, path?: string): HeadDescriptorBuilds 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. |
buildHreflangAlternates | function | (settings: StoreContext | null | undefined, path?: string): HeadDescriptor['alternateLanguages']Builds hreflang alternate links for multilingual SEO. |
cdn | function | (url: string | null | undefined, width?: number, height?: number): stringGenerate a CDN URL with optional image optimization |
clearAuthTokenCookie | function | (): voidDeletes 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-… |
color | function | (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 |
dispatchRouteChanged | function | (): voidDispatch the `route::changed` Salla SDK event with the current page config. |
extractTokenFromCookies | function | (cookieHeader: string | null, cookieName: string): string | null |
formatSallaPlural | function | (template: unknown, count: number): stringResolve a Salla / Laravel-style pluralized translation for a given count. |
getMobileOS | function | (): MobileOSDetects the current mobile OS from the User-Agent. Returns `'other'` on the server (no `navigator`) and on desktop/unknown agents. |
getSallaSDK | function | (): typeof window.salla | undefinedGet Salla SDK instance if available |
getStoreIdentifier | function | (explicit?: string): stringWhich store to ask the API about — see {@link resolveStoreIdentifier }. |
isPlaceholder | function | (url: string | null | undefined): booleanCheck if a URL is the placeholder image |
localeToOgLocale | function | (locale: string): stringConverts an ISO-639-1 locale string to the og:locale format (e.g. `ar` → `ar_AR`). |
mergeDocumentDescriptors | function | (...descriptors: DocumentElementDescriptor[]): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }Merge multiple `DocumentElementDescriptor`s into React-ready props. |
mergeElementAttrs | function | (descriptors: DocumentElementAttrs[]): Record<string, string>Merge an ordered array of `DocumentElementAttrs` into a flat `Record<string, string>`. |
mergeHead | function | (base: HeadDescriptor, extension: Partial<HeadDescriptor>): HeadDescriptor |
normalizeClasses | function | (input: string | string[] | undefined): string[] |
registerThemeHookSlots | function | (...names: string[]): voidDeclare hook slots the theme renders itself so apps may mount into them. |
resolveAppStoreUrl | function | (apps?: StoreApps, os?: MobileOS): string | undefinedPicks 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 |
resolveHead | function | (descriptor: HeadDescriptor): HeadResult |
setHeadAdapter | function | (adapter: HeadAdapter): void |
sortOptions | function | (currentSort: string, t: TranslateFn): { id: string; name: string; is_selected: boolean; }[] |
stripUnsafeHtml | function | (html: string): string |
syncAttrsToElement | function | (element: Element, next: Record<string, string>): voidApply 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. |
toReactProps | function | (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_NAME | constant | 'token' |
AppScopeContexts | interface | AppScopeContextsOne public `app.*` bucket per app, keyed by appScopeId. Everything else is read from the real `salla.config` at runtime. |
DocumentElementAttrs | interface | DocumentElementAttrsAttributes to apply to a single HTML element (`<body>` or `<html>`). |
DocumentElementDescriptor | interface | DocumentElementDescriptorDescriptor that a route or component passes to `useDocumentClass`. Each field maps to the corresponding HTML element. |
HeadDescriptor | interface | HeadDescriptor |
LinkDescriptor | interface | LinkDescriptorTyped `<link>` descriptor — covers SEO, preload, prefetch, and resource hints. |
OpenGraphImage | interface | OpenGraphImage |
ScriptDescriptor | interface | ScriptDescriptorTyped `<script>` descriptor — for injecting scripts into the document head. |
StoreContext | interface | StoreContextCentral settings context - single source of truth for all API data. Contains everything from the settings endpoint response after processing. |
StyleDescriptor | interface | StyleDescriptorTyped `<style>` descriptor — for injecting inline CSS into the document head. |
AppConfigBag | type | AppConfigBagOne app's private `app.*` bag, keyed without the `app.` prefix (`app.color` → `color`). |
HeadResult | type | HeadResult |
MobileOS | type | MobileOSThe visitor's mobile operating system, or `'other'` (desktop/unknown/server). |
RouteChangedEvent | type | PageContextPayload dispatched via `salla.event.dispatch('route::changed', payload)` after each client-side navigation completes. |
@salla.sa/twilight-theme-engine/utils/baseHead
3| Export | Kind | Signature and summary |
|---|---|---|
buildBaseHead | function | (settings: StoreContext | null | undefined, locale?: string, path?: string): HeadDescriptorBuilds 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. |
buildHreflangAlternates | function | (settings: StoreContext | null | undefined, path?: string): HeadDescriptor['alternateLanguages']Builds hreflang alternate links for multilingual SEO. |
localeToOgLocale | function | (locale: string): stringConverts 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| Export | Kind | Signature and summary |
|---|---|---|
getCdnImageSrcSet | function | (url: string | undefined, widths: readonly number[], options?: Omit<CdnImageOptions, 'width' | 'height'>): string | undefined |
getCdnImageUrl | function | (url: string | undefined, options?: CdnImageOptions): string | undefined |
CdnImageOptions | interface | CdnImageOptions |
@salla.sa/twilight-theme-engine/utils/head
9| Export | Kind | Signature and summary |
|---|---|---|
mergeHead | function | (base: HeadDescriptor, extension: Partial<HeadDescriptor>): HeadDescriptor |
resolveHead | function | (descriptor: HeadDescriptor): HeadResult |
setHeadAdapter | function | (adapter: HeadAdapter): void |
HeadDescriptor | interface | HeadDescriptor |
LinkDescriptor | interface | LinkDescriptorTyped `<link>` descriptor — covers SEO, preload, prefetch, and resource hints. |
OpenGraphImage | interface | OpenGraphImage |
ScriptDescriptor | interface | ScriptDescriptorTyped `<script>` descriptor — for injecting scripts into the document head. |
StyleDescriptor | interface | StyleDescriptorTyped `<style>` descriptor — for injecting inline CSS into the document head. |
HeadResult | type | HeadResult |
@salla.sa/twilight-theme-engine/types
65| Export | Kind | Signature and summary |
|---|---|---|
HookName | enum | HookNamePredefined hook names for type-safe hook registration. |
AffiliateConfig | interface | AffiliateConfig |
BootData | interface | BootData |
Brand | interface | Brand |
Breadcrumb | interface | Breadcrumb |
Cart | interface | Cart |
CartItem | interface | CartItem |
CartItemAttachment | interface | CartItemAttachment |
CartItemOffer | interface | CartItemOffer |
CartItemOption | interface | CartItemOption |
CartOption | interface | CartOption |
Category | interface | Category |
ComponentDefinition | interface | ComponentDefinition |
CurrencyConfig | interface | CurrencyConfig |
ExternalServices | interface | ExternalServices |
Feature | interface | Feature |
FreeShippingBar | interface | FreeShippingBar |
HomeComponent | interface | HomeComponent |
HomeComponentConfig | interface | HomeComponentConfig |
HomeComponentData | interface | HomeComponentDataHome component data from Salla API Used by HomePage to render dynamic components |
HookDefinition | interface | HookDefinitionHook definition with handler and priority. |
JitsuConfig | interface | JitsuConfig |
Language | interface | Language |
LanguageConfig | interface | LanguageConfig |
LayoutProps | interface | LayoutProps |
LoginConfig | interface | LoginConfig |
MenuItem | interface | MenuItemMenu item structure from Salla API |
Money | interface | Money |
NotifyAvailability | interface | NotifyAvailability |
OpeningHoursSettings | interface | OpeningHoursSettingsOpening hours settings for receiving orders. Uses the Spatie\OpeningHours format (day names as keys). TODO: add to API response |
Page | interface | Page |
Product | interface | Product |
ProductBrand | interface | ProductBrand |
ProductCategory | interface | ProductCategory |
ProductDonation | interface | ProductDonation |
ProductImage | interface | ProductImage |
ProductOption | interface | ProductOption |
ProductOptionDetail | interface | ProductOptionDetail |
ProductOptionValue | interface | ProductOptionValue |
ProductRating | interface | ProductRating |
ProductSku | interface | ProductSkuVariant rows from `products/{id}/details?with[]=skus`. |
ProductTag | interface | ProductTag |
ResponseHeaders | interface | ResponseHeaders |
Slider | interface | Slider |
Store | interface | Store |
StoreApps | interface | StoreAppsMobile app download URLs for the store |
StoreContacts | interface | StoreContacts |
StoreScope | interface | StoreScope |
StoreSettings | interface | StoreSettings |
StoreSocial | interface | StoreSocial |
Testimonial | interface | Testimonial |
Theme | interface | Theme |
ThemeColor | interface | ThemeColor |
ThemeFont | interface | ThemeFont |
ThemeSettings | interface | ThemeSettings |
TranslationMap | interface | TranslationMap |
User | interface | User |
UserPreferences | interface | UserPreferences |
UserSocialAccount | interface | UserSocialAccount |
ComponentType | type | ComponentType<P> |
HookHandler | type | HookHandler<T>Hook handler function type. |
HookHandlers | type | HookHandlersHook handlers map for bulk registration. |
JsonObject | type | JsonObjectUtility 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. |
ProductStatus | type | ProductStatus |
ProductType | type | ProductType |
@salla.sa/twilight-theme-engine/types/hooks
4| Export | Kind | Signature and summary |
|---|---|---|
HookName | enum | HookNamePredefined hook names for type-safe hook registration. |
HookDefinition | interface | HookDefinitionHook definition with handler and priority. |
HookHandler | type | HookHandler<T>Hook handler function type. |
HookHandlers | type | HookHandlersHook handlers map for bulk registration. |
@salla.sa/twilight-theme-engine/eslint
1| Export | Kind | Signature and summary |
|---|---|---|
twilightEslintConfig | object | EslintConfig[] |
@salla.sa/twilight-theme-engine/vite
19| Export | Kind | Signature and summary |
|---|---|---|
bestPracticesPlugin | function | (options?: BestPracticesOptions): Plugin |
describeThemeTypeIssue | function | (raw: unknown, fileLabel?: string): string | nullDev-time diagnostic for the `type` field, or `null` when it is correct. |
getFrameworkAdapter | function | (framework: Framework): FrameworkAdapterGet framework adapter by name |
getThemeType | function | (raw: unknown): string | undefinedRead the declared theme type, tolerating any hand-edited shape. |
isReactThemeManifest | function | (raw: unknown): booleanWhether a parsed manifest declares itself a React/SSR theme. |
twilightReact | function | (options?: TwilightReactOptions): Promise<PluginOption[]>Main Twilight Vite plugin. |
nextjs | object | FrameworkAdapterNext.js framework adapter (placeholder for future implementation) |
tanstack | object | FrameworkAdapter |
REACT_THEME_TYPE | constant | 'react'Value of `twilight.json`'s `type` for a React/SSR theme. |
BestPracticesOptions | interface | BestPracticesOptions |
FrameworkAdapter | interface | FrameworkAdapterFramework adapter interface for extensibility |
NextJsRouterOptions | interface | NextJsRouterOptionsOptions for Next.js router configuration (for future support) |
ReactPluginOptions | interface | ReactPluginOptionsOptions for React plugin configuration |
TanStackRouterOptions | interface | TanStackRouterOptionsOptions for TanStack Router plugin configuration |
TwilightManifest | interface | TwilightManifestThe top-level shape of `twilight.json` that the engine cares about. |
TwilightReactOptions | interface | TwilightReactOptions |
TwilightRoute | interface | TwilightRoute |
Framework | type | FrameworkSupported frameworks for twilightReact plugin |
RouterOptions | type | RouterOptionsRouter configuration based on framework |
@salla.sa/twilight-theme-engine/dev
7| Export | Kind | Signature and summary |
|---|---|---|
DevSettingsWidget | component | ({ schema }: DevSettingsWidgetProps): ReactElement | null |
DevSchema | interface | DevSchema |
DevSchemaComponent | interface | DevSchemaComponent |
DevSchemaField | interface | DevSchemaField |
DevSchemaOption | interface | DevSchemaOption |
DevSettingsWidgetProps | interface | DevSettingsWidgetProps |
DevFieldKind | type | DevFieldKindHow a single setting/field is rendered in the dev widget. |
@salla.sa/twilight-theme-engine/routes
67| Export | Kind | Signature and summary |
|---|---|---|
getLanguageInfo | function | (locale: string): { readonly code: string; readonly name: string; readonly dir: 'rtl' | 'ltr'; } |
isLocale | function | (value?: string): value is Locale |
slugBrandRedirectLoader | function | (ctx: { params: SlugBrandParams; }): Promise<never> |
FALLBACK_LOCALE | constant | 'ar'Pure locale constants and helpers — no virtual modules, safe to import from Vite config context (e.g. vite plugins, head adapters). |
SUPPORTED_LOCALES | constant | readonly ['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'] |
ArticleDetail | interface | ArticleDetail |
ArticleMeta | interface | ArticleMeta |
ArticleStats | interface | ArticleStats |
ArticleSummary | interface | ArticleSummary |
BlogAuthorLoaderData | interface | BlogAuthorLoaderData |
BlogAuthorType | interface | BlogAuthor |
BlogCategoryLoaderData | interface | BlogCategoryLoaderData |
BlogCategoryType | interface | BlogCategory |
BlogPageProps | interface | BlogPageProps |
BlogSinglePageProps | interface | BlogSinglePageProps |
BlogTagLoaderData | interface | BlogTagLoaderData |
BlogTagType | interface | BlogTag |
Brand | interface | Brand |
BrandsGroup | interface | BrandsGroup |
BrandsPageProps | interface | BrandsPageProps |
CartPageProps | interface | CartPageProps |
CategoryMeta | interface | CategoryMeta |
CategoryPageProps | interface | CategoryPagePropsProps for Category/Collection Page component |
HeadDescriptor | interface | HeadDescriptor |
HomeLoaderData | interface | HomeLoaderData |
HomePageProps | interface | HomePagePropsProps for HomePage component |
IdParams | interface | IdParams |
LoaderContext | interface | LoaderContext |
LoyaltyPageProps | interface | LoyaltyPageProps |
LoyaltyPoint | interface | LoyaltyPoint |
LoyaltyPrize | interface | LoyaltyPrize |
LoyaltyPrizeItem | interface | LoyaltyPrizeItem |
NotFoundPageProps | interface | NotFoundPageProps |
NotificationsPageProps | interface | NotificationsPageProps |
Order | interface | Order |
OrderItem | interface | OrderItem |
OrderListItem | interface | OrderListItem |
OrderSinglePageProps | interface | OrderSinglePageProps |
OrdersPageProps | interface | OrdersPageProps |
OrdersQuery | interface | OrdersQueryURL query parameters for orders page |
PageQuery | interface | PageQuery |
PageSingleProps | interface | PageSingleProps |
ProductListLoaderContext | interface | ProductListLoaderContext |
ProductListLoaderData | interface | ProductListLoaderDataUnified loader data for all product listing pages |
ProductListLoaderParams | interface | ProductListLoaderParams |
ProductListPageMeta | interface | ProductListPageMetaStatic page metadata |
ProductListQuery | interface | ProductListQueryURL query parameters — no page field, product list uses cursor-based pagination |
ProductListSourceConfig | interface | ProductListSourceConfigSource configuration |
ProductListTag | interface | ProductListTagTag entity - products can be filtered by tags |
ProductPageProps | interface | ProductPageProps |
ProfilePageProps | interface | ProfilePageProps |
RouteModule | interface | RouteModule<TData, TParams, TProps> |
RoutePagination | interface | RoutePagination |
SlugBrandParams | interface | SlugBrandParams |
SlugIdParams | interface | SlugIdParams |
StaticPage | interface | StaticPage |
TestimonialsPageProps | interface | TestimonialsPageProps |
ThankYouLoaderParams | interface | ThankYouLoaderParams |
ThankYouPageProps | interface | ThankYouPageProps |
WalletPageProps | interface | WalletPageProps |
WishlistPageProps | interface | WishlistPageProps |
AnyHomeComponent | type | AnyHomeComponent |
HomeComponentsProps | type | HomeComponentsProps |
Locale | type | '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' |
OrdersSearchParams | type | OrdersQueryURL search params for orders routes - aliases OrdersQuery |
ProductListEntity | type | ProductListEntityEntity union type for source metadata |
ProductListSource | type | ProductListSourceUnified source type matching API sources directly |
@salla.sa/twilight-theme-engine/routes/home
11| Export | Kind | Signature and summary |
|---|---|---|
HomeSkeleton | component | (props: unknown): ReactNode |
homeLoader | function | (ctx?: { locale?: string; }): Promise<HomeLoaderData> |
registerHomeComponentConfig | function | (config: Record<string, HomeComponentConfig>): voidRegister 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. |
registerHomeComponents | function | (components?: Record<string, AnyHomeComponent | null>, prefix?: string): void |
DefaultHomeComponents | object | Record<string, AnyHomeComponent | null> |
Home | object | { readonly id: 'index'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: MemoExoticComponent<({ components }: HomePageProps) => JSX.Element>; } |
HomeLoaderData | interface | HomeLoaderData |
HomePageProps | interface | HomePagePropsProps for HomePage component |
AnyHomeComponent | type | AnyHomeComponent |
HomeComponentConfig | type | HomeComponentConfigRender-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. |
HomeComponentsProps | type | HomeComponentsProps |
@salla.sa/twilight-theme-engine/routes/cart
4| Export | Kind | Signature and summary |
|---|---|---|
CartPage | component | (props: CartPageProps): JSX.Element |
cartLoader | function | (): CartPagePropsSSR-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). |
Cart | object | { readonly id: 'cart'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: typeof CartPage; } |
CartPageProps | interface | CartPageProps |
@salla.sa/twilight-theme-engine/routes/product
3| Export | Kind | Signature and summary |
|---|---|---|
productLoader | function | ({ params }: { params: IdParams; }): Promise<ProductPageProps> |
Product | object | { readonly id: 'product.single'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: typeof ProductPage; } |
ProductPageProps | interface | ProductPageProps |
@salla.sa/twilight-theme-engine/routes/product-listing
17| Export | Kind | Signature and summary |
|---|---|---|
ProductListPage | component | ({ page, source, query, products, pagination, filters, }: ProductListLoaderData): JSX.ElementProduct List Page - Unified component for all product listing pages |
useAppliedFilters | hook | (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. |
head | function | (ctx: TwilightContext, data: ProductListLoaderData): HeadDescriptor |
parseFiltersFromSearch | function | (search: string): ProductListFilters | nullReads 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. |
productListLoader | function | (ctx: ProductListLoaderContext): Promise<ProductListLoaderData> |
ProductListing | object | { readonly id: 'product.index'; readonly loader: typeof productListLoader; readonly head: typeof head; readonly Component: typeof ProductListPage; } |
CategoryPageProps | interface | CategoryPagePropsProps for Category/Collection Page component |
ProductListLoaderContext | interface | ProductListLoaderContext |
ProductListLoaderData | interface | ProductListLoaderDataUnified loader data for all product listing pages |
ProductListLoaderParams | interface | ProductListLoaderParams |
ProductListPageMeta | interface | ProductListPageMetaStatic page metadata |
ProductListQuery | interface | ProductListQueryURL query parameters — no page field, product list uses cursor-based pagination |
ProductListSourceConfig | interface | ProductListSourceConfigSource configuration |
ProductListTag | interface | ProductListTagTag entity - products can be filtered by tags |
AppliedFiltersStatus | type | AppliedFiltersStatus |
ProductListEntity | type | ProductListEntityEntity union type for source metadata |
ProductListSource | type | ProductListSourceUnified source type matching API sources directly |
@salla.sa/twilight-theme-engine/routes/blog
28| Export | Kind | Signature and summary |
|---|---|---|
BlogAuthorPage | component | (props: BlogAuthorLoaderData): ReactNode |
BlogCategoryPage | component | (props: BlogCategoryLoaderData): ReactNode |
BlogPage | component | (props: BlogPageProps): ReactNode |
BlogSinglePage | component | (props: BlogSinglePageProps): ReactNode |
BlogTagPage | component | (props: BlogTagLoaderData): ReactNode |
blogAuthorLoader | function | ({ params, }: { params: IdParams; }): Promise<BlogAuthorLoaderData> |
blogCategoryLoader | function | ({ params, }: { params: SlugIdParams; }): Promise<BlogCategoryLoaderData> |
blogLoader | function | (): Promise<BlogPageProps> |
blogSingleLoader | function | ({ params, }: { params: SlugIdParams; }): Promise<BlogSinglePageProps> |
blogTagLoader | function | ({ params, }: { params: SlugIdParams; }): Promise<BlogTagLoaderData> |
Blog | object | { readonly id: 'blog.index'; readonly loader: typeof blogLoaderWithExtend; readonly head: typeof blogHead; readonly Component: LazyExoticComponent<typeof BlogPage>; } |
BlogAuthorRoute | object | { readonly id: 'blog.index.author'; readonly loader: typeof blogAuthorLoaderWithExtend; readonly head: typeof blogAuthorHead; readonly Component: LazyExoticComponent<typeof BlogAuthorPage>; } |
BlogCategoryRoute | object | { readonly id: 'blog.index.category'; readonly loader: typeof blogCategoryLoaderWithExtend; readonly head: typeof blogCategoryHead; readonly Component: LazyExoticComponent<typeof BlogCategoryPage>; } |
BlogSingle | object | { readonly id: 'blog.single'; readonly loader: typeof blogSingleLoaderWithExtend; readonly head: typeof blogSingleHead; readonly Component: LazyExoticComponent<typeof BlogSinglePage>; } |
BlogTagRoute | object | { readonly id: 'blog.index.tag'; readonly loader: typeof blogTagLoaderWithExtend; readonly head: typeof blogTagHead; readonly Component: LazyExoticComponent<typeof BlogTagPage>; } |
ArticleDetail | interface | ArticleDetail |
ArticleMeta | interface | ArticleMeta |
ArticleStats | interface | ArticleStats |
ArticleSummary | interface | ArticleSummary |
BlogAuthorLoaderData | interface | BlogAuthorLoaderData |
BlogAuthorType | interface | BlogAuthor |
BlogCategoryLoaderData | interface | BlogCategoryLoaderData |
BlogCategoryType | interface | BlogCategory |
BlogPageProps | interface | BlogPageProps |
BlogSinglePageProps | interface | BlogSinglePageProps |
BlogTagLoaderData | interface | BlogTagLoaderData |
BlogTagType | interface | BlogTag |
CategoryMeta | interface | CategoryMeta |
@salla.sa/twilight-theme-engine/routes/brands
6| Export | Kind | Signature and summary |
|---|---|---|
BrandsPage | component | (props: BrandsPageProps): ReactNode |
brandsLoader | function | (): Promise<BrandsPageProps> |
Brands | object | { readonly id: 'brands.index'; readonly loader: typeof brandsLoaderWithExtend; readonly head: typeof brandsHead; readonly Component: LazyExoticComponent<MemoExoticComponent<({ page, brands }: BrandsPageProps) => JSX.Element>>; } |
Brand | interface | Brand |
BrandsGroup | interface | BrandsGroup |
BrandsPageProps | interface | BrandsPageProps |
@salla.sa/twilight-theme-engine/routes/account
34| Export | Kind | Signature and summary |
|---|---|---|
NotificationsPage | component | (props: NotificationsPageProps): ReactNode |
OrderSinglePage | component | (props: OrderSinglePageProps): ReactNode |
OrdersPage | component | (props: OrdersPageProps): ReactNode |
ProfilePage | component | (props: ProfilePageProps): ReactNode |
SettingsPage | component | (props: SettingsPageProps): ReactNode |
WalletPage | component | (props: WalletPageProps): ReactNode |
WishlistPage | component | (props: WishlistPageProps): ReactNode |
notificationsLoader | function | (_ctx: { locale: string; }): Promise<NotificationsPageProps> |
orderSingleLoader | function | ({ params, }: { params: IdParams; }): Promise<OrderSinglePageProps> |
ordersLoader | function | (ctx: { query?: OrdersQuery; with_items?: boolean | number; }, extend?: (data: OrdersPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>): Promise<OrdersPageProps> |
profileLoader | function | (_ctx: { locale: string; }): Promise<ProfilePageProps> |
settingsLoader | function | (_ctx: { locale: string; }): Promise<SettingsPageProps> |
walletLoader | function | (ctx: LoaderContext): Promise<WalletPageProps> |
wishlistLoader | function | (ctx: LoaderContext): Promise<WishlistPageProps> |
Notifications | object | { 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… |
Orders | object | { readonly id: 'customer.orders.index'; readonly loader: typeof ordersLoaderWithExtend; readonly head: typeof ordersHead; readonly Component: LazyExoticComponent<typeof OrdersPage>; } |
OrderSingle | object | { readonly id: 'customer.orders.single'; readonly loader: typeof orderSingleLoaderWithExtend; readonly head: typeof orderSingleHead; readonly Component: LazyExoticComponent<typeof OrderSinglePage>; } |
Profile | object | { 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… |
Settings | object | { 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… |
Wallet | object | { 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… |
Wishlist | object | { 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… |
Notification | interface | Notification |
NotificationsPageProps | interface | NotificationsPageProps |
Order | interface | Order |
OrderItem | interface | OrderItem |
OrderListItem | interface | OrderListItem |
OrderSinglePageProps | interface | OrderSinglePageProps |
OrdersPageProps | interface | OrdersPageProps |
OrdersQuery | interface | OrdersQueryURL query parameters for orders page |
ProfilePageProps | interface | ProfilePageProps |
SettingsPageProps | interface | SettingsPageProps |
WalletPageProps | interface | WalletPageProps |
WishlistPageProps | interface | WishlistPageProps |
OrdersSearchParams | type | OrdersQueryURL search params for orders routes - aliases OrdersQuery |
@salla.sa/twilight-theme-engine/routes/account/orders
10| Export | Kind | Signature and summary |
|---|---|---|
OrderSinglePage | component | (props: OrderSinglePageProps): ReactNode |
OrdersPage | component | (props: OrdersPageProps): ReactNode |
orderSingleLoader | function | ({ params, }: { params: IdParams; }): Promise<OrderSinglePageProps> |
ordersLoader | function | (ctx: { query?: OrdersQuery; with_items?: boolean | number; }, extend?: (data: OrdersPageProps, ctx: { params: Record<string, never>; }) => Promise<Record<string, unknown>> | Record<string, unknown>): Promise<OrdersPageProps> |
Orders | object | { readonly id: 'customer.orders.index'; readonly loader: typeof ordersLoaderWithExtend; readonly head: typeof ordersHead; readonly Component: LazyExoticComponent<typeof OrdersPage>; } |
OrderSingle | object | { readonly id: 'customer.orders.single'; readonly loader: typeof orderSingleLoaderWithExtend; readonly head: typeof orderSingleHead; readonly Component: LazyExoticComponent<typeof OrderSinglePage>; } |
OrderSinglePageProps | interface | OrderSinglePageProps |
OrdersPageProps | interface | OrdersPageProps |
OrdersQuery | interface | OrdersQueryURL query parameters for orders page |
OrdersSearchParams | type | OrdersQueryURL search params for orders routes - aliases OrdersQuery |
@salla.sa/twilight-theme-engine/routes/loyalty
7| Export | Kind | Signature and summary |
|---|---|---|
LoyaltyPage | component | (props: LoyaltyPageProps): ReactNode |
loyaltyLoader | function | (): Promise<LoyaltyPageProps> |
Loyalty | object | { readonly id: 'loyalty'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof LoyaltyPage>; } |
LoyaltyPageProps | interface | LoyaltyPageProps |
LoyaltyPoint | interface | LoyaltyPoint |
LoyaltyPrize | interface | LoyaltyPrize |
LoyaltyPrizeItem | interface | LoyaltyPrizeItem |
@salla.sa/twilight-theme-engine/routes/page
5| Export | Kind | Signature and summary |
|---|---|---|
PageSingleLazy | component | (props: PageSingleProps): ReactNode |
pageSingleLoader | function | ({ params }: { params: IdParams; }): Promise<PageSingleProps> |
PageSingle | object | { readonly id: 'page-single'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof PageSingle>; } |
PageSingleProps | interface | PageSingleProps |
StaticPage | interface | StaticPage |
@salla.sa/twilight-theme-engine/routes/testimonials
4| Export | Kind | Signature and summary |
|---|---|---|
TestimonialsPage | component | (props: TestimonialsPageProps): ReactNode |
testimonialsLoader | function | (_ctx: { locale: string; }): Promise<TestimonialsPageProps> |
Testimonials | object | { readonly id: 'testimonials'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof TestimonialsPage>; } |
TestimonialsPageProps | interface | TestimonialsPageProps |
@salla.sa/twilight-theme-engine/routes/thank-you
5| Export | Kind | Signature and summary |
|---|---|---|
ThankYouPage | component | (props: ThankYouPageProps): ReactNode |
thankYouLoader | function | ({ params, }: { params: ThankYouLoaderParams; }): Promise<ThankYouPageProps> |
ThankYou | object | { readonly id: 'thank-you'; readonly loader: typeof loader; readonly head: typeof head; readonly Component: LazyExoticComponent<typeof ThankYouPage>; } |
ThankYouLoaderParams | interface | ThankYouLoaderParams |
ThankYouPageProps | interface | ThankYouPageProps |
@salla.sa/twilight-theme-engine/routes/seo-redirects
4| Export | Kind | Signature and summary |
|---|---|---|
pendingOrdersRedirectLoader | function | (ctx?: { params: PendingOrdersRedirectParams; }): Promise<never> |
slugBrandRedirectLoader | function | (ctx: { params: SlugBrandParams; }): Promise<never> |
PendingOrdersRedirectParams | interface | PendingOrdersRedirectParams |
SlugBrandParams | interface | SlugBrandParams |
@salla.sa/twilight-theme-engine/skeleton
12| Export | Kind | Signature and summary |
|---|---|---|
BlogSkeleton | component | (props: object): ReactNode |
BreadcrumbSkeleton | component | ({ className }?: SkeletonProps): React.JSX.Element |
CartSkeleton | component | (props: object): ReactNode |
CustomerLayoutSkeleton | component | (props: object): ReactNode |
CustomerPageSkeleton | component | (props: object): ReactNode |
HomeSkeleton | component | (props: unknown): ReactNode |
PageSkeleton | component | (props: PageSkeletonProps): ReactNode |
ProductCardSkeleton | component | ({ className }?: SkeletonProps): React.JSX.Element |
ProductDetailSkeleton | component | (props: object): ReactNode |
ProductGridSkeleton | component | (props?: SkeletonProps & { count?: number; }): React.JSX.Element |
SkeletonPulse | component | (props: { className?: string; circle?: boolean; style?: React.CSSProperties; }): ReactNode |
PageSkeletonProps | interface | PageSkeletonProps |
@salla.sa/twilight-theme-engine/tanstack
19| Export | Kind | Signature and summary |
|---|---|---|
TanStackLinkAdapter | component | (props: Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>): ReactNodeTanStack Router Link adapter. Translates framework-agnostic props to TanStack Router Link props. |
TanStackNavigationProvider deprecated | component | ({ children }: { children: ReactNode; }): JSX.Element |
useAttrs | hook | (): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }Read and merge `<body>` / `<html>` attributes from all currently active route matches (via `staticData.documentAttrs`). |
attrs | function | (descriptor: DocumentElementDescriptor): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }Pure adapter: converts a `DocumentElementDescriptor` to React-ready props. |
createRouter | function | (routeTree: any, options?: CreateRouterOptions): RouterCore<any, 'never', false, RouterHistory, Record<string, any>>Creates and configures the TanStack Router instance for the Twilight theme. |
createTanStackLinkAdapter | function | (): ForwardRefExoticComponent<Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>>Create a TanStack Router Link adapter component. |
createTwilightRootRoute | function | (): (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. |
earlyHintsMiddleware | function | (): AnyRequestMiddleware |
getTwilightContext | function | (): TwilightContext |
head | function | (descriptor: HeadDescriptor): { meta: Record<string, unknown>[]; links: Record<string, unknown>[]; styles: Record<string, unknown>[]; scripts: Record<string, unknown>[]; } |
mergeAttrs | function | (...descriptors: DocumentElementDescriptor[]): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }Merge multiple `DocumentElementDescriptor`s into React-ready props. |
runWithTwilightContext | function | <T>(partial: Partial<TwilightContext>, fn: () => T): T |
twilightMiddleware | function | (options?: TwilightMiddlewareOptions): AnyRequestMiddleware |
updateTwilightContext | function | (partial: Partial<TwilightContext>): void |
withHead | function | <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. |
CreateRouterOptions | interface | CreateRouterOptionsOptions for creating the TanStack Router instance. |
RouterInitialContext | interface | RouterInitialContextInitial router context passed from createRouter to beforeLoad. |
TwilightContext | interface | TwilightContext |
TwilightLocation | interface | TwilightLocation<TSearch> |
@salla.sa/twilight-theme-engine/nextjs
4| Export | Kind | Signature and summary |
|---|---|---|
NextJsLinkAdapter | component | (props: Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>): ReactNodeNext.js Link adapter. Translates framework-agnostic props to Next.js Link props. |
attrs | function | (descriptor: DocumentElementDescriptor): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }Next.js App Router document element adapter. |
head | function | (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… |
mergeAttrs | function | (...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| Export | Kind | Signature and summary |
|---|---|---|
attrs | function | (descriptor: DocumentElementDescriptor): voidApply `<body>` and `<html>` attributes directly to the DOM. |
clearAttrs | function | (): voidRemove all attributes previously applied by `domDocumentAdapter`. |
@salla.sa/twilight-theme-engine/sentry/client
1| Export | Kind | Signature and summary |
|---|---|---|
initThemeSentry | function | (theme: string, dsn?: string): voidBrowser-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| Export | Kind | Signature and summary |
|---|---|---|
withThemeSentry | function | <T extends FetchHandler>(handler: T, theme: string): TWrap 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| Export | Kind | Signature and summary |
|---|---|---|
ImageModal | component | (props: ImageModalProps): ReactNodeLazy-loaded modal components ImageModal is lazy-loaded since it's a standalone component. Modal is kept eager because it uses compound component pattern. |
Modal | component | ({ isOpen, onClose, children, closeOnBackdropClick, closeOnEscape, preventBodyScroll, size, position, className, }: ModalProps): React.ReactPortal | null |
ImageModalProps | interface | ImageModalProps |
ModalBodyProps | interface | ModalBodyProps |
ModalFooterProps | interface | ModalFooterProps |
ModalHeaderProps | interface | ModalHeaderProps |
ModalProps | interface | ModalProps |
@salla.sa/twilight-theme-engine/components/drawer
5| Export | Kind | Signature and summary |
|---|---|---|
Drawer | component | ({ isOpen, onClose, children, size, closeOnBackdropClick, closeOnEscape, preventBodyScroll, className, }: DrawerProps): React.ReactPortal | null |
DrawerBodyProps | interface | DrawerBodyProps |
DrawerFooterProps | interface | DrawerFooterProps |
DrawerHeaderProps | interface | DrawerHeaderProps |
DrawerProps | interface | DrawerProps |
@salla.sa/twilight-theme-engine/components/dropdown
5| Export | Kind | Signature and summary |
|---|---|---|
Dropdown | component | ({ isOpen, onClose, children, className }: DropdownProps): JSX.Element |
DropdownItemProps | interface | DropdownItemProps |
DropdownMenuProps | interface | DropdownMenuProps |
DropdownProps | interface | DropdownProps |
DropdownTriggerProps | interface | DropdownTriggerProps |
@salla.sa/twilight-theme-engine/components/collapse
4| Export | Kind | Signature and summary |
|---|---|---|
Collapse | component | ({ children, className }: CollapseProps): JSX.Element |
CollapseContentProps | interface | CollapseContentProps |
CollapseProps | interface | CollapseProps |
CollapseTriggerProps | interface | CollapseTriggerProps |
@salla.sa/twilight-theme-engine/components/toast
9| Export | Kind | Signature and summary |
|---|---|---|
Toaster | component | ({ mobilePosition, addToCartToast, }: { mobilePosition?: ToastPosition; addToCartToast?: boolean; }): JSX.Element |
useToast | hook | (title: string, options?: ToastOptions): string | number |
toast | function | (title: string, options?: ToastOptions): string | number |
ToastFn | interface | ToastFn |
ToastOptions | interface | ToastOptions |
ToastPromiseOptions | interface | ToastPromiseOptions<T> |
ToastUpdateOptions | interface | ToastUpdateOptions |
ToastPosition | type | ToastPosition |
ToastType | type | ToastType |
@salla.sa/twilight-theme-engine/components/cart
4| Export | Kind | Signature and summary |
|---|---|---|
CartItem | component | (props: CartItemProps): ReactNodeLazy-loaded cart components Use these for code-splitting cart sections |
CartSummary | component | (props: CartSummaryProps): ReactNode |
SeoCartWidget | component | (props: SeoCartWidgetProps): ReactNode |
SeoCartWidgetProps | interface | SeoCartWidgetProps |
@salla.sa/twilight-theme-engine/components/product
7| Export | Kind | Signature and summary |
|---|---|---|
AddToCartForm | component | (props: AddToCartFormProps): ReactNode |
ProductCard | component | (props: ProductCardProps): ReactNode |
ProductDetails | component | (props: ProductDetailsProps): ReactNode |
ProductGallery | component | (props: ProductGalleryProps): JSX.Element |
ProductCardProps | interface | ProductCardProps |
ProductGalleryProps | interface | ProductGalleryProps |
ProductCardLayout | type | ProductCardLayoutProduct card layout variants - mutually exclusive |
@salla.sa/twilight-theme-engine/components/layout
8| Export | Kind | Signature and summary |
|---|---|---|
Copyright | component | (props: CopyrightProps): ReactNode |
CustomerLayout | component | (props: CustomerLayoutProps): ReactNode |
Footer | component | (props: unknown): ReactNode |
Header | component | (props: HeaderProps): ReactNodeLazy-loaded layout components Use these for code-splitting layout sections |
MasterLayout | component | (props: LayoutProps): ReactNode |
WidgetHead | component | (props: unknown): ReactNode |
pushEqualHeightConfig | function | (settings: Record<string, unknown>): voidPushes the equal-height product card configuration to the GTM dataLayer. Mirrors PHP `HeadWidget::run()` -> `GoogleTagManager::set('equalHeight', ...)`. |
LayoutProps | interface | LayoutPropsBase props for layout components with children |
@salla.sa/twilight-theme-engine/components/home
22| Export | Kind | Signature and summary |
|---|---|---|
BundleComponent | component | (props: BundleComponentProps): ReactNode |
FeaturedProductsStyle1 | component | (props: FeaturedProductsStyle1Props): ReactNode |
FeaturedProductsStyle2 | component | (props: FeaturedProductsStyle2Props): ReactNode |
FeaturedProductsStyle3 | component | (props: FeaturedProductsStyle3Props): ReactNode |
FixedBanner | component | (props: FixedBannerComponentProps): ReactNode |
FixedProducts | component | ({ data }: FixedProductsProps): JSX.Element | null |
HomeComponentRenderer | component | (props: { data: HomeComponentData; index: number; }): ReactNodeMemoized component renderer with scroll-based lazy loading Components only mount when scrolled into view - preventing API calls until needed |
ParallaxBackground | component | (props: ParallaxBackgroundProps): ReactNode |
PhotosSlider | component | (props: PhotosSliderProps): ReactNode |
ProductsSlider | component | ({ data }: ProductsSliderProps): JSX.Element |
SquarePhotos | component | (props: SquarePhotosProps): ReactNode |
StoreFeatures | component | (props: StoreFeaturesProps): ReactNode |
Testimonials | component | (props: TestimonialsProps): ReactNode |
Youtube | component | (props: YoutubeProps): ReactNode |
registerHomeComponentConfig | function | (config: Record<string, HomeComponentConfig>): voidRegister 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. |
registerHomeComponents | function | (components?: Record<string, AnyHomeComponent | null>, prefix?: string): void |
ComponentErrorBoundary | class | ComponentErrorBoundary |
DefaultHomeComponents | object | Record<string, AnyHomeComponent | null> |
BundleComponentProps | interface | BundleComponentProps |
AnyHomeComponent | type | AnyHomeComponent |
HomeComponentConfig | type | HomeComponentConfigRender-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. |
HomeComponentsProps | type | HomeComponentsProps |
@salla.sa/twilight-theme-engine/components/common
22| Export | Kind | Signature and summary |
|---|---|---|
BlogSkeleton | component | (props: object): ReactNode |
Breadcrumb | component | (props: BreadcrumbProps): ReactNodeLazy-loaded common components Use these for code-splitting non-critical components |
BreadcrumbSkeleton | component | ({ className }?: SkeletonProps): React.JSX.Element |
CurrencySymbol | component | (props: { currency: string; }): ReactNode |
CustomerLayoutSkeleton | component | (props: object): ReactNode |
CustomerPageSkeleton | component | (props: object): ReactNode |
DeferredData | component | <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> … |
ErrorPage | component | (props: ErrorPageProps): ReactNode |
Image | component | (props: ImageProps): ReactNodeOptimized Image component with native browser lazy loading. |
Link | component | (props: Omit<BaseLinkProps, 'ref'> & RefAttributes<HTMLAnchorElement>): ReactNodeFramework-agnostic Link component. |
NoContent | component | (props: NoContentProps): ReactNode |
PageSkeleton | component | (props: PageSkeletonProps): ReactNode |
ProductCardSkeleton | component | ({ className }?: SkeletonProps): React.JSX.Element |
ProductDetailSkeleton | component | (props: object): ReactNode |
ProductGridSkeleton | component | (props?: SkeletonProps & { count?: number; }): React.JSX.Element |
RenderWhenVisible | component | (props: RenderWhenVisibleProps): ReactNode |
SkeletonPulse | component | (props: { className?: string; circle?: boolean; style?: React.CSSProperties; }): ReactNode |
resolveDeferred | function | <T>(promiseOrValue: Promise<T> | T | undefined): T | Promise<T> | undefined |
DeferredDataProps | interface | DeferredDataProps<T> |
LinkProps | interface | BaseLinkPropsFramework-agnostic Link props. Supported across TanStack Router, Next.js, and other React frameworks. |
PageSkeletonProps | interface | PageSkeletonProps |
LinkPreload | type | LinkPreloadPreload behavior for Link component |
@salla.sa/twilight-theme-engine/providers
40| Export | Kind | Signature and summary |
|---|---|---|
DocumentClassProvider | component | ({ children }: DocumentClassProviderProps): JSX.Element |
LinkProvider | component | ({ 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. |
NavigationInterceptor | component | (): nullNavigationInterceptor - Framework-agnostic SPA navigation interceptor. |
NavigationProvider | component | ({ navigate, children, }: { navigate: NavigateFn; children: ReactNode; }): FunctionComponentElement<ProviderProps<NavigationContextValue>> |
TwilightProvider | component | ({ children, debug, skeleton, translations: themeTranslations, onReady, onError, client, toast, toastMobilePosition, addToCartToast, routeClass, layout: LayoutComponent, }: TwilightProviderProps): React.ReactElement |
useDocumentClassContext | hook | (): DocumentClassContextValue | null |
useDocumentClassOutput | hook | (): { bodyAttrs: Record<string, string>; htmlAttrs: Record<string, string>; }Returns computed React prop objects for `<body>` and `<html>` built from all active `useDocumentClass` registrations. |
useIsBlog | hook | (): booleanCheck if current page is blog related |
useIsBrands | hook | (): booleanCheck if current page is brands related |
useIsCart | hook | (): booleanCheck if current page is cart |
useIsCustomer | hook | (): booleanCheck if current page is in customer area |
useIsHome | hook | (): booleanCheck if current page is homepage |
useIsProduct | hook | (): booleanCheck if current page is product detail |
useIsSearch | hook | (): booleanCheck if current page is search |
useLinkAdapter | hook | (): LinkAdapterHook to access the Link adapter from context. Throws if used outside LinkProvider. |
useLocation | hook | <TSearch = Record<string, unknown>>(): TwilightLocation<TSearch>Get the current location (TanStack Router compatible). Reads from the router context for SSR compatibility. |
useNavigate | hook | (): NavigateFnGet the navigate function. Matches React Router, TanStack Router, and Remix naming convention. |
useRouteId | hook | (): stringGet the current route ID. Used for route detection (isHome, isProduct, etc.) |
useTwilight | hook | (): TwilightContextValue |
configureNavigation | function | (config: { notFound?: (message?: string) => never; redirect?: (path: string, opts?: { replace?: boolean; }) => never; unauthorized?: (_message?: string) => never; }): voidConfigure navigation functions for a specific framework. Called by framework adapters during setup. |
createLinkWithAdapter | function | (adapter: LinkAdapter): ComponentType<BaseLinkProps>Higher-order function to create a Link component bound to a specific adapter. Useful for framework-specific exports. |
notFound | function | (message?: string): neverThrow a notFound error. Use in route loaders. Framework adapters will override this to throw framework-specific errors. |
orThrow | function | <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. |
orUnauthorized | function | <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. |
redirect | function | (path: string, opts?: { replace?: boolean; }): neverThrow a redirect. Use in route loaders. Framework adapters will override this to throw framework-specific redirects. |
registerDocumentSync | function | (framework: string, component: LazyExoticComponent<FC>): voidRegister a framework-specific document sync component. Convenience function for adding new frameworks to the registry. |
unauthorized | function | (message?: string): neverThrow an unauthorized error. Use in route loaders to protect authenticated routes. Framework adapters will override this to throw framework-specific errors. |
LinkProviderError | class | LinkProviderErrorError thrown when Link is used outside of LinkProvider |
NotFoundError | class | NotFoundErrorNotFound error - thrown to trigger 404 |
RedirectError | class | RedirectErrorRedirect error - thrown to trigger a redirect |
SettingsError | class | SettingsError |
UnauthorizedError | class | UnauthorizedErrorUnauthorized error - thrown to trigger 401 |
routeDocumentSyncs | object | Record<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. |
RouteId | object | { 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. |
DocumentClassProviderProps | interface | DocumentClassProviderProps |
Location | interface | TwilightLocation<TSearch> |
TwilightProviderProps | interface | TwilightProviderProps |
NavigateFn | type | NavigateFn |
NavigateOptions | type | NavigateOptions |
RouteIdType | type | RouteIdType |
@salla.sa/twilight-theme-engine/api/types
2| Export | Kind | Signature and summary |
|---|---|---|
PaginatedResult | interface | PaginatedResult<T>Generic paginated result type for API responses that work with loader functions. Matches the `ItemsLoaderFn<T>` interface expected by `ItemsList` component. |
Pagination | interface | PaginationCursor-based pagination response for paginated API endpoints. |
@salla.sa/twilight-theme-engine/api/client
6| Export | Kind | Signature and summary |
|---|---|---|
api | function | <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.… |
cdn | function | <T>(url: Input, options?: Options): ResponsePromise<T> |
getActiveScope | function | (): ActiveScope | nullActive 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 … |
getActiveScopeId | function | (): string | null{@link getActiveScope} reduced to the market id. |
getAuthToken | function | (): string | nullThe 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_HEADER | constant | 'store-identifier'The header every Salla API call is answered by store. |
@salla.sa/twilight-theme-engine/api/store
3| Export | Kind | Signature and summary |
|---|---|---|
resolveStoreIdentifier | function | (explicit?: string): stringWhich store to ask about, in the order the answers can be trusted. |
store | object | { settings: (storeIdentifier?: string) => Promise<StoreContext | null>; queries: { settings: (storeIdentifier?: string) => OmitKeyof<UseQueryOptions<StoreContext | null, Error, StoreContext | null, readonly unknown[]>, 'queryFn'> & { queryFn?: QueryFunction<StoreContext | null, … |
StoreContext | interface | StoreContextCentral 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| Export | Kind | Signature and summary |
|---|---|---|
translations | object | { 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| Export | Kind | Signature and summary |
|---|---|---|
cart | object | { 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… |
CartApiResponse | interface | CartApiResponse |
@salla.sa/twilight-theme-engine/api/product
15| Export | Kind | Signature and summary |
|---|---|---|
getProductPreview | function | (id: string): Product | undefinedList-card product for `placeholderData`. Prefers the preview key; if that was dropped on SSR dehydrate, rebuilds it from the current-scope list/wishlist. |
isProductPreviewQuery | function | (query: { queryKey: readonly unknown[]; }): booleanTrue when this query is a list-card stand-in — skip it when dehydrating SSR. |
productDetailQueryKey | function | (id: string): readonly ['products', 'detail', string, { readonly scope: ActiveScope | null; }] |
productPreviewQueryKey | function | (id: string): readonly ['products', 'preview', string, { readonly scope: ActiveScope | null; }] |
rememberProductPreview | function | (product: Product): voidRemember 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. |
shouldDehydrateQuery | function | (query: Parameters<typeof defaultShouldDehydrateQuery>[0]): booleanDefault dehydrate policy (success) plus pending SSR-stream queries, minus list-card stand-ins. Replacing the default wholesale would ship error states. |
product | object | { 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… |
Filter | interface | Filter |
FilterValue | interface | FilterValue |
ProductsListParams | interface | ProductsListParams |
ProductsListResponse | interface | ProductsListResponse |
ProductListFilters | type | ProductListFiltersA `<salla-filters>` selection, i.e. the `salla-filters::changed` payload. |
ProductListFilterValue | type | ProductListFilterValueOne `<salla-filters>` value: a scalar, a list, or a nested `{ sub-key: value }` (variants). |
ProductsListResult | type | ProductsListResult |
ProductsListSource | type | ProductsListSource |
@salla.sa/twilight-theme-engine/api/home
1| Export | Kind | Signature and summary |
|---|---|---|
home | object | { 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| Export | Kind | Signature and summary |
|---|---|---|
brand | object | { 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| Export | Kind | Signature and summary |
|---|---|---|
loyalty | object | { 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| Export | Kind | Signature and summary |
|---|---|---|
order | object | { 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… |
CheckoutThankYouData | interface | CheckoutThankYouData |
OrderDetailResponse | interface | OrderDetailResponse |
OrdersListParams | interface | OrdersListParams |
OrdersListResponse | interface | OrdersListResponse |
@salla.sa/twilight-theme-engine/api/category
1| Export | Kind | Signature and summary |
|---|---|---|
category | object | { 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| Export | Kind | Signature and summary |
|---|---|---|
page | object | { 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/notification
2| Export | Kind | Signature and summary |
|---|---|---|
notification | object | { list: () => Promise<NotificationsListResponse>; markAsRead: (id: number) => Promise<void>; markAllAsRead: () => Promise<void>; queries: { list: () => OmitKeyof<UseQueryOptions<NotificationsListResponse, Error, NotificationsListResponse, string[]>, 'queryFn'> & { queryFn?: Quer… |
NotificationsListResponse | interface | NotificationsListResponse |
@salla.sa/twilight-theme-engine/api/wishlist
2| Export | Kind | Signature and summary |
|---|---|---|
wishlist | object | { 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. |
WishlistListParams | interface | WishlistListParams |
@salla.sa/twilight-theme-engine/api/user
1| Export | Kind | Signature and summary |
|---|---|---|
user | object | { 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| Export | Kind | Signature and summary |
|---|---|---|
profile | object | { delete: () => Promise<void>; updateSettings: (name: string, value: boolean) => Promise<void>; } |
@salla.sa/twilight-theme-engine/api/apps
4| Export | Kind | Signature and summary |
|---|---|---|
apps | object | { snippets: () => Promise<AppSnippet[]>; settings: () => Promise<AppSettings>; queries: { snippets: () => OmitKeyof<UseQueryOptions<AppSnippet[], Error, AppSnippet[], string[]>, 'queryFn'> & { queryFn?: QueryFunction<AppSnippet[], string[], never> | undefined; } & { queryKey: st… |
AppSettings | interface | AppSettingsPer-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.*`. |
AppSnippet | interface | AppSnippet |
AppSnippetRow | interface | AppSnippetRow |
@salla.sa/twilight-theme-engine/tracking
7| Export | Kind | Signature and summary |
|---|---|---|
GoogleTagBody | component | ({ gtmIds }: GoogleTagBodyProps): nullGoogleTagBody - Injects GTM script and noscript iframe. |
LazyGoogleTagBody | component | (props: GoogleTagBodyProps): ReactNodeLazy-loaded GoogleTagBody component. |
LazySiftSnippet | component | (props: SiftSnippetProps): ReactNodeLazy-loaded SiftSnippet component. |
SiftSnippet | component | ({ beaconKey, customerId }: SiftSnippetProps): nullSiftSnippet - Injects Sift Science fraud detection script. |
TwilightBundles | component | (): nullTwilightBundles - Injects twilight bundles script when custom components are detected. |
GoogleTagBodyProps | interface | GoogleTagBodyProps |
SiftSnippetProps | interface | SiftSnippetProps |
@salla.sa/twilight-theme-engine/store
3| Export | Kind | Signature and summary |
|---|---|---|
LazyStoreClosedNotification | component | (props: StoreClosedNotificationProps): ReactNodeLazy-loaded StoreClosedNotification component. |
StoreClosedNotification | component | (_props: StoreClosedNotificationProps): JSX.Element | nullStoreClosedNotification - Shows a notification bar when the store is closed. |
StoreClosedNotificationProps | interface | StoreClosedNotificationProps |
Short aliases
These import paths export exactly the same thing as a longer one.
@salla.sa/twilight-theme-engine/modal | same as ./components/modal |
@salla.sa/twilight-theme-engine/drawer | same as ./components/drawer |
@salla.sa/twilight-theme-engine/dropdown | same as ./components/dropdown |
@salla.sa/twilight-theme-engine/collapse | same as ./components/collapse |
@salla.sa/twilight-theme-engine/toast | same as ./components/toast |
@salla.sa/twilight-theme-engine/cart | same as ./components/cart |
@salla.sa/twilight-theme-engine/product | same as ./components/product |
@salla.sa/twilight-theme-engine/layout | same as ./components/layout |
@salla.sa/twilight-theme-engine/home | same as ./components/home |
@salla.sa/twilight-theme-engine/common | same as ./components/common |