-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtunnelblick.d.ts
139 lines (124 loc) · 4.96 KB
/
tunnelblick.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import {
AppleAppKey,
JXAApplication,
JXAArraySpecifier,
JXABoolean,
JXAInteger,
JXANumber,
JXARecord,
JXASpecifier,
JXAText,
JXAReal,
JXAType,
JXADate,
JXALocationSpecifier,
JXAFile,
JXAProperty,
JXARGBColor,
JXAPoint,
JXARectangle,
JXARectangleValue,
JXAList,
JXAItem,
ObjectSpecifierConstructor,
EachElementsType,
RespondsTo,
} from "@apple-jxa/types";
export namespace Tunnelblick {
/**
* Tunnelblick AppleScript support
*/
export namespace TunnelblickSuite {
export interface Application extends JXAApplication {
/**
* Connect a VPN configuration.
* @param directParameter Name of configuration to connect.
*/
connect(directParameter: string): boolean
/**
* Disconnect a VPN configuration.
* @param directParameter Name of configuration to disconnect.
*/
disconnect(directParameter: string): boolean
/**
* Connect all unconnected VPN configurations.
*/
connectAll(): number
/**
* Disconnect all connected VPN configurations.
*/
disconnectAll(): number
/**
* Disconnect all connected VPN configurations except 'when computer starts' configurations.
*/
disconnectAllExceptWhenComputerStarts(): number
/**
* Quit Tunnelblick gracefully.
*/
quit(): number
/**
* Notify Tunnelblick that an OpenVPN configuration file has been changed
* @param directParameter Name of configuration whose OpenVPN configuration file was changed
*/
changedOpenvpnConfigurationFileFor(directParameter: string): boolean
/**
* Notify Tunnelblick that one or more VPN configurations have been added and/or removed.
*/
addedOrRemovedConfigurations(): boolean
/**
* Save the username for a VPN configuration in the Keychain.
* @param directParameter Username
* @param option for: Name of configuration whose username is to be set.
*/
saveUsername(directParameter: string, option: { for: string }): boolean
/**
* Save the password for a VPN configuration in the Keychain.
* @param directParameter Password
* @param option for: Name of configuration whose password is to be set.
*/
savePassword(directParameter: string, option: { for: string }): boolean
/**
* Save the passphrase for a VPN configuration in the Keychain.
* @param directParameter Passphrase
* @param option for: Name of configuration whose passphrase is to be set.
*/
savePassphrase(directParameter: string, option: { for: string }): boolean
/**
* Delete all of the credentials (username, password, and passphrase) for a VPN configuration.
* @param directParameter Name of configuration whose credentials are to be deleted.
*/
deleteAllCredentialsFor(directParameter: string): boolean
configurations: JXAArraySpecifier<TunnelblickSuite.Configuration>
Configuration: ObjectSpecifierConstructor<Configuration>
}
/**
* A VPN configuration.
*/
export interface Configuration extends JXASpecifier<'configuration'> {
/**
* Name of the configuration.
*/
name: JXAText
/**
* State of the configuration. 'EXITING' means disconnecting or disconnected. 'CONNECTED' means connected. Other values show progress towards a connection.
*/
state: JXAText
/**
* 'LAUNCH' means the configuration will be connected automatically when Tunnelblick launches. 'START' means the configuration will be connected automatically when the computer starts. 'NO' means the configuration will not be connected automatically.
*/
autoconnect: JXAText
/**
* The number of bytes that have come in through the connection since Tunnelblick was launched. (For client configurations only. This will return '0' for configurations that are functioning as a server.)
*/
bytesIn: JXAText
/**
* The number of bytes that have gone out through the connection since Tunnelblick was launched. (For client configurations only. This will return '0' for configurations that are functioning as a server.)
*/
bytesOut: JXAText
}
}
export type Application = TunnelblickSuite.Application
}
declare global {
function Application(name: AppleAppKey<'Tunnelblick'>): Tunnelblick.Application;
}