@oxog/react-check 1.1.6 → 1.3.0

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +115 -1
  2. package/README.md +149 -51
  3. package/dist/browser-inject.global.js +705 -158
  4. package/dist/chain.cjs +8 -531
  5. package/dist/chain.cjs.map +1 -1
  6. package/dist/chain.d.cts +2 -2
  7. package/dist/chain.d.ts +2 -2
  8. package/dist/chain.js +2 -533
  9. package/dist/chain.js.map +1 -1
  10. package/dist/chunk-27R56V2S.js +473 -0
  11. package/dist/chunk-27R56V2S.js.map +1 -0
  12. package/dist/chunk-3K2AER5M.cjs +356 -0
  13. package/dist/chunk-3K2AER5M.cjs.map +1 -0
  14. package/dist/chunk-7R4KKJTW.cjs +255 -0
  15. package/dist/chunk-7R4KKJTW.cjs.map +1 -0
  16. package/dist/chunk-7YYMP3PP.js +723 -0
  17. package/dist/chunk-7YYMP3PP.js.map +1 -0
  18. package/dist/chunk-DWM55ACO.cjs +294 -0
  19. package/dist/chunk-DWM55ACO.cjs.map +1 -0
  20. package/dist/chunk-G7YVIPS7.cjs +475 -0
  21. package/dist/chunk-G7YVIPS7.cjs.map +1 -0
  22. package/dist/chunk-GE2ZX7I7.cjs +727 -0
  23. package/dist/chunk-GE2ZX7I7.cjs.map +1 -0
  24. package/dist/chunk-GS7T56RP.cjs +9 -0
  25. package/dist/chunk-GS7T56RP.cjs.map +1 -0
  26. package/dist/chunk-IM6OG2IC.js +338 -0
  27. package/dist/chunk-IM6OG2IC.js.map +1 -0
  28. package/dist/chunk-RQYHXWUC.js +292 -0
  29. package/dist/chunk-RQYHXWUC.js.map +1 -0
  30. package/dist/chunk-WLN7ZVO4.js +253 -0
  31. package/dist/chunk-WLN7ZVO4.js.map +1 -0
  32. package/dist/cli.js +1443 -207
  33. package/dist/cli.js.map +1 -1
  34. package/dist/detect.cjs +22 -324
  35. package/dist/detect.cjs.map +1 -1
  36. package/dist/detect.d.cts +8 -2
  37. package/dist/detect.d.ts +8 -2
  38. package/dist/detect.js +1 -324
  39. package/dist/detect.js.map +1 -1
  40. package/dist/{event-emitter-CxKUDo9q.d.cts → event-emitter-BVYUPYLd.d.cts} +3 -2
  41. package/dist/{event-emitter-CxKUDo9q.d.ts → event-emitter-BVYUPYLd.d.ts} +3 -2
  42. package/dist/fix.cjs +6 -715
  43. package/dist/fix.cjs.map +1 -1
  44. package/dist/fix.d.cts +2 -2
  45. package/dist/fix.d.ts +2 -2
  46. package/dist/fix.js +2 -719
  47. package/dist/fix.js.map +1 -1
  48. package/dist/index.cjs +2380 -3308
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +255 -88
  51. package/dist/index.d.ts +255 -88
  52. package/dist/index.js +2289 -3290
  53. package/dist/index.js.map +1 -1
  54. package/dist/{scanner-CTBraprQ.d.ts → scanner-D0mBQGTx.d.ts} +23 -3
  55. package/dist/{scanner-5j2LEM-q.d.cts → scanner-DUBgwztZ.d.cts} +23 -3
  56. package/dist/scanner.cjs +8 -1652
  57. package/dist/scanner.cjs.map +1 -1
  58. package/dist/scanner.d.cts +3 -3
  59. package/dist/scanner.d.ts +3 -3
  60. package/dist/scanner.js +4 -1656
  61. package/dist/scanner.js.map +1 -1
  62. package/dist/{types-xAXT9cir.d.cts → types-BZ3OeZ-5.d.cts} +28 -10
  63. package/dist/{types-xAXT9cir.d.ts → types-BZ3OeZ-5.d.ts} +28 -10
  64. package/package.json +20 -11
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { F as FiberNode, R as RenderInfo, a as ReactDevToolsHook, S as SessionReport, b as ReportOptions, C as CLIMessage, B as BrowserMessage, c as ScannerConfig, W as WindowWithReactDevTools } from './types-xAXT9cir.js';
2
- export { q as ComponentNode, h as ComponentStats, E as ErrorCode, t as FiberType, g as FixSuggestion, e as FixType, k as FrameworkInfo, m as FrameworkOptions, O as OverlayOptions, p as ReactCheckConfig, r as ReactCheckError, s as ReactCheckEvents, o as ReactCheckOptions, d as RenderChainInfo, n as RuleOptions, i as SessionInfo, j as SessionSummary, f as Severity, l as ThresholdOptions, T as TimelineEvent } from './types-xAXT9cir.js';
3
- import { S as Scanner } from './scanner-CTBraprQ.js';
4
- export { b as ScannerEvents, a as StatsCollector, c as StatsEvents } from './scanner-CTBraprQ.js';
1
+ import { F as FiberNode, R as RenderInfo, a as ReactDevToolsHook, S as SessionReport, b as ReportOptions, C as CLIMessage, B as BrowserMessage, c as RenderChainInfo, d as ScannerConfig, W as WindowWithReactDevTools } from './types-BZ3OeZ-5.js';
2
+ export { r as ComponentNode, h as ComponentStats, E as ErrorCode, u as FiberType, g as FixSuggestion, e as FixType, k as FrameworkInfo, m as FrameworkOptions, O as OverlayOptions, q as ReactCheckConfig, s as ReactCheckError, t as ReactCheckEvents, p as ReactCheckOptions, n as RuleLevel, o as RuleOptions, i as SessionInfo, j as SessionSummary, f as Severity, l as ThresholdOptions, T as TimelineEvent } from './types-BZ3OeZ-5.js';
3
+ import { S as Scanner } from './scanner-D0mBQGTx.js';
4
+ export { b as ScannerEvents, a as StatsCollector, c as StatsEvents } from './scanner-D0mBQGTx.js';
5
5
  export { ChainAnalyzer, ChainEvents } from './chain.js';
