/** ***************************************** * 状态 ***************************************** */ interface State { [key: string]: unknown; } /** ***************************************** * 状态 ***************************************** */ declare type Context = T & { next: () => void | P; }; /** ***************************************** * 事件函数 ***************************************** */ declare type Handler = (context: Context) => void | P; /** ***************************************** * 洋葱对象 ***************************************** */ export declare class Onion { /** 链头 */ private $$onionHead; /** 链尾 */ private $$onionTail; /** 初始化对象 */ constructor(); /** 添加处理函数 */ add(handler: Handler): () => void; /** 执行处理函数 */ call(state: T, callback?: (state: T) => void | P): void | P; /** 清空链 */ clear(): void; } /** ***************************************** * 创建洋葱对象 ***************************************** */ export declare function onion(): Onion; export {}; //# sourceMappingURL=onion.d.ts.map