feature: Adds better types for base.
This commit is contained in:
parent
3d5d7d4446
commit
fdf3ce72d8
1 changed files with 13 additions and 5 deletions
|
@ -3,15 +3,21 @@ export type ParameterReturnedValue = {
|
|||
message?: string
|
||||
}
|
||||
|
||||
export type ConnectedClients = {
|
||||
|
||||
export type ConnectedDevice = {
|
||||
sourceIP: string,
|
||||
sourcePort: number,
|
||||
destPort: number,
|
||||
|
||||
protocol: "tcp" | "udp"
|
||||
};
|
||||
|
||||
export interface BackendInterface {
|
||||
new(): {
|
||||
addConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): void;
|
||||
removeConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): void;
|
||||
|
||||
|
||||
run(): Promise<void>,
|
||||
|
||||
getAllConnections(): {
|
||||
sourceIP: string,
|
||||
sourcePort: number,
|
||||
|
@ -19,8 +25,10 @@ export interface BackendInterface {
|
|||
protocol: "tcp" | "udp"
|
||||
}[];
|
||||
|
||||
status: "running" | "stopped" | "starting";
|
||||
logs: string[],
|
||||
state: "stopped" | "running" | "starting";
|
||||
|
||||
probeConnectedClients: ConnectedDevice[],
|
||||
logs: string[]
|
||||
},
|
||||
|
||||
checkParametersConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): ParameterReturnedValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue