Skip to content

Commit

Permalink
feat(rpc): adds data types
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Oct 28, 2019
1 parent 6f7c4d8 commit aa2835d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/rpc/src/types/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface DataParser {
serialize: (data: object) => DataOutput | Promise<DataOutput>;
deserialize: (data: DataInput) => object | Promise<object>;
}

export type DataInput = string | Buffer | ArrayBuffer | Buffer[];
export type DataOutput = string | Buffer;
1 change: 1 addition & 0 deletions packages/rpc/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './protocol';
export * from './data';

0 comments on commit aa2835d

Please sign in to comment.