@absolutejs/voice 0.0.22-beta.502 → 0.0.22-beta.504
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,42 @@
|
|
|
1
|
+
export type BrowserNoiseSuppressorOptions = {
|
|
2
|
+
/** Existing AudioContext to reuse. If omitted, a fresh one is created at 48kHz. */
|
|
3
|
+
audioContext?: AudioContext;
|
|
4
|
+
/** Optional message sent to the worklet via port.postMessage on init. */
|
|
5
|
+
initialPort?: Record<string, unknown>;
|
|
6
|
+
/** AudioWorkletNode options forwarded to the constructor. */
|
|
7
|
+
nodeOptions?: AudioWorkletNodeOptions;
|
|
8
|
+
/** Registered AudioWorkletProcessor name to instantiate. */
|
|
9
|
+
processorName: string;
|
|
10
|
+
/** Caller-supplied input stream from getUserMedia or similar. */
|
|
11
|
+
stream: MediaStream;
|
|
12
|
+
/** URL of the AudioWorklet script that registers `processorName`. */
|
|
13
|
+
workletUrl: string;
|
|
14
|
+
};
|
|
15
|
+
export type BrowserNoiseSuppressorHandle = {
|
|
16
|
+
/** The worklet node — operators can postMessage to tune at runtime. */
|
|
17
|
+
node: AudioWorkletNode;
|
|
18
|
+
/** A MediaStream containing the denoised audio track. */
|
|
19
|
+
stream: MediaStream;
|
|
20
|
+
/** Tears down the worklet + closes the AudioContext when this helper created it. */
|
|
21
|
+
stop: () => Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
export declare const applyBrowserNoiseSuppression: (options: BrowserNoiseSuppressorOptions) => Promise<BrowserNoiseSuppressorHandle>;
|
|
24
|
+
export type BrowserNoiseSuppressorPreset = {
|
|
25
|
+
initialPort?: Record<string, unknown>;
|
|
26
|
+
/** Display label for UI affordances. */
|
|
27
|
+
label: string;
|
|
28
|
+
nodeOptions?: AudioWorkletNodeOptions;
|
|
29
|
+
processorName: string;
|
|
30
|
+
workletUrl: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Convenience presets pointing at well-known open-source worklets. Operators
|
|
34
|
+
* still install the underlying npm package and copy the worklet file to a
|
|
35
|
+
* URL their site can serve.
|
|
36
|
+
*/
|
|
37
|
+
export declare const BROWSER_NOISE_SUPPRESSOR_PRESETS: {
|
|
38
|
+
/** DeepFilterNet 2023 model — best quality open-source pick. */
|
|
39
|
+
readonly deepfilternet: (workletUrl: string) => BrowserNoiseSuppressorPreset;
|
|
40
|
+
/** Jitsi @jitsi/rnnoise-wasm — ships a `rnnoise-processor` worklet. */
|
|
41
|
+
readonly rnnoise: (workletUrl: string) => BrowserNoiseSuppressorPreset;
|
|
42
|
+
};
|
|
@@ -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
|
-
|
|
7
|
-
|
|
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,14 @@ 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 { BROWSER_NOISE_SUPPRESSOR_PRESETS, applyBrowserNoiseSuppression, } from "./client/browserNoiseSuppression";
|
|
114
|
+
export type { BrowserNoiseSuppressorHandle, BrowserNoiseSuppressorOptions, BrowserNoiseSuppressorPreset, } from "./client/browserNoiseSuppression";
|
|
115
|
+
export { buildVoiceHTMXAttributes, wrapVoiceHTMLInHTMXContainer, wrapVoiceHTMLWithHTMXPolling, } from "./client/htmxAttributes";
|
|
116
|
+
export type { VoiceHTMXPollingAttributes } from "./client/htmxAttributes";
|
|
117
|
+
export { createLiveCallViewerFromOptions, renderVoiceCostDashboardFromEvents, renderVoiceCostDashboardHTMX, renderVoiceLiveCallViewerFromState, renderVoiceLiveCallViewerFromViewer, renderVoiceLiveCallViewerHTMX, renderVoiceReplayTimelineFromArtifact, renderVoiceReplayTimelineHTMX, resolveVoiceDashboardRenderers, } from "./client/htmxDashboardRenderers";
|
|
118
|
+
export type { ResolvedVoiceDashboardRenderers, VoiceCostDashboardHTMXInput, VoiceCostDashboardRenderer, VoiceDashboardHTMXAttributes, VoiceDashboardHTMXRendererConfig, VoiceLiveCallViewerHTMXInput, VoiceLiveCallViewerRenderer, VoiceReplayTimelineHTMXInput, VoiceReplayTimelineRenderer, } from "./client/htmxDashboardRenderers";
|
|
119
|
+
export { createVoiceCostDashboardHTMXRoute, createVoiceHTMXDashboardRoutes, createVoiceHTMXDashboardRoutesFromStores, createVoiceLiveCallViewerHTMXRoute, createVoiceReplayTimelineHTMXRoute, } from "./htmxDashboardRoutes";
|
|
120
|
+
export type { CreateVoiceHTMXDashboardRoutesFromStoresOptions, VoiceHTMXCostDashboardRoutesOptions, VoiceHTMXDashboardRoutesOptions, VoiceHTMXLiveCallViewerRoutesOptions, VoiceHTMXReplayTimelineRoutesOptions, } from "./htmxDashboardRoutes";
|
|
113
121
|
export { buildVoiceCostDashboardReport } from "./client/costDashboard";
|
|
114
122
|
export type { VoiceCostDashboardBucket, VoiceCostDashboardOptions, VoiceCostDashboardReport, } from "./client/costDashboard";
|
|
115
123
|
export { createLiveCallViewer } from "./client/liveCallViewer";
|