diff --git a/examples/webworker/src/index.ts b/examples/webworker/src/index.ts index 8e8cccb..45420d6 100644 --- a/examples/webworker/src/index.ts +++ b/examples/webworker/src/index.ts @@ -1,4 +1,4 @@ -import { WorkerTransport, listen } from 'data-transport'; +import { WorkerTransport, listen, createTransport } from 'data-transport'; import { Worker, Main } from './interface'; class MainTransport diff --git a/src/createTransport.ts b/src/createTransport.ts index a694207..067635a 100644 --- a/src/createTransport.ts +++ b/src/createTransport.ts @@ -56,8 +56,8 @@ export interface TransportOptionsMap { ElectronRenderer: ElectronRendererTransportOptions; ServiceWorkerClient: ServiceWorkerClientTransportOptions; ServiceWorkerService: ServiceWorkerServiceTransportOptions; - WorkerMain: WorkerMainTransportOptions; - WorkerInternal: WorkerInternalTransportOptions; + WebWorkerClient: WorkerMainTransportOptions; + WebWorkerInternal: WorkerInternalTransportOptions; WebRTC: WebRTCTransportOptions; Broadcast: BroadcastTransportOptions; SharedWorkerClient: SharedWorkerClientTransportOptions; @@ -77,8 +77,8 @@ export interface Transports { SharedWorkerInternal: SharedWorkerInternalTransport; ServiceWorkerClient: ServiceWorkerClientTransport; ServiceWorkerService: ServiceWorkerServiceTransport; - WorkerMain: WorkerMainTransport; - WorkerInternal: WorkerInternalTransport; + WebWorkerClient: WorkerMainTransport; + WebWorkerInternal: WorkerInternalTransport; BrowserExtensions: BrowserExtensionsGenericTransport; BrowserExtensionsMain: BrowserExtensionsMainTransport; BrowserExtensionsClient: BrowserExtensionsClientTransport; @@ -102,8 +102,8 @@ export const TransportMap = { ElectronRenderer: ElectronTransport.Renderer, ServiceWorkerClient: ServiceWorkerTransport.Client, ServiceWorkerService: ServiceWorkerTransport.Service, - WorkerMain: WorkerTransport.Main, - WorkerInternal: WorkerTransport.Worker, + WebWorkerClient: WorkerTransport.Main, + WebWorkerInternal: WorkerTransport.Worker, WebRTC: WebRTCTransport, Broadcast: BroadcastTransport, SharedWorkerClient: SharedWorkerTransport.Client, diff --git a/test/createTransport.test.ts b/test/createTransport.test.ts index 3b05ba8..47b7a40 100644 --- a/test/createTransport.test.ts +++ b/test/createTransport.test.ts @@ -26,8 +26,8 @@ test('base merge transport by main', async () => { 'ElectronRenderer', 'ServiceWorkerClient', 'ServiceWorkerService', - 'WorkerMain', - 'WorkerInternal', + 'WebWorkerClient', + 'WebWorkerInternal', 'WebRTC', 'Broadcast', 'SharedWorkerClient',