Skip to content

Commit 66cb253

Browse files
committed
add missing imports
1 parent 7cb5971 commit 66cb253

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ The default header cell renderer. Renders sortable columns with sort indicators.
714714
**Example:**
715715

716716
```tsx
717-
import { renderHeaderCell } from 'react-data-grid';
717+
import { renderHeaderCell, type Column } from 'react-data-grid';
718718

719719
const columns: readonly Column<Row>[] = [
720720
{
@@ -733,7 +733,7 @@ A basic text editor provided for convenience.
733733
**Example:**
734734

735735
```tsx
736-
import { textEditor } from 'react-data-grid';
736+
import { textEditor, type Column } from 'react-data-grid';
737737

738738
const columns: readonly Column<Row>[] = [
739739
{
@@ -797,7 +797,7 @@ Renders the expand/collapse toggle for grouped rows.
797797
**Example:**
798798

799799
```tsx
800-
import { renderToggleGroup } from 'react-data-grid';
800+
import { renderToggleGroup, type Column } from 'react-data-grid';
801801

802802
const columns: readonly Column<Row>[] = [
803803
{
@@ -815,7 +815,7 @@ A simple cell renderer that displays the cell value as text.
815815
**Example:**
816816

817817
```tsx
818-
import { renderValue } from 'react-data-grid';
818+
import { renderValue, type Column } from 'react-data-grid';
819819

820820
const columns: readonly Column<Row>[] = [
821821
{
@@ -853,7 +853,7 @@ A pre-configured column for row selection. Includes checkbox renderers for heade
853853
**Example:**
854854

855855
```tsx
856-
import { DataGrid, SelectColumn } from 'react-data-grid';
856+
import { DataGrid, SelectColumn, type Column } from 'react-data-grid';
857857

858858
const columns: readonly Column<Row>[] = [SelectColumn, ...otherColumns];
859859

@@ -964,6 +964,8 @@ Function to determine how many columns this cell should span. Returns the number
964964
**Example:**
965965

966966
```tsx
967+
import type { Column } from 'react-data-grid';
968+
967969
const columns: readonly Column<Row>[] = [
968970
{
969971
key: 'title',
@@ -1079,6 +1081,8 @@ interface ColumnGroup<R, SR = unknown> {
10791081
**Example:**
10801082

10811083
```tsx
1084+
import type { ColumnOrColumnGroup } from 'react-data-grid';
1085+
10821086
const columns: readonly ColumnOrColumnGroup<Row>[] = [
10831087
{
10841088
name: 'Personal Info',
@@ -1133,6 +1137,8 @@ interface RenderCellProps<TRow, TSummaryRow = unknown> {
11331137
**Example:**
11341138

11351139
```tsx
1140+
import type { RenderCellProps } from 'react-data-grid';
1141+
11361142
function CustomCell({ row, column, onRowChange }: RenderCellProps<MyRow>) {
11371143
return (
11381144
<div>
@@ -1173,6 +1179,8 @@ interface RenderEditCellProps<TRow, TSummaryRow = unknown> {
11731179
**Example:**
11741180

11751181
```tsx
1182+
import type { RenderEditCellProps } from 'react-data-grid';
1183+
11761184
function CustomEditor({ row, column, onRowChange, onClose }: RenderEditCellProps<MyRow>) {
11771185
return (
11781186
<input
@@ -1287,6 +1295,8 @@ Function to manually select the cell. Pass `true` to immediately start editing.
12871295
**Example:**
12881296

12891297
```tsx
1298+
import type { CellMouseArgs, CellMouseEvent } from 'react-data-grid';
1299+
12901300
function onCellClick(args: CellMouseArgs<Row>, event: CellMouseEvent) {
12911301
console.log('Clicked cell at row', args.rowIdx, 'column', args.column.key);
12921302
args.selectCell(true); // Select and start editing
@@ -1308,6 +1318,8 @@ Returns whether `preventGridDefault` was called.
13081318
**Example:**
13091319

13101320
```tsx
1321+
import type { CellMouseArgs, CellMouseEvent } from 'react-data-grid';
1322+
13111323
function onCellClick(args: CellMouseArgs<Row>, event: CellMouseEvent) {
13121324
if (args.column.key === 'actions') {
13131325
event.preventGridDefault(); // Prevent cell selection
@@ -1367,6 +1379,8 @@ interface EditCellKeyDownArgs<TRow, TSummaryRow> {
13671379
**Example:**
13681380

13691381
```tsx
1382+
import type { CellKeyDownArgs, CellKeyboardEvent } from 'react-data-grid';
1383+
13701384
function onCellKeyDown(args: CellKeyDownArgs<Row>, event: CellKeyboardEvent) {
13711385
if (args.mode === 'EDIT' && event.key === 'Escape') {
13721386
args.onClose(false); // Close without committing
@@ -1423,6 +1437,8 @@ type ColSpanArgs<TRow, TSummaryRow> =
14231437
**Example:**
14241438

14251439
```tsx
1440+
import type { Column } from 'react-data-grid';
1441+
14261442
const columns: readonly Column<Row>[] = [
14271443
{
14281444
key: 'title',

0 commit comments

Comments
 (0)