@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
19 lines (18 loc) • 1.14 kB
TypeScript
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf, UseRpcCacheKey } from '../core/useRpc.js';
/**
* Retrieves the first active campaign.
*
* This function acts as a wrapper around the `useRpc` composable,
* simplifying the process of fetching data. It internally calls `useRpc`
* with the provided parameters and options.
*
* @param params An object containing parameters and options for the `getCampaign` RPC call.
* @param params.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 campaign data,
* loading state, and any error information.
*/
export declare function useCampaign<DataT = NormalizedRpcResponse<'getCampaign'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
options: UseRpcOptions<'getCampaign', DataT, PickKeys, DefaultT>;
}>, key?: UseRpcCacheKey): UseRpcReturn<'getCampaign', DataT, PickKeys, DefaultT>;