Comparing version 0.0.6 to 0.0.7
import { Channel } from "sync-message"; | ||
import * as Comlink from "comlink"; | ||
export declare class InterruptError extends Error { | ||
@@ -8,13 +9,13 @@ readonly type = "InterruptError"; | ||
} | ||
export declare class SyncClient<T> { | ||
export declare class SyncClient<T = any> { | ||
workerCreator: () => Worker; | ||
channel?: Channel; | ||
channel?: Channel | null; | ||
interrupter?: () => void; | ||
state: "idle" | "running" | "awaitingMessage"; | ||
worker: Worker; | ||
workerProxy: any; | ||
workerProxy: Comlink.Remote<T>; | ||
private _interruptRejector?; | ||
private _interruptPromise?; | ||
private _messageId; | ||
constructor(workerCreator: () => Worker, channel?: Channel); | ||
constructor(workerCreator: () => Worker, channel?: Channel | null); | ||
interrupt(): Promise<void>; | ||
@@ -21,0 +22,0 @@ call(proxyMethod: any, ...args: any[]): Promise<any>; |
@@ -14,7 +14,7 @@ import {Channel, readMessage, uuidv4, writeMessage} from "sync-message"; | ||
export class SyncClient<T> { | ||
export class SyncClient<T=any> { | ||
public interrupter?: () => void; | ||
public state: "idle" | "running" | "awaitingMessage" = "idle"; | ||
public worker: Worker; | ||
public workerProxy: any; | ||
public workerProxy: Comlink.Remote<T>; | ||
@@ -27,3 +27,3 @@ private _interruptRejector?: (reason?: any) => void; | ||
public workerCreator: () => Worker, | ||
public channel?: Channel, | ||
public channel?: Channel | null, | ||
) { | ||
@@ -30,0 +30,0 @@ this._start(); |
{ | ||
"name": "comsync", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
32864
7
208
1
154