react-api-adts
Version:
Helpful algebraic data types for API handling in React apps.
12 lines (11 loc) • 374 B
TypeScript
import { Writer } from "protobufjs/minimal";
import { Decoder, Encoder } from "./api";
interface ProtoEncoder<T> {
encode(message: T): Writer;
}
interface ProtoDecoder<T> {
decode(input: Uint8Array): T;
}
export declare function protoEncoder<T>(enc: ProtoEncoder<T>): Encoder<T>;
export declare function protoDecoder<T>(dec: ProtoDecoder<T>): Decoder<T>;
export {};