Skip to content

Commit 767af21

Browse files
authored
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.
1 parent 27c498e commit 767af21

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
*/
1717

1818
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
19-
import type { Config } from './config';
20-
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
19+
import type { Config } from './config.js';
2120
import type { BrowserContext } from 'playwright';
2221

2322
export type Connection = {
2423
server: Server;
25-
connect(transport: Transport): Promise<void>;
2624
close(): Promise<void>;
2725
};
2826

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Connection, createConnection as createConnectionImpl } from './connection.js';
17+
import { createConnection as createConnectionImpl } from './connection.js';
18+
import type { Connection } from '../index.js';
1819
import { resolveConfig } from './config.js';
1920
import { contextFactory } from './browserContextFactory.js';
2021

0 commit comments

Comments
 (0)