Skip to content

Commit

Permalink
update enum key
Browse files Browse the repository at this point in the history
  • Loading branch information
Sczlog committed Jul 23, 2021
1 parent f5c2c21 commit 146387c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/matcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class MachineMatcher implements IMatcher {
public start(): void {
if (this.state === 'inactive') {
this.emitter.addListener(
MatcherKey.NEW_EVENT,
MatcherKey.RECEIVE_NEW_EVENT,
(event: StepEvent, target: HTMLElement | null) => {
this.machine.send({
type: event.type,
Expand Down
2 changes: 1 addition & 1 deletion src/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Recorder {
const listener = observer.emitter.on(
`observer.${observer.name}`,
(event: StepEvent, target: HTMLElement | null) => {
this.matcher.emitter.emit(MatcherKey.NEW_EVENT, event, target);
this.matcher.emitter.emit(MatcherKey.RECEIVE_NEW_EVENT, event, target);
},
{
objectify: true,
Expand Down
8 changes: 4 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { IDataTransferItem } from './util/entry-reader';

export enum MatcherKey {
NEW_EVENT = 'matcher.browser_event.new',
NEW_STEP = 'matcher.step_event.new',
UPDATE_STEP = 'matcher.step_event.update',
END_STEP = 'matcher.step_event.end',
RECEIVE_NEW_EVENT = 'matcher.browser_event.new',
EMIT_NEW_STEP = 'matcher.step_event.new',
EMIT_UPDATE_STEP = 'matcher.step_event.update',
EMIT_END_STEP = 'matcher.step_event.end',
}

export type Step = {
Expand Down
8 changes: 4 additions & 4 deletions typings/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IMeta } from './util/metaquerier';
import { IDataTransferItem } from './util/entry-reader';
export declare enum MatcherKey {
NEW_EVENT = "matcher.browser_event.new",
NEW_STEP = "matcher.step_event.new",
UPDATE_STEP = "matcher.step_event.update",
END_STEP = "matcher.step_event.end"
RECEIVE_NEW_EVENT = "matcher.browser_event.new",
EMIT_NEW_STEP = "matcher.step_event.new",
EMIT_UPDATE_STEP = "matcher.step_event.update",
EMIT_END_STEP = "matcher.step_event.end"
}
export declare type Step = {
selector: IMeta;
Expand Down

0 comments on commit 146387c

Please sign in to comment.