(descriptor = {})
| 1617 | export { commandKeymapCompartment }; |
| 1618 | |
| 1619 | export function registerExternalCommand(descriptor = {}) { |
| 1620 | const normalized = normalizeExternalCommand(descriptor); |
| 1621 | if (!normalized) return null; |
| 1622 | |
| 1623 | const { name } = normalized; |
| 1624 | if (commandMap.has(name)) { |
| 1625 | commandMap.delete(name); |
| 1626 | } |
| 1627 | |
| 1628 | addCommand(normalized); |
| 1629 | const stored = commandMap.get(name); |
| 1630 | if (stored) { |
| 1631 | stored.key = normalized.key ?? stored.key; |
| 1632 | } |
| 1633 | |
| 1634 | rebuildKeymap(); |
| 1635 | return stored; |
| 1636 | } |
| 1637 | |
| 1638 | export function removeExternalCommand(name) { |
| 1639 | if (!name) return false; |
no test coverage detected