diff --git a/README.markdown b/README.markdown index 1b7e8bfc2..062d7f927 100644 --- a/README.markdown +++ b/README.markdown @@ -796,6 +796,14 @@ type OneOfCase> = T extends { } ? T[U] : never; + +/** Extracts the specific type of a value type from a oneOf field */ +export type OneOfValue> = T extends { + $case: K; + [key: string]: unknown; +} + ? T + : never; ``` # Default values and unset fields