(...args: any[])
| 9 | descriptor: PropertyDescriptor |
| 10 | ) { |
| 11 | const newMethod = function (...args: any[]) { |
| 12 | if (target["clipboard"] == undefined) { |
| 13 | target["operations"].push({ |
| 14 | key: propertyKey, |
| 15 | args, |
| 16 | }); |
| 17 | return; |
| 18 | } else { |
| 19 | const clipboard = target["clipboard"]; |
| 20 | return clipboard[propertyKey].call(clipboard, ...args); |
| 21 | } |
| 22 | }; |
| 23 | descriptor.value = newMethod; // 替换原声明 |
| 24 | } |
| 25 |