rpc_ts
Version:
Remote Procedure Calls in TypeScript made simple
34 lines (33 loc) • 1.09 kB
TypeScript
/**
* @module ModuleRpcProtocolGrpcWebCommon
*
* A Codec that serializes/deserializes messages to and from JSON.
*
* @license
* Copyright (c) Aiden.ai
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { GrpcWebCodec } from './codec';
import { grpc } from '@improbable-eng/grpc-web';
/**
* A Codec that serializes/deserializes messages to and from JSON.
*/
export declare class GrpcWebJsonCodec implements GrpcWebCodec {
/** @override */
getContentType(): string;
/** @override */
encodeMessage(_method: string, payload: any): Uint8Array;
/** @override */
encodeTrailer(metadata: grpc.Metadata): Uint8Array;
/** @override */
encodeRequest(_method: string, message: any): Uint8Array;
/** @override */
decodeRequest(_method: string, message: Uint8Array): any;
/** @override */
decodeMessage(_method: string, encodedMessage: Uint8Array): any;
/** @override */
decodeTrailer(encodedTrailer: Uint8Array): grpc.Metadata;
private encode;
}