ChemPal Documentation - v1.7.0
    Preparing search index...
    • Expose console API on window.__responseAggregate when in aggregate mode.

      Returns void

      export function initConsoleApi(): void {
      if (typeof __RESPONSE_AGGREGATE__ !== 'undefined' && __RESPONSE_AGGREGATE__) {
      const api = {
      download: downloadAsZip,
      list,
      clear,
      get count() {
      return captured.size;
      },
      };

      // window has no typed slot for our custom debug property; widen to a string-keyed record to attach it.
      (window as unknown as Record<string, unknown>).__responseAggregate = api;

      console.log(
      '%c[ResponseAggregate] Capture mode enabled!',
      'color: #4CAF50; font-weight: bold; font-size: 14px;',
      );
      console.log('Available commands:');
      console.log(' window.__responseAggregate.download() - Download captured responses as zip');
      console.log(' window.__responseAggregate.list() - List all captured responses');
      console.log(' window.__responseAggregate.clear() - Clear captured responses');
      console.log(' window.__responseAggregate.count - Number of captured responses');
      }
      }