Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { IProtocol, IRequestResponseMap, IEventMap } from "./IProtocol";
- import { ISerializable } from "./ISerializable";
- type RequestResponseMap = {
- ping: {
- RequestParams: {};
- ResponseParams: {};
- };
- echo: {
- RequestParams: ISerializable;
- ResponseParams: ISerializable;
- };
- authenticate: {
- RequestParams: {
- username: string;
- password: string;
- };
- ResponseParams: { err: null; token: string } | { err: string; token: null };
- };
- };
- type EventMap = {
- tick: { now: number };
- };
- type IMyProtocol = IProtocol<RequestResponseMap, EventMap>;
- export { IMyProtocol };
Add Comment
Please, Sign In to add comment