* Builds a chunk schema from the streaming success schema of an RPC. * * @since 4.0.0
(
rpc: R
)
| 220 | * @since 4.0.0 |
| 221 | */ |
| 222 | static schema<R extends Rpc.Any>( |
| 223 | rpc: R |
| 224 | ): Schema.declareConstructor<Chunk<R>, Chunk<R>, readonly [Rpc.SuccessExitSchema<R>]> { |
| 225 | const successSchema = ((rpc as any as Rpc.AnyWithProps).successSchema as RpcSchema.Stream<any, any>).success |
| 226 | if (!successSchema) { |
| 227 | return Schema.Never as any |
| 228 | } |
| 229 | return this.schemaFrom(successSchema) as any |
| 230 | } |
| 231 | |
| 232 | /** |
| 233 | * Builds a chunk schema that validates each success value with the supplied schema. |
no test coverage detected