feat(typescript): mark some `metadata` parameters as optional (#1369)

Resolves https://github.com/grpc/grpc-web/issues/1368
This commit is contained in:
Andrew Benton 2023-10-16 14:35:11 -07:00 committed by GitHub
parent 49d3b70868
commit 1ab0bdc25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -653,7 +653,7 @@ void PrintTypescriptFile(Printer* printer, const FileDescriptor* file,
printer->Indent();
printer->Print(vars,
"request: $input_type$,\n"
"metadata: grpcWeb.Metadata | null): "
"metadata?: grpcWeb.Metadata | null): "
"$promise$<$output_type$>;\n\n");
printer->Outdent();
@ -671,7 +671,7 @@ void PrintTypescriptFile(Printer* printer, const FileDescriptor* file,
printer->Indent();
printer->Print(vars,
"request: $input_type$,\n"
"metadata: grpcWeb.Metadata | null,\n"
"metadata?: grpcWeb.Metadata | null,\n"
"callback?: (err: grpcWeb.RpcError,\n"
" response: $output_type$) => void) {\n");
printer->Print(vars, "if (callback !== undefined) {\n");