import { Ref } from 'vue'; import { OrderSearchFields, OrderType, GraphQLClient, Order, Cart, DateSearchInput, DecimalSearchInput, OrderSortInput, MediaImageProductSearchInput, TransformationsInput } from '@propeller-commerce/propeller-sdk-v2'; import { AnyUser } from '@propeller-commerce/propeller-v2-core-ui'; export interface OrderSearchForm { term?: string; createdAt?: DateSearchInput; lastModifiedAt?: DateSearchInput; price?: DecimalSearchInput; sortInput?: Partial; type?: OrderType; } export interface UseOrdersOptions { graphqlClient: GraphQLClient; user: Ref; companyId?: Ref; language?: Ref; itemsPerPage?: number; /** Default statuses to filter by */ orderStatuses?: string[]; termFields?: OrderSearchFields[]; /** * Seed the search/filter form on mount — e.g. rehydrated from the URL query * so a bookmarked/shared filtered view restores. The consumer owns the fetch. */ initialSearchForm?: OrderSearchForm; configuration?: { imageSearchFiltersGrid?: MediaImageProductSearchInput; imageVariantFiltersSmall?: TransformationsInput; }; channelIds?: number[]; onCartCreated?: (cart: Cart) => void; afterReorder?: (cart: Cart) => void; } export interface UseOrdersReturn { orders: Ref; loading: Ref; error: Ref; searchForm: Ref; currentOrder: Ref; orderLoading: Ref; currentPage: Ref; totalPages: Ref; totalItems: Ref; itemsPerPage: Ref; fetchOrders: (page?: number) => Promise; fetchOrder: (orderId: number) => Promise; goToPage: (page: number) => void; resetSearch: () => void; downloadPdf: (order: Order) => Promise<{ success: boolean; error?: string; }>; downloadQuotePdf: (quoteId: number) => Promise<{ success: boolean; error?: string; }>; reorder: (order: Order, cartId?: string) => Promise<{ success: boolean; cart?: Cart; error?: string; }>; setQuoteStatus: (orderId: number, flags: { status?: string; }) => Promise<{ success: boolean; error?: string; }>; } export declare function useOrders(options: UseOrdersOptions): UseOrdersReturn;