forked from crowetic/commerce
updated useCart types
This commit is contained in:
parent
7edd5aa182
commit
61fa423673
@ -6,10 +6,10 @@ import { useCommerce } from '..'
|
|||||||
export type CartResponse<Data> = ResponseState<Data> & { isEmpty?: boolean }
|
export type CartResponse<Data> = ResponseState<Data> & { isEmpty?: boolean }
|
||||||
|
|
||||||
export type CartInput = {
|
export type CartInput = {
|
||||||
cartId: Cart['id']
|
cartId?: BaseCart['id']
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function useCart<Data>(
|
export default function useCart<Data extends BaseCart | null>(
|
||||||
options: HookFetcherOptions,
|
options: HookFetcherOptions,
|
||||||
input: HookInput,
|
input: HookInput,
|
||||||
fetcherFn: HookFetcher<Data, CartInput>,
|
fetcherFn: HookFetcher<Data, CartInput>,
|
||||||
|
3
framework/commerce/types.d.ts
vendored
3
framework/commerce/types.d.ts
vendored
@ -127,7 +127,8 @@ interface BaseCart {
|
|||||||
discounts?: DiscountBase[]
|
discounts?: DiscountBase[]
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Cart extends Entity {
|
// TODO: Remove this type in favor of BaseCart
|
||||||
|
interface Cart2 extends Entity {
|
||||||
id: string | undefined
|
id: string | undefined
|
||||||
currency: { code: string }
|
currency: { code: string }
|
||||||
taxIncluded?: boolean
|
taxIncluded?: boolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user