Home > PCB_Event > addImageEventListener
PCB_Event.addImageEventListener() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Warning: This API is now obsolete.
临时接口(插入图片 PCB 迁移打通流程用):统一事件机制落地后替换,请尽快迁移,勿在新功能中继续依赖
新增插入图片事件监听
Signature
typescript
function addImageEventListener(
id: string,
callFn: (message: { file?: File; source: 'toolbar' | 'paste' }) => void | Promise<void>,
): boolean;1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | 事件 ID,用于防止重复注册(内部自动加扩展 uuid 前缀) |
callFn | (message: { file?: File; source: 'toolbar' | 'paste' }) => void | Promise<void> | 事件触发时的回调,接收 pro-ui 触发的放置图片请求 |
Returns
boolean
是否注册成功
Remarks
ADD since EDA v5