@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
25 lines (24 loc) • 1.63 kB
TypeScript
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf, UseRpcCacheKey } from '../core/useRpc.js';
/**
* Retrieves data about the current shop by its shopID using the `getShopConfiguration` RPC method.
*
* This function acts as a wrapper around the `useRpc` composable,
* simplifying the process of fetching data. It internally calls `useRpc`
* with the provided options.
*
* @see https://scayle.dev/en/api-guides/storefront-api/resources/shop-configuration/get-a-shop-configuration
*
* @template DataT The type of the normalized RPC response data. Defaults to `NormalizedRpcResponse<'getShopConfiguration'>`.
* @template PickKeys The keys to pick from the data. Defaults to all keys of `DataT`.
* @template DefaultT The default value to use if data is not available. Defaults to `null`.
*
* @param options An object containing options for the underlying `useRpc` call.
* @param options.options The options for the underlying `useRpc` call, controlling data handling and loading state.
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
*
* @returns The result of the `useRpc` call, which includes the fetched data,
* loading state, and any error information.
*/
export declare function useShopConfiguration<DataT = NormalizedRpcResponse<'getShopConfiguration'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
options: UseRpcOptions<'getShopConfiguration', DataT, PickKeys, DefaultT>;
}>, key?: UseRpcCacheKey): UseRpcReturn<'getShopConfiguration', DataT, PickKeys, DefaultT>;