MorusServiceClientPb.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * @fileoverview gRPC-Web generated client stub for mint.morus.v1
  3. * @enhanceable
  4. * @public
  5. */
  6. // Code generated by protoc-gen-grpc-web. DO NOT EDIT.
  7. // versions:
  8. // protoc-gen-grpc-web v1.4.2
  9. // protoc v4.24.3
  10. // source: morus.proto
  11. /* eslint-disable */
  12. // @ts-nocheck
  13. import * as grpcWeb from 'grpc-web';
  14. import * as morus_pb from './morus_pb';
  15. export class MarkdownClient {
  16. client_: grpcWeb.AbstractClientBase;
  17. hostname_: string;
  18. credentials_: null | { [index: string]: string; };
  19. options_: null | { [index: string]: any; };
  20. constructor (hostname: string,
  21. credentials?: null | { [index: string]: string; },
  22. options?: null | { [index: string]: any; }) {
  23. if (!options) options = {};
  24. if (!credentials) credentials = {};
  25. options['format'] = 'binary';
  26. this.client_ = new grpcWeb.GrpcWebClientBase(options);
  27. this.hostname_ = hostname.replace(/\/+$/, '');
  28. this.credentials_ = credentials;
  29. this.options_ = options;
  30. }
  31. methodDescriptorToHtml = new grpcWeb.MethodDescriptor(
  32. '/mint.morus.v1.Markdown/ToHtml',
  33. grpcWeb.MethodType.UNARY,
  34. morus_pb.MarkdownToHtmlRequest,
  35. morus_pb.MarkdownToHtmlResponse,
  36. (request: morus_pb.MarkdownToHtmlRequest) => {
  37. return request.serializeBinary();
  38. },
  39. morus_pb.MarkdownToHtmlResponse.deserializeBinary
  40. );
  41. toHtml(
  42. request: morus_pb.MarkdownToHtmlRequest,
  43. metadata: grpcWeb.Metadata | null): Promise<morus_pb.MarkdownToHtmlResponse>;
  44. toHtml(
  45. request: morus_pb.MarkdownToHtmlRequest,
  46. metadata: grpcWeb.Metadata | null,
  47. callback: (err: grpcWeb.RpcError,
  48. response: morus_pb.MarkdownToHtmlResponse) => void): grpcWeb.ClientReadableStream<morus_pb.MarkdownToHtmlResponse>;
  49. toHtml(
  50. request: morus_pb.MarkdownToHtmlRequest,
  51. metadata: grpcWeb.Metadata | null,
  52. callback?: (err: grpcWeb.RpcError,
  53. response: morus_pb.MarkdownToHtmlResponse) => void) {
  54. if (callback !== undefined) {
  55. return this.client_.rpcCall(
  56. this.hostname_ +
  57. '/mint.morus.v1.Markdown/ToHtml',
  58. request,
  59. metadata || {},
  60. this.methodDescriptorToHtml,
  61. callback);
  62. }
  63. return this.client_.unaryCall(
  64. this.hostname_ +
  65. '/mint.morus.v1.Markdown/ToHtml',
  66. request,
  67. metadata || {},
  68. this.methodDescriptorToHtml);
  69. }
  70. }