Skip to content

Commit

Permalink
fix(type): resubmit from #7914
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Nov 16, 2020
1 parent 5eb5243 commit d084861
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/taro/types/taro.extend.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ declare namespace Taro {
/**
* 监听一个事件,接受参数
*/
on(eventName: string | symbol, listener: (...args: any[]) => void): this
on(eventName: string, listener: (...args: any[]) => void): this

/**
* 添加一个事件监听,并在事件触发完成之后移除Callbacks链
*/
once(eventName: string | symbol, listener: (...args: any[]) => void): this
once(eventName: string, listener: (...args: any[]) => void): this

/**
* 取消监听一个事件
*/
off(eventName: string | symbol, listener?: (...args: any[]) => void): this
off(eventName: string, listener?: (...args: any[]) => void): this

/**
* 取消监听的所有事件
Expand All @@ -28,21 +28,21 @@ declare namespace Taro {
/**
* 触发一个事件,传参
*/
trigger(eventName: string | symbol, ...args: any[]): boolean
trigger(eventName: string, ...args: any[]): boolean
}

// eventCenter

namespace eventCenter {
function on(eventName: string | symbol, listener: (...args: any[]) => void): void
function on(eventName: string, listener: (...args: any[]) => void): void

function once(eventName: string | symbol, listener: (...args: any[]) => void): void
function once(eventName: string, listener: (...args: any[]) => void): void

function off(eventName: string | symbol, listener?: (...args: any[]) => void): void
function off(eventName: string, listener?: (...args: any[]) => void): void

function off(): void

function trigger(eventName: string | symbol, ...args: any[]): boolean
function trigger(eventName: string, ...args: any[]): boolean
}

// ENV_TYPE
Expand Down

0 comments on commit d084861

Please sign in to comment.