abledom 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -111,7 +111,7 @@ declare class AbleDOM {
111
111
  private _onFocusOut;
112
112
  private _notifyAsync;
113
113
  private _getCurrentIssues;
114
- idle(markAsRead?: boolean, timeout?: number): Promise<ValidationIssue[] | null>;
114
+ idle(markAsRead?: boolean, timeout?: number): Promise<ValidationIssue[]>;
115
115
  clearCurrentIssues(anchored?: boolean, notAnchored?: boolean): void;
116
116
  highlightElement(element: HTMLElement | null, scrollIntoView?: boolean, autoHideTime?: number): void;
117
117
  log: typeof console.error;
package/dist/index.d.ts CHANGED
@@ -111,7 +111,7 @@ declare class AbleDOM {
111
111
  private _onFocusOut;
112
112
  private _notifyAsync;
113
113
  private _getCurrentIssues;
114
- idle(markAsRead?: boolean, timeout?: number): Promise<ValidationIssue[] | null>;
114
+ idle(markAsRead?: boolean, timeout?: number): Promise<ValidationIssue[]>;
115
115
  clearCurrentIssues(anchored?: boolean, notAnchored?: boolean): void;
116
116
  highlightElement(element: HTMLElement | null, scrollIntoView?: boolean, autoHideTime?: number): void;
117
117
  log: typeof console.error;
package/dist/index.js CHANGED
@@ -1488,18 +1488,20 @@ var AbleDOM = class {
1488
1488
  }
1489
1489
  let timeoutClear;
1490
1490
  let timeoutResolve;
1491
+ let timedOut = false;
1491
1492
  let timeoutPromise = timeout ? new Promise((resolve) => {
1492
1493
  timeoutResolve = () => {
1493
1494
  timeoutClear == null ? void 0 : timeoutClear();
1494
- timeoutResolve = void 0;
1495
- resolve(null);
1495
+ resolve(this._getCurrentIssues(!!markAsRead));
1496
1496
  };
1497
1497
  let timeoutTimer = this._win.setTimeout(() => {
1498
1498
  timeoutClear = void 0;
1499
+ timedOut = true;
1499
1500
  timeoutResolve == null ? void 0 : timeoutResolve();
1500
1501
  }, timeout);
1501
1502
  timeoutClear = () => {
1502
1503
  this._win.clearTimeout(timeoutTimer);
1504
+ timeoutResolve = void 0;
1503
1505
  timeoutClear = void 0;
1504
1506
  };
1505
1507
  }) : void 0;
@@ -1508,8 +1510,8 @@ var AbleDOM = class {
1508
1510
  this._idleResolve = () => {
1509
1511
  delete this._idlePromise;
1510
1512
  delete this._idleResolve;
1511
- resolve(this._getCurrentIssues(!!markAsRead));
1512
- timeoutResolve == null ? void 0 : timeoutResolve();
1513
+ resolve(this._getCurrentIssues(timedOut ? false : !!markAsRead));
1514
+ timeoutClear == null ? void 0 : timeoutClear();
1513
1515
  };
1514
1516
  });
1515
1517
  }