@tanstack/ai-solid 0.13.14 → 0.14.0

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.
Files changed (40) hide show
  1. package/dist/index.d.ts +12 -0
  2. package/dist/index.js +12 -0
  3. package/dist/types.d.ts +139 -0
  4. package/dist/use-audio-recorder.d.ts +37 -0
  5. package/dist/use-audio-recorder.js +39 -0
  6. package/dist/use-audio-recorder.js.map +1 -0
  7. package/dist/use-chat.d.ts +9 -0
  8. package/dist/use-chat.js +162 -0
  9. package/dist/use-chat.js.map +1 -0
  10. package/dist/use-generate-audio.d.ts +88 -0
  11. package/dist/use-generate-audio.js +52 -0
  12. package/dist/use-generate-audio.js.map +1 -0
  13. package/dist/use-generate-image.d.ts +96 -0
  14. package/dist/use-generate-image.js +60 -0
  15. package/dist/use-generate-image.js.map +1 -0
  16. package/dist/use-generate-speech.d.ts +90 -0
  17. package/dist/use-generate-speech.js +54 -0
  18. package/dist/use-generate-speech.js.map +1 -0
  19. package/dist/use-generate-video.d.ts +103 -0
  20. package/dist/use-generate-video.js +114 -0
  21. package/dist/use-generate-video.js.map +1 -0
  22. package/dist/use-generation.d.ts +88 -0
  23. package/dist/use-generation.js +94 -0
  24. package/dist/use-generation.js.map +1 -0
  25. package/dist/use-summarize.d.ts +93 -0
  26. package/dist/use-summarize.js +57 -0
  27. package/dist/use-summarize.js.map +1 -0
  28. package/dist/use-transcription.d.ts +99 -0
  29. package/dist/use-transcription.js +63 -0
  30. package/dist/use-transcription.js.map +1 -0
  31. package/package.json +4 -4
  32. package/src/index.ts +6 -0
  33. package/src/use-audio-recorder.ts +87 -0
  34. package/src/use-generate-audio.ts +5 -8
  35. package/src/use-generate-image.ts +5 -8
  36. package/src/use-generate-speech.ts +7 -7
  37. package/src/use-generate-video.ts +17 -9
  38. package/src/use-generation.ts +17 -6
  39. package/src/use-summarize.ts +7 -8
  40. package/src/use-transcription.ts +9 -11
