tenebrous-sheets/static/scripts/ts/_proto/cofd_api_pb_service.d.ts

65 lines
2.2 KiB
TypeScript

// package: models.proto.cofd.api
// file: cofd_api.proto
import * as cofd_api_pb from "./cofd_api_pb";
import * as cofd_pb from "./cofd_pb";
import {grpc} from "@improbable-eng/grpc-web";
type CofdApiUpdateSkillValue = {
readonly methodName: string;
readonly service: typeof CofdApi;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof cofd_api_pb.UpdateSkillValueRequest;
readonly responseType: typeof cofd_pb.CofdSheet.Skill;
};
export class CofdApi {
static readonly serviceName: string;
static readonly UpdateSkillValue: CofdApiUpdateSkillValue;
}
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
export type Status = { details: string, code: number; metadata: grpc.Metadata }
interface UnaryResponse {
cancel(): void;
}
interface ResponseStream<T> {
cancel(): void;
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
}
interface RequestStream<T> {
write(message: T): RequestStream<T>;
end(): void;
cancel(): void;
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
}
interface BidirectionalStream<ReqT, ResT> {
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
end(): void;
cancel(): void;
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
}
export class CofdApiClient {
readonly serviceHost: string;
constructor(serviceHost: string, options?: grpc.RpcOptions);
updateSkillValue(
requestMessage: cofd_api_pb.UpdateSkillValueRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: cofd_pb.CofdSheet.Skill|null) => void
): UnaryResponse;
updateSkillValue(
requestMessage: cofd_api_pb.UpdateSkillValueRequest,
callback: (error: ServiceError|null, responseMessage: cofd_pb.CofdSheet.Skill|null) => void
): UnaryResponse;
}