-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
41 lines (37 loc) · 1.01 KB
/
index.d.ts
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
33
34
35
36
37
38
39
40
41
export type BoxedJsInterface = unknown;
export type JsHandlerFunction = (
event: string,
data: Record<string, any>,
) => void;
export interface JsInterface {
port: number;
socketHandler: (
interface: BoxedJsInterface,
event: string,
data: Record<string, any>,
) => void;
interface: BoxedJsInterface;
}
export interface WrappedJsInterface {
port: number;
socketHandler: (event: string, data: Record<string, any>) => void;
}
export namespace ChannelCreatePreferences {
interface Tcp {
deleteClientWhenClosed: boolean;
concurrent: boolean;
preset: string;
}
interface Udp {
deleteClientWhenClosed: boolean;
preset: string;
}
}
export function createTcpChannel(
pref: ChannelCreatePreferences.Tcp,
): JsInterface;
export function createUdpChannel(
pref: ChannelCreatePreferences.Udp,
): JsInterface;
export function eventHandler(event: string, data: Record<string, any>): void;
export function setJsEventHandler(f: (event:string, data: Record<string, any>) => void): void;