From d50900093b0e68eb123c88f50b313f5479eedc9c Mon Sep 17 00:00:00 2001 From: Ashraf Ali Date: Thu, 3 Sep 2026 00:44:04 +0600 Subject: [PATCH] fix(types): expose signal option of Locator.elementHandle The signal option is documented and honored by the client implementation but was missing from the generated types because the hand-written override did not list it. --- packages/playwright-client/types/types.d.ts | 2 +- packages/playwright-core/types/types.d.ts | 2 +- utils/generate_types/overrides.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index 2acee94c525e7..b14199edc3f72 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -14382,7 +14382,7 @@ export interface Locator { * multiple elements match the locator, throws. * @param options */ - elementHandle(options?: { timeout?: number }): Promise>; + elementHandle(options?: { timeout?: number, signal?: AbortSignal }): Promise>; /** * Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses * [locator.highlight([options])](https://playwright.dev/docs/api/class-locator#locator-highlight). diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 2acee94c525e7..b14199edc3f72 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -14382,7 +14382,7 @@ export interface Locator { * multiple elements match the locator, throws. * @param options */ - elementHandle(options?: { timeout?: number }): Promise>; + elementHandle(options?: { timeout?: number, signal?: AbortSignal }): Promise>; /** * Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses * [locator.highlight([options])](https://playwright.dev/docs/api/class-locator#locator-highlight). diff --git a/utils/generate_types/overrides.d.ts b/utils/generate_types/overrides.d.ts index a329924e5ad0f..62a22315672f7 100644 --- a/utils/generate_types/overrides.d.ts +++ b/utils/generate_types/overrides.d.ts @@ -198,7 +198,7 @@ export interface Locator { evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal, exposeFunctions?: boolean }): Promise>; evaluateAll(pageFunction: PageFunctionOn, arg?: Arg): Promise; waitForFunction(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise; - elementHandle(options?: { timeout?: number }): Promise>; + elementHandle(options?: { timeout?: number, signal?: AbortSignal }): Promise>; highlight(options?: { style?: string | { [key: string]: string | number } }): Promise; toString(): string; }