(method: RpcMethod)
| 447 | } |
| 448 | |
| 449 | function tsNullableResultTypeName(method: RpcMethod): string | undefined { |
| 450 | const resultSchema = getMethodResultSchema(method); |
| 451 | if (!resultSchema) return undefined; |
| 452 | const inner = getNullableInner(resultSchema); |
| 453 | if (!inner) return undefined; |
| 454 | // Resolve $ref to a type name |
| 455 | if (inner.$ref) { |
| 456 | const refName = inner.$ref.split("/").pop(); |
| 457 | if (refName) return `${toPascalCase(refName)} | undefined`; |
| 458 | } |
| 459 | const innerName = getRpcSchemaTypeName(inner, method.rpcMethod.split(".").map(toPascalCase).join("") + "Result"); |
| 460 | return `${innerName} | undefined`; |
| 461 | } |
| 462 | |
| 463 | function tsResultType(method: RpcMethod): string { |
| 464 | if (isVoidSchema(getMethodResultSchema(method))) return "void"; |
no test coverage detected
searching dependent graphs…