if (typeof Promise.withResolvers !== 'function') { Promise.withResolvers = function () { let resolve!: (value: T | PromiseLike) => void; let reject!: (reason?: any) => void; const promise = new Promise((res, rej) => { resolve = res; reject = rej; }); return { promise, resolve, reject } as PromiseWithResolvers; }; Object.defineProperty(Promise, 'withResolvers', {}); } if (typeof Array.prototype.at !== 'function') { Array.prototype.at = function (index: number) { return index < 0 ? this[this.length + index] : this[index]; }; } export {};