/* * @Description: * @Autor: YeeChan * @Date: 2019-11-26 14:13:43 */ /** * 事件绑定接口 */ export class FMListener { callback: Function; //对象回调方法 target: any; //对象本身 } /** * 添加一个绑定接口 * @param callback //对象回调方法 * @param target //对象本身 * @returns FMListener */ export function handleFM_custom(callback: Function, target: any): FMListener { return { "target": target, "callback": callback } } /** * call一个绑定接口 * @param FMListener * @param ...argArray * @returns any */ export function callFM_custom(inter: FMListener, ...argArray: any[]): any { if (inter && inter.callback) { return inter.callback.call(inter.target, ...argArray) } } //导出 (window).FMListener = FMListener; (window).handleFM_custom = handleFM_custom; (window).callFM_custom = callFM_custom;