Skip to content

Commit 9fb238e

Browse files
committed
Fix type of FakeMessageChannel
so that the type system thinks it's a drop in replacement for MessageChannel
1 parent a02478c commit 9fb238e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/fake_message_channel.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FakeMessagePort {
3232
}
3333
}
3434

35-
export class FakeMessageChannel {
35+
class FakeMessageChannel {
3636
port1: FakeMessagePort;
3737
port2: FakeMessagePort;
3838
constructor() {
@@ -41,4 +41,8 @@ export class FakeMessageChannel {
4141
this.port1._otherPort = this.port2;
4242
this.port2._otherPort = this.port1;
4343
}
44-
}
44+
};
45+
46+
let FakeMessageChannel1 = FakeMessageChannel as unknown as typeof MessageChannel;
47+
48+
export { FakeMessageChannel1 as FakeMessageChannel};

0 commit comments

Comments
 (0)