- Preparing search index...
- The search index is not available
feng3d
Methods
emit
- emit<K>(obj: O, type: K, data?: T[K], bubbles?: boolean, broadcast?: boolean, share?: boolean): IEvent<T[K]>
-
Parameters
-
obj: O
-
type: K
-
Optional
data: T[K]
-
bubbles: boolean = false
-
broadcast: boolean = false
-
share: boolean = true
Returns IEvent<T[K]>
eventNames
- eventNames(obj: O): string[]
-
Returns string[]
has
- has<K>(obj: O, type: K): boolean
-
Returns boolean
listenerCount
- listenerCount<K>(obj: O, type: K): number
-
Returns number
off
- off<K>(obj: O, type?: K, listener?: ((event: IEvent<T[K]>) => any), thisObject?: any): AnyEmitter<O, T>
-
Parameters
-
obj: O
-
Optional
type: K
-
Optional
listener: ((event: IEvent<T[K]>) => any)
-
- (event: IEvent<T[K]>): any
-
Returns any
-
Optional
thisObject: any
offAny
- offAny<K>(obj: O, listener?: ((event: IEvent<T[K]>) => void), thisObject?: any): AnyEmitter<O, T>
-
Parameters
-
obj: O
-
Optional
listener: ((event: IEvent<T[K]>) => void)
-
- (event: IEvent<T[K]>): void
-
Returns void
-
Optional
thisObject: any
on
- on<K>(obj: O, type: K, listener: ((event: IEvent<T[K]>) => any), thisObject?: any, priority?: number, once?: boolean): AnyEmitter<O, T>
-
Parameters
-
obj: O
-
type: K
-
listener: ((event: IEvent<T[K]>) => any)
-
- (event: IEvent<T[K]>): any
-
Returns any
-
Optional
thisObject: any
-
priority: number = 0
-
once: boolean = false
onAny
- onAny<K>(obj: O, listener: ((event: IEvent<T[K]>) => void), thisObject?: any, priority?: number, once?: boolean): AnyEmitter<O, T>
-
Parameters
-
obj: O
-
listener: ((event: IEvent<T[K]>) => void)
-
- (event: IEvent<T[K]>): void
-
Returns void
-
Optional
thisObject: any
-
priority: number = 0
-
once: boolean = false
once
- once<K>(obj: O, type: K, listener: ((event: IEvent<T[K]>) => void), thisObject?: any, priority?: number): AnyEmitter<O, T>
-
Parameters
-
obj: O
-
type: K
-
listener: ((event: IEvent<T[K]>) => void)
-
- (event: IEvent<T[K]>): void
-
Returns void
-
thisObject: any = null
-
priority: number = 0
任意事件发射器。
可以为任何对象甚至基础类型发射事件。
可针对(除undefined、null、Symbol外)的任意对象(0, 1, true, false, "1", {})发射事件