# IRange

> Language fallback: requested `zh-CN`; content is `en-US`.

- Human documentation: [https://docs.univer.ai/zh-CN/reference/types/range](https://docs.univer.ai/zh-CN/reference/types/range)

- Agent Markdown: [https://docs.univer.ai/zh-CN/reference/types/range.md](https://docs.univer.ai/zh-CN/reference/types/range.md)

- Requested language: `zh-CN`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [types/range.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/types/range.mdx)

---

A rectangular selection described by zero-based row and column indices. Both end indices are inclusive: rows 0–1 and columns 0–1 identify `A1:B2`. This data object describes coordinates; [`FRange`](https://docs.univer.ai/zh-CN/reference/facade/range.md) provides operations on the cells.

```ts
import type { IRange } from '@univerjs/core'

const range: IRange = { startRow: 0, endRow: 1, startColumn: 0, endColumn: 1 } // A1:B2
```

## Import

```ts
import type { IRange } from '@univerjs/core'
```

## Definition

```ts
interface IRange extends IRowRange, IColumnRange {
  rangeType?: RANGE_TYPE
  startAbsoluteRefType?: AbsoluteRefType
  endAbsoluteRefType?: AbsoluteRefType
}
```

## Fields

### `rangeType`

Optional · `RANGE_TYPE | undefined`

### `startAbsoluteRefType`

Optional · `AbsoluteRefType | undefined`

### `endAbsoluteRefType`

Optional · `AbsoluteRefType | undefined`

### `unitId`

Optional · `string | undefined`

Id of the Workbook the range belongs to.
When this field is not defined, it should be considered as the range in the currently activated worksheet.

### `sheetId`

Optional · `string | undefined`

Id of the Worksheet the range belongs to.
When this field is not defined, it should be considered as the range in the currently activated worksheet.

### `startRow`

Required · `number`

Zero-based index of the first row, inclusive.

### `endRow`

Required · `number`

Zero-based index of the last row, inclusive.

### `startColumn`

Required · `number`

Zero-based index of the first column, inclusive.

### `endColumn`

Required · `number`

Zero-based index of the last column, inclusive.

## Related types

* [`IRowRange`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/sheets/typedef.d.ts)
* [`IColumnRange`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/sheets/typedef.d.ts)
* [`RANGE_TYPE`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/sheets/typedef.d.ts)
* [`AbsoluteRefType`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/sheets/typedef.d.ts)

**Package:** [`@univerjs/core`](https://docs.univer.ai/zh-CN/reference/packages/plugins/univerjs/core.md) · [Type definitions](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/sheets/typedef.d.ts)
