@girs/gssdp-1.0 1.0.0-3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/gssdp-1.0.cjs +9 -0
- package/gssdp-1.0.d.cts +649 -0
- package/gssdp-1.0.d.ts +654 -0
- package/gssdp-1.0.js +8 -0
- package/package.json +55 -0
- package/tsconfig.doc.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# GSSDP-1.0
|
|
3
|
+
|
|
4
|
+
GJS TypeScript type definitions for GSSDP-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gjs) v3.0.0-beta.12.
|
|
5
|
+
|
|
6
|
+
GObject-based API for handling resource discovery and announcement over SSDP.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
To use this type definitions, install them with NPM like this:
|
|
11
|
+
```bash
|
|
12
|
+
npm install @girs/gssdp-1.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
You can import this package into your project like this:
|
|
18
|
+
```ts
|
|
19
|
+
import GSSDP from '@girs/gssdp-1.0';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or if you prefer CommonJS, you can also use this:
|
|
23
|
+
```ts
|
|
24
|
+
const GSSDP = require('@girs/gssdp-1.0');
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules), you can also import this module like you would do this in JavaScript:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import GSSDP from 'gi://GSSDP?version=1.0';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
package/gssdp-1.0.cjs
ADDED
package/gssdp-1.0.d.cts
ADDED
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
4
|
+
*
|
|
5
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
6
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* GSSDP-1.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type Soup from '@girs/soup-2.4';
|
|
13
|
+
import type Gio from '@girs/gio-2.0';
|
|
14
|
+
import type GObject from '@girs/gobject-2.0';
|
|
15
|
+
import type GLib from '@girs/glib-2.0';
|
|
16
|
+
|
|
17
|
+
export enum Error {
|
|
18
|
+
/**
|
|
19
|
+
* GSSDP could not find a valid IP address of a
|
|
20
|
+
* #GSSDPClient.
|
|
21
|
+
*/
|
|
22
|
+
NO_IP_ADDRESS,
|
|
23
|
+
/**
|
|
24
|
+
* Unknown error.
|
|
25
|
+
*/
|
|
26
|
+
FAILED,
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* SSDP search target for finding all possible resources.
|
|
30
|
+
*/
|
|
31
|
+
export const ALL_RESOURCES: string | null
|
|
32
|
+
export function error_quark(): GLib.Quark
|
|
33
|
+
export module Client {
|
|
34
|
+
|
|
35
|
+
// Signal callback interfaces
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// Constructor properties interface
|
|
40
|
+
|
|
41
|
+
export interface ConstructorProperties extends Gio.Initable.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
42
|
+
|
|
43
|
+
// Own constructor properties of GSSDP-1.0.GSSDP.Client
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Whether this client is active or not (passive). When active
|
|
47
|
+
* (default), the client sends messages on the network, otherwise
|
|
48
|
+
* not. In most cases, you don't want to touch this property.
|
|
49
|
+
*/
|
|
50
|
+
active?: boolean | null
|
|
51
|
+
/**
|
|
52
|
+
* The IP address of the assoicated network interface.
|
|
53
|
+
*/
|
|
54
|
+
host_ip?: string | null
|
|
55
|
+
/**
|
|
56
|
+
* The name of the network interface this client is associated with.
|
|
57
|
+
* Set to NULL to autodetect.
|
|
58
|
+
*/
|
|
59
|
+
interface?: string | null
|
|
60
|
+
/**
|
|
61
|
+
* UDP port to use for sending multicast M-SEARCH requests on the
|
|
62
|
+
* network. If not set (or set to 0) a random port will be used.
|
|
63
|
+
* This property can be only set during object construction.
|
|
64
|
+
*/
|
|
65
|
+
msearch_port?: number | null
|
|
66
|
+
/**
|
|
67
|
+
* The network this client is currently connected to. You could set this
|
|
68
|
+
* to anything you want to identify the network this client is
|
|
69
|
+
* associated with. If you are using #GUPnPContextManager and associated
|
|
70
|
+
* interface is a WiFi interface, this property is set to the ESSID of
|
|
71
|
+
* the network. Otherwise, expect this to be the network IP address by
|
|
72
|
+
* default.
|
|
73
|
+
*/
|
|
74
|
+
network?: string | null
|
|
75
|
+
/**
|
|
76
|
+
* The SSDP server's identifier.
|
|
77
|
+
*/
|
|
78
|
+
server_id?: string | null
|
|
79
|
+
/**
|
|
80
|
+
* Time-to-live value to use for all sockets created by this client.
|
|
81
|
+
* If not set (or set to 0) the value recommended by UPnP will be used.
|
|
82
|
+
* This property can only be set during object construction.
|
|
83
|
+
*/
|
|
84
|
+
socket_ttl?: number | null
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Client extends Gio.Initable {
|
|
90
|
+
|
|
91
|
+
// Own properties of GSSDP-1.0.GSSDP.Client
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Whether this client is active or not (passive). When active
|
|
95
|
+
* (default), the client sends messages on the network, otherwise
|
|
96
|
+
* not. In most cases, you don't want to touch this property.
|
|
97
|
+
*/
|
|
98
|
+
active: boolean
|
|
99
|
+
/**
|
|
100
|
+
* The IP address of the assoicated network interface.
|
|
101
|
+
*/
|
|
102
|
+
host_ip: string | null
|
|
103
|
+
/**
|
|
104
|
+
* The name of the network interface this client is associated with.
|
|
105
|
+
* Set to NULL to autodetect.
|
|
106
|
+
*/
|
|
107
|
+
readonly interface: string | null
|
|
108
|
+
/**
|
|
109
|
+
* UDP port to use for sending multicast M-SEARCH requests on the
|
|
110
|
+
* network. If not set (or set to 0) a random port will be used.
|
|
111
|
+
* This property can be only set during object construction.
|
|
112
|
+
*/
|
|
113
|
+
readonly msearch_port: number
|
|
114
|
+
/**
|
|
115
|
+
* The network this client is currently connected to. You could set this
|
|
116
|
+
* to anything you want to identify the network this client is
|
|
117
|
+
* associated with. If you are using #GUPnPContextManager and associated
|
|
118
|
+
* interface is a WiFi interface, this property is set to the ESSID of
|
|
119
|
+
* the network. Otherwise, expect this to be the network IP address by
|
|
120
|
+
* default.
|
|
121
|
+
*/
|
|
122
|
+
network: string | null
|
|
123
|
+
/**
|
|
124
|
+
* The SSDP server's identifier.
|
|
125
|
+
*/
|
|
126
|
+
server_id: string | null
|
|
127
|
+
/**
|
|
128
|
+
* Time-to-live value to use for all sockets created by this client.
|
|
129
|
+
* If not set (or set to 0) the value recommended by UPnP will be used.
|
|
130
|
+
* This property can only be set during object construction.
|
|
131
|
+
*/
|
|
132
|
+
readonly socket_ttl: number
|
|
133
|
+
|
|
134
|
+
// Own fields of GSSDP-1.0.GSSDP.Client
|
|
135
|
+
|
|
136
|
+
parent: GObject.Object
|
|
137
|
+
priv: ClientPrivate
|
|
138
|
+
|
|
139
|
+
// Owm methods of GSSDP-1.0.GSSDP.Client
|
|
140
|
+
|
|
141
|
+
add_cache_entry(ip_address: string | null, user_agent: string | null): void
|
|
142
|
+
/**
|
|
143
|
+
* Adds a header field to the message sent by this `client`. It is intended to
|
|
144
|
+
* be used by clients requiring vendor specific header fields. (If there is an
|
|
145
|
+
* existing header with name name , then this creates a second one).
|
|
146
|
+
* @param name Header name
|
|
147
|
+
* @param value Header value
|
|
148
|
+
*/
|
|
149
|
+
append_header(name: string | null, value: string | null): void
|
|
150
|
+
/**
|
|
151
|
+
* Removes all the headers for this `client`.
|
|
152
|
+
*/
|
|
153
|
+
clear_headers(): void
|
|
154
|
+
get_active(): boolean
|
|
155
|
+
/**
|
|
156
|
+
* Get the IP address we advertise ourselves as using.
|
|
157
|
+
* @returns The IP address. This string should not be freed.
|
|
158
|
+
*/
|
|
159
|
+
get_host_ip(): string | null
|
|
160
|
+
/**
|
|
161
|
+
* Get the name of the network interface associated to `client`.
|
|
162
|
+
* @returns The network interface name. This string should not be freed.
|
|
163
|
+
*/
|
|
164
|
+
get_interface(): string | null
|
|
165
|
+
get_main_context(): GLib.MainContext
|
|
166
|
+
/**
|
|
167
|
+
* Get the network this client is associated with.
|
|
168
|
+
* @returns The network identification. This string should not be freed.
|
|
169
|
+
*/
|
|
170
|
+
get_network(): string | null
|
|
171
|
+
get_server_id(): string | null
|
|
172
|
+
guess_user_agent(ip_address: string | null): string | null
|
|
173
|
+
/**
|
|
174
|
+
* Removes `name` from the list of headers . If there are multiple values for
|
|
175
|
+
* `name,` they are all removed.
|
|
176
|
+
* @param name Header name
|
|
177
|
+
*/
|
|
178
|
+
remove_header(name: string | null): void
|
|
179
|
+
/**
|
|
180
|
+
* Sets the network identification of `client` to `network`.
|
|
181
|
+
* @param network The string identifying the network
|
|
182
|
+
*/
|
|
183
|
+
set_network(network: string | null): void
|
|
184
|
+
/**
|
|
185
|
+
* Sets the server ID of `client` to `server_id`.
|
|
186
|
+
* @param server_id The server ID
|
|
187
|
+
*/
|
|
188
|
+
set_server_id(server_id: string | null): void
|
|
189
|
+
|
|
190
|
+
// Own signals of GSSDP-1.0.GSSDP.Client
|
|
191
|
+
|
|
192
|
+
connect(sigName: "message-received", callback: (...args: any[]) => void): number
|
|
193
|
+
connect_after(sigName: "message-received", callback: (...args: any[]) => void): number
|
|
194
|
+
emit(sigName: "message-received", from_ip: string | null, from_port: number, type: number, headers: Soup.MessageHeaders, ...args: any[]): void
|
|
195
|
+
|
|
196
|
+
// Class property signals of GSSDP-1.0.GSSDP.Client
|
|
197
|
+
|
|
198
|
+
connect(sigName: "notify::active", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
199
|
+
connect_after(sigName: "notify::active", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
200
|
+
emit(sigName: "notify::active", ...args: any[]): void
|
|
201
|
+
connect(sigName: "notify::host-ip", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
202
|
+
connect_after(sigName: "notify::host-ip", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
203
|
+
emit(sigName: "notify::host-ip", ...args: any[]): void
|
|
204
|
+
connect(sigName: "notify::interface", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
205
|
+
connect_after(sigName: "notify::interface", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
206
|
+
emit(sigName: "notify::interface", ...args: any[]): void
|
|
207
|
+
connect(sigName: "notify::msearch-port", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
208
|
+
connect_after(sigName: "notify::msearch-port", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
209
|
+
emit(sigName: "notify::msearch-port", ...args: any[]): void
|
|
210
|
+
connect(sigName: "notify::network", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
211
|
+
connect_after(sigName: "notify::network", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
212
|
+
emit(sigName: "notify::network", ...args: any[]): void
|
|
213
|
+
connect(sigName: "notify::server-id", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
214
|
+
connect_after(sigName: "notify::server-id", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
215
|
+
emit(sigName: "notify::server-id", ...args: any[]): void
|
|
216
|
+
connect(sigName: "notify::socket-ttl", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
217
|
+
connect_after(sigName: "notify::socket-ttl", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
|
|
218
|
+
emit(sigName: "notify::socket-ttl", ...args: any[]): void
|
|
219
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
220
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
221
|
+
emit(sigName: string, ...args: any[]): void
|
|
222
|
+
disconnect(id: number): void
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export class Client extends GObject.Object {
|
|
226
|
+
|
|
227
|
+
// Own properties of GSSDP-1.0.GSSDP.Client
|
|
228
|
+
|
|
229
|
+
static name: string
|
|
230
|
+
static $gtype: GObject.GType<Client>
|
|
231
|
+
|
|
232
|
+
// Constructors of GSSDP-1.0.GSSDP.Client
|
|
233
|
+
|
|
234
|
+
constructor(config?: Client.ConstructorProperties)
|
|
235
|
+
constructor(main_context: GLib.MainContext | null, iface: string | null)
|
|
236
|
+
static new(main_context: GLib.MainContext | null, iface: string | null): Client
|
|
237
|
+
static new_with_port(iface: string | null, msearch_port: number): Client
|
|
238
|
+
_init(config?: Client.ConstructorProperties): void
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export module ResourceBrowser {
|
|
242
|
+
|
|
243
|
+
// Signal callback interfaces
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Signal callback interface for `resource-available`
|
|
247
|
+
*/
|
|
248
|
+
export interface ResourceAvailableSignalCallback {
|
|
249
|
+
($obj: ResourceBrowser, usn: string | null, locations: string[]): void
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Signal callback interface for `resource-unavailable`
|
|
254
|
+
*/
|
|
255
|
+
export interface ResourceUnavailableSignalCallback {
|
|
256
|
+
($obj: ResourceBrowser, usn: string | null): void
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
// Constructor properties interface
|
|
261
|
+
|
|
262
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
263
|
+
|
|
264
|
+
// Own constructor properties of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Whether this browser is active or not.
|
|
268
|
+
*/
|
|
269
|
+
active?: boolean | null
|
|
270
|
+
/**
|
|
271
|
+
* The #GSSDPClient to use.
|
|
272
|
+
*/
|
|
273
|
+
client?: Client | null
|
|
274
|
+
/**
|
|
275
|
+
* The maximum number of seconds in which to request other parties
|
|
276
|
+
* to respond.
|
|
277
|
+
*/
|
|
278
|
+
mx?: number | null
|
|
279
|
+
/**
|
|
280
|
+
* The discovery target.
|
|
281
|
+
*/
|
|
282
|
+
target?: string | null
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface ResourceBrowser {
|
|
288
|
+
|
|
289
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Whether this browser is active or not.
|
|
293
|
+
*/
|
|
294
|
+
active: boolean
|
|
295
|
+
/**
|
|
296
|
+
* The #GSSDPClient to use.
|
|
297
|
+
*/
|
|
298
|
+
readonly client: Client
|
|
299
|
+
/**
|
|
300
|
+
* The maximum number of seconds in which to request other parties
|
|
301
|
+
* to respond.
|
|
302
|
+
*/
|
|
303
|
+
mx: number
|
|
304
|
+
/**
|
|
305
|
+
* The discovery target.
|
|
306
|
+
*/
|
|
307
|
+
target: string | null
|
|
308
|
+
|
|
309
|
+
// Own fields of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
310
|
+
|
|
311
|
+
parent: GObject.Object
|
|
312
|
+
priv: ResourceBrowserPrivate
|
|
313
|
+
|
|
314
|
+
// Owm methods of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
315
|
+
|
|
316
|
+
get_active(): boolean
|
|
317
|
+
get_client(): Client
|
|
318
|
+
get_mx(): number
|
|
319
|
+
get_target(): string | null
|
|
320
|
+
/**
|
|
321
|
+
* Begins discovery if `resource_browser` is active and no discovery is
|
|
322
|
+
* performed. Otherwise does nothing.
|
|
323
|
+
* @returns %TRUE if rescaning has been started.
|
|
324
|
+
*/
|
|
325
|
+
rescan(): boolean
|
|
326
|
+
/**
|
|
327
|
+
* (De)activates `resource_browser`.
|
|
328
|
+
* @param active %TRUE to activate `resource_browser`
|
|
329
|
+
*/
|
|
330
|
+
set_active(active: boolean): void
|
|
331
|
+
/**
|
|
332
|
+
* Sets the used MX value of `resource_browser` to `mx`.
|
|
333
|
+
* @param mx The to be used MX value
|
|
334
|
+
*/
|
|
335
|
+
set_mx(mx: number): void
|
|
336
|
+
/**
|
|
337
|
+
* Sets the browser target of `resource_browser` to `target`.
|
|
338
|
+
* @param target The browser target
|
|
339
|
+
*/
|
|
340
|
+
set_target(target: string | null): void
|
|
341
|
+
|
|
342
|
+
// Own virtual methods of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
343
|
+
|
|
344
|
+
vfunc_resource_unavailable(usn: string | null): void
|
|
345
|
+
|
|
346
|
+
// Own signals of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
347
|
+
|
|
348
|
+
connect(sigName: "resource-available", callback: ResourceBrowser.ResourceAvailableSignalCallback): number
|
|
349
|
+
connect_after(sigName: "resource-available", callback: ResourceBrowser.ResourceAvailableSignalCallback): number
|
|
350
|
+
emit(sigName: "resource-available", usn: string | null, locations: string[], ...args: any[]): void
|
|
351
|
+
connect(sigName: "resource-unavailable", callback: ResourceBrowser.ResourceUnavailableSignalCallback): number
|
|
352
|
+
connect_after(sigName: "resource-unavailable", callback: ResourceBrowser.ResourceUnavailableSignalCallback): number
|
|
353
|
+
emit(sigName: "resource-unavailable", usn: string | null, ...args: any[]): void
|
|
354
|
+
|
|
355
|
+
// Class property signals of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
356
|
+
|
|
357
|
+
connect(sigName: "notify::active", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
358
|
+
connect_after(sigName: "notify::active", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
359
|
+
emit(sigName: "notify::active", ...args: any[]): void
|
|
360
|
+
connect(sigName: "notify::client", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
361
|
+
connect_after(sigName: "notify::client", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
362
|
+
emit(sigName: "notify::client", ...args: any[]): void
|
|
363
|
+
connect(sigName: "notify::mx", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
364
|
+
connect_after(sigName: "notify::mx", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
365
|
+
emit(sigName: "notify::mx", ...args: any[]): void
|
|
366
|
+
connect(sigName: "notify::target", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
367
|
+
connect_after(sigName: "notify::target", callback: (($obj: ResourceBrowser, pspec: GObject.ParamSpec) => void)): number
|
|
368
|
+
emit(sigName: "notify::target", ...args: any[]): void
|
|
369
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
370
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
371
|
+
emit(sigName: string, ...args: any[]): void
|
|
372
|
+
disconnect(id: number): void
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export class ResourceBrowser extends GObject.Object {
|
|
376
|
+
|
|
377
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
378
|
+
|
|
379
|
+
static name: string
|
|
380
|
+
static $gtype: GObject.GType<ResourceBrowser>
|
|
381
|
+
|
|
382
|
+
// Constructors of GSSDP-1.0.GSSDP.ResourceBrowser
|
|
383
|
+
|
|
384
|
+
constructor(config?: ResourceBrowser.ConstructorProperties)
|
|
385
|
+
/**
|
|
386
|
+
* `target` is a generic string the resource browser listens for on the SSDP
|
|
387
|
+
* bus. There are several possible targets such as
|
|
388
|
+
* <itemizedlist>
|
|
389
|
+
* <listitem><para>"ssdp:all" for everything</para></listitem>
|
|
390
|
+
* <listitem><para>
|
|
391
|
+
* "upnp:rootdevice" for UPnP device entry points, not caring about the
|
|
392
|
+
* device type</para></listitem>
|
|
393
|
+
* <listitem><para>The UUID of a specific device</para></listitem>
|
|
394
|
+
* <listitem><para>Device types such as
|
|
395
|
+
* "urn:schemas-upnp-org:device:MediaServer:1"</para></listitem>
|
|
396
|
+
* <listitem><para>Service types such as
|
|
397
|
+
* "urn:schemas-upnp-org:service:ContentDirectory:1"</para></listitem>
|
|
398
|
+
* </itemizedlist>
|
|
399
|
+
* @constructor
|
|
400
|
+
* @param client The #GSSDPClient to associate with
|
|
401
|
+
* @param target A SSDP search target
|
|
402
|
+
* @returns A new #GSSDPResourceBrowser object.
|
|
403
|
+
*/
|
|
404
|
+
constructor(client: Client, target: string | null)
|
|
405
|
+
/**
|
|
406
|
+
* `target` is a generic string the resource browser listens for on the SSDP
|
|
407
|
+
* bus. There are several possible targets such as
|
|
408
|
+
* <itemizedlist>
|
|
409
|
+
* <listitem><para>"ssdp:all" for everything</para></listitem>
|
|
410
|
+
* <listitem><para>
|
|
411
|
+
* "upnp:rootdevice" for UPnP device entry points, not caring about the
|
|
412
|
+
* device type</para></listitem>
|
|
413
|
+
* <listitem><para>The UUID of a specific device</para></listitem>
|
|
414
|
+
* <listitem><para>Device types such as
|
|
415
|
+
* "urn:schemas-upnp-org:device:MediaServer:1"</para></listitem>
|
|
416
|
+
* <listitem><para>Service types such as
|
|
417
|
+
* "urn:schemas-upnp-org:service:ContentDirectory:1"</para></listitem>
|
|
418
|
+
* </itemizedlist>
|
|
419
|
+
* @constructor
|
|
420
|
+
* @param client The #GSSDPClient to associate with
|
|
421
|
+
* @param target A SSDP search target
|
|
422
|
+
* @returns A new #GSSDPResourceBrowser object.
|
|
423
|
+
*/
|
|
424
|
+
static new(client: Client, target: string | null): ResourceBrowser
|
|
425
|
+
_init(config?: ResourceBrowser.ConstructorProperties): void
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export module ResourceGroup {
|
|
429
|
+
|
|
430
|
+
// Constructor properties interface
|
|
431
|
+
|
|
432
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
433
|
+
|
|
434
|
+
// Own constructor properties of GSSDP-1.0.GSSDP.ResourceGroup
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Whether this group of resources is available or not.
|
|
438
|
+
*/
|
|
439
|
+
available?: boolean | null
|
|
440
|
+
/**
|
|
441
|
+
* The #GSSDPClient to use.
|
|
442
|
+
*/
|
|
443
|
+
client?: Client | null
|
|
444
|
+
/**
|
|
445
|
+
* The number of seconds our advertisements are valid.
|
|
446
|
+
*/
|
|
447
|
+
max_age?: number | null
|
|
448
|
+
/**
|
|
449
|
+
* The minimum number of milliseconds between SSDP messages.
|
|
450
|
+
* The default is 120 based on DLNA specification.
|
|
451
|
+
*/
|
|
452
|
+
message_delay?: number | null
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface ResourceGroup {
|
|
458
|
+
|
|
459
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceGroup
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Whether this group of resources is available or not.
|
|
463
|
+
*/
|
|
464
|
+
available: boolean
|
|
465
|
+
/**
|
|
466
|
+
* The #GSSDPClient to use.
|
|
467
|
+
*/
|
|
468
|
+
readonly client: Client
|
|
469
|
+
/**
|
|
470
|
+
* The number of seconds our advertisements are valid.
|
|
471
|
+
*/
|
|
472
|
+
max_age: number
|
|
473
|
+
/**
|
|
474
|
+
* The minimum number of milliseconds between SSDP messages.
|
|
475
|
+
* The default is 120 based on DLNA specification.
|
|
476
|
+
*/
|
|
477
|
+
message_delay: number
|
|
478
|
+
|
|
479
|
+
// Own fields of GSSDP-1.0.GSSDP.ResourceGroup
|
|
480
|
+
|
|
481
|
+
parent: GObject.Object
|
|
482
|
+
priv: ResourceGroupPrivate
|
|
483
|
+
|
|
484
|
+
// Owm methods of GSSDP-1.0.GSSDP.ResourceGroup
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Adds a resource with target `target,` USN `usn,` and locations `locations`
|
|
488
|
+
* to `resource_group`.
|
|
489
|
+
* @param target The resource's target
|
|
490
|
+
* @param usn The resource's USN
|
|
491
|
+
* @param locations A #GList of the resource's locations
|
|
492
|
+
* @returns The ID of the added resource.
|
|
493
|
+
*/
|
|
494
|
+
add_resource(target: string | null, usn: string | null, locations: string[]): number
|
|
495
|
+
/**
|
|
496
|
+
* Adds a resource with target `target,` USN `usn,` and location `location`
|
|
497
|
+
* to `resource_group`.
|
|
498
|
+
* @param target The resource's target
|
|
499
|
+
* @param usn The resource's USN
|
|
500
|
+
* @param location The resource's location
|
|
501
|
+
* @returns The ID of the added resource.
|
|
502
|
+
*/
|
|
503
|
+
add_resource_simple(target: string | null, usn: string | null, location: string | null): number
|
|
504
|
+
get_available(): boolean
|
|
505
|
+
get_client(): Client
|
|
506
|
+
get_max_age(): number
|
|
507
|
+
get_message_delay(): number
|
|
508
|
+
/**
|
|
509
|
+
* Removes the resource with ID `resource_id` from `resource_group`.
|
|
510
|
+
* @param resource_id The ID of the resource to remove
|
|
511
|
+
*/
|
|
512
|
+
remove_resource(resource_id: number): void
|
|
513
|
+
/**
|
|
514
|
+
* Sets `resource_group<`!-- -->s availability to `available`. Changing
|
|
515
|
+
* `resource_group<`!-- -->s availability causes it to announce its new state
|
|
516
|
+
* to listening SSDP clients.
|
|
517
|
+
* @param available %TRUE if `resource_group` should be available (advertised)
|
|
518
|
+
*/
|
|
519
|
+
set_available(available: boolean): void
|
|
520
|
+
/**
|
|
521
|
+
* Sets the number of seconds advertisements are valid to `max_age`.
|
|
522
|
+
* @param max_age The number of seconds advertisements are valid
|
|
523
|
+
*/
|
|
524
|
+
set_max_age(max_age: number): void
|
|
525
|
+
/**
|
|
526
|
+
* Sets the minimum time between each SSDP message.
|
|
527
|
+
* @param message_delay The message delay in ms.
|
|
528
|
+
*/
|
|
529
|
+
set_message_delay(message_delay: number): void
|
|
530
|
+
|
|
531
|
+
// Class property signals of GSSDP-1.0.GSSDP.ResourceGroup
|
|
532
|
+
|
|
533
|
+
connect(sigName: "notify::available", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
534
|
+
connect_after(sigName: "notify::available", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
535
|
+
emit(sigName: "notify::available", ...args: any[]): void
|
|
536
|
+
connect(sigName: "notify::client", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
537
|
+
connect_after(sigName: "notify::client", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
538
|
+
emit(sigName: "notify::client", ...args: any[]): void
|
|
539
|
+
connect(sigName: "notify::max-age", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
540
|
+
connect_after(sigName: "notify::max-age", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
541
|
+
emit(sigName: "notify::max-age", ...args: any[]): void
|
|
542
|
+
connect(sigName: "notify::message-delay", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
543
|
+
connect_after(sigName: "notify::message-delay", callback: (($obj: ResourceGroup, pspec: GObject.ParamSpec) => void)): number
|
|
544
|
+
emit(sigName: "notify::message-delay", ...args: any[]): void
|
|
545
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
546
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
547
|
+
emit(sigName: string, ...args: any[]): void
|
|
548
|
+
disconnect(id: number): void
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export class ResourceGroup extends GObject.Object {
|
|
552
|
+
|
|
553
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceGroup
|
|
554
|
+
|
|
555
|
+
static name: string
|
|
556
|
+
static $gtype: GObject.GType<ResourceGroup>
|
|
557
|
+
|
|
558
|
+
// Constructors of GSSDP-1.0.GSSDP.ResourceGroup
|
|
559
|
+
|
|
560
|
+
constructor(config?: ResourceGroup.ConstructorProperties)
|
|
561
|
+
constructor(client: Client)
|
|
562
|
+
static new(client: Client): ResourceGroup
|
|
563
|
+
_init(config?: ResourceGroup.ConstructorProperties): void
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export interface ClientClass {
|
|
567
|
+
|
|
568
|
+
// Own fields of GSSDP-1.0.GSSDP.ClientClass
|
|
569
|
+
|
|
570
|
+
parent_class: GObject.ObjectClass
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export abstract class ClientClass {
|
|
574
|
+
|
|
575
|
+
// Own properties of GSSDP-1.0.GSSDP.ClientClass
|
|
576
|
+
|
|
577
|
+
static name: string
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export interface ClientPrivate {
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export class ClientPrivate {
|
|
584
|
+
|
|
585
|
+
// Own properties of GSSDP-1.0.GSSDP.ClientPrivate
|
|
586
|
+
|
|
587
|
+
static name: string
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export interface ResourceBrowserClass {
|
|
591
|
+
|
|
592
|
+
// Own fields of GSSDP-1.0.GSSDP.ResourceBrowserClass
|
|
593
|
+
|
|
594
|
+
parent_class: GObject.ObjectClass
|
|
595
|
+
resource_unavailable: (resource_browser: ResourceBrowser, usn: string | null) => void
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export abstract class ResourceBrowserClass {
|
|
599
|
+
|
|
600
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceBrowserClass
|
|
601
|
+
|
|
602
|
+
static name: string
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export interface ResourceBrowserPrivate {
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
export class ResourceBrowserPrivate {
|
|
609
|
+
|
|
610
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceBrowserPrivate
|
|
611
|
+
|
|
612
|
+
static name: string
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface ResourceGroupClass {
|
|
616
|
+
|
|
617
|
+
// Own fields of GSSDP-1.0.GSSDP.ResourceGroupClass
|
|
618
|
+
|
|
619
|
+
parent_class: GObject.ObjectClass
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
export abstract class ResourceGroupClass {
|
|
623
|
+
|
|
624
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceGroupClass
|
|
625
|
+
|
|
626
|
+
static name: string
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export interface ResourceGroupPrivate {
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export class ResourceGroupPrivate {
|
|
633
|
+
|
|
634
|
+
// Own properties of GSSDP-1.0.GSSDP.ResourceGroupPrivate
|
|
635
|
+
|
|
636
|
+
static name: string
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Name of the imported GIR library
|
|
641
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
642
|
+
*/
|
|
643
|
+
export const __name__: string
|
|
644
|
+
/**
|
|
645
|
+
* Version of the imported GIR library
|
|
646
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
647
|
+
*/
|
|
648
|
+
export const __version__: string
|
|
649
|
+
// END
|