mdoTomofumi Chiba
11/23/2023, 2:38:33 AM

TypeScript: tRPC で戻り値の型を取得する

import { inferProcedureOutput } from "@trpc/server";
export type MyProcedureOutput = inferProcedureOutput<typeof myProcedure>;

戻り値が配列の場合は、

export type MyProcedureOutput = (inferProcedureOutput<typeof myProcedure>)[number];
TweetLike