Skip to content

Commit

Permalink
refactor(webworker): rename webworker client transport
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Dec 12, 2024
1 parent 82f5bc9 commit 2cff9b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/webworker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WorkerTransport, listen } from 'data-transport';
import { WorkerTransport, listen, createTransport } from 'data-transport';
import { Worker, Main } from './interface';

class MainTransport
Expand Down
12 changes: 6 additions & 6 deletions src/createTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions test/createTransport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ test('base merge transport by main', async () => {
'ElectronRenderer',
'ServiceWorkerClient',
'ServiceWorkerService',
'WorkerMain',
'WorkerInternal',
'WebWorkerClient',
'WebWorkerInternal',
'WebRTC',
'Broadcast',
'SharedWorkerClient',
Expand Down

0 comments on commit 2cff9b2

Please sign in to comment.