# ReportViewer.CancellationToken

## Content

# Class: CancellationToken

[ReportViewer](../modules/ReportViewer).CancellationToken

Cancellation token.

## Table of contents

### Properties

- [isCancellationRequested](ReportViewer.CancellationToken#iscancellationrequested)
- [parentToken](ReportViewer.CancellationToken#parenttoken)
- [promise](ReportViewer.CancellationToken#promise)

### Methods

- [register](ReportViewer.CancellationToken#register)
- [create](ReportViewer.CancellationToken#create)

## Properties

### <a id="iscancellationrequested" name="iscancellationrequested"></a> isCancellationRequested

• `Readonly` **isCancellationRequested**: `boolean`

___

### <a id="parenttoken" name="parenttoken"></a> parentToken

• `Optional` `Readonly` **parentToken**: [`CancellationToken`](ReportViewer.CancellationToken)

The parent token

___

### <a id="promise" name="promise"></a> promise

• `Readonly` **promise**: `Promise`<`any`\>

## Methods

### <a id="register" name="register"></a> register

▸ **register**(`callback`): `void`

Registers a new cancellation handler. Handler is invoked when cancellation is requested.

#### Parameters

| Name | Type |
| :------ | :------ |
| `callback` | (`reason`: `any`) => `any` |

#### Returns

`void`

___

### <a id="create" name="create"></a> create

▸ `Static` **create**(`parentToken?`): `Object`

Creates a cancellation token and trigger function.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parentToken?` | [`CancellationToken`](ReportViewer.CancellationToken) | The parent token. |

#### Returns

`Object`

| Name | Type |
| :------ | :------ |
| `token` | [`CancellationToken`](ReportViewer.CancellationToken) |
| `cancel` | (`e`: `any`) => `void` |
