Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Microsoft Playwright Public API Types

From Leeroopedia
Knowledge Sources
Domains TypeDefinitions, PublicAPI
Last Updated 2026-02-12 00:00 GMT

Overview

Auto-generated TypeScript type definitions that define the complete public API surface for the playwright-core package.

Description

This file (~23,318 lines) is generated by /utils/generate_types/index.js and provides TypeScript type declarations for every class, interface, method, and option type in the Playwright public API. It is the canonical type definition file published with the playwright-core npm package.

The file begins with imports from Node.js built-ins and companion type files:

import { ChildProcess } from 'child_process';
import { Readable } from 'stream';
import { ReadStream } from 'fs';
import { Protocol } from './protocol';
import { Serializable, EvaluationArgument, PageFunction, PageFunctionOn, SmartHandle, ElementHandleForTag, BindingSource } from './structs';

It also conditionally imports Zod types for runtime schema validation support:

import { ZodTypeAny, z } from 'zod';
import * as z3 from 'zod/v3';
type ZodSchema = ZodTypeAny | z3.ZodTypeAny;

Key type categories include:

  • Browser automation: Page, Browser, BrowserContext, BrowserType, Frame
  • Element interaction: Locator, ElementHandle, FrameLocator
  • Input: Keyboard, Mouse, Touchscreen
  • Network: Request, Response, Route, WebSocket, APIRequestContext
  • Events and utilities: ConsoleMessage, Dialog, Download, FileChooser, Video, Worker
  • Testing: Tracing, Coverage, Accessibility
  • Configuration options: Numerous option interfaces for every method

This file is identical in content to packages/playwright-client/types/types.d.ts; both are generated from the same source.

Usage

These types are consumed by TypeScript users of playwright-core (and transitively by playwright and @playwright/test) to get IDE autocompletion, inline documentation, and compile-time type checking for all Playwright API calls.

Code Reference

Source Location

Import

// Automatically resolved by TypeScript when using playwright-core
import { Page, Browser, BrowserContext, Locator } from 'playwright-core';

Generation

# This file is auto-generated; do not edit manually
# Generated by: /utils/generate_types/index.js

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment