(
lines: string[],
indent: string,
method: RpcMethod,
options: {
paramsName?: string;
paramsDescription?: string;
resultDescription?: string;
deprecated?: boolean;
experimental?: boolean;
internal?: boolean;
} = {}
)
| 773 | } |
| 774 | |
| 775 | function pushPyRpcMethodDocstring( |
| 776 | lines: string[], |
| 777 | indent: string, |
| 778 | method: RpcMethod, |
| 779 | options: { |
| 780 | paramsName?: string; |
| 781 | paramsDescription?: string; |
| 782 | resultDescription?: string; |
| 783 | deprecated?: boolean; |
| 784 | experimental?: boolean; |
| 785 | internal?: boolean; |
| 786 | } = {} |
| 787 | ): void { |
| 788 | const sections: string[] = [method.description ?? `Calls ${method.rpcMethod}.`]; |
| 789 | if (options.paramsName && options.paramsDescription) { |
| 790 | sections.push(`Args:\n ${options.paramsName}: ${options.paramsDescription}`); |
| 791 | } |
| 792 | if (options.resultDescription) { |
| 793 | sections.push(`Returns:\n ${options.resultDescription}`); |
| 794 | } |
| 795 | if (options.deprecated) { |
| 796 | sections.push(".. deprecated:: This API is deprecated and will be removed in a future version."); |
| 797 | } |
| 798 | if (options.experimental) { |
| 799 | sections.push(".. warning:: This API is experimental and may change or be removed in future versions."); |
| 800 | } |
| 801 | if (options.internal) { |
| 802 | sections.push(":meta private:\n\nInternal SDK API; not part of the public surface."); |
| 803 | } |
| 804 | |
| 805 | lines.push(`${indent}${pyDocstringLiteral(sections.join("\n\n"))}`); |
| 806 | } |
| 807 | |
| 808 | function modernizePython(code: string): string { |
| 809 | // Replace Optional[X] with X | None (handles arbitrarily nested brackets) |
no test coverage detected
searching dependent graphs…