# Range Copy Preview
URL: https://pro.rv-grid.com/api/range-copy-preview/
Source: src/content/docs/api/range-copy-preview.md
### `computeRangeCopyPreviewData`

Computes the exact range-copy values for a temporary drag target.

**@param** options Source range, target range, row/column types, and providers.
 *
**@returns** Preview matrix and row/prop lookup, or `null` when no copy preview can be computed.

```ts
export function computeRangeCopyPreviewData(;
```

---

### `mapRangeCopyMatrixToData`

Maps a copied source matrix onto a target range using RevoGrid range-copy semantics.

**@param** matrix Source values ordered row-major.
 *
**@param** source Source range to exclude from target writes.
 *
**@param** target Target range to preview.
 *
**@param** providers Plugin providers used to resolve target columns.
 *
**@param** colType Column dimension type.
 *
**@returns** Row/prop lookup for preview rendering.

```ts
export function mapRangeCopyMatrixToData(
  matrix: unknown[][],
  source: RangeArea,
  target: RangeArea,
  providers: Pick<PluginProviders, 'column'>,
  colType: DimensionCols,
): Record<number, DataType>;
```

---

### `isInRange`

```ts
export function isInRange(row: number, col: number, range: RangeArea);
```

---

### `RangeCopyPreviewComputedData`

```ts
export type RangeCopyPreviewComputedData = {
  matrix: unknown[][];
  data: Record<number, DataType>;
};
```

---

### `RangeCopyPreviewComputeOptions` (Extended from `index.ts`)

```ts
export type RangeCopyPreviewComputeOptions = Pick<ChangedRange, 'oldRange' | 'newRange'> & {
  type: DimensionRows;
  colType: DimensionCols;
  providers: PluginProviders;
};
```

---

### `RangeCopyPreviewPlugin`

The `RangeCopyPreviewPlugin` renders ghost values for the exact range copy
that RevoGrid will apply when the user drops an autofill/range-copy drag.

**Features**:
- Shows copied source values while dragging the fill handle.
- Uses copy semantics only; it does not infer AutoFill sequences.
- Keeps preview view-only and never writes to the data store.
- Clears preview on drop, cancel, source changes, and plugin destruction.

### Example
```typescript
import { RangeCopyPreviewPlugin } from '@revolist/revogrid-pro';

grid.plugins = [RangeCopyPreviewPlugin];
```

```ts
class RangeCopyPreviewPlugin {
  destroy();
}
```
