-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.ts
114 lines (91 loc) · 2.71 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
const addon = require('bindings')('dcmtk.node');
export interface Node {
aet: string;
ip: string;
port: number;
};
export interface KeyValue {
key: string;
value: string;
}
interface scuOptions {
source: Node;
target: Node;
verbose?: boolean;
}
interface scpOptions {
source: Node;
peers: Node[];
verbose?: boolean;
}
export interface echoScuOptions extends scuOptions {
};
export interface findScuOptions extends scuOptions {
netTransferPrefer?: string;
tags: KeyValue[];
charset?: string;
};
export interface getScuOptions extends scuOptions {
netTransferPrefer?: string;
tags: KeyValue[];
storagePath?: string;
};
export interface moveScuOptions extends scuOptions {
tags: KeyValue[];
destination: string;
netTransferPrefer?: string;
};
export interface storeScuOptions extends scuOptions {
sourcePath: string;
netTransferPropose?: string;
};
export interface storeScpOptions extends scpOptions {
storagePath?: string;
netTransferPrefer?: string;
netTransferPropose?: string;
writeTransfer?: string;
permissive?: boolean;
storeOnly?: boolean;
writeFile?: boolean;
};
export interface shutdownScuOptions extends scuOptions {
};
export interface parseOptions {
sourcePath: string;
verbose?: boolean;
}
export interface recompressOptions {
sourcePath: string;
storagePath: string;
writeTransfer?: string;
lossyQuality?: number;
enableRecompression?: boolean;
verbose?: boolean;
};
export function echoScu(options: echoScuOptions, callback: (result: string) => void) {
addon.echoScu(JSON.stringify(options), callback);
}
export function findScu(options: findScuOptions, callback: (result: string) => void) {
addon.findScu(JSON.stringify(options), callback);
}
export function getScu(options: getScuOptions, callback: (result: string) => void) {
addon.getScu(JSON.stringify(options), callback);
}
export function moveScu(options: moveScuOptions, callback: (result: string) => void) {
addon.moveScu(JSON.stringify(options), callback);
}
export function storeScu(options: storeScuOptions, callback: (result: string) => void) {
addon.storeScu(JSON.stringify(options), callback);
}
export function startStoreScp(options: storeScpOptions, callback: (result: string) => void) {
addon.startScp(JSON.stringify(options), callback);
}
export function shutdownScu(options: shutdownScuOptions, callback: (result: string) => void) {
addon.shutdownScu(JSON.stringify(options), callback);
}
export function parseFile(options: parseOptions, callback: (result: string) => void) {
addon.parseFile(JSON.stringify(options), callback);
}
export function recompress(options: recompressOptions, callback: (result: string) => void) {
addon.recompress(JSON.stringify(options), callback);
}