Interface: UseSparePartsOptions
Defined in: composables/react/useSpareParts.ts:55
Properties
companyId?
optionalcompanyId?:number
Defined in: composables/react/useSpareParts.ts:93
Active company — scopes the assortment.
configuration?
optionalconfiguration?:object
Defined in: composables/react/useSpareParts.ts:114
Image filter config, mirroring useProductSearch's configuration.
anonymousUserId?
optionalanonymousUserId?:number
The channel's anonymous user, seeded by the host. Scopes logged-out listings exactly like the SSR seed does.
imageSearchFiltersGrid?
optionalimageSearchFiltersGrid?:unknown
imageVariantFiltersMedium?
optionalimageVariantFiltersMedium?:unknown
graphqlClient?
optionalgraphqlClient?:GraphQLClient
Defined in: composables/react/useSpareParts.ts:57
SDK client. Without it the hook stays idle (controlled mode needs no client).
language
language:
string
Defined in: composables/react/useSpareParts.ts:73
Language for the spare parts themselves (the storefront language).
machineLanguage?
optionalmachineLanguage?:string
Defined in: composables/react/useSpareParts.ts:84
Language the MACHINE TREE is authored in. Defaults to language.
machine(slug:, language:) is language-scoped and hard-errors with
"No machine found for slug and language" when the machine has no name/slug
in that language. Machine trees are commonly maintained in one language
(typically EN) while their spare parts are localized — so the lookup and the
parts list need different languages. Set this when they diverge.
onFiltersChange?
optionalonFiltersChange?: (filters) =>void
Defined in: composables/react/useSpareParts.ts:123
Fired with the facet list after each fetch.
Parameters
filters
AttributeFilter[]
Returns
void
onItemsFoundChange?
optionalonItemsFoundChange?: (count) =>void
Defined in: composables/react/useSpareParts.ts:127
Fired with the total item count after each fetch.
Parameters
count
number
Returns
void
onMachineChange?
optionalonMachineChange?: (machine) =>void
Defined in: composables/react/useSpareParts.ts:131
Fired with the machine itself after each fetch (name, child machines, …).
Parameters
machine
SparePartsMachine
Returns
void
onPartsResponse?
optionalonPartsResponse?: (response) =>void
Defined in: composables/react/useSpareParts.ts:129
Fired with the raw parts response after each fetch.
Parameters
response
SparePartsResponse
Returns
void
onPriceBoundsChange?
optionalonPriceBoundsChange?: (min,max) =>void
Defined in: composables/react/useSpareParts.ts:125
Fired with the price-slider bounds after each fetch.
Parameters
min
number
max
number
Returns
void
pageSize?
optionalpageSize?:number
Defined in: composables/react/useSpareParts.ts:111
Items per page. Defaults to 12.
parts?
optionalparts?:SparePart[]
Defined in: composables/react/useSpareParts.ts:64
Controlled mode: pre-fetched parts (e.g. SSR-seeded). When DEFINED the hook
performs no fetching at all and simply echoes these back. Pass [] (not
undefined) to show an empty state while the host controls loading.
priceFilterMax?
optionalpriceFilterMax?:number
Defined in: composables/react/useSpareParts.ts:102
Price-range filter upper bound.
priceFilterMin?
optionalpriceFilterMin?:number
Defined in: composables/react/useSpareParts.ts:99
Price-range filter lower bound.
slug?
optionalslug?:string
Defined in: composables/react/useSpareParts.ts:67
Slug of the machine whose parts to list.
sortField?
optionalsortField?:string
Defined in: composables/react/useSpareParts.ts:105
Sort field.
sortOrder?
optionalsortOrder?:string
Defined in: composables/react/useSpareParts.ts:108
Sort direction.
taxZone?
optionaltaxZone?:string
Defined in: composables/react/useSpareParts.ts:87
Tax zone for price calculation.
term?
optionalterm?:string
Defined in: composables/react/useSpareParts.ts:70
Free-text search, scoped server-side to this machine's parts.
textFilters?
optionaltextFilters?:ProductTextFilterInput[]
Defined in: composables/react/useSpareParts.ts:96
Attribute (facet) filters.
user?
optionaluser?:Contact|Customer|null
Defined in: composables/react/useSpareParts.ts:90
Active user — drives userId scoping and contact/customer pricing.