Rename event emitter to emitter
This commit is contained in:
parent
98f4236c35
commit
0fc0fa932a
@ -1,4 +1,4 @@
|
|||||||
import { EventEmitter } from "./EventEmitter";
|
import { Emitter } from "./Emitter";
|
||||||
import { Logger, LogLabel, LevelLogLabel, colorRadio, StatusLabel } from "./Logger";
|
import { Logger, LogLabel, LevelLogLabel, colorRadio, StatusLabel } from "./Logger";
|
||||||
interface IAppAPIParam {
|
interface IAppAPIParam {
|
||||||
api: {
|
api: {
|
||||||
@ -118,7 +118,7 @@ type IAPIEvent<I extends IAnyData, O extends IAnyData> = {
|
|||||||
/**
|
/**
|
||||||
* 接口调用
|
* 接口调用
|
||||||
*/
|
*/
|
||||||
class API<I extends IAnyData, O extends IAnyData> extends EventEmitter<IAPIEvent<I, O>> {
|
class API<I extends IAnyData, O extends IAnyData> extends Emitter<IAPIEvent<I, O>> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础 URL
|
* 基础 URL
|
||||||
|
@ -22,7 +22,7 @@ type GenericEventHandler<Events extends Record<EventType, unknown>> =
|
|||||||
| Handler<Events[keyof Events]>
|
| Handler<Events[keyof Events]>
|
||||||
| WildcardHandler<Events>;
|
| WildcardHandler<Events>;
|
||||||
|
|
||||||
export class EventEmitter<Events extends Record<EventType, unknown>> {
|
export class Emitter<Events extends Record<EventType, unknown>> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Map of event names to registered handler functions.
|
* A Map of event names to registered handler functions.
|
@ -782,7 +782,7 @@ class StatusLabel {
|
|||||||
* 失败
|
* 失败
|
||||||
*/
|
*/
|
||||||
static readonly Failed = new LogLabel(
|
static readonly Failed = new LogLabel(
|
||||||
"×", new LogStyle().setBlank("0 4px").setBorder("1000px", "1px solid red").setColor("red")
|
"x", new LogStyle().setBlank("0 4px").setBorder("1000px", "1px solid red").setColor("red")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EventEmitter, EventType } from "./EventEmitter";
|
import { Emitter, EventType } from "./Emitter";
|
||||||
import { Logger, LogLabel, LogStyle, LevelLogLabel } from "./Logger";
|
import { Logger, LogLabel, LogStyle, LevelLogLabel } from "./Logger";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +62,7 @@ class Modular<
|
|||||||
DEP extends Depends<M> = Depends<M>,
|
DEP extends Depends<M> = Depends<M>,
|
||||||
E extends Record<EventType, unknown> = Record<EventType, unknown>,
|
E extends Record<EventType, unknown> = Record<EventType, unknown>,
|
||||||
TD extends IAnyTypeObject = IAnyTypeObject>
|
TD extends IAnyTypeObject = IAnyTypeObject>
|
||||||
extends EventEmitter<E>
|
extends Emitter<E>
|
||||||
implements WXContext<TD, IAnyTypeObject> {
|
implements WXContext<TD, IAnyTypeObject> {
|
||||||
|
|
||||||
// [x:string]: any;
|
// [x:string]: any;
|
||||||
|
Loading…
Reference in New Issue
Block a user