import { EvaContext } from "@springtree/eva-sdk-core-service"; import { IJoinOrganizationUnitHub, ISubscribeToElevationBarcode } from "../request/organization-unit-hub.js"; import { IHubEventElevationBarcodeConfirmed, IHubEventOrderUpdated, IHubEventPaymentTransactionCreated, IHubEventPaymentTransactionUpdated, IHubEventStationScan, IHubEventSubscribedOrderAdditionalInformation, IHubEventUserTaskCreated, IHubEventUserTaskUpdated } from "../response/organization-unit-hub.js"; import { BaseHub, IHubConnectionOptions, THubConnectionEventHandler } from "./base-hub.js"; import { GetApplicationConfigurationResponse } from "@springtree/eva-services-core"; /** * The hub event handler types */ export type TElevationBarcodeConfirmedHandler = (event: IHubEventElevationBarcodeConfirmed) => void; export type TOrderUpdatedHandler = (event: IHubEventOrderUpdated) => void; export type TPaymentTransactionCreatedHandler = (event: IHubEventPaymentTransactionCreated) => void; export type TPaymentTransactionUpdatedHandler = (event: IHubEventPaymentTransactionUpdated) => void; export type TSubscribedOrderAdditionalInformationHandler = (event: IHubEventSubscribedOrderAdditionalInformation) => void; export type TUserTaskCreatedHandler = (event: IHubEventUserTaskCreated) => void; export type TUserTaskUpdatedHandler = (event: IHubEventUserTaskUpdated) => void; export type TScanHandler = (event: IHubEventStationScan) => void; /** * The Organization Unit hub is the consolidation of the following previous hubs: * * - ElevationBarcodeHub * - OrderHub * - PaymentHub * - UserTaskHub * * The elevation barcode related messages can be used to confirm elevation requests when the * corresponding headers are returned from an(y) EVA service call * * The order related messages can be used to track changes to subscribed orders * This will also automatically subscribe to any payments made on the order * There is also the option to subscribe to a single specific payment transaction * * Once connected all the user task creation and updates for the organization unit will be received on this hub */ export declare class OrganizationUnitHub extends BaseHub { setEventHandler(eventName: "connection", handler: THubConnectionEventHandler): void; setEventHandler(eventName: "ElevationConfirmed", handler: TElevationBarcodeConfirmedHandler): void; setEventHandler(eventName: "SubscribedOrderAdditionalInformation", handler: TSubscribedOrderAdditionalInformationHandler): void; setEventHandler(eventName: "SubscribedOrderUpdated", handler: TOrderUpdatedHandler): void; setEventHandler(eventName: "SubscribedPaymentTransactionCreated", handler: TPaymentTransactionCreatedHandler): void; setEventHandler(eventName: "SubscribedPaymentTransactionUpdated", handler: TPaymentTransactionUpdatedHandler): void; setEventHandler(eventName: "UserTaskCreated", handler: TUserTaskCreatedHandler): void; setEventHandler(eventName: "UserTaskUpdated", handler: TUserTaskUpdatedHandler): void; setEventHandler(eventName: "Scan", handler: TScanHandler): void; /** * Creates a OrganizationUnitHub hub instance * * NOTE: Uses the ShopHub from the configuration because that is the new string ID based variant * of the original organization unit hub */ constructor({ configuration, context, options, }: { configuration: GetApplicationConfigurationResponse; context: EvaContext; options?: IHubConnectionOptions; }); /** * Subscribe to be able to receive an elevation barcode magic links confirmation */ subscribeToElevationBarcode(request: ISubscribeToElevationBarcode): Promise; /** * Subscribes to updates for a specific payment transaction */ subscribeToPaymentTransaction(paymentTransactionId: string): Promise; /** * Unsubscribes from updates for a specific payment */ unsubscribeFromPaymentTransaction(paymentTransactionId: string): Promise; /** * Subscribes to updates for a specific order */ subscribeToOrder(orderId: string): Promise; /** * Unsubscribes from updates for a specific order */ unsubscribeFromOrder(orderId: string): Promise; /** * Subscribes to scan events from a specific station */ subscribeToStationEvents(stationId: string): Promise; /** * Unsubscribes from scan events from a specific station */ unsubscribeFromStationEvents(stationId: string): Promise; } //# sourceMappingURL=organization-unit-hub.d.ts.map