///
import type { SocketShape } from '@packages/socket/browser/client'
import type * as MobX from 'mobx'
import type { TapManager } from './src/tap/tap-manager'
import type { EventManager } from './src/runner/event-manager'
export {}
/**
* The eventManager and driver are bundled separately
* by webpack. We cannot import them because of
* circular dependencies.
* To work around this, we build the driver, eventManager
* and some other dependencies using webpack, and consumed the dist'd
* source code.
*
* This is attached to `window` under the `UnifiedRunner` namespace.
*
* For now, just declare the types that we need to give us type safety where possible.
* Eventually, we should decouple the event manager and import it directly.
*/
declare global {
interface Window {
ws?: SocketShape
getEventManager: () => EventManager
__CYPRESS_TAP_BINDING__?: TapManager
UnifiedRunner: {
/**
* This is the config served from the back-end.
* We will manage config using GraphQL going forward,
* but for now we are also caching it on `window`
* to be able to move fast and iterate
*/
config: Record
/**
* The app's own React and React DOM, which the runner bundle reads from
* the host modules and re-exports here for Studio and cy.prompt.
*
* Unfortunately, attempting to have React in a project
* using Vue causes mad conflicts because React'S JSX type
* is ambient, so we cannot actually type it.
*/
React: any
ReactDOM: any
dom: any
highlight: any
CypressJQuery: any
MobX: typeof MobX
/**
* Any React components or general code needed from
* runner, reporter or driver are also bundled with
* webpack and made available via the window.UnifedRunner namespace.
*
* We cannot import the correct types, because this causes the linter and type
* checker to run on runner and reporter, and it blows up.
*/
Reporter: any
shortcuts: {
stop: () => void
}
/**
* Points reporter code that binds document-level listeners or portals
* DOM nodes at the document the reporter is rendered into (the reporter
* renders inside a same-origin iframe).
*/
setReporterDocument: (doc: Document) => void
}
}
}