MCPcopy
hub / github.com/TanStack/ai / injectGenerateImage

Function injectGenerateImage

packages/ai-angular/src/inject-generate-image.ts:28–55  ·  view source on GitHub ↗
(
  options: Omit<InjectGenerateImageOptions, 'onResult'> & {
    onResult?: (result: ImageGenerationResult) => TTransformed
  },
)

Source from the content-addressed store, hash-verified

26}
27
28export function injectGenerateImage<TTransformed = void>(
29 options: Omit<InjectGenerateImageOptions, 'onResult'> & {
30 onResult?: (result: ImageGenerationResult) => TTransformed
31 },
32): InjectGenerateImageResult<
33 InferGenerationOutputFromReturn<ImageGenerationResult, TTransformed>
34> {
35 const devtools = {
36 ...options.devtools,
37 framework: 'angular' as const,
38 hookName: 'injectGenerateImage',
39 outputKind: 'image' as const,
40 }
41 const { generate, result, isLoading, error, status, stop, reset } =
42 injectGeneration<ImageGenerateInput, ImageGenerationResult, TTransformed>({
43 ...options,
44 devtools,
45 })
46 return {
47 generate: generate as (input: ImageGenerateInput) => Promise<void>,
48 result,
49 isLoading,
50 error,
51 status,
52 stop,
53 reset,
54 }
55}

Callers

nothing calls this directly

Calls 1

injectGenerationFunction · 0.90

Tested by

no test coverage detected