@absolutejs/voice 0.0.5 → 0.0.7
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.
- package/dist/plugin.d.ts +10 -2
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/plugin.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import type { VoicePluginConfig, VoiceSessionRecord } from './types';
|
|
3
|
-
|
|
2
|
+
import type { VoiceHTMXConfig, VoicePluginConfig, VoiceRouteConfig, VoiceSessionRecord } from './types';
|
|
3
|
+
type InferVoiceResult<TOnTurn extends (...args: any) => any> = Exclude<Awaited<ReturnType<TOnTurn>>, void> extends {
|
|
4
|
+
result?: infer TResult;
|
|
5
|
+
} ? TResult : unknown;
|
|
6
|
+
type VoiceOnTurnHandler<TContext, TSession extends VoiceSessionRecord> = VoiceRouteConfig<TContext, TSession, unknown>['onTurn'];
|
|
7
|
+
export declare const voice: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TOnTurn extends VoiceOnTurnHandler<TContext, TSession> = VoiceOnTurnHandler<TContext, TSession>>(config: Omit<VoicePluginConfig<TContext, TSession, InferVoiceResult<TOnTurn>>, "onTurn" | "htmx"> & {
|
|
8
|
+
onTurn: TOnTurn;
|
|
9
|
+
htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<InferVoiceResult<TOnTurn>>>;
|
|
10
|
+
}) => Elysia<"", {
|
|
4
11
|
decorator: {};
|
|
5
12
|
store: {};
|
|
6
13
|
derive: {};
|
|
@@ -66,3 +73,4 @@ export declare const voice: <TContext = unknown, TSession extends VoiceSessionRe
|
|
|
66
73
|
standaloneSchema: {};
|
|
67
74
|
response: {};
|
|
68
75
|
}>;
|
|
76
|
+
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -208,7 +208,7 @@ export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionR
|
|
|
208
208
|
silenceMs?: number;
|
|
209
209
|
};
|
|
210
210
|
logger?: VoiceLogger;
|
|
211
|
-
htmx?: boolean | VoiceHTMXConfig<TSession, TResult
|
|
211
|
+
htmx?: boolean | VoiceHTMXConfig<TSession, NoInfer<TResult>>;
|
|
212
212
|
} & VoiceRouteConfig<TContext, TSession, TResult>;
|
|
213
213
|
export type CreateVoiceSessionOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
214
214
|
id: string;
|