import * as grpcWeb from 'grpc-web';

import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"
import * as threads_pb from './threads_pb'; // proto import: "threads.proto"


export class ThreadsClient {
  constructor (hostname: string,
               credentials?: null | { [index: string]: string; },
               options?: null | { [index: string]: any; });

  getThread(
    request: threads_pb.GetThreadReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: threads_pb.GetThreadRes) => void
  ): grpcWeb.ClientReadableStream<threads_pb.GetThreadRes>;

  postReply(
    request: threads_pb.PostReplyReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: threads_pb.PostReplyRes) => void
  ): grpcWeb.ClientReadableStream<threads_pb.PostReplyRes>;

  updateReply(
    request: threads_pb.UpdateReplyReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: threads_pb.Reply) => void
  ): grpcWeb.ClientReadableStream<threads_pb.Reply>;

  deleteReply(
    request: threads_pb.DeleteReplyReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: google_protobuf_empty_pb.Empty) => void
  ): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

}

export class ThreadsPromiseClient {
  constructor (hostname: string,
               credentials?: null | { [index: string]: string; },
               options?: null | { [index: string]: any; });

  getThread(
    request: threads_pb.GetThreadReq,
    metadata?: grpcWeb.Metadata
  ): Promise<threads_pb.GetThreadRes>;

  postReply(
    request: threads_pb.PostReplyReq,
    metadata?: grpcWeb.Metadata
  ): Promise<threads_pb.PostReplyRes>;

  updateReply(
    request: threads_pb.UpdateReplyReq,
    metadata?: grpcWeb.Metadata
  ): Promise<threads_pb.Reply>;

  deleteReply(
    request: threads_pb.DeleteReplyReq,
    metadata?: grpcWeb.Metadata
  ): Promise<google_protobuf_empty_pb.Empty>;

}

