import { KioskScanner } from "../runtime/devices/scanner.js"; import { ApplicationExitPolicyDecision, ApplicationManifest } from "../../HDLKiosk/kernel/application/types.js"; import { KioskRuntimeBindings, KioskSession, KioskSessionStart } from "../runtime/types.js"; import { SalesCommandBinding } from "../runtime/operations/command.js"; import { KioskScanConsumer } from "../sales/inputs/scan.js"; import { KioskSaleReceipt } from "../runtime/operations/checkoutOrder.js"; import { KioskScreens } from "../ui/KioskSurfaces.js"; import { KioskApplicationProps } from "../ui/KioskApplication.js"; import { ComponentType } from "react"; //#region src/components/kiosk/app/contracts.d.ts interface KioskCheckoutOptions { /** Physical payment policy; the sales pricing channel can still be POS. */ paymentChannel?: string; requestFulfillment?: boolean; /** Show the pickup number on the default paid result and look it up if the receipt lacks it. */ showPickupNumber?: boolean; /** Receives the original sale even when its view is hidden. Implementations * must be idempotent by order ID so an explicit retry can reconcile a lost response. */ onSaleConfirmed?(receipt: KioskSaleReceipt): void | Promise; } /** Bindings shared by sales machines. Each instance owns its device subscriptions and order. */ interface KioskSalesRuntime extends Omit { attachSession?(session: KioskSession, start: KioskSessionStart, scanner: KioskScanner): ReturnType>; /** Session-wide shopping consumer. Optional slice command overrides take precedence. */ onScan?: KioskScanConsumer; commandOverrides?: readonly SalesCommandBinding[]; screens?: KioskScreens; Header?: ComponentType<{ activity: string; disabled: boolean; }>; checkout?: KioskCheckoutOptions; /** Other activities that must keep this terminal awake, such as dispensing. */ protectedActivities?: readonly string[]; /** Full-screen device activities draw their own brand/header. */ hideHeaderActivities?: readonly string[]; /** Host inactivity/exit requests use the same policy and order cleanup as Done. */ subscribeExit?(requestExit: () => void): () => void; confirmExit?(challenge: Extract['challenge'], session: KioskSession): Promise; } interface KioskSalesDefinition { manifest: ApplicationManifest; runtime: KioskSalesRuntime; /** Omit for a machine that starts from an entry screen or hardware trigger. */ initialWorkflow?: string; renderEntry?: KioskApplicationProps['renderEntry']; } //#endregion export { KioskCheckoutOptions, KioskSalesDefinition, KioskSalesRuntime };