UNPKG

ts-proto

Version:

[![npm](https://img.shields.io/npm/v/ts-proto)](https://www.npmjs.com/package/ts-proto) [![build](https://github.com/stephenh/ts-proto/workflows/Build/badge.svg)](https://github.com/stephenh/ts-proto/actions)

18 lines (17 loc) 1.16 kB
import { MethodDescriptorProto, FileDescriptorProto, ServiceDescriptorProto } from "ts-proto-descriptors"; import { Code } from "ts-poet"; import { Context } from "./context"; /** Generates a client that uses the `@improbable-web/grpc-web` library. */ export declare function generateGrpcClientImpl(ctx: Context, _fileDesc: FileDescriptorProto, serviceDesc: ServiceDescriptorProto): Code; /** Creates the service descriptor that grpc-web needs at runtime. */ export declare function generateGrpcServiceDesc(fileDesc: FileDescriptorProto, serviceDesc: ServiceDescriptorProto): Code; /** * Creates the method descriptor that grpc-web needs at runtime to make `unary` calls. * * Note that we take a few liberties in the implementation give we don't 100% match * what grpc-web's existing output is, but it works out; see comments in the method * implementation. */ export declare function generateGrpcMethodDesc(ctx: Context, serviceDesc: ServiceDescriptorProto, methodDesc: MethodDescriptorProto): Code; /** Adds misc top-level definitions for grpc-web functionality. */ export declare function addGrpcWebMisc(ctx: Context, hasStreamingMethods: boolean): Code;