Skip to content

Commit d80f34a

Browse files
committed
Figured out how to remove tslint errors
1 parent 62ab438 commit d80f34a

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

src/v2/providers/https.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -515,38 +515,30 @@ type GenkitAction<
515515
stream(
516516
input: I["__output"],
517517
options: GenkitRunOptions
518-
): { stream: AsyncIterable<S["__output"]>; output: O["__output"] };
518+
): { stream: AsyncIterable<S["__output"]>; output: Promise<O["__output"]> };
519519

520520
__action: {
521521
name: string;
522522
};
523523
};
524524

525-
// Note: A double infer is required to extract the ZodType's native type from the GenkitAction, but triggers an
526-
// unused variable linter error for the ZodType wrapper.
527-
/* eslint-disable @typescript-eslint/no-unused-vars */
528-
type ActionInput<F extends GenkitAction> = F extends GenkitAction<
529-
infer I extends ZodType<infer T>,
530-
any,
531-
any
532-
>
533-
? T
525+
type ActionInput<F extends GenkitAction> = F extends GenkitAction<infer I extends ZodType, any, any>
526+
? I["__output"]
534527
: never;
535528
type ActionOutput<F extends GenkitAction> = F extends GenkitAction<
536529
any,
537-
infer O extends ZodType<infer T>,
530+
infer O extends ZodType,
538531
any
539532
>
540-
? T
533+
? O["__output"]
541534
: never;
542535
type ActionStream<F extends GenkitAction> = F extends GenkitAction<
543536
any,
544537
any,
545-
infer S extends ZodType<infer T>
538+
infer S extends ZodType
546539
>
547-
? T
540+
? S["__output"]
548541
: never;
549-
/* eslint-enable @typescript-eslint/no-unused-vars */
550542

551543
export function onCallGenkit<A extends GenkitAction>(
552544
action: A

0 commit comments

Comments
 (0)