import type React from 'react'; import type { AdjustTimeBookingSnapshot, AdjustTimeCheckoutResult, AdjustTimeInitialAction, AdjustTimeProduct } from '../types'; import type { DiscountKeyboardValueState } from '../../../../pro/priceKeyboard/components/discountKeyboard/types'; import type { ResolveBestAddTimePlanResult } from '../../types'; import type { AdjustTimeActionKey } from '../components/AdjustTimeActionList'; import type { ChangeTimeValue } from '../utils/changeTime'; declare global { interface Window { __pisellAdjustTimeSetShopClosingTime?: (time?: string | null) => string | undefined; } } /** 当前右侧对比区要展示的一次加时方案。 */ interface AdjustTimeScenario { title: string; subtitle: string; icon: React.ReactNode; newStart: Date; newEnd: Date; uncappedNewEnd: Date; effectiveEndLimit?: Date; targetMinutes: number; selectedProductId?: string | number; unlimited?: boolean; valid: boolean; } /** controller 的入参:由 modal 传入预约快照、可选商品和提交回调。 */ interface UseAdjustTimeModalControllerParams { open: boolean; booking: AdjustTimeBookingSnapshot; products: AdjustTimeProduct[]; resourceEndTime?: Date | string; shopClosingTime?: string; initialAction?: AdjustTimeInitialAction; previewDueAmount?: number; previewLoading?: boolean; onSave?: (result: AdjustTimeCheckoutResult) => void; onCheckout?: (result: AdjustTimeCheckoutResult) => void; onPreviewChange?: (result: AdjustTimeCheckoutResult) => void | Promise; } /** controller 的出参:把 UI 需要展示的数据和所有交互方法统一返回给 modal。 */ interface UseAdjustTimeModalControllerResult { activeAction: AdjustTimeActionKey; autoPricing: ResolveBestAddTimePlanResult; checkoutDisabled: boolean; dueAmount: number; addedMinutes: number; pricedNewEnd: Date; pricedTotalMinutes: number; shouldShowEffectiveUntilHint: boolean; effectiveUntilTime: string; resourceAvailabilityWarning?: string; manualEndTime: string; changeTimeValue: ChangeTimeValue; scenario: AdjustTimeScenario; handleActionChange: (action: AdjustTimeActionKey) => void; handleCheckout: () => void; handleSave: () => void; handleManualEndTimeChange: (value: string) => void; handleChangeTimeChange: (value: ChangeTimeValue) => void; handleReset: () => void; priceInputState?: DiscountKeyboardValueState; handleDueAmountChange: (value: number, state?: DiscountKeyboardValueState) => void; handleAutoAmount: () => void; handlePriceInputStateChange: (state: DiscountKeyboardValueState) => void; setManualDueAmount: React.Dispatch>; } export declare const useAdjustTimeModalController: ({ open, booking, products, resourceEndTime, shopClosingTime, initialAction, previewDueAmount, previewLoading, onSave, onCheckout, onPreviewChange, }: UseAdjustTimeModalControllerParams) => UseAdjustTimeModalControllerResult; export {};