@@ -0,0 +1,96 @@
1
+ import { Accessor } from "solid-js";
2
+ import { AIDevtoolsDisplayOptions, ConnectConnectionAdapter, GenerationClientState, GenerationFetcher, ImageGenerateInput, InferGenerationOutputFromReturn } from "@tanstack/ai-client";
3
+ import { ImageGenerationResult, StreamChunk } from "@tanstack/ai";
4
+
5
+ //#region src/use-generate-image.d.ts
6
+
7
+ /**
8
+ * Options for the useGenerateImage hook.
9
+ *
10
+ * @template TOutput - The transformed output type (defaults to ImageGenerationResult)
11
+ */
12
+ interface UseGenerateImageOptions<TOutput = ImageGenerationResult> {
13
+ /** Connect-based adapter for streaming transport (SSE, HTTP stream, custom) */
14
+ connection?: ConnectConnectionAdapter;
15
+ /** Direct async function for image generation */
16
+ fetcher?: GenerationFetcher<ImageGenerateInput, ImageGenerationResult>;
17
+ /** Unique identifier for this generation instance */
18
+ id?: string;
19
+ /** Additional body parameters to send with connect-based adapter requests */
20
+ body?: Record<string, any>;
21
+ /** Display options for TanStack AI Devtools. */
22
+ devtools?: AIDevtoolsDisplayOptions;
23
+ /**
24
+ * Callback when images are generated. Can optionally return a transformed value.
25
+ *
26
+ * - Return a non-null value to transform and store it as the result
27
+ * - Return `null` to keep the previous result unchanged
28
+ * - Return nothing (`void`) to store the raw result as-is
29
+ */
30
+ onResult?: (result: ImageGenerationResult) => TOutput | null | void;
31
+ /** Callback when an error occurs */
32
+ onError?: (error: Error) => void;
33
+ /** Callback when progress is reported (0-100) */
34
+ onProgress?: (progress: number, message?: string) => void;
35
+ /** Callback for each stream chunk (connect-based adapter mode only) */
36
+ onChunk?: (chunk: StreamChunk) => void;
37
+ }
38
+ /**
39
+ * Return type for the useGenerateImage hook.
40
+ *
41
+ * @template TOutput - The transformed output type (defaults to ImageGenerationResult)
42
+ */
43
+ interface UseGenerateImageReturn<TOutput = ImageGenerationResult> {
44
+ /** Trigger image generation */
45
+ generate: (input: ImageGenerateInput) => Promise<void>;
46
+ /** The generation result containing images, or null */
47
+ result: Accessor<TOutput | null>;
48
+ /** Whether generation is in progress */
49
+ isLoading: Accessor<boolean>;
50
+ /** Current error, if any */
51
+ error: Accessor<Error | undefined>;
52
+ /** Current state of the generation */
53
+ status: Accessor<GenerationClientState>;
54
+ /** Abort the current generation */
55
+ stop: () => void;
56
+ /** Clear result, error, and return to idle */
57
+ reset: () => void;
58
+ }
59
+ /**
60
+ * Solid hook for generating images using AI models.
61
+ *
62
+ * Supports two transport modes:
63
+ * - **ConnectConnectionAdapter** -- Streaming transport (SSE, HTTP stream, custom)
64
+ * - **Fetcher** -- Direct async function call
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * import { useGenerateImage } from '@tanstack/ai-solid'
69
+ * import { fetchServerSentEvents } from '@tanstack/ai-client'
70
+ *
71
+ * function ImageGenerator() {
72
+ * const { generate, result, isLoading, error, reset } = useGenerateImage({
73
+ * connection: fetchServerSentEvents('/api/generate/image'),
74
+ * })
75
+ *
76
+ * return (
77
+ * <div>
78
+ * <button onClick={() => generate({ prompt: 'A sunset over mountains' })}>
79
+ * Generate
80
+ * </button>
81
+ * {isLoading() && <p>Generating...</p>}
82
+ * {error() && <p>Error: {error()!.message}</p>}
83
+ * {result()?.images.map((img, i) => (
84
+ * <img src={img.url || `data:image/png;base64,${img.b64Json}`} />
85
+ * ))}
86
+ * </div>
87
+ * )
88
+ * }
89
+ * ```
90
+ */
91
+ declare function useGenerateImage<TTransformed = void>(options: Omit<UseGenerateImageOptions, 'onResult'> & {
92
+ onResult?: (result: ImageGenerationResult) => TTransformed;
93
+ }): UseGenerateImageReturn<InferGenerationOutputFromReturn<ImageGenerationResult, TTransformed>>;
94
+ //#endregion
95
+ export { UseGenerateImageOptions, UseGenerateImageReturn, useGenerateImage };
96
+ //# sourceMappingURL=use-generate-image.d.ts.map
@@ -0,0 +1,60 @@
1
+ import { useGeneration } from "./use-generation.js";
2
+
3
+ //#region src/use-generate-image.ts
4
+ /**
5
+ * Solid hook for generating images using AI models.
6
+ *
7
+ * Supports two transport modes:
8
+ * - **ConnectConnectionAdapter** -- Streaming transport (SSE, HTTP stream, custom)
9
+ * - **Fetcher** -- Direct async function call
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * import { useGenerateImage } from '@tanstack/ai-solid'
14
+ * import { fetchServerSentEvents } from '@tanstack/ai-client'
15
+ *
16
+ * function ImageGenerator() {
17
+ * const { generate, result, isLoading, error, reset } = useGenerateImage({
18
+ * connection: fetchServerSentEvents('/api/generate/image'),
19
+ * })
20
+ *
21
+ * return (
22
+ * <div>
23
+ * <button onClick={() => generate({ prompt: 'A sunset over mountains' })}>
24
+ * Generate
25
+ * </button>
26
+ * {isLoading() && <p>Generating...</p>}
27
+ * {error() && <p>Error: {error()!.message}</p>}
28
+ * {result()?.images.map((img, i) => (
29
+ * <img src={img.url || `data:image/png;base64,${img.b64Json}`} />
30
+ * ))}
31
+ * </div>
32
+ * )
33
+ * }
34
+ * ```
35
+ */
36
+ function useGenerateImage(options) {
37
+ const devtools = {
38
+ ...options.devtools,
39
+ framework: "solid",
40
+ hookName: "useGenerateImage",
41
+ outputKind: "image"
42
+ };
43
+ const { generate, result, isLoading, error, status, stop, reset } = useGeneration({
44
+ ...options,
45
+ devtools
46
+ });
47
+ return {
48
+ generate,
49
+ result,
50
+ isLoading,
51
+ error,
52
+ status,
53
+ stop,
54
+ reset
55
+ };
56
+ }
57
+
58
+ //#endregion
59
+ export { useGenerateImage };
60
+ //# sourceMappingURL=use-generate-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-generate-image.js","names":[],"sources":["../src/use-generate-image.ts"],"sourcesContent":["import { useGeneration } from './use-generation'\nimport type { ImageGenerationResult, StreamChunk } from '@tanstack/ai'\nimport type {\n AIDevtoolsDisplayOptions,\n ConnectConnectionAdapter,\n GenerationClientState,\n GenerationFetcher,\n ImageGenerateInput,\n InferGenerationOutputFromReturn,\n} from '@tanstack/ai-client'\nimport type { Accessor } from 'solid-js'\n\n/**\n * Options for the useGenerateImage hook.\n *\n * @template TOutput - The transformed output type (defaults to ImageGenerationResult)\n */\nexport interface UseGenerateImageOptions<TOutput = ImageGenerationResult> {\n /** Connect-based adapter for streaming transport (SSE, HTTP stream, custom) */\n connection?: ConnectConnectionAdapter\n /** Direct async function for image generation */\n fetcher?: GenerationFetcher<ImageGenerateInput, ImageGenerationResult>\n /** Unique identifier for this generation instance */\n id?: string\n /** Additional body parameters to send with connect-based adapter requests */\n body?: Record<string, any>\n /** Display options for TanStack AI Devtools. */\n devtools?: AIDevtoolsDisplayOptions\n /**\n * Callback when images are generated. Can optionally return a transformed value.\n *\n * - Return a non-null value to transform and store it as the result\n * - Return `null` to keep the previous result unchanged\n * - Return nothing (`void`) to store the raw result as-is\n */\n onResult?: (result: ImageGenerationResult) => TOutput | null | void\n /** Callback when an error occurs */\n onError?: (error: Error) => void\n /** Callback when progress is reported (0-100) */\n onProgress?: (progress: number, message?: string) => void\n /** Callback for each stream chunk (connect-based adapter mode only) */\n onChunk?: (chunk: StreamChunk) => void\n}\n\n/**\n * Return type for the useGenerateImage hook.\n *\n * @template TOutput - The transformed output type (defaults to ImageGenerationResult)\n */\nexport interface UseGenerateImageReturn<TOutput = ImageGenerationResult> {\n /** Trigger image generation */\n generate: (input: ImageGenerateInput) => Promise<void>\n /** The generation result containing images, or null */\n result: Accessor<TOutput | null>\n /** Whether generation is in progress */\n isLoading: Accessor<boolean>\n /** Current error, if any */\n error: Accessor<Error | undefined>\n /** Current state of the generation */\n status: Accessor<GenerationClientState>\n /** Abort the current generation */\n stop: () => void\n /** Clear result, error, and return to idle */\n reset: () => void\n}\n\n/**\n * Solid hook for generating images using AI models.\n *\n * Supports two transport modes:\n * - **ConnectConnectionAdapter** -- Streaming transport (SSE, HTTP stream, custom)\n * - **Fetcher** -- Direct async function call\n *\n * @example\n * ```tsx\n * import { useGenerateImage } from '@tanstack/ai-solid'\n * import { fetchServerSentEvents } from '@tanstack/ai-client'\n *\n * function ImageGenerator() {\n * const { generate, result, isLoading, error, reset } = useGenerateImage({\n * connection: fetchServerSentEvents('/api/generate/image'),\n * })\n *\n * return (\n * <div>\n * <button onClick={() => generate({ prompt: 'A sunset over mountains' })}>\n * Generate\n * </button>\n * {isLoading() && <p>Generating...</p>}\n * {error() && <p>Error: {error()!.message}</p>}\n * {result()?.images.map((img, i) => (\n * <img src={img.url || `data:image/png;base64,${img.b64Json}`} />\n * ))}\n * </div>\n * )\n * }\n * ```\n */\nexport function useGenerateImage<TTransformed = void>(\n options: Omit<UseGenerateImageOptions, 'onResult'> & {\n onResult?: (result: ImageGenerationResult) => TTransformed\n },\n): UseGenerateImageReturn<\n InferGenerationOutputFromReturn<ImageGenerationResult, TTransformed>\n> {\n const devtools = {\n ...options.devtools,\n framework: 'solid',\n hookName: 'useGenerateImage',\n outputKind: 'image' as const,\n }\n const { generate, result, isLoading, error, status, stop, reset } =\n useGeneration<ImageGenerateInput, ImageGenerationResult, TTransformed>({\n ...options,\n devtools,\n })\n\n return {\n generate: generate as (input: ImageGenerateInput) => Promise<void>,\n result,\n isLoading,\n error,\n status,\n stop,\n reset,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGA,SAAgB,iBACd,SAKA;CACA,MAAM,WAAW;EACf,GAAG,QAAQ;EACX,WAAW;EACX,UAAU;EACV,YAAY;EACb;CACD,MAAM,EAAE,UAAU,QAAQ,WAAW,OAAO,QAAQ,MAAM,UACxD,cAAuE;EACrE,GAAG;EACH;EACD,CAAC;AAEJ,QAAO;EACK;EACV;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -0,0 +1,90 @@
1
+ import { Accessor } from "solid-js";
2
+ import { AIDevtoolsDisplayOptions, ConnectConnectionAdapter, GenerationClientState, GenerationFetcher, InferGenerationOutputFromReturn, SpeechGenerateInput } from "@tanstack/ai-client";
3
+ import { StreamChunk, TTSResult } from "@tanstack/ai";
4
+
5
+ //#region src/use-generate-speech.d.ts
6
+
7
+ /**
8
+ * Options for the useGenerateSpeech hook.
9
+ *
10
+ * @template TOutput - The transformed output type (defaults to TTSResult)
11
+ */
12
+ interface UseGenerateSpeechOptions<TOutput = TTSResult> {
13
+ /** Connect-based adapter for streaming transport (SSE, HTTP stream, custom) */
14
+ connection?: ConnectConnectionAdapter;
15
+ /** Direct async function for speech generation */
16
+ fetcher?: GenerationFetcher<SpeechGenerateInput, TTSResult>;
17
+ /** Unique identifier for this generation instance */
18
+ id?: string;
19
+ /** Additional body parameters to send with connect-based adapter requests */
20
+ body?: Record<string, any>;
21
+ /** Display options for TanStack AI Devtools. */
22
+ devtools?: AIDevtoolsDisplayOptions;
23
+ /**
24
+ * Callback when speech is generated. Can optionally return a transformed value.
25
+ *
26
+ * - Return a non-null value to transform and store it as the result
27
+ * - Return `null` to keep the previous result unchanged
28
+ * - Return nothing (`void`) to store the raw result as-is
29
+ */
30
+ onResult?: (result: TTSResult) => TOutput | null | void;
31
+ /** Callback when an error occurs */
32
+ onError?: (error: Error) => void;
33
+ /** Callback when progress is reported (0-100) */
34
+ onProgress?: (progress: number, message?: string) => void;
35
+ /** Callback for each stream chunk (connect-based adapter mode only) */
36
+ onChunk?: (chunk: StreamChunk) => void;
37
+ }
38
+ /**
39
+ * Return type for the useGenerateSpeech hook.
40
+ *
41
+ * @template TOutput - The transformed output type (defaults to TTSResult)
42
+ */
43
+ interface UseGenerateSpeechReturn<TOutput = TTSResult> {
44
+ /** Trigger speech generation */
45
+ generate: (input: SpeechGenerateInput) => Promise<void>;
46
+ /** The TTS result containing audio data, or null */
47
+ result: Accessor<TOutput | null>;
48
+ /** Whether generation is in progress */
49
+ isLoading: Accessor<boolean>;
50
+ /** Current error, if any */
51
+ error: Accessor<Error | undefined>;
52
+ /** Current state of the generation */
53
+ status: Accessor<GenerationClientState>;
54
+ /** Abort the current generation */
55
+ stop: () => void;
56
+ /** Clear result, error, and return to idle */
57
+ reset: () => void;
58
+ }
59
+ /**
60
+ * Solid hook for generating speech (text-to-speech) using AI models.
61
+ *
62
+ * @example
63
+ * ```tsx
64
+ * import { useGenerateSpeech } from '@tanstack/ai-solid'
65
+ * import { fetchServerSentEvents } from '@tanstack/ai-client'
66
+ *
67
+ * function SpeechGenerator() {
68
+ * const { generate, result, isLoading } = useGenerateSpeech({
69
+ * connection: fetchServerSentEvents('/api/generate/speech'),
70
+ * })
71
+ *
72
+ * return (
73
+ * <div>
74
+ * <button onClick={() => generate({ text: 'Hello world', voice: 'alloy' })}>
75
+ * Generate Speech
76
+ * </button>
77
+ * {result() && (
78
+ * <audio src={`data:audio/${result()!.format};base64,${result()!.audio}`} controls />
79
+ * )}
80
+ * </div>
81
+ * )
82
+ * }
83
+ * ```
84
+ */
85
+ declare function useGenerateSpeech<TTransformed = void>(options: Omit<UseGenerateSpeechOptions, 'onResult'> & {
86
+ onResult?: (result: TTSResult) => TTransformed;
87
+ }): UseGenerateSpeechReturn<InferGenerationOutputFromReturn<TTSResult, TTransformed>>;
88
+ //#endregion
89
+ export { UseGenerateSpeechOptions, UseGenerateSpeechReturn, useGenerateSpeech };
90
+ //# sourceMappingURL=use-generate-speech.d.ts.map
@@ -0,0 +1,54 @@
1
+ import { useGeneration } from "./use-generation.js";
2
+
3
+ //#region src/use-generate-speech.ts
4
+ /**
5
+ * Solid hook for generating speech (text-to-speech) using AI models.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import { useGenerateSpeech } from '@tanstack/ai-solid'
10
+ * import { fetchServerSentEvents } from '@tanstack/ai-client'
11
+ *
12
+ * function SpeechGenerator() {
13
+ * const { generate, result, isLoading } = useGenerateSpeech({
14
+ * connection: fetchServerSentEvents('/api/generate/speech'),
15
+ * })
16
+ *
17
+ * return (
18
+ * <div>
19
+ * <button onClick={() => generate({ text: 'Hello world', voice: 'alloy' })}>
20
+ * Generate Speech
21
+ * </button>
22
+ * {result() && (
23
+ * <audio src={`data:audio/${result()!.format};base64,${result()!.audio}`} controls />
24
+ * )}
25
+ * </div>
26
+ * )
27
+ * }
28
+ * ```
29
+ */
30
+ function useGenerateSpeech(options) {
31
+ const devtools = {
32
+ ...options.devtools,
33
+ framework: "solid",
34
+ hookName: "useGenerateSpeech",
35
+ outputKind: "audio"
36
+ };
37
+ const { generate, result, isLoading, error, status, stop, reset } = useGeneration({
38
+ ...options,
39
+ devtools
40
+ });
41
+ return {
42
+ generate,
43
+ result,
44
+ isLoading,
45
+ error,
46
+ status,
47
+ stop,
48
+ reset
49
+ };
50
+ }
51
+
52
+ //#endregion
53
+ export { useGenerateSpeech };
54
+ //# sourceMappingURL=use-generate-speech.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-generate-speech.js","names":[],"sources":["../src/use-generate-speech.ts"],"sourcesContent":["import { useGeneration } from './use-generation'\nimport type { StreamChunk, TTSResult } from '@tanstack/ai'\nimport type {\n AIDevtoolsDisplayOptions,\n ConnectConnectionAdapter,\n GenerationClientState,\n GenerationFetcher,\n InferGenerationOutputFromReturn,\n SpeechGenerateInput,\n} from '@tanstack/ai-client'\nimport type { Accessor } from 'solid-js'\n\n/**\n * Options for the useGenerateSpeech hook.\n *\n * @template TOutput - The transformed output type (defaults to TTSResult)\n */\nexport interface UseGenerateSpeechOptions<TOutput = TTSResult> {\n /** Connect-based adapter for streaming transport (SSE, HTTP stream, custom) */\n connection?: ConnectConnectionAdapter\n /** Direct async function for speech generation */\n fetcher?: GenerationFetcher<SpeechGenerateInput, TTSResult>\n /** Unique identifier for this generation instance */\n id?: string\n /** Additional body parameters to send with connect-based adapter requests */\n body?: Record<string, any>\n /** Display options for TanStack AI Devtools. */\n devtools?: AIDevtoolsDisplayOptions\n /**\n * Callback when speech is generated. Can optionally return a transformed value.\n *\n * - Return a non-null value to transform and store it as the result\n * - Return `null` to keep the previous result unchanged\n * - Return nothing (`void`) to store the raw result as-is\n */\n onResult?: (result: TTSResult) => TOutput | null | void\n /** Callback when an error occurs */\n onError?: (error: Error) => void\n /** Callback when progress is reported (0-100) */\n onProgress?: (progress: number, message?: string) => void\n /** Callback for each stream chunk (connect-based adapter mode only) */\n onChunk?: (chunk: StreamChunk) => void\n}\n\n/**\n * Return type for the useGenerateSpeech hook.\n *\n * @template TOutput - The transformed output type (defaults to TTSResult)\n */\nexport interface UseGenerateSpeechReturn<TOutput = TTSResult> {\n /** Trigger speech generation */\n generate: (input: SpeechGenerateInput) => Promise<void>\n /** The TTS result containing audio data, or null */\n result: Accessor<TOutput | null>\n /** Whether generation is in progress */\n isLoading: Accessor<boolean>\n /** Current error, if any */\n error: Accessor<Error | undefined>\n /** Current state of the generation */\n status: Accessor<GenerationClientState>\n /** Abort the current generation */\n stop: () => void\n /** Clear result, error, and return to idle */\n reset: () => void\n}\n\n/**\n * Solid hook for generating speech (text-to-speech) using AI models.\n *\n * @example\n * ```tsx\n * import { useGenerateSpeech } from '@tanstack/ai-solid'\n * import { fetchServerSentEvents } from '@tanstack/ai-client'\n *\n * function SpeechGenerator() {\n * const { generate, result, isLoading } = useGenerateSpeech({\n * connection: fetchServerSentEvents('/api/generate/speech'),\n * })\n *\n * return (\n * <div>\n * <button onClick={() => generate({ text: 'Hello world', voice: 'alloy' })}>\n * Generate Speech\n * </button>\n * {result() && (\n * <audio src={`data:audio/${result()!.format};base64,${result()!.audio}`} controls />\n * )}\n * </div>\n * )\n * }\n * ```\n */\nexport function useGenerateSpeech<TTransformed = void>(\n options: Omit<UseGenerateSpeechOptions, 'onResult'> & {\n onResult?: (result: TTSResult) => TTransformed\n },\n): UseGenerateSpeechReturn<\n InferGenerationOutputFromReturn<TTSResult, TTransformed>\n> {\n const devtools = {\n ...options.devtools,\n framework: 'solid',\n hookName: 'useGenerateSpeech',\n outputKind: 'audio' as const,\n }\n const { generate, result, isLoading, error, status, stop, reset } =\n useGeneration<SpeechGenerateInput, TTSResult, TTransformed>({\n ...options,\n devtools,\n })\n\n return {\n generate: generate as (input: SpeechGenerateInput) => Promise<void>,\n result,\n isLoading,\n error,\n status,\n stop,\n reset,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAgB,kBACd,SAKA;CACA,MAAM,WAAW;EACf,GAAG,QAAQ;EACX,WAAW;EACX,UAAU;EACV,YAAY;EACb;CACD,MAAM,EAAE,UAAU,QAAQ,WAAW,OAAO,QAAQ,MAAM,UACxD,cAA4D;EAC1D,GAAG;EACH;EACD,CAAC;AAEJ,QAAO;EACK;EACV;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -0,0 +1,103 @@
1
+ import { Accessor } from "solid-js";
2
+ import { AIDevtoolsDisplayOptions, ConnectConnectionAdapter, GenerationClientState, GenerationFetcher, InferGenerationOutputFromReturn, VideoGenerateInput, VideoGenerateResult, VideoStatusInfo } from "@tanstack/ai-client";
3
+ import { StreamChunk } from "@tanstack/ai";
4
+
5
+ //#region src/use-generate-video.d.ts
6
+
7
+ /**
8
+ * Options for the useGenerateVideo hook.
9
+ *
10
+ * @template TOutput - The transformed output type (defaults to VideoGenerateResult)
11
+ */
12
+ interface UseGenerateVideoOptions<TOutput = VideoGenerateResult> {
13
+ /** Connect-based adapter for streaming transport (server handles polling) */
14
+ connection?: ConnectConnectionAdapter;
15
+ /** Direct async function that returns a completed video result */
16
+ fetcher?: GenerationFetcher<VideoGenerateInput, VideoGenerateResult>;
17
+ /** Unique identifier for this generation instance */
18
+ id?: string;
19
+ /** Additional body parameters to send with connect-based adapter requests */
20
+ body?: Record<string, any>;
21
+ /** Display options for TanStack AI Devtools. */
22
+ devtools?: AIDevtoolsDisplayOptions;
23
+ /**
24
+ * Callback when video generation completes. Can optionally return a transformed value.
25
+ *
26
+ * - Return a non-null value to transform and store it as the result
27
+ * - Return `null` to keep the previous result unchanged
28
+ * - Return nothing (`void`) to store the raw result as-is
29
+ */
30
+ onResult?: (result: VideoGenerateResult) => TOutput | null | void;
31
+ /** Callback when an error occurs */
32
+ onError?: (error: Error) => void;
33
+ /** Callback when progress is reported (0-100) */
34
+ onProgress?: (progress: number, message?: string) => void;
35
+ /** Callback when a video job is created */
36
+ onJobCreated?: (jobId: string) => void;
37
+ /** Callback on each status update */
38
+ onStatusUpdate?: (status: VideoStatusInfo) => void;
39
+ /** Callback for each stream chunk (connect-based adapter mode only) */
40
+ onChunk?: (chunk: StreamChunk) => void;
41
+ }
42
+ /**
43
+ * Return type for the useGenerateVideo hook.
44
+ *
45
+ * @template TOutput - The transformed output type (defaults to VideoGenerateResult)
46
+ */
47
+ interface UseGenerateVideoReturn<TOutput = VideoGenerateResult> {
48
+ /** Trigger video generation */
49
+ generate: (input: VideoGenerateInput) => Promise<void>;
50
+ /** The final video result (with URL), or null */
51
+ result: Accessor<TOutput | null>;
52
+ /** The current job ID, or null */
53
+ jobId: Accessor<string | null>;
54
+ /** Current video generation status info, or null */
55
+ videoStatus: Accessor<VideoStatusInfo | null>;
56
+ /** Whether generation/polling is in progress */
57
+ isLoading: Accessor<boolean>;
58
+ /** Current error, if any */
59
+ error: Accessor<Error | undefined>;
60
+ /** Current state of the generation */
61
+ status: Accessor<GenerationClientState>;
62
+ /** Abort the current generation/polling */
63
+ stop: () => void;
64
+ /** Clear all state and return to idle */
65
+ reset: () => void;
66
+ }
67
+ /**
68
+ * Solid hook for generating videos using AI models.
69
+ *
70
+ * Video generation is asynchronous: a job is created, then polled for status
71
+ * until completion. This hook handles the full lifecycle.
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * import { useGenerateVideo } from '@tanstack/ai-solid'
76
+ * import { fetchServerSentEvents } from '@tanstack/ai-client'
77
+ *
78
+ * function VideoGenerator() {
79
+ * const { generate, result, videoStatus, isLoading } = useGenerateVideo({
80
+ * connection: fetchServerSentEvents('/api/generate/video'),
81
+ * onStatusUpdate: (status) => console.log(`Progress: ${status.progress}%`),
82
+ * })
83
+ *
84
+ * return (
85
+ * <div>
86
+ * <button onClick={() => generate({ prompt: 'A flying car over a city' })}>
87
+ * Generate Video
88
+ * </button>
89
+ * {isLoading() && videoStatus() && (
90
+ * <p>Status: {videoStatus()!.status} ({videoStatus()!.progress}%)</p>
91
+ * )}
92
+ * {result() && <video src={result()!.url} controls />}
93
+ * </div>
94
+ * )
95
+ * }
96
+ * ```
97
+ */
98
+ declare function useGenerateVideo<TTransformed = void>(options: Omit<UseGenerateVideoOptions, 'onResult'> & {
99
+ onResult?: (result: VideoGenerateResult) => TTransformed;
100
+ }): UseGenerateVideoReturn<InferGenerationOutputFromReturn<VideoGenerateResult, TTransformed>>;
101
+ //#endregion
102
+ export { UseGenerateVideoOptions, UseGenerateVideoReturn, useGenerateVideo };
103
+ //# sourceMappingURL=use-generate-video.d.ts.map
@@ -0,0 +1,114 @@
1
+ import { createEffect, createMemo, createSignal, createUniqueId, onCleanup, onMount } from "solid-js";
2
+ import { VideoGenerationClient } from "@tanstack/ai-client";
3
+ import { createVideoDevtoolsBridge } from "@tanstack/ai-client/devtools";
4
+
5
+ //#region src/use-generate-video.ts
6
+ /**
7
+ * Solid hook for generating videos using AI models.
8
+ *
9
+ * Video generation is asynchronous: a job is created, then polled for status
10
+ * until completion. This hook handles the full lifecycle.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { useGenerateVideo } from '@tanstack/ai-solid'
15
+ * import { fetchServerSentEvents } from '@tanstack/ai-client'
16
+ *
17
+ * function VideoGenerator() {
18
+ * const { generate, result, videoStatus, isLoading } = useGenerateVideo({
19
+ * connection: fetchServerSentEvents('/api/generate/video'),
20
+ * onStatusUpdate: (status) => console.log(`Progress: ${status.progress}%`),
21
+ * })
22
+ *
23
+ * return (
24
+ * <div>
25
+ * <button onClick={() => generate({ prompt: 'A flying car over a city' })}>
26
+ * Generate Video
27
+ * </button>
28
+ * {isLoading() && videoStatus() && (
29
+ * <p>Status: {videoStatus()!.status} ({videoStatus()!.progress}%)</p>
30
+ * )}
31
+ * {result() && <video src={result()!.url} controls />}
32
+ * </div>
33
+ * )
34
+ * }
35
+ * ```
36
+ */
37
+ function useGenerateVideo(options) {
38
+ const hookId = createUniqueId();
39
+ const clientId = options.id || hookId;
40
+ const [result, setResult] = createSignal(null);
41
+ const [jobId, setJobId] = createSignal(null);
42
+ const [videoStatus, setVideoStatus] = createSignal(null);
43
+ const [isLoading, setIsLoading] = createSignal(false);
44
+ const [error, setError] = createSignal(void 0);
45
+ const [status, setStatus] = createSignal("idle");
46
+ const client = createMemo(() => {
47
+ const baseOptions = {
48
+ id: clientId,
49
+ body: options.body,
50
+ devtoolsBridgeFactory: createVideoDevtoolsBridge,
51
+ devtools: {
52
+ ...options.devtools,
53
+ framework: "solid",
54
+ hookName: "useGenerateVideo",
55
+ outputKind: "video"
56
+ },
57
+ onResult: ((r) => options.onResult?.(r)),
58
+ onError: (e) => options.onError?.(e),
59
+ onProgress: (p, m) => options.onProgress?.(p, m),
60
+ onChunk: (c) => options.onChunk?.(c),
61
+ onJobCreated: (id) => options.onJobCreated?.(id),
62
+ onStatusUpdate: (s) => options.onStatusUpdate?.(s),
63
+ onResultChange: setResult,
64
+ onLoadingChange: setIsLoading,
65
+ onErrorChange: setError,
66
+ onStatusChange: setStatus,
67
+ onJobIdChange: setJobId,
68
+ onVideoStatusChange: setVideoStatus
69
+ };
70
+ if (options.connection) return new VideoGenerationClient({
71
+ ...baseOptions,
72
+ connection: options.connection
73
+ });
74
+ if (options.fetcher) return new VideoGenerationClient({
75
+ ...baseOptions,
76
+ fetcher: options.fetcher
77
+ });
78
+ throw new Error("useGenerateVideo requires either a connection or fetcher option");
79
+ }, [clientId]);
80
+ createEffect(() => {
81
+ const currentBody = options.body;
82
+ client().updateOptions({ ...currentBody !== void 0 && { body: currentBody } });
83
+ });
84
+ onMount(() => {
85
+ client().mountDevtools();
86
+ });
87
+ onCleanup(() => {
88
+ client().dispose();
89
+ });
90
+ const generate = async (input) => {
91
+ await client().generate(input);
92
+ };
93
+ const stop = () => {
94
+ client().stop();
95
+ };
96
+ const reset = () => {
97
+ client().reset();
98
+ };
99
+ return {
100
+ generate,
101
+ result,
102
+ jobId,
103
+ videoStatus,
104
+ isLoading,
105
+ error,
106
+ status,
107
+ stop,
108
+ reset
109
+ };
110
+ }
111
+
112
+ //#endregion
113
+ export { useGenerateVideo };
114
+ //# sourceMappingURL=use-generate-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-generate-video.js","names":[],"sources":["../src/use-generate-video.ts"],"sourcesContent":["import { VideoGenerationClient } from '@tanstack/ai-client'\nimport { createVideoDevtoolsBridge } from '@tanstack/ai-client/devtools'\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n onCleanup,\n onMount,\n} from 'solid-js'\nimport type { StreamChunk } from '@tanstack/ai'\nimport type {\n AIDevtoolsDisplayOptions,\n ConnectConnectionAdapter,\n GenerationClientState,\n GenerationFetcher,\n InferGenerationOutputFromReturn,\n VideoGenerateInput,\n VideoGenerateResult,\n VideoStatusInfo,\n} from '@tanstack/ai-client'\nimport type { Accessor } from 'solid-js'\n\n/**\n * Options for the useGenerateVideo hook.\n *\n * @template TOutput - The transformed output type (defaults to VideoGenerateResult)\n */\nexport interface UseGenerateVideoOptions<TOutput = VideoGenerateResult> {\n /** Connect-based adapter for streaming transport (server handles polling) */\n connection?: ConnectConnectionAdapter\n /** Direct async function that returns a completed video result */\n fetcher?: GenerationFetcher<VideoGenerateInput, VideoGenerateResult>\n /** Unique identifier for this generation instance */\n id?: string\n /** Additional body parameters to send with connect-based adapter requests */\n body?: Record<string, any>\n /** Display options for TanStack AI Devtools. */\n devtools?: AIDevtoolsDisplayOptions\n /**\n * Callback when video generation completes. Can optionally return a transformed value.\n *\n * - Return a non-null value to transform and store it as the result\n * - Return `null` to keep the previous result unchanged\n * - Return nothing (`void`) to store the raw result as-is\n */\n onResult?: (result: VideoGenerateResult) => TOutput | null | void\n /** Callback when an error occurs */\n onError?: (error: Error) => void\n /** Callback when progress is reported (0-100) */\n onProgress?: (progress: number, message?: string) => void\n /** Callback when a video job is created */\n onJobCreated?: (jobId: string) => void\n /** Callback on each status update */\n onStatusUpdate?: (status: VideoStatusInfo) => void\n /** Callback for each stream chunk (connect-based adapter mode only) */\n onChunk?: (chunk: StreamChunk) => void\n}\n\n/**\n * Return type for the useGenerateVideo hook.\n *\n * @template TOutput - The transformed output type (defaults to VideoGenerateResult)\n */\nexport interface UseGenerateVideoReturn<TOutput = VideoGenerateResult> {\n /** Trigger video generation */\n generate: (input: VideoGenerateInput) => Promise<void>\n /** The final video result (with URL), or null */\n result: Accessor<TOutput | null>\n /** The current job ID, or null */\n jobId: Accessor<string | null>\n /** Current video generation status info, or null */\n videoStatus: Accessor<VideoStatusInfo | null>\n /** Whether generation/polling is in progress */\n isLoading: Accessor<boolean>\n /** Current error, if any */\n error: Accessor<Error | undefined>\n /** Current state of the generation */\n status: Accessor<GenerationClientState>\n /** Abort the current generation/polling */\n stop: () => void\n /** Clear all state and return to idle */\n reset: () => void\n}\n\n/**\n * Solid hook for generating videos using AI models.\n *\n * Video generation is asynchronous: a job is created, then polled for status\n * until completion. This hook handles the full lifecycle.\n *\n * @example\n * ```tsx\n * import { useGenerateVideo } from '@tanstack/ai-solid'\n * import { fetchServerSentEvents } from '@tanstack/ai-client'\n *\n * function VideoGenerator() {\n * const { generate, result, videoStatus, isLoading } = useGenerateVideo({\n * connection: fetchServerSentEvents('/api/generate/video'),\n * onStatusUpdate: (status) => console.log(`Progress: ${status.progress}%`),\n * })\n *\n * return (\n * <div>\n * <button onClick={() => generate({ prompt: 'A flying car over a city' })}>\n * Generate Video\n * </button>\n * {isLoading() && videoStatus() && (\n * <p>Status: {videoStatus()!.status} ({videoStatus()!.progress}%)</p>\n * )}\n * {result() && <video src={result()!.url} controls />}\n * </div>\n * )\n * }\n * ```\n */\n// `TTransformed` infers from the `onResult` return position so the callback\n// parameter is typed as `VideoGenerateResult` and `result` narrows to the\n// transform's return. See issue #848.\nexport function useGenerateVideo<TTransformed = void>(\n options: Omit<UseGenerateVideoOptions, 'onResult'> & {\n onResult?: (result: VideoGenerateResult) => TTransformed\n },\n): UseGenerateVideoReturn<\n InferGenerationOutputFromReturn<VideoGenerateResult, TTransformed>\n> {\n type TOutput = InferGenerationOutputFromReturn<\n VideoGenerateResult,\n TTransformed\n >\n const hookId = createUniqueId()\n const clientId = options.id || hookId\n\n const [result, setResult] = createSignal<TOutput | null>(null)\n const [jobId, setJobId] = createSignal<string | null>(null)\n const [videoStatus, setVideoStatus] = createSignal<VideoStatusInfo | null>(\n null,\n )\n const [isLoading, setIsLoading] = createSignal(false)\n const [error, setError] = createSignal<Error | undefined>(undefined)\n const [status, setStatus] = createSignal<GenerationClientState>('idle')\n\n const client = createMemo(() => {\n // Conditional spread on `body`: VideoGenerationClientOptions.body\n // is a strict optional; EOPT forbids passing `T | undefined`.\n const baseOptions = {\n id: clientId,\n body: options.body,\n devtoolsBridgeFactory: createVideoDevtoolsBridge,\n devtools: {\n ...options.devtools,\n framework: 'solid',\n hookName: 'useGenerateVideo',\n outputKind: 'video' as const,\n },\n // The transform's raw return type (`TTransformed`) and the stored output\n // (`TOutput`, with null/void/undefined stripped) are identical at runtime;\n // the cast bridges the relationship that the conditional type hides.\n onResult: ((r: VideoGenerateResult) => options.onResult?.(r)) as (\n result: VideoGenerateResult,\n ) => TOutput | null | void,\n onError: (e: Error) => options.onError?.(e),\n onProgress: (p: number, m?: string) => options.onProgress?.(p, m),\n onChunk: (c: StreamChunk) => options.onChunk?.(c),\n onJobCreated: (id: string) => options.onJobCreated?.(id),\n onStatusUpdate: (s: VideoStatusInfo) => options.onStatusUpdate?.(s),\n onResultChange: setResult,\n onLoadingChange: setIsLoading,\n onErrorChange: setError,\n onStatusChange: setStatus,\n onJobIdChange: setJobId,\n onVideoStatusChange: setVideoStatus,\n }\n\n if (options.connection) {\n return new VideoGenerationClient<TOutput>({\n ...baseOptions,\n connection: options.connection,\n })\n }\n\n if (options.fetcher) {\n return new VideoGenerationClient<TOutput>({\n ...baseOptions,\n fetcher: options.fetcher,\n })\n }\n\n throw new Error(\n 'useGenerateVideo requires either a connection or fetcher option',\n )\n }, [clientId])\n\n // Sync body changes without recreating client\n createEffect(() => {\n const currentBody = options.body\n client().updateOptions({\n ...(currentBody !== undefined && { body: currentBody }),\n })\n })\n\n onMount(() => {\n client().mountDevtools()\n })\n\n // Cleanup on unmount: stop any in-flight requests and unregister devtools\n onCleanup(() => {\n client().dispose()\n })\n\n const generate = async (input: VideoGenerateInput) => {\n await client().generate(input)\n }\n\n const stop = () => {\n client().stop()\n }\n\n const reset = () => {\n client().reset()\n }\n\n return {\n generate,\n result,\n jobId,\n videoStatus,\n isLoading,\n error,\n status,\n stop,\n reset,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuHA,SAAgB,iBACd,SAKA;CAKA,MAAM,SAAS,gBAAgB;CAC/B,MAAM,WAAW,QAAQ,MAAM;CAE/B,MAAM,CAAC,QAAQ,aAAa,aAA6B,KAAK;CAC9D,MAAM,CAAC,OAAO,YAAY,aAA4B,KAAK;CAC3D,MAAM,CAAC,aAAa,kBAAkB,aACpC,KACD;CACD,MAAM,CAAC,WAAW,gBAAgB,aAAa,MAAM;CACrD,MAAM,CAAC,OAAO,YAAY,aAAgC,OAAU;CACpE,MAAM,CAAC,QAAQ,aAAa,aAAoC,OAAO;CAEvE,MAAM,SAAS,iBAAiB;EAG9B,MAAM,cAAc;GAClB,IAAI;GACJ,MAAM,QAAQ;GACd,uBAAuB;GACvB,UAAU;IACR,GAAG,QAAQ;IACX,WAAW;IACX,UAAU;IACV,YAAY;IACb;GAID,YAAY,MAA2B,QAAQ,WAAW,EAAE;GAG5D,UAAU,MAAa,QAAQ,UAAU,EAAE;GAC3C,aAAa,GAAW,MAAe,QAAQ,aAAa,GAAG,EAAE;GACjE,UAAU,MAAmB,QAAQ,UAAU,EAAE;GACjD,eAAe,OAAe,QAAQ,eAAe,GAAG;GACxD,iBAAiB,MAAuB,QAAQ,iBAAiB,EAAE;GACnE,gBAAgB;GAChB,iBAAiB;GACjB,eAAe;GACf,gBAAgB;GAChB,eAAe;GACf,qBAAqB;GACtB;AAED,MAAI,QAAQ,WACV,QAAO,IAAI,sBAA+B;GACxC,GAAG;GACH,YAAY,QAAQ;GACrB,CAAC;AAGJ,MAAI,QAAQ,QACV,QAAO,IAAI,sBAA+B;GACxC,GAAG;GACH,SAAS,QAAQ;GAClB,CAAC;AAGJ,QAAM,IAAI,MACR,kEACD;IACA,CAAC,SAAS,CAAC;AAGd,oBAAmB;EACjB,MAAM,cAAc,QAAQ;AAC5B,UAAQ,CAAC,cAAc,EACrB,GAAI,gBAAgB,UAAa,EAAE,MAAM,aAAa,EACvD,CAAC;GACF;AAEF,eAAc;AACZ,UAAQ,CAAC,eAAe;GACxB;AAGF,iBAAgB;AACd,UAAQ,CAAC,SAAS;GAClB;CAEF,MAAM,WAAW,OAAO,UAA8B;AACpD,QAAM,QAAQ,CAAC,SAAS,MAAM;;CAGhC,MAAM,aAAa;AACjB,UAAQ,CAAC,MAAM;;CAGjB,MAAM,cAAc;AAClB,UAAQ,CAAC,OAAO;;AAGlB,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -0,0 +1,88 @@
1
+ import { Accessor } from "solid-js";
2
+ import { AIDevtoolsDisplayOptions, ConnectConnectionAdapter, GenerationClientState, GenerationFetcher, InferGenerationOutputFromReturn } from "@tanstack/ai-client";
3
+ import { StreamChunk } from "@tanstack/ai";
4
+
5
+ //#region src/use-generation.d.ts
6
+
7
+ /**
8
+ * Options for the useGeneration hook.
9
+ *
10
+ * Accepts either a `connection` (streaming transport) or a `fetcher` (direct async call).
11
+ *
12
+ * @template TInput - The input type for the generation request
13
+ * @template TResult - The result type returned by the generation
14
+ * @template TOutput - The transformed output type (defaults to TResult)
15
+ */
16
+ interface UseGenerationOptions<TInput, TResult, TOutput = TResult> {
17
+ /** Connect-based adapter for streaming transport (SSE, HTTP stream, custom) */
18
+ connection?: ConnectConnectionAdapter;
19
+ /** Direct async function for one-shot generation (no streaming protocol needed) */
20
+ fetcher?: GenerationFetcher<TInput, TResult>;
21
+ /** Unique identifier for this generation instance */
22
+ id?: string;
23
+ /** Additional body parameters to send with connect-based adapter requests */
24
+ body?: Record<string, any>;
25
+ /** Display options for TanStack AI Devtools. */
26
+ devtools?: AIDevtoolsDisplayOptions;
27
+ /**
28
+ * Callback when a result is received. Can optionally return a transformed value.
29
+ *
30
+ * - Return a non-null value to transform and store it as the result
31
+ * - Return `null` to keep the previous result unchanged
32
+ * - Return nothing (`void`) to store the raw result as-is
33
+ */
34
+ onResult?: (result: TResult) => TOutput | null | void;
35
+ /** Callback when an error occurs */
36
+ onError?: (error: Error) => void;
37
+ /** Callback when progress is reported (0-100) */
38
+ onProgress?: (progress: number, message?: string) => void;
39
+ /** Callback for each stream chunk (connect-based adapter mode only) */
40
+ onChunk?: (chunk: StreamChunk) => void;
41
+ }
42
+ /**
43
+ * Return type for the useGeneration hook.
44
+ *
45
+ * @template TOutput - The output type (possibly transformed from the raw result)
46
+ */
47
+ interface UseGenerationReturn<TOutput> {
48
+ /** Trigger a generation request */
49
+ generate: (input: Record<string, any>) => Promise<void>;
50
+ /** The generation result, or null if not yet generated */
51
+ result: Accessor<TOutput | null>;
52
+ /** Whether a generation is currently in progress */
53
+ isLoading: Accessor<boolean>;
54
+ /** Current error, if any */
55
+ error: Accessor<Error | undefined>;
56
+ /** Current state of the generation client */
57
+ status: Accessor<GenerationClientState>;
58
+ /** Abort the current generation */
59
+ stop: () => void;
60
+ /** Clear result, error, and return to idle */
61
+ reset: () => void;
62
+ }
63
+ /**
64
+ * Generic Solid hook for one-shot generation tasks.
65
+ *
66
+ * This is the base hook used by `useGenerateImage`, `useGenerateSpeech`,
67
+ * `useTranscription`, and `useSummarize`. You can also use it directly
68
+ * for custom generation types.
69
+ *
70
+ * @template TInput - The input type for the generation request
71
+ * @template TResult - The result type returned by the generation
72
+ * @template TOutput - The transformed output type (defaults to TResult)
73
+ *
74
+ * @example
75
+ * ```tsx
76
+ * const { generate, result, isLoading } = useGeneration<MyInput, MyResult>({
77
+ * connection: fetchServerSentEvents('/api/generate/custom'),
78
+ * })
79
+ *
80
+ * await generate({ prompt: 'Hello' })
81
+ * ```
82
+ */
83
+ declare function useGeneration<TInput extends Record<string, any>, TResult, TTransformed = void>(options: Omit<UseGenerationOptions<TInput, TResult>, 'onResult'> & {
84
+ onResult?: (result: TResult) => TTransformed;
85
+ }): UseGenerationReturn<InferGenerationOutputFromReturn<TResult, TTransformed>>;
86
+ //#endregion
87
+ export { UseGenerationOptions, UseGenerationReturn, useGeneration };
88
+ //# sourceMappingURL=use-generation.d.ts.map