From 767af21e021f51f8d4a50df348ae4be175094c34 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 5 Jun 2025 08:47:04 +0200 Subject: [PATCH] chore: fix Connection type (#517) The external `Connection` type regressed in https://github.com/microsoft/playwright-mcp/pull/490/files#diff-a6be0583428e46844273df76939f02077073da3075716fc57d291a5f2463eaf5, where the `connect()` function was removed but not from the types. I've changed the code so we import from there, similar to how we do it for `config.d.ts`, so this shouldn't happen again. --- index.d.ts | 4 +--- src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 551ed55..9ea8bcc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -16,13 +16,11 @@ */ import type { Server } from '@modelcontextprotocol/sdk/server/index.js'; -import type { Config } from './config'; -import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js'; +import type { Config } from './config.js'; import type { BrowserContext } from 'playwright'; export type Connection = { server: Server; - connect(transport: Transport): Promise; close(): Promise; }; diff --git a/src/index.ts b/src/index.ts index 3c865be..2f5f2f9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Connection, createConnection as createConnectionImpl } from './connection.js'; +import { createConnection as createConnectionImpl } from './connection.js'; +import type { Connection } from '../index.js'; import { resolveConfig } from './config.js'; import { contextFactory } from './browserContextFactory.js';