import { ServiceStorage } from '@/core/ServiceStorage' ; import type { App } from '@/core/App' ; import type { RendererEvents } from '@/common/Events' ; const baseDecorator = ( name , showLog = true ) => ( target , methodName , descriptor ) => { const actions = ServiceStorage . services . get ( target . constructor ) || [ ] ; actions . push ( { name , methodName , showLog , } ) ; ServiceStorage . services . set ( target . constructor , actions ) ; return descriptor ; } ; /**
 *  service 用的 event 装饰器
 */ export const event = ( url ) => baseDecorator ( url ) ; export class ServiceModule { constructor ( public app ) { this . app = app ; } } export type TServiceModule = typeof ServiceModule ;