From 53ada7bf104cb5412eed6cd69b56c19cd57304d4 Mon Sep 17 00:00:00 2001 From: kit101 Date: Thu, 9 Mar 2023 14:04:47 +0800 Subject: [PATCH] docs: fix incorrect content for emit method in event api --- docs/docs/api/event.md | 9 +++++---- packages/types/src/shell/api/event.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/docs/api/event.md b/docs/docs/api/event.md index 0eb8b9738..9e2bdf641 100644 --- a/docs/docs/api/event.md +++ b/docs/docs/api/event.md @@ -43,12 +43,13 @@ off(event: string, listener: (...args: any[]) => void): void; ```typescript /** - * 取消监听事件 - * cancel a monitor from a event + * 触发事件 + * emit a message for a event * @param event 事件名称 - * @param listener 事件回调 + * @param args 事件参数 + * @returns */ -off(event: string, listener: (...args: any[]) => void): void; +emit(event: string, ...args: any[]): void; ``` ## 使用示例 diff --git a/packages/types/src/shell/api/event.ts b/packages/types/src/shell/api/event.ts index 18e76febe..02b8bc5b3 100644 --- a/packages/types/src/shell/api/event.ts +++ b/packages/types/src/shell/api/event.ts @@ -21,7 +21,7 @@ export interface IPublicApiEvent { /** * 触发事件 - * emit a message fot a event + * emit a message for a event * @param event 事件名称 * @param args 事件参数 * @returns