diff --git a/packages/runtime/src/message-type-contract.ts b/packages/runtime/src/message-type-contract.ts index d4590101..b305fbf9 100644 --- a/packages/runtime/src/message-type-contract.ts +++ b/packages/runtime/src/message-type-contract.ts @@ -22,7 +22,7 @@ export type PartialMessage = { T extends (Date | Uint8Array | bigint | boolean | string | number) ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends { oneofKind: string } ? T + : T extends { oneofKind: string & keyof T } ? { [k in T['oneofKind']]: { oneofKind: k } & { [p in k]: PartialField } }[T['oneofKind']] : T extends { oneofKind: undefined } ? T : T extends object ? PartialMessage : T ;