diff --git a/src/createTablePlugin.tsx b/src/createTablePlugin.tsx index 26c41227e..7208d3e6e 100644 --- a/src/createTablePlugin.tsx +++ b/src/createTablePlugin.tsx @@ -21,6 +21,7 @@ import createPaste from './fb-stubs/createPaste'; import {List, Map as ImmutableMap} from 'immutable'; import React from 'react'; import {KeyboardActions} from './MenuBar'; +import {TableBodyRow} from './ui'; type ID = string; @@ -60,7 +61,6 @@ type State = { * the client in an unknown state. */ export function createTablePlugin(props: Props) { - // @ts-ignore return class extends FlipperPlugin> { static keyboardActions: KeyboardActions = ['clear', 'createPaste']; @@ -97,7 +97,7 @@ export function createTablePlugin(props: Props) { } }; - state = { + state: State = { selectedIds: [], }; @@ -121,7 +121,7 @@ export function createTablePlugin(props: Props) { createPaste = () => { let paste = ''; - const mapFn = row => + const mapFn = (row: TableBodyRow) => Object.keys(props.columns) .map(key => textContent(row.columns[key].value)) .join('\t'); @@ -129,7 +129,9 @@ export function createTablePlugin(props: Props) { if (this.state.selectedIds.length > 0) { // create paste from selection paste = this.props.persistedState.rows - .filter(row => this.state.selectedIds.indexOf(row.key) > -1) + .filter( + (row: TableBodyRow) => this.state.selectedIds.indexOf(row.key) > -1, + ) .map(mapFn) .join('\n'); } else {