forked from Novage/wt-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
32 lines (28 loc) · 709 Bytes
/
types.ts
File metadata and controls
32 lines (28 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import type { FastTrackerSettings } from "../fast-tracker.ts";
import { MessagePort } from "node:worker_threads";
export type WorkerDataType = {
settings?: Partial<FastTrackerSettings>;
};
export type TrackerWorkerInEvent =
// Pot from socket worker to tracker worker
| {
type: "port";
port: MessagePort;
}
// Stats request
| {
type: "getStats";
id: number;
}
// Port from socket worker peer to tracker worker peer
| {
type: "newPeer";
port: MessagePort;
};
export type SwarmsStats = { infoHash: string; peersCount: number }[];
export type TrackerWorkerOutEvent = {
type: "stats";
id: number;
threadId: number;
swarms: SwarmsStats;
};