Skip to content

Commit

Permalink
feat(reverse): addd Reverse type
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Jul 5, 2023
1 parent 00eecc6 commit b768d6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-transport",
"version": "4.2.1",
"version": "4.2.2",
"description": "A simple and responsible transport",
"main": "lib/index.js",
"unpkg": "dist/index.umd.js",
Expand Down
6 changes: 5 additions & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { transportKey, transportType } from './constant';
import { listen } from './decorators';

export interface BaseInteraction {
listen?: Record<string, (...args: any) => any>;
emit?: Record<string, (...args: any) => any>;
}

export type Reverse<T extends BaseInteraction> = {
emit: T['listen'];
listen: T['emit'];
};

export type MergeInteraction<
T extends BaseInteraction,
U extends BaseInteraction
Expand Down

0 comments on commit b768d6e

Please sign in to comment.