6
6
  export { FixEvents, FixSuggester } from './fix.js';
7
7
  export { detectFramework, detectFrameworkFromWindow, frameworkDetectors, getFrameworkTips } from './detect.js';
8
- import { E as EventEmitter } from './event-emitter-CxKUDo9q.js';
8
+ import { E as EventEmitter } from './event-emitter-BVYUPYLd.js';
9
9
  import * as node_net from 'node:net';
10
10
  import * as puppeteer from 'puppeteer';
11
11
 
@@ -626,6 +626,19 @@ declare class Logger {
626
626
  group(label: string, fn: () => void): void;
627
627
  }
628
628
 
629
+ /**
630
+ * Component name pattern matching
631
+ * @packageDocumentation
632
+ */
633
+ /**
634
+ * Match a component name against a simple glob pattern (`*` = any characters,
635
+ * `?` = one character). All other characters match literally.
636
+ * @param name - Component name
637
+ * @param pattern - Glob pattern
638
+ * @returns true if the name matches
639
+ */
640
+ declare function matchComponentPattern(name: string, pattern: string): boolean;
641
+
629
642
  /**
630
643
  * WebSocket client connection
631
644
  */
@@ -759,6 +772,12 @@ declare class WebSocketServer extends EventEmitter<WebSocketServerEvents> {
759
772
  * Stop the server
760
773
  */
761
774
  stop(): Promise<void>;
775
+ /**
776
+ * Get the port the server listens on (the real port after start() when
777
+ * constructed with port 0)
778
+ * @returns Port number
779
+ */
780
+ getPort(): number;
762
781
  /**
763
782
  * Broadcast message to all clients
764
783
  * @param message - Message to broadcast
@@ -839,18 +858,13 @@ declare class ProxyServer extends EventEmitter<ProxyServerEvents> {
839
858
  private options;
840
859
  /** Target URL parsed */
841
860
  private targetUrl;
842
- /** Injection script */
861
+ /** Injection script (loaded from the bundled browser script on start() when not provided) */
843
862
  private injectionScript;
844
863
  /**
845
864
  * Create a new proxy server
846
865
  * @param options - Proxy options
847
866
  */
848
867
  constructor(options: ProxyOptions);
849
- /**
850
- * Build the injection script
851
- * @returns Injection script string
852
- */
853
- private buildInjectionScript;
854
868
  /**
855
869
  * Handle incoming request
856
870
  * @param req - Client request
@@ -1033,6 +1047,14 @@ declare class BrowserLauncher extends EventEmitter<BrowserEvents> {
1033
1047
  */
1034
1048
  declare function isPuppeteerAvailable(): Promise<boolean>;
1035
1049
 
1050
+ /**
1051
+ * Load the browser injection script and prepend the WebSocket port setting
1052
+ * @param wsPort - Port of the CLI WebSocket server the page should connect to
1053
+ * @returns Script source ready for `evaluateOnNewDocument` or a `<script>` tag
1054
+ * @throws Error when the bundle cannot be found (broken installation)
1055
+ */
1056
+ declare function loadInjectionScript(wsPort: number): Promise<string>;
1057
+
1036
1058
  /**
1037
1059
  * Browser overlay for render visualization
1038
1060
  * @packageDocumentation
@@ -1046,12 +1068,10 @@ interface OverlayConfig {
1046
1068
  enabled: boolean;
1047
1069
  /** Whether to highlight renders */
1048
1070
  highlightRenders: boolean;
1049
- /** Animation speed */
1050
- animationSpeed: 'slow' | 'fast' | 'off';
1051
- /** Whether to show badges */
1052
- showBadges: boolean;
1053
1071
  /** Whether to show toolbar */
1054
1072
  showToolbar: boolean;
1073
+ /** Highlight duration in ms (0 = persistent until cleared) */
1074
+ highlightDuration: number;
1055
1075
  }
