brief

  Externally control the resolution and rejection of a promise.

details

  Creates a promise with accessible `resolve` and `reject` methods, enabling external entities to settle the promise based on custom logic or asynchronous events. This is particularly useful when the promise's outcome depends on factors outside the immediate context.

### Type parameters

- #### T

### Hierarchy

- DeferredPromise

## Index

### Constructors

- constructor

### Properties

- mStatus
- promise
- reject
- resolve

### Accessors

- status

## Constructors

### constructor

- new DeferredPromise(): DeferredPromise

- - Defined in @zowe/imperative/src/utilities/src/DeferredPromise.ts:32

  #### Returns DeferredPromise

## Properties

### Private mStatus

mStatus: DeferredPromiseStatus = DeferredPromiseStatus.Pending

- Defined in @zowe/imperative/src/utilities/src/DeferredPromise.ts:28

### promise

promise: Promise<T>

- Defined in @zowe/imperative/src/utilities/src/DeferredPromise.ts:30

### reject

reject: (reason?: any) => void

- Defined in @zowe/imperative/src/utilities/src/DeferredPromise.ts:32

#### Type declaration

- - (reason?: any): void

  - #### Parameters

    - ##### Optional reason: any

    #### Returns void

### resolve

resolve: (value: T | PromiseLike<T>) => void

- Defined in @zowe/imperative/src/utilities/src/DeferredPromise.ts:31

#### Type declaration

- - (value: T | PromiseLike<T>): void

  - #### Parameters

    - ##### value: T | PromiseLike<T>

    #### Returns void

## Accessors

### status

- get status(): DeferredPromiseStatus

- - Defined in @zowe/imperative/src/utilities/src/DeferredPromise.ts:50

  #### Returns DeferredPromiseStatus

  The status of the deferred promise

Generated using TypeDoc