@grpc/proto-loader
Advanced tools
Comparing version 0.6.0-pre12 to 0.6.0-pre13
@@ -470,4 +470,4 @@ #!/usr/bin/env node | ||
formatter.writeLine(`${name}(metadata: grpc.Metadata, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(metadata: grpc.Metadata, options: grpc.CallOptions, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(metadata: grpc.Metadata, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(options: grpc.CallOptions, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(callback: ${callbackType}): ${callType};`); | ||
} | ||
@@ -487,4 +487,4 @@ } | ||
formatter.writeLine(`${name}(argument: ${requestType}, metadata: grpc.Metadata, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(argument: ${requestType}, metadata: grpc.Metadata, options: grpc.CallOptions, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(argument: ${requestType}, metadata: grpc.Metadata, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(argument: ${requestType}, options: grpc.CallOptions, callback: ${callbackType}): ${callType};`); | ||
formatter.writeLine(`${name}(argument: ${requestType}, callback: ${callbackType}): ${callType};`); | ||
} | ||
@@ -502,3 +502,3 @@ } | ||
} | ||
formatter.writeLine(`export interface ${serviceType.name}Handlers {`); | ||
formatter.writeLine(`export interface ${serviceType.name}Handlers extends grpc.UntypedServiceImplementation {`); | ||
formatter.indent(); | ||
@@ -510,4 +510,4 @@ for (const methodName of Object.keys(serviceType.methods).sort()) { | ||
} | ||
const requestType = getTypeInterfaceName(method.resolvedRequestType); | ||
const responseType = getTypeInterfaceName(method.resolvedResponseType) + '__Output'; | ||
const requestType = getTypeInterfaceName(method.resolvedRequestType) + '__Output'; | ||
const responseType = getTypeInterfaceName(method.resolvedResponseType); | ||
if (method.requestStream) { | ||
@@ -514,0 +514,0 @@ if (method.responseStream) { |
{ | ||
"name": "@grpc/proto-loader", | ||
"version": "0.6.0-pre12", | ||
"version": "0.6.0-pre13", | ||
"author": "Google Inc.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -55,1 +55,35 @@ # gRPC Protobuf Loader | ||
``` | ||
## Generating TypeScript types | ||
The `proto-loader-gen-types` script distributed with this package can be used to generate TypeScript type information for the objects loaded at runtime. More information about how to use it can be found in [the *@grpc/proto-loader TypeScript Type Generator CLI Tool* proposal document](https://github.com/grpc/proposal/blob/master/L70-node-proto-loader-type-generator.md). The arguments mostly match the `load` function's options; the full usage information is as follows: | ||
``` | ||
proto-loader-gen-types.js [options] filenames... | ||
Options: | ||
--help Show help [boolean] | ||
--version Show version number [boolean] | ||
--keepCase Preserve the case of field names [boolean] | ||
--longs The type that should be used to output 64 bit integer | ||
values. Can be String, Number [string] | ||
--enums The type that should be used to output enum fields. Can be | ||
String [string] | ||
--bytes The type that should be used to output bytes fields. Can be | ||
String, Array [string] | ||
--defaults Output default values for omitted fields [boolean] | ||
--arrays Output default values for omitted repeated fields even if | ||
--defaults is not set [boolean] | ||
--objects Output default values for omitted message fields even if | ||
--defaults is not set [boolean] | ||
--oneofs Output virtual oneof fields set to the present field's name | ||
[boolean] | ||
--json Represent Infinity and NaN as strings in float fields. Also | ||
decode google.protobuf.Any automatically [boolean] | ||
--includeComments Generate doc comments from comments in the original files | ||
[boolean] | ||
--includeDirs, -I Directories to search for included files [array] | ||
--outDir, -O Directory in which to output files [string] [required] | ||
--grpcLib The gRPC implementation library that these types will be | ||
used with [string] [required] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66111
88