1056
1076
  /**
1057
1077
  * Overlay for visualizing React renders in the browser
@@ -1063,21 +1083,41 @@ declare class Overlay {
1063
1083
  private host;
1064
1084
  /** Overlay configuration */
1065
1085
  private config;
1066
- /** Highlight elements */
1067
- private highlights;
1068
- /** Badge elements */
1069
- private badges;
1070
- /** Render counts for badges */
1071
- private renderCounts;
1086
+ /** Tracked components (deduplication) */
1087
+ private trackedComponents;
1088
+ /** Render chains */
1089
+ private renderChains;
1072
1090
  /** Toolbar element */
1073
1091
  private toolbar;
1074
1092
  /** Whether overlay is visible */
1075
1093
  private visible;
1094
+ /** Whether panel is collapsed to icon */
1095
+ private collapsed;
1096
+ /** Total render count */
1097
+ private totalRenders;
1098
+ /** FPS value */
1099
+ private fps;
1100
+ /** Scan start time */
1101
+ private startTime;
1102
+ /** Fade timeout handles */
1103
+ private fadeTimeouts;
1104
+ /** Bound scroll handler for cleanup */
1105
+ private scrollHandler;
1106
+ /** Scroll update pending flag (for throttling) */
1107
+ private scrollUpdatePending;
1108
+ /** Stats update interval */
1109
+ private statsInterval;
1076
1110
  /**
1077
1111
  * Create a new overlay
1078
1112
  * @param config - Overlay configuration
1079
1113
  */
1080
1114
  constructor(config?: Partial<OverlayConfig>);
1115
+ /** Retry count for init */
1116
+ private initRetryCount;
1117
+ /** Pending init retry timer (document.body not ready yet) */
1118
+ private initRetryTimer;
1119
+ /** Aborts document-level listeners (drag handling) on destroy */
1120
+ private documentListeners;
1081
1121
  /**
1082
1122
  * Initialize the overlay
1083
1123
  */
