(event: HookEvent)
| 330 | }; |
| 331 | |
| 332 | const addMatcher = (event: HookEvent) => { |
| 333 | // Only for events with matchers |
| 334 | if (!matcherEvents.includes(event as any)) return; |
| 335 | |
| 336 | const newMatcher: EditableHookMatcher = { |
| 337 | id: HooksManager.generateId(), |
| 338 | matcher: '', |
| 339 | hooks: [], |
| 340 | expanded: true |
| 341 | }; |
| 342 | |
| 343 | setEditableHooks(prev => ({ |
| 344 | ...prev, |
| 345 | [event]: [...(prev[event as 'PreToolUse' | 'PostToolUse'] as EditableHookMatcher[]), newMatcher] |
| 346 | })); |
| 347 | }; |
| 348 | |
| 349 | const addDirectCommand = (event: HookEvent) => { |
| 350 | // Only for events without matchers |
no test coverage detected