(a: {
key: K;
label: string | ((s: MessageActionsState) => string);
types: readonly T[];
applies?: (s: MessageActionsState) => boolean;
stays?: true;
run: (m: NavigableOf<T>, caps: MessageActionCaps) => void;
})
| 146 | |
| 147 | // Identity builder — preserves tuple type so `run`'s param narrows (array literal widens without this). |
| 148 | function action<const T extends NavigableType, const K extends string>(a: { |
| 149 | key: K; |
| 150 | label: string | ((s: MessageActionsState) => string); |
| 151 | types: readonly T[]; |
| 152 | applies?: (s: MessageActionsState) => boolean; |
| 153 | stays?: true; |
| 154 | run: (m: NavigableOf<T>, caps: MessageActionCaps) => void; |
| 155 | }) { |
| 156 | return a; |
| 157 | } |
| 158 | export const MESSAGE_ACTIONS = [action({ |
| 159 | key: 'enter', |
| 160 | label: s => s.expanded ? 'collapse' : 'expand', |
no outgoing calls
no test coverage detected