/** * A promise with exposed resolve and reject methods. This allows you to create a promise without any parameters * and then call resolve or reject on it at any time. This enables you to hand out promises to callers without having * initiated or decided on how and when to resolve the promise with minimal overhead. Just call resolve on it and * all waiting parties will have their then function callbaks invoked. * * The weird constructor is due to the special requirements and * expectations on the inner workings of a promise. * https://www.ecma-international.org/ecma-262/7.0/index.html#sec-newpromisecapability * https://stackoverflow.com/questions/48158730/extend-javascript-promise-and-resolve-or-reject-it-inside-constructor/48159603 */ export declare class OpenPromise extends Promise { resolve: ((value: T) => void); reject: ((reason: any) => void); constructor(executor?: (resolve: (value: T | PromiseLike) => void, reject: (reason: any) => void) => void); }