{ name: 'closeButton' as FormatterName, // Typecast to FormatterName. Use constant in real code formatText: () => '', // Returns an empty string because we don't need to display this in the exported data formatElement: ({ values: [id] }: TableFormatterInputs<[id: string]>) => { const button = document.createElement('button'); button.innerText = 'Close'; button.addEventListener('click', () => { event.stopPropagation(); closePosition(id); }); return button; }, }