Gets the hydration state from the current app.
()
| 34 | |
| 35 | /** Gets the hydration state from the current app. */ |
| 36 | async function getHydrationState() { |
| 37 | return wd.executeScript<{ |
| 38 | hydratedComponents: number; |
| 39 | componentsSkippedHydration: number; |
| 40 | }>(() => { |
| 41 | const devModeWindow = window as Window & |
| 42 | typeof globalThis & { |
| 43 | ngDevMode: { |
| 44 | hydratedComponents: number; |
| 45 | componentsSkippedHydration: number; |
| 46 | }; |
| 47 | }; |
| 48 | |
| 49 | return { |
| 50 | hydratedComponents: devModeWindow.ngDevMode.hydratedComponents, |
| 51 | componentsSkippedHydration: devModeWindow.ngDevMode.componentsSkippedHydration, |
| 52 | }; |
| 53 | }); |
| 54 | } |
| 55 | }); |