@absolutejs/voice 0.0.22-beta.502 → 0.0.22-beta.503

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ export type VoiceHTMXPollingAttributes = {
2
+ /** Set true to emit hx-get/hx-trigger when refreshUrl is also provided. */
3
+ poll?: boolean;
4
+ /** Polling cadence. Default 5_000ms. Clamped to >= 1_000ms. */
5
+ pollIntervalMs?: number;
6
+ /** Extra HTMX attributes to splice in. Keys without the 'hx-' prefix have it added. */
7
+ pushAttributes?: Record<string, string>;
8
+ /** URL hx-get fires against. Without it, polling is skipped. */
9
+ refreshUrl?: string;
10
+ /** hx-swap value. Default 'outerHTML'. */
11
+ swap?: string;
12
+ /** Optional hx-target selector. */
13
+ target?: string;
14
+ };
15
+ export declare const buildVoiceHTMXAttributes: (attrs: VoiceHTMXPollingAttributes | undefined) => string;
16
+ /**
17
+ * Injects HTMX polling attributes into the first opening tag of an HTML string.
18
+ * Returns the original HTML unchanged when attrs produce no attributes.
19
+ */
20
+ export declare const wrapVoiceHTMLWithHTMXPolling: (html: string, attrs: VoiceHTMXPollingAttributes | undefined) => string;
21
+ /**
22
+ * Wraps arbitrary HTML in a self-refreshing div that polls refreshUrl.
23
+ * Use this when the inner HTML doesn't have a stable root element to mutate.
24
+ */
25
+ export declare const wrapVoiceHTMLInHTMXContainer: (html: string, attrs: VoiceHTMXPollingAttributes & {
26
+ className?: string;
27
+ elementTag?: string;
28
+ }) => string;
@@ -3,16 +3,8 @@ import type { VoiceCallReviewArtifact } from "../testing/review";
3
3
  import { type VoiceCostDashboardBucket, type VoiceCostDashboardOptions, type VoiceCostDashboardReport } from "./costDashboard";
4
4
  import { type LiveCallViewState, type LiveCallViewer } from "./liveCallViewer";
5
5
  import { type ReplayTimelineReport } from "./replayTimeline";
6
- export type VoiceDashboardHTMXAttributes = {
7
- /** Set true to wrap the fragment in an hx-get + hx-trigger="every Ns" polling shell. */
8
- poll?: boolean;
9
- /** Polling cadence when poll is true. Default 5 seconds. */
10
- pollIntervalMs?: number;
11
- /** Route the renderer points hx-get at. Default mirrors the route the handler is mounted on. */
12
- refreshUrl?: string;
13
- /** hx-swap value. Default 'outerHTML'. */
14
- swap?: string;
15
- };
6
+ import { type VoiceHTMXPollingAttributes } from "./htmxAttributes";
7
+ export type VoiceDashboardHTMXAttributes = VoiceHTMXPollingAttributes;
16
8
  export type VoiceCostDashboardHTMXInput = {
17
9
  attributes?: VoiceDashboardHTMXAttributes;
18
10
  currency?: string;
package/dist/index.d.ts CHANGED
@@ -110,6 +110,12 @@ export { createInMemoryVoiceCallQuota } from "./callQuota";
110
110
  export type { CreateInMemoryVoiceCallQuotaOptions, VoiceCallQuota, VoiceCallQuotaRejection, VoiceCallQuotaResult, VoiceCallQuotaTier, VoiceCallReservation, } from "./callQuota";
111
111
  export { createVoiceBearerAuthVerifier, createVoiceHMACAuthVerifier, createVoiceRouteAuth, } from "./routeAuth";
112
112
  export type { VoiceRouteAuthDecision, VoiceRouteAuthInput, VoiceRouteAuthOptions, VoiceRouteAuthVerifier, } from "./routeAuth";
113
+ export { buildVoiceHTMXAttributes, wrapVoiceHTMLInHTMXContainer, wrapVoiceHTMLWithHTMXPolling, } from "./client/htmxAttributes";
114
+ export type { VoiceHTMXPollingAttributes } from "./client/htmxAttributes";
115
+ export { createLiveCallViewerFromOptions, renderVoiceCostDashboardFromEvents, renderVoiceCostDashboardHTMX, renderVoiceLiveCallViewerFromState, renderVoiceLiveCallViewerFromViewer, renderVoiceLiveCallViewerHTMX, renderVoiceReplayTimelineFromArtifact, renderVoiceReplayTimelineHTMX, resolveVoiceDashboardRenderers, } from "./client/htmxDashboardRenderers";
116
+ export type { ResolvedVoiceDashboardRenderers, VoiceCostDashboardHTMXInput, VoiceCostDashboardRenderer, VoiceDashboardHTMXAttributes, VoiceDashboardHTMXRendererConfig, VoiceLiveCallViewerHTMXInput, VoiceLiveCallViewerRenderer, VoiceReplayTimelineHTMXInput, VoiceReplayTimelineRenderer, } from "./client/htmxDashboardRenderers";
117
+ export { createVoiceCostDashboardHTMXRoute, createVoiceHTMXDashboardRoutes, createVoiceHTMXDashboardRoutesFromStores, createVoiceLiveCallViewerHTMXRoute, createVoiceReplayTimelineHTMXRoute, } from "./htmxDashboardRoutes";
118
+ export type { CreateVoiceHTMXDashboardRoutesFromStoresOptions, VoiceHTMXCostDashboardRoutesOptions, VoiceHTMXDashboardRoutesOptions, VoiceHTMXLiveCallViewerRoutesOptions, VoiceHTMXReplayTimelineRoutesOptions, } from "./htmxDashboardRoutes";
113
119
  export { buildVoiceCostDashboardReport } from "./client/costDashboard";
114
120
  export type { VoiceCostDashboardBucket, VoiceCostDashboardOptions, VoiceCostDashboardReport, } from "./client/costDashboard";
115
121
  export { createLiveCallViewer } from "./client/liveCallViewer";