---
title: "RejectablePromise"
---
# RejectablePromise

Defined in: [src/types/async.d.ts:22](https://github.com/xdan/jodit/blob/main/src/types/async.d.ts#L22)

## Extends

- [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`\>

## Type Parameters

| Type Parameter |
| ------ |
| `T` |

### rejectCallback

**rejectCallback**: (`reason?`) => `void`

Defined in: [src/types/async.d.ts:23](https://github.com/xdan/jodit/blob/main/src/types/async.d.ts#L23)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `reason?` | `any` |

#### Returns

`void`

***

### \[toStringTag\]

`readonly` **\[toStringTag\]**: `string`

Defined in: [../typescript/lib/lib.es2015.symbol.wellknown.d.ts:176](https://github.com/xdan/jodit/blob/main/../typescript/lib/lib.es2015.symbol.wellknown.d.ts#L176)

#### Inherited from

`Promise.[toStringTag]`

### finally()

**finally**(`onfinally?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`\>

Defined in: [src/types/async.d.ts:24](https://github.com/xdan/jodit/blob/main/src/types/async.d.ts#L24)

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
resolved value cannot be modified from the callback.

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `onfinally?` | (() => `void`) \| `null` | The callback to execute when the Promise is settled (fulfilled or rejected). |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`\>

A Promise for the completion of the callback.

#### Overrides

`Promise.finally`

***

### then()

**then**\<`TResult1`, `TResult2`\>(`onfulfilled?`, `onrejected?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`TResult1` \| `TResult2`\>

Defined in: [../typescript/lib/lib.es5.d.ts:1557](https://github.com/xdan/jodit/blob/main/../typescript/lib/lib.es5.d.ts#L1557)

Attaches callbacks for the resolution and/or rejection of the Promise.

#### Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| `TResult1` | `T` |
| `TResult2` | `never` |

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `onfulfilled?` | ((`value`) => `TResult1` \| `PromiseLike`\<`TResult1`\>) \| `null` | The callback to execute when the Promise is resolved. |
| `onrejected?` | ((`reason`) => `TResult2` \| `PromiseLike`\<`TResult2`\>) \| `null` | The callback to execute when the Promise is rejected. |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`TResult1` \| `TResult2`\>

A Promise for the completion of which ever callback is executed.

#### Inherited from

`Promise.then`

***

### catch()

**catch**\<`TResult`\>(`onrejected?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T` \| `TResult`\>

Defined in: [../typescript/lib/lib.es5.d.ts:1564](https://github.com/xdan/jodit/blob/main/../typescript/lib/lib.es5.d.ts#L1564)

Attaches a callback for only the rejection of the Promise.

#### Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| `TResult` | `never` |

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `onrejected?` | ((`reason`) => `TResult` \| `PromiseLike`\<`TResult`\>) \| `null` | The callback to execute when the Promise is rejected. |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T` \| `TResult`\>

A Promise for the completion of the callback.

#### Inherited from

`Promise.catch`
