Skip to content

Deduplicate ElectronApplication declaration in generated type sources#41199

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-electronapplication-duplicate-export
Open

Deduplicate ElectronApplication declaration in generated type sources#41199
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-electronapplication-duplicate-export

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 8, 2026

ElectronApplication was being exported twice in generated types.d.ts files because utils/generate_types/overrides.d.ts defined it twice. This caused duplicated interface output in both core and client type bundles.

  • Root cause

    • utils/generate_types/overrides.d.ts contained two identical blocks:
      • type ElectronType = typeof import('electron')
      • export interface ElectronApplication { ... }
  • Change made

    • Removed the second duplicated ElectronType + ElectronApplication block from utils/generate_types/overrides.d.ts.
  • Generated output impact

    • Regenerated declarations now contain a single ElectronApplication definition in:
      • packages/playwright-core/types/types.d.ts
      • packages/playwright-client/types/types.d.ts
  • Before/after (source override)

    // kept (single source of truth)
    //@ts-ignore this will be any if electron is not installed
    type ElectronType = typeof import('electron');
    
    export interface ElectronApplication {
      evaluate<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<R>;
      evaluate<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<R>;
      evaluateHandle<R, Arg>(pageFunction: PageFunctionOn<ElectronType, Arg, R>, arg: Arg): Promise<SmartHandle<R>>;
      evaluateHandle<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<SmartHandle<R>>;
    }
    
    // removed: identical duplicate block near file end

Co-authored-by: yury-s <9798949+yury-s@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix duplicate export of ElectronApplication interface Deduplicate ElectronApplication declaration in generated type sources Jun 8, 2026
Copilot finished work on behalf of yury-s June 8, 2026 18:25
Copilot AI requested a review from yury-s June 8, 2026 18:25
@yury-s yury-s marked this pull request as ready for review June 8, 2026 18:29
@yury-s yury-s added the CQ1 label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ElectronApplication interface exported twice

3 participants