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 communities_pb from './communities_pb'; // proto import: "communities.proto"
import * as editor_pb from './editor_pb'; // proto import: "editor.proto"


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

  createCommunity(
    request: editor_pb.CreateCommunityReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: communities_pb.Community) => void
  ): grpcWeb.ClientReadableStream<communities_pb.Community>;

  updateCommunity(
    request: editor_pb.UpdateCommunityReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: communities_pb.Community) => void
  ): grpcWeb.ClientReadableStream<communities_pb.Community>;

  listEventCommunityInviteRequests(
    request: editor_pb.ListEventCommunityInviteRequestsReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.ListEventCommunityInviteRequestsRes) => void
  ): grpcWeb.ClientReadableStream<editor_pb.ListEventCommunityInviteRequestsRes>;

  decideEventCommunityInviteRequest(
    request: editor_pb.DecideEventCommunityInviteRequestReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.DecideEventCommunityInviteRequestRes) => void
  ): grpcWeb.ClientReadableStream<editor_pb.DecideEventCommunityInviteRequestRes>;

  sendBlogPostNotification(
    request: editor_pb.SendBlogPostNotificationReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: google_protobuf_empty_pb.Empty) => void
  ): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

  makeUserVolunteer(
    request: editor_pb.MakeUserVolunteerReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.Volunteer) => void
  ): grpcWeb.ClientReadableStream<editor_pb.Volunteer>;

  updateVolunteer(
    request: editor_pb.UpdateVolunteerReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.Volunteer) => void
  ): grpcWeb.ClientReadableStream<editor_pb.Volunteer>;

  listVolunteers(
    request: editor_pb.ListVolunteersReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.ListVolunteersRes) => void
  ): grpcWeb.ClientReadableStream<editor_pb.ListVolunteersRes>;

  listPostcards(
    request: editor_pb.ListPostcardsReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.ListPostcardsRes) => void
  ): grpcWeb.ClientReadableStream<editor_pb.ListPostcardsRes>;

  downloadPostcardPdf(
    request: editor_pb.DownloadPostcardPdfReq,
    metadata: grpcWeb.Metadata | undefined,
    callback: (err: grpcWeb.RpcError,
               response: editor_pb.DownloadPostcardPdfRes) => void
  ): grpcWeb.ClientReadableStream<editor_pb.DownloadPostcardPdfRes>;

}

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

  createCommunity(
    request: editor_pb.CreateCommunityReq,
    metadata?: grpcWeb.Metadata
  ): Promise<communities_pb.Community>;

  updateCommunity(
    request: editor_pb.UpdateCommunityReq,
    metadata?: grpcWeb.Metadata
  ): Promise<communities_pb.Community>;

  listEventCommunityInviteRequests(
    request: editor_pb.ListEventCommunityInviteRequestsReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.ListEventCommunityInviteRequestsRes>;

  decideEventCommunityInviteRequest(
    request: editor_pb.DecideEventCommunityInviteRequestReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.DecideEventCommunityInviteRequestRes>;

  sendBlogPostNotification(
    request: editor_pb.SendBlogPostNotificationReq,
    metadata?: grpcWeb.Metadata
  ): Promise<google_protobuf_empty_pb.Empty>;

  makeUserVolunteer(
    request: editor_pb.MakeUserVolunteerReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.Volunteer>;

  updateVolunteer(
    request: editor_pb.UpdateVolunteerReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.Volunteer>;

  listVolunteers(
    request: editor_pb.ListVolunteersReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.ListVolunteersRes>;

  listPostcards(
    request: editor_pb.ListPostcardsReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.ListPostcardsRes>;

  downloadPostcardPdf(
    request: editor_pb.DownloadPostcardPdfReq,
    metadata?: grpcWeb.Metadata
  ): Promise<editor_pb.DownloadPostcardPdfRes>;

}

