Skip to content

Commit 28d6b24

Browse files
committed
Lint
1 parent 99014ab commit 28d6b24

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

packages/php-wasm/universal/src/lib/comlink-sync.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { MessagePort as NodeMessagePort } from 'worker_threads';
2+
13
/**
24
* Comlink library protocol extension to use synchronous messaging.
35
*
@@ -155,9 +157,7 @@ export function wrapSync<T>(
155157

156158
/// Transport ///
157159

158-
export type IsomorphicMessagePort =
159-
| MessagePort
160-
| import('worker_threads').MessagePort;
160+
export type IsomorphicMessagePort = MessagePort | NodeMessagePort;
161161

162162
export class NodeSABSyncReceiveMessageTransport {
163163
static receiveMessageOnPort: any;
@@ -246,13 +246,13 @@ export interface EventSource {
246246
addEventListener(
247247
type: string,
248248
listener: EventListenerOrEventListenerObject,
249-
options?: {}
249+
options?: object
250250
): void;
251251

252252
removeEventListener(
253253
type: string,
254254
listener: EventListenerOrEventListenerObject,
255-
options?: {}
255+
options?: object
256256
): void;
257257
}
258258

@@ -714,7 +714,7 @@ export function expose(
714714
}
715715
}
716716
})
717-
.catch((error) => {
717+
.catch(() => {
718718
// Send Serialization Error To Caller
719719
const [wireValue, transferables] = toWireValue({
720720
value: new TypeError('Unserializable return value'),
@@ -774,6 +774,7 @@ function releaseEndpoint(ep: Endpoint) {
774774
}
775775

776776
interface FinalizationRegistry<T> {
777+
// @ts-ignore
777778
new (cb: (heldValue: T) => void): FinalizationRegistry<T>;
778779
register(
779780
weakItem: object,
@@ -782,7 +783,7 @@ interface FinalizationRegistry<T> {
782783
): void;
783784
unregister(unregisterToken: object): void;
784785
}
785-
declare var FinalizationRegistry: FinalizationRegistry<Endpoint>;
786+
declare const FinalizationRegistry: FinalizationRegistry<Endpoint>;
786787

787788
const proxyCounter = new WeakMap<Endpoint, number>();
788789
const proxyFinalizers =
@@ -915,7 +916,7 @@ export function transfer<T>(obj: T, transfers: Transferable[]): T {
915916
return obj;
916917
}
917918

918-
export function proxy<T extends {}>(obj: T): T & ProxyMarked {
919+
export function proxy<T extends object>(obj: T): T & ProxyMarked {
919920
return Object.assign(obj, { [proxyMarker]: true }) as any;
920921
}
921922

@@ -996,12 +997,12 @@ export interface NodeEndpoint {
996997
on(
997998
type: string,
998999
listener: EventListenerOrEventListenerObject,
999-
options?: {}
1000+
options?: object
10001001
): void;
10011002
off(
10021003
type: string,
10031004
listener: EventListenerOrEventListenerObject,
1004-
options?: {}
1005+
options?: object
10051006
): void;
10061007
start?: () => void;
10071008
}

0 commit comments

Comments
 (0)