@@ -1086,67 +1126,102 @@ declare class Overlay {
1086
1126
  * Destroy the overlay
1087
1127
  */
1088
1128
  destroy(): void;
1129
+ /**
1130
+ * Handle scroll/resize events - update all highlight positions
1131
+ */
1132
+ private onScroll;
1133
+ /**
1134
+ * Update positions of all tracked highlights
1135
+ */
1136
+ private updateAllPositions;
1089
1137
  /**
1090
1138
  * Inject CSS styles into shadow DOM
1091
1139
  */
1092
1140
  private injectStyles;
1093
1141
  /**
1094
- * Create the floating toolbar
1142
+ * Create the floating panel
1095
1143
  */
1096
1144
  private createToolbar;
1097
1145
  /**
1098
1146
  * Set up toolbar event listeners
1099
1147
  */
1100
1148
  private setupToolbarEvents;
1149
+ /**
1150
+ * Toggle collapse state
1151
+ */
1152
+ private toggleCollapse;
1153
+ /**
1154
+ * Switch active tab
1155
+ */
1156
+ private switchTab;
1157
+ /**
1158
+ * Update highlights visibility
1159
+ */
1160
+ private updateHighlightsVisibility;
1101
1161
  /**
1102
1162
  * Make an element draggable
1103
- * @param element - Element to make draggable
1104
1163
  */
1105
1164
  private makeDraggable;
1165
+ /** Maximum number of highlights to show at once */
1166
+ private static readonly MAX_HIGHLIGHTS;
1167
+ /** Component names to skip (generic/internal) */
1168
+ private static readonly SKIP_COMPONENTS;
1106
1169
  /**
1107
- * Highlight a component render with flash effect
1108
- * @param render - Render information
1109
- * @param element - DOM element to highlight
1170
+ * Highlight a component render
1110
1171
  */
1111
1172
  highlight(render: RenderInfo, element: Element): void;
1112
1173
  /**
1113
- * Create a flash overlay effect on the element
1114
- * @param rect - Element bounding rectangle
1115
- * @param color - Flash color
1174
+ * Add a render chain
1116
1175
  */
1117
- private createFlashOverlay;
1176
+ addChain(chain: RenderChainInfo): void;
1118
1177
  /**
1119
- * Update or create a badge for a component
1120
- * @param render - Render information
1121
- * @param rect - Bounding rectangle
1122
- * @param color - Badge color
1178
+ * Update FPS value
1123
1179
  */
1124
- private updateBadge;
1180
+ updateFps(fps: number): void;
1125
1181
  /**
1126
- * Get severity level for a render
1127
- * @param render - Render information
1128
- * @returns Severity level
1182
+ * Create a highlight element
1183
+ */
1184
+ private createHighlightElement;
1185
+ /**
1186
+ * Update highlight position
1187
+ */
1188
+ private updateHighlightPosition;
1189
+ /**
1190
+ * Update highlight color
1191
+ */
1192
+ private updateHighlightColor;
1193
+ /**
1194
+ * Reset fade timeout
1195
+ */
1196
+ private resetFadeTimeout;
1197
+ /**
1198
+ * Get the oldest tracked component by last render time
1199
+ */
1200
+ private getOldestTrackedComponent;
1201
+ /**
1202
+ * Remove a highlight by component name
1203
+ */
1204
+ private removeHighlight;
1205
+ /**
1206
+ * Get severity level
1129
1207
  */
1130
1208
  private getSeverity;
1131
1209
  /**
1132
- * Record a render event (updates stats even without DOM element)
1133
- * @param render - Render information
1210
+ * Record a render event
1134
1211
  */
1135
1212
  recordRender(render: RenderInfo): void;
1136
- /** Total render count */
1137
- private totalRenders;
1138
1213
  /**
1139
- * Update toolbar stats
1214
+ * Update all stats
1140
1215
  */
1141
1216
  private updateStats;
1142
1217
  /**
1143
- * Clear all highlights
1218
+ * Update component list in Components tab
1144
1219
  */
1145
- clearHighlights(): void;
1220
+ private updateComponentList;
1146
1221
  /**
1147
- * Clear all badges
1222
+ * Update chain list in Chains tab
1148
1223
  */
1149
- clearBadges(): void;
1224
+ private updateChainList;
1150
1225
  /**
1151
1226
  * Clear all visualizations
1152
1227
  */
@@ -1165,14 +1240,16 @@ declare class Overlay {
1165
1240
  toggle(): void;
1166
1241
  /**
1167
1242
  * Update configuration
1168
- * @param config - Partial configuration
1169
1243
  */
1170
1244
  configure(config: Partial<OverlayConfig>): void;
1171
1245
  /**
1172
1246
  * Check if overlay is visible
1173
- * @returns true if visible
1174
1247
  */
1175
1248
  isVisible(): boolean;
1249
+ /**
1250
+ * Get render counts
1251
+ */
1252
+ getRenderCounts(): Map<string, number>;
1176
1253
  }
1177
1254
 
1178
1255
  /**
@@ -1214,8 +1291,6 @@ declare class BrowserScanner extends EventEmitter<BrowserScannerEvents> {
1214
1291
  private running;
1215
1292
  /** React version detected */
1216
1293
  private reactVersion;
1217
- /** Previous fiber states for comparison */
1218
- private prevFiberStates;
1219
1294
  /** Component render counts */
1220
1295
  private renderCounts;
1221
1296
  /** Original DevTools hook methods */
@@ -1282,16 +1357,14 @@ declare class BrowserScanner extends EventEmitter<BrowserScannerEvents> {
1282
1357
  */
1283
1358
  private detectReactVersion;
1284
1359
  /**
1285
- * Process a fiber commit (public for IIFE hook integration)
1286
- * @param rootFiber - Root fiber of the committed tree
1360
+ * Process a fiber commit (public for IIFE hook integration).
1361
+ *
1362
+ * Only components that actually rendered in this commit are reported: React
1363
+ * reuses untouched subtrees (their `child` pointer is shared with the
1364
+ * alternate) and bailed-out components do not get the `PerformedWork` flag.
1365
+ * @param rootFiber - Root fiber of the committed tree (`root.current`)
1287
1366
  */
1288
1367
  processCommit(rootFiber: FiberNode): void;
1289
- /**
1290
- * Walk the fiber tree
1291
- * @param fiber - Current fiber
1292
- * @param parent - Parent component name
1293
- */
1294
- private walkFiber;
1295
1368
  /**
1296
1369
  * Process a single fiber
1297
1370
  * @param fiber - Fiber to process
@@ -1345,8 +1418,13 @@ declare class BrowserScanner extends EventEmitter<BrowserScannerEvents> {
1345
1418
  }
1346
1419
 
1347
1420
  /**
1348
- * Browser injection script - main entry point for browser-side code
1349
- * This file is bundled as an IIFE for injection into target pages
1421
+ * Browser-side injector: coordinates the BrowserScanner, the Overlay and the
1422
+ * WebSocket connection to the CLI.
1423
+ *
1424
+ * This module has NO side effects when imported, so it is safe to import from
1425
+ * Node.js, SSR bundles and tests. The self-installing IIFE lives in
1426
+ * `inject.ts`, which is only built into `dist/browser-inject.global.js`.
1427
+ *
1350
1428
  * @packageDocumentation
1351
1429
  */
1352
1430
 
@@ -1366,10 +1444,33 @@ declare class ReactCheckInjector {
1366
1444
  private reconnectTimeout;
1367
1445
  /** Whether initialized */
1368
1446
  private initialized;
1447
+ /** Whether destroyed (no more reconnects, commits are ignored) */
1448
+ private destroyed;
1449
+ /** Whether commit processing is paused (CLI sent `stop`) */
1450
+ private paused;
1451
+ /** Commits received before `init()` */
1452
+ private pendingCommits;
1453
+ /** Message queue for messages sent before connection */
1454
+ private messageQueue;
1455
+ /** requestAnimationFrame handle for FPS measurement */
1456
+ private rafHandle;
1457
+ /** Restores the React DevTools hook to its state before installation */
1458
+ private restoreHook;
1459
+ /** Window reference */
1460
+ private win;
1369
1461
  /**
1370
1462
  * Create the injector
1463
+ * @param win - Window object (defaults to the global window)
1464
+ */
1465
+ constructor(win?: WindowWithReactDevTools);
1466
+ /**
1467
+ * Feed a committed fiber root to the scanner. Called from the React DevTools
1468
+ * hook installed by {@link installReactCheck}.
1469
+ * @param root - Fiber root passed to `onCommitFiberRoot`
1371
1470
  */
1372
- constructor();
1471
+ handleCommit(root: {
1472
+ current: FiberNode;
1473
+ } | null | undefined): void;
1373
1474
  /**
1374
1475
  * Initialize the injector
1375
1476
  */
@@ -1378,10 +1479,20 @@ declare class ReactCheckInjector {
1378
1479
  * Set up scanner event handlers
1379
1480
  */
1380
1481
  private setupScannerEvents;
1482
+ /**
1483
+ * Measure frames per second with requestAnimationFrame and report it
1484
+ */
1485
+ private startFpsMeasurement;
1381
1486
  /**
1382
1487
  * Connect to CLI WebSocket server
1383
1488
  */
1384
1489
  private connect;
1490
+ /**
1491
+ * Remove event handlers from a socket so that closing it does not trigger
1492
+ * reconnects
1493
+ * @param ws - Socket
1494
+ */
1495
+ private detachSocket;
1385
1496
  /**
1386
1497
  * Schedule a reconnection attempt
1387
1498
  */
@@ -1410,8 +1521,6 @@ declare class ReactCheckInjector {
1410
1521
  * @param config - New configuration
1411
1522
  */
1412
1523
  private handleConfig;
1413
- /** Message queue for messages sent before connection */
1414
- private messageQueue;
1415
1524
  /**
1416
1525
  * Send message to CLI
1417
1526
  * @param message - Browser message
@@ -1422,10 +1531,85 @@ declare class ReactCheckInjector {
1422
1531
  */
1423
1532
  private flushMessageQueue;
1424
1533
  /**
1425
- * Destroy the injector
1534
+ * Register a function that restores the DevTools hook on destroy
1535
+ * @param restore - Restore callback
1536
+ */
1537
+ setHookRestorer(restore: () => void): void;
1538
+ /**
1539
+ * Destroy the injector: stops reconnecting, closes the socket, restores the
1540
+ * React DevTools hook, removes the overlay and cancels all timers.
1426
1541
  */
1427
1542
  destroy(): void;
1428
1543
  }
1544
+ /**
1545
+ * Install ReactCheck into a page: hooks the React DevTools global hook (creating
1546
+ * it when React has not loaded yet), creates the injector and initialises it
1547
+ * once the DOM is ready. Returns `null` on internal pages or when ReactCheck is
1548
+ * already installed.
1549
+ *
1550
+ * @param win - Window object
1551
+ * @returns The injector instance, or null when nothing was installed
1552
+ */
1553
+ declare function installReactCheck(win: WindowWithReactDevTools): ReactCheckInjector | null;
1554
+
1555
+ /**
1556
+ * Package version (kept in sync with package.json; checked by tests)
1557
+ * @packageDocumentation
1558
+ */
1559
+ declare const VERSION = "1.3.0";
1560
+
1561
+ /**
1562
+ * One-call programmatic scan of a URL
1563
+ * @packageDocumentation
1564
+ */
1565
+
1566
+ /**
1567
+ * Options for {@link quickScan}
1568
+ */
1569
+ interface QuickScanOptions {
1570
+ /** How long to observe the page, in milliseconds (default: 30000) */
1571
+ duration?: number;
1572
+ /** Run the browser headless (default: true) */
1573
+ headless?: boolean;
1574
+ /** Directory to write reports to (no files are written when omitted) */
1575
+ output?: string;
1576
+ /** Report formats to write when `output` is set (default: html, json) */
1577
+ formats?: Array<'html' | 'json' | 'md'>;
1578
+ /** Render-count thresholds */
1579
+ thresholds?: {
1580
+ critical?: number;
1581
+ warning?: number;
1582
+ fps?: number;
1583
+ };
1584
+ /** Only track components matching these glob patterns */
1585
+ include?: string[];
1586
+ /** Ignore components matching these glob patterns */
1587
+ exclude?: string[];
1588
+ /** Port for the internal WebSocket server (default: a free ephemeral port) */
1589
+ port?: number;
1590
+ /** Extra Chrome arguments passed to Puppeteer */
1591
+ browserArgs?: string[];
1592
+ }
1593
+ /**
1594
+ * Quick scan a URL and generate a report. Launches Chrome through Puppeteer
1595
+ * (an optional peer dependency), injects the ReactCheck browser script, records
1596
+ * renders for `duration` milliseconds and returns the session report.
1597
+ *
1598
+ * @example
1599
+ * ```typescript
1600
+ * import { quickScan } from '@oxog/react-check';
1601
+ *
1602
+ * const report = await quickScan('http://localhost:3000', {
1603
+ * duration: 30000,
1604
+ * headless: true,
1605
+ * });
1606
+ *
1607
+ * console.log(`Found ${report.summary.criticalIssues} critical issues`);
1608
+ * ```
1609
+ * @throws ReactCheckError BROWSER_LAUNCH_FAILED when Puppeteer is missing or the
1610
+ * browser cannot start, REACT_NOT_FOUND when no React render was observed
1611
+ */
1612
+ declare function quickScan(url: string, options?: QuickScanOptions): Promise<SessionReport>;
1429
1613
 
1430
1614
  /**
1431
1615
  * ReactCheck - Zero-dependency React Performance Scanner
@@ -1435,7 +1619,6 @@ declare class ReactCheckInjector {
1435
1619
  * @packageDocumentation
1436
1620
  */
1437
1621
 
1438
- declare const VERSION = "1.0.0";
1439
1622
  /**
1440
1623
  * Create a new ReactCheck scanner instance with default options
1441
1624
  *
@@ -1458,7 +1641,12 @@ declare function createScanner(options?: {
1458
1641
  thresholds?: {
1459
1642
  critical?: number;
1460
1643
  warning?: number;
1644
+ fps?: number;
1461
1645
  };
1646
+ /** Only track components matching one of these glob patterns */
1647
+ include?: string[];
1648
+ /** Ignore components matching one of these glob patterns */
1649
+ exclude?: string[];
1462
1650
  }): Scanner;
1463
1651
  /**
1464
1652
  * Create a new report generator
@@ -1480,26 +1668,5 @@ declare function createReportGenerator(options?: {
1480
1668
  output?: string;
1481
1669
  includeSourceCode?: boolean;
1482
1670
  }): ReportGenerator;
1483
- /**
1484
- * Quick scan a URL and generate a report
1485
- *
1486
- * @example
1487
- * ```typescript
1488
- * import { quickScan } from '@oxog/react-check';
1489
- *
1490
- * const report = await quickScan('http://localhost:3000', {
1491
- * duration: 30000,
1492
- * headless: true,
1493
- * });
1494
- *
1495
- * console.log(`Found ${report.summary.criticalIssues} critical issues`);
1496
- * ```
1497
- */
1498
- declare function quickScan(url: string, options?: {
1499
- duration?: number;
1500
- headless?: boolean;
1501
- output?: string;
1502
- formats?: Array<'html' | 'json' | 'md'>;
1503
- }): Promise<SessionReport>;
1504
1671
 
1505
- export { type BrowserEvents, type BrowserLaunchOptions, BrowserLauncher, BrowserMessage, BrowserScanner, type BrowserScannerEvents, CLIMessage, EventEmitter, FiberNode, FiberTag, LogLevel, Logger, Overlay, type OverlayConfig, type ProxyOptions, ProxyServer, type ProxyServerEvents, ReactCheckInjector, ReactDevToolsHook, RenderInfo, type ReportFormat, ReportGenerator, ReportOptions, Scanner, ScannerConfig, SessionReport, VERSION, WebSocketClient, WebSocketServer, type WebSocketServerEvents, WindowWithReactDevTools, colors, createRenderInfo, createReportGenerator, createScanner, ensureDir, escapeHtml, exists, findFiberByName, findUp, formatBytes, formatDuration, formatNumber, formatPercent, formatRenderTime, generateHTMLReport, generateJSONReport, generateMarkdownReport, generateReport, getBaseName, getChangedProps, getComponentName, getComponentPath, getDirName, getExtension, getFiberDOMNode, getOwner, getParentFiber, getReactVersion, handleBrowserMessages, isHostComponent, isMemoized, isPuppeteerAvailable, isUserComponent, joinPath, pad, parseJSONReport, quickScan, readJsonFile, readTextFile, resolvePath, saveReport, saveReports, shallowEqual, stripAnsi, supportsColor, truncate, validateJSONReport, walkFiberTree, writeJsonFile, writeTextFile };
1672
+ export { type BrowserEvents, type BrowserLaunchOptions, BrowserLauncher, BrowserMessage, BrowserScanner, type BrowserScannerEvents, CLIMessage, EventEmitter, FiberNode, FiberTag, LogLevel, Logger, Overlay, type OverlayConfig, type ProxyOptions, ProxyServer, type ProxyServerEvents, type QuickScanOptions, ReactCheckInjector, ReactDevToolsHook, RenderChainInfo, RenderInfo, type ReportFormat, ReportGenerator, ReportOptions, Scanner, ScannerConfig, SessionReport, VERSION, WebSocketClient, WebSocketServer, type WebSocketServerEvents, WindowWithReactDevTools, colors, createRenderInfo, createReportGenerator, createScanner, ensureDir, escapeHtml, exists, findFiberByName, findUp, formatBytes, formatDuration, formatNumber, formatPercent, formatRenderTime, generateHTMLReport, generateJSONReport, generateMarkdownReport, generateReport, getBaseName, getChangedProps, getComponentName, getComponentPath, getDirName, getExtension, getFiberDOMNode, getOwner, getParentFiber, getReactVersion, handleBrowserMessages, installReactCheck, isHostComponent, isMemoized, isPuppeteerAvailable, isUserComponent, joinPath, loadInjectionScript, matchComponentPattern, pad, parseJSONReport, quickScan, readJsonFile, readTextFile, resolvePath, saveReport, saveReports, shallowEqual, stripAnsi, supportsColor, truncate, validateJSONReport, walkFiberTree, writeJsonFile, writeTextFile };