Skip to content

Commit

Permalink
Figured out how to remove tslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
inlined committed Jan 24, 2025
1 parent 62ab438 commit d80f34a
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/v2/providers/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,38 +515,30 @@ type GenkitAction<
stream(
input: I["__output"],
options: GenkitRunOptions
): { stream: AsyncIterable<S["__output"]>; output: O["__output"] };
): { stream: AsyncIterable<S["__output"]>; output: Promise<O["__output"]> };

__action: {
name: string;
};
};

// Note: A double infer is required to extract the ZodType's native type from the GenkitAction, but triggers an
// unused variable linter error for the ZodType wrapper.
/* eslint-disable @typescript-eslint/no-unused-vars */
type ActionInput<F extends GenkitAction> = F extends GenkitAction<
infer I extends ZodType<infer T>,
any,
any
>
? T
type ActionInput<F extends GenkitAction> = F extends GenkitAction<infer I extends ZodType, any, any>
? I["__output"]
: never;
type ActionOutput<F extends GenkitAction> = F extends GenkitAction<
any,
infer O extends ZodType<infer T>,
infer O extends ZodType,
any
>
? T
? O["__output"]
: never;
type ActionStream<F extends GenkitAction> = F extends GenkitAction<
any,
any,
infer S extends ZodType<infer T>
infer S extends ZodType
>
? T
? S["__output"]
: never;
/* eslint-enable @typescript-eslint/no-unused-vars */

export function onCallGenkit<A extends GenkitAction>(
action: A
Expand Down

0 comments on commit d80f34a

Please sign in to comment.