Skip to content

Commit 7ae96aa

Browse files
committed
fix: enhance return type in defineRpcFunction to include args and return schemas
1 parent e015103 commit 7ae96aa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/kit/src/utils/define.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@ export function defineRpcFunction<
3131

3232
const fn = birpc(rest)
3333

34-
return fn as typeof fn & { argsSchema?: AS, returnSchema?: RS }
34+
const augmentedFn = fn as typeof fn & { argsSchema?: AS, returnSchema?: RS }
35+
augmentedFn.argsSchema = args
36+
augmentedFn.returnSchema = ret
37+
38+
return augmentedFn
3539
}

0 commit comments

Comments
 (0)