mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
Moved SwrOptions type
This commit is contained in:
parent
82c5cd4aba
commit
7f3174bcd0
@ -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<T, K> = Omit<T, keyof K> & K
|
||||
|
||||
@ -67,3 +69,9 @@ export type HookHandler<
|
||||
fetcher?: HookFetcherFn<Data, FetchInput, Result, Body>
|
||||
normalizer?(data: Result): Data
|
||||
}
|
||||
|
||||
export type SwrOptions<Data, Input = null, Result = any> = ConfigInterface<
|
||||
Data,
|
||||
CommerceError,
|
||||
HookFetcher<Data, Input, Result>
|
||||
>
|
||||
|
@ -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<Data, Input = null, Result = any> = ConfigInterface<
|
||||
Data,
|
||||
CommerceError,
|
||||
HookFetcher<Data, Input, Result>
|
||||
>
|
||||
|
||||
export type ResponseState<Result> = responseInterface<Result, CommerceError> & {
|
||||
isLoading: boolean
|
||||
|
Loading…
x
Reference in New Issue
Block a user