(targets: TypedSelection[])
| 17 | } |
| 18 | |
| 19 | export function ensureSingleTarget(targets: TypedSelection[]) { |
| 20 | if (targets.length !== 1) { |
| 21 | throw new Error("Can only have one target with this action"); |
| 22 | } |
| 23 | |
| 24 | return targets[0]; |
| 25 | } |
| 26 | |
| 27 | export async function runForEachEditor<T, U>( |
| 28 | targets: T[], |