import type { AnyCommerceEvent, CommerceEvent, CommerceEventDataRegistry, CommerceEventListenerOptions, CommerceEventName } from '@evershop/evershop/types/commerceEvents'; /** * Publish an event. Returns it, or undefined on the server. * * `options.id` sets the event id; use an id the server can compute too * (`checkout_completed` uses the order uuid) when a server-side copy of the * event may be sent. */ export declare function dispatchCommerceEvent(name: N, data: CommerceEventDataRegistry[N], options?: { id?: string; }): CommerceEvent | undefined; /** * Listen to one event, or to all of them with `'*'`. Returns a function that * stops listening. */ export declare function onCommerceEvent(name: N, handler: (event: CommerceEvent) => void, options?: CommerceEventListenerOptions): () => void; export declare function onCommerceEvent(name: '*', handler: (event: AnyCommerceEvent) => void, options?: CommerceEventListenerOptions): () => void; /** * Deliver the pending events now. The bus does it by itself when the page * is hidden or left; call it before a navigation the bus cannot see. */ export declare function flushCommerceEvents(): void;