Я делаю простой класс (Primrose
), который расширяет глобальные Promise
для добавления resolve
и reject
методов
export class Primrose<Resolution> extends Promise<Resolution>{
private _resolve: /* Type binding should be here */
private _reject: /* Type binding should be here */
constructor() {
super((_resolve, _reject) => {
this._resolve = _resolve
this._reject = _reject
})
}
resolve(resolution: Resolution) {
this._resolve(resolution)
}
reject(rejection) {
this._reject(rejection)
}
}
Я хочу дать _promise
и _reject
правильные привязки, но я не знаю, где они. Где я могу их найти?