Guest User

Untitled

a guest
Mar 9th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import { IProtocol, IRequestResponseMap, IEventMap } from "./IProtocol";
  2. import { ISerializable } from "./ISerializable";
  3.  
  4. type RequestResponseMap = {
  5. ping: {
  6. RequestParams: {};
  7. ResponseParams: {};
  8. };
  9. echo: {
  10. RequestParams: ISerializable;
  11. ResponseParams: ISerializable;
  12. };
  13. authenticate: {
  14. RequestParams: {
  15. username: string;
  16. password: string;
  17. };
  18. ResponseParams: { err: null; token: string } | { err: string; token: null };
  19. };
  20. };
  21.  
  22. type EventMap = {
  23. tick: { now: number };
  24. };
  25.  
  26. type IMyProtocol = IProtocol<RequestResponseMap, EventMap>;
  27.  
  28. export { IMyProtocol };
Add Comment
Please, Sign In to add comment