diff --git a/framework/commerce/utils/types.ts b/framework/commerce/utils/types.ts index 3c81bac61..f6dbe866f 100644 --- a/framework/commerce/utils/types.ts +++ b/framework/commerce/utils/types.ts @@ -1,4 +1,6 @@ -import type { ResponseState, SwrOptions } from './use-data' +import type { ConfigInterface } from 'swr' +import type { CommerceError } from './errors' +import type { ResponseState } from './use-data' export type Override = Omit & K @@ -67,3 +69,9 @@ export type HookHandler< fetcher?: HookFetcherFn normalizer?(data: Result): Data } + +export type SwrOptions = ConfigInterface< + Data, + CommerceError, + HookFetcher +> diff --git a/framework/commerce/utils/use-data-2.ts b/framework/commerce/utils/use-data-2.ts index 1fddf56fb..a5d237aaa 100644 --- a/framework/commerce/utils/use-data-2.ts +++ b/framework/commerce/utils/use-data-2.ts @@ -1,20 +1,7 @@ -import useSWR, { ConfigInterface, responseInterface } from 'swr' -import type { - HookHandler, - HookInput, - HookFetcher, - PickRequired, - Fetcher, -} from './types' +import useSWR, { responseInterface } from 'swr' +import type { HookHandler, HookInput, PickRequired, Fetcher } from './types' import defineProperty from './define-property' import { CommerceError } from './errors' -import { useCommerce } from '..' - -export type SwrOptions = ConfigInterface< - Data, - CommerceError, - HookFetcher -> export type ResponseState = responseInterface & { isLoading: boolean