/** * vapor-chamber - the IIFE variants' one builder: `createApp` and `connect`, * the same in every variant, so one call site works whichever bundle loads. */ import { createAsyncCommandBus, type AsyncCommandBusOptions, type PluginParts, type CommandBusOptions } from './command-bus'; import { type HttpTransportOptions } from './transports'; export type CreateAppOptions = { /** The bus's transport: one, or a map by action pattern (`createAsyncCommandBus({ transport })`). */ transport?: AsyncCommandBusOptions['transport']; /** Plugins to install on the bus. */ plugins?: PluginParts[]; /** Dead-letter mode. Default: 'error' */ onMissing?: CommandBusOptions['onMissing']; /** Hold a dispatch until its handler registers (`createBuffer`). */ buffer?: CommandBusOptions['buffer']; /** The bus's retry, on by default. `{ actionPolicies: { cartAdd: 'idempotent' } }` declares a policy, `false` turns it off. */ retry?: AsyncCommandBusOptions['retry']; }; /** * createApp - a configured async bus: its transport, retry and plugins. * * @example * const { bus, dispatch } = VaporChamber.createApp({ * transport: VaporChamber.httpTransport({ endpoint: '/api/vc' }) * }) * dispatch('cartAdd', { id: 1 }, { quantity: 2 }) */ export declare function createApp(options?: CreateAppOptions): { bus: ReturnType; dispatch: ReturnType['dispatch']; }; /** * connect - one-line setup for the sprinkled-JS audience: HTTP with CSRF. * * Equivalent to: * createApp({ transport: httpTransport({ endpoint, csrf: true, ...rest }) }) * * @example * */ export declare function connect(options: HttpTransportOptions & Omit): ReturnType; //# sourceMappingURL=iife-app.d.ts.map