@girs/grl-0.2 0.2.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/grl-0.2.d.ts ADDED
@@ -0,0 +1,4466 @@
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
+ * Grl-0.2
10
+ */
11
+
12
+ import type Gio from '@girs/gio-2.0';
13
+ import type GObject from '@girs/gobject-2.0';
14
+ import type GLib from '@girs/glib-2.0';
15
+ import type GModule from '@girs/gmodule-2.0';
16
+
17
+ export namespace Grl {
18
+
19
+ /**
20
+ * These constants identify all the available core errors
21
+ */
22
+ enum CoreError {
23
+ /**
24
+ * The browse operation failed
25
+ */
26
+ BROWSE_FAILED,
27
+ /**
28
+ * The search operation failed
29
+ */
30
+ SEARCH_FAILED,
31
+ /**
32
+ * Searching NULL-text is not supported
33
+ */
34
+ SEARCH_NULL_UNSUPPORTED,
35
+ /**
36
+ * The query operation failed
37
+ */
38
+ QUERY_FAILED,
39
+ /**
40
+ * The resolution operation failed
41
+ */
42
+ RESOLVE_FAILED,
43
+ /**
44
+ * The media was not found
45
+ */
46
+ MEDIA_NOT_FOUND,
47
+ /**
48
+ * The store operation failed
49
+ */
50
+ STORE_FAILED,
51
+ /**
52
+ * The store metadata operation failed
53
+ */
54
+ STORE_METADATA_FAILED,
55
+ /**
56
+ * The removal operation failed
57
+ */
58
+ REMOVE_FAILED,
59
+ /**
60
+ * The media from_uri operation failed
61
+ */
62
+ MEDIA_FROM_URI_FAILED,
63
+ /**
64
+ * Failed to load plugin configuration from a file
65
+ */
66
+ CONFIG_LOAD_FAILED,
67
+ /**
68
+ * Failed to set configuration for plugin
69
+ */
70
+ CONFIG_FAILED,
71
+ /**
72
+ * Failed to unregister source
73
+ */
74
+ UNREGISTER_SOURCE_FAILED,
75
+ /**
76
+ * Failed to load plugin
77
+ */
78
+ LOAD_PLUGIN_FAILED,
79
+ /**
80
+ * Failed to unload plugin
81
+ */
82
+ UNLOAD_PLUGIN_FAILED,
83
+ /**
84
+ * Failed to register metadata key
85
+ */
86
+ REGISTER_METADATA_KEY_FAILED,
87
+ /**
88
+ * Failed to start changed notifications
89
+ */
90
+ NOTIFY_CHANGED_FAILED,
91
+ /**
92
+ * The operation was cancelled
93
+ */
94
+ OPERATION_CANCELLED,
95
+ /**
96
+ * Invalid authentication token
97
+ */
98
+ AUTHENTICATION_TOKEN,
99
+ }
100
+ /**
101
+ * Grilo log levels. Defines the level of verbosity selected in Grilo.
102
+ */
103
+ enum LogLevel {
104
+ /**
105
+ * Log level none
106
+ */
107
+ NONE,
108
+ /**
109
+ * Log on error
110
+ */
111
+ ERROR,
112
+ /**
113
+ * Log on warning
114
+ */
115
+ WARNING,
116
+ /**
117
+ * Log on message
118
+ */
119
+ MESSAGE,
120
+ /**
121
+ * Log on info
122
+ */
123
+ INFO,
124
+ /**
125
+ * Log on debug
126
+ */
127
+ DEBUG,
128
+ /**
129
+ * Last level of log
130
+ */
131
+ LAST,
132
+ }
133
+ /**
134
+ * GrlMedia serialize type
135
+ */
136
+ enum MediaSerializeType {
137
+ /**
138
+ * Basic mode
139
+ */
140
+ BASIC,
141
+ /**
142
+ * Partial mode
143
+ */
144
+ PARTIAL,
145
+ /**
146
+ * Full mode
147
+ */
148
+ FULL,
149
+ }
150
+ /**
151
+ * Source priority ranks. Defines the order in which the resolver
152
+ * (or similar rank-picking mechanisms) will choose this source
153
+ * over an alternative one with the same function.
154
+ *
155
+ * These constants serve as a rough guidance for defining the rank
156
+ * of a GrlSource. Any value is valid, including values bigger
157
+ * than GRL_RANK_HIGHEST.
158
+ */
159
+ enum Rank {
160
+ /**
161
+ * will be chosen last or not at all
162
+ */
163
+ LOWEST,
164
+ /**
165
+ * unlikely to be chosen
166
+ */
167
+ LOW,
168
+ /**
169
+ * likely to be chosen
170
+ */
171
+ DEFAULT,
172
+ /**
173
+ * will be chosen
174
+ */
175
+ HIGH,
176
+ /**
177
+ * will be chosen first
178
+ */
179
+ HIGHEST,
180
+ }
181
+ /**
182
+ * Specifies which kind of change has happened in the plugin
183
+ */
184
+ enum SourceChangeType {
185
+ /**
186
+ * content has changed. It is used when any property of
187
+ * #GrlMedia has changed, or in case of #GrlMediaBox, if several children have
188
+ * been added and removed.
189
+ */
190
+ CHANGED,
191
+ /**
192
+ * new content has been added.
193
+ */
194
+ ADDED,
195
+ /**
196
+ * content has been removed
197
+ */
198
+ REMOVED,
199
+ }
200
+ enum MediaType {
201
+ /**
202
+ * no media
203
+ */
204
+ NONE,
205
+ /**
206
+ * audio media
207
+ */
208
+ AUDIO,
209
+ /**
210
+ * video media
211
+ */
212
+ VIDEO,
213
+ /**
214
+ * image media
215
+ */
216
+ IMAGE,
217
+ /**
218
+ * any media
219
+ */
220
+ ALL,
221
+ }
222
+ /**
223
+ * Resolution flags
224
+ * @bitfield
225
+ */
226
+ enum ResolutionFlags {
227
+ /**
228
+ * Normal mode.
229
+ */
230
+ NORMAL,
231
+ /**
232
+ * Try other plugins if necessary.
233
+ */
234
+ FULL,
235
+ /**
236
+ * Use idle loop to relay results.
237
+ */
238
+ IDLE_RELAY,
239
+ /**
240
+ * Only resolve fast metadata keys.
241
+ */
242
+ FAST_ONLY,
243
+ }
244
+ /**
245
+ * Bitwise flags which reflect the kind of operations that a
246
+ * #GrlSource supports.
247
+ * @bitfield
248
+ */
249
+ enum SupportedOps {
250
+ /**
251
+ * no operation is supported
252
+ */
253
+ NONE,
254
+ /**
255
+ * Fetch specific keys of metadata based on other metadata.
256
+ */
257
+ RESOLVE,
258
+ /**
259
+ * Retrieve complete sets of #GrlMedia
260
+ */
261
+ BROWSE,
262
+ /**
263
+ * Look up for #GrlMedia given a search text
264
+ */
265
+ SEARCH,
266
+ /**
267
+ * Look up for #GrlMedia give a service specific query
268
+ */
269
+ QUERY,
270
+ /**
271
+ * Store content in a service
272
+ */
273
+ STORE,
274
+ /**
275
+ * Store content as child of a certian parent category.
276
+ */
277
+ STORE_PARENT,
278
+ /**
279
+ * Update metadata of a #GrlMedia in a service.
280
+ */
281
+ STORE_METADATA,
282
+ /**
283
+ * Remove content from a service.
284
+ */
285
+ REMOVE,
286
+ /**
287
+ * Create a #GrlMedia instance from an URI
288
+ * representing a media resource.
289
+ */
290
+ MEDIA_FROM_URI,
291
+ /**
292
+ * Notify about changes in the #GrlSource.
293
+ */
294
+ NOTIFY_CHANGE,
295
+ }
296
+ /**
297
+ * Type of media to allow.
298
+ * @bitfield
299
+ */
300
+ enum TypeFilter {
301
+ /**
302
+ * allow no content (only #GrlMediaBox)
303
+ */
304
+ NONE,
305
+ /**
306
+ * allow audio content
307
+ */
308
+ AUDIO,
309
+ /**
310
+ * allow video content
311
+ */
312
+ VIDEO,
313
+ /**
314
+ * allow image content
315
+ */
316
+ IMAGE,
317
+ /**
318
+ * allow any type of content
319
+ */
320
+ ALL,
321
+ }
322
+ /**
323
+ * Flags for writing operations.
324
+ * @bitfield
325
+ */
326
+ enum WriteFlags {
327
+ /**
328
+ * Normal mode.
329
+ */
330
+ NORMAL,
331
+ /**
332
+ * Try other plugins if necessary.
333
+ */
334
+ FULL,
335
+ }
336
+ const CONFIG_KEY_APIKEY: string | null
337
+ const CONFIG_KEY_APIKEY_BLOB: string | null
338
+ const CONFIG_KEY_APISECRET: string | null
339
+ const CONFIG_KEY_APITOKEN: string | null
340
+ const CONFIG_KEY_APITOKEN_SECRET: string | null
341
+ const CONFIG_KEY_PASSWORD: string | null
342
+ const CONFIG_KEY_PLUGIN: string | null
343
+ const CONFIG_KEY_SOURCE: string | null
344
+ const CONFIG_KEY_USERNAME: string | null
345
+ const COUNT_INFINITY: number
346
+ const KEYID_FORMAT: string | null
347
+ const METADATA_KEY_ALBUM: number
348
+ const METADATA_KEY_ARTIST: number
349
+ const METADATA_KEY_AUDIO_TRACK: number
350
+ const METADATA_KEY_AUTHOR: number
351
+ const METADATA_KEY_BITRATE: number
352
+ const METADATA_KEY_CAMERA_MODEL: number
353
+ const METADATA_KEY_CERTIFICATE: number
354
+ const METADATA_KEY_CHILDCOUNT: number
355
+ const METADATA_KEY_CHILDCOUNT_UNKNOWN: number
356
+ const METADATA_KEY_CREATION_DATE: number
357
+ const METADATA_KEY_DESCRIPTION: number
358
+ const METADATA_KEY_DIRECTOR: number
359
+ const METADATA_KEY_DURATION: number
360
+ const METADATA_KEY_EPISODE: number
361
+ const METADATA_KEY_EPISODE_TITLE: number
362
+ const METADATA_KEY_EXPOSURE_TIME: number
363
+ const METADATA_KEY_EXTERNAL_PLAYER: number
364
+ const METADATA_KEY_EXTERNAL_URL: number
365
+ const METADATA_KEY_FAVOURITE: number
366
+ const METADATA_KEY_FLASH_USED: number
367
+ const METADATA_KEY_FRAMERATE: number
368
+ const METADATA_KEY_GENRE: number
369
+ const METADATA_KEY_HEIGHT: number
370
+ const METADATA_KEY_ID: number
371
+ const METADATA_KEY_INVALID: number
372
+ const METADATA_KEY_ISO_SPEED: number
373
+ const METADATA_KEY_KEYWORD: number
374
+ const METADATA_KEY_LAST_PLAYED: number
375
+ const METADATA_KEY_LAST_POSITION: number
376
+ const METADATA_KEY_LICENSE: number
377
+ const METADATA_KEY_LYRICS: number
378
+ const METADATA_KEY_MB_ALBUM_ID: number
379
+ const METADATA_KEY_MB_ARTIST_ID: number
380
+ const METADATA_KEY_MB_RECORDING_ID: number
381
+ const METADATA_KEY_MB_TRACK_ID: number
382
+ const METADATA_KEY_MIME: number
383
+ const METADATA_KEY_MODIFICATION_DATE: number
384
+ const METADATA_KEY_ORIENTATION: number
385
+ const METADATA_KEY_ORIGINAL_TITLE: number
386
+ const METADATA_KEY_PERFORMER: number
387
+ const METADATA_KEY_PLAY_COUNT: number
388
+ const METADATA_KEY_PRODUCER: number
389
+ const METADATA_KEY_PUBLICATION_DATE: number
390
+ const METADATA_KEY_RATING: number
391
+ const METADATA_KEY_REGION: number
392
+ const METADATA_KEY_SEASON: number
393
+ const METADATA_KEY_SHOW: number
394
+ const METADATA_KEY_SITE: number
395
+ const METADATA_KEY_SIZE: number
396
+ const METADATA_KEY_SOURCE: number
397
+ const METADATA_KEY_START_TIME: number
398
+ const METADATA_KEY_STUDIO: number
399
+ const METADATA_KEY_THUMBNAIL: number
400
+ const METADATA_KEY_THUMBNAIL_BINARY: number
401
+ const METADATA_KEY_TITLE: number
402
+ const METADATA_KEY_TITLE_FROM_FILENAME: number
403
+ const METADATA_KEY_TRACK_NUMBER: number
404
+ const METADATA_KEY_URL: number
405
+ const METADATA_KEY_WIDTH: number
406
+ const OPERATION_OPTION_COUNT: string | null
407
+ const OPERATION_OPTION_KEY_EQUAL_FILTER: string | null
408
+ const OPERATION_OPTION_KEY_RANGE_FILTER: string | null
409
+ const OPERATION_OPTION_RESOLUTION_FLAGS: string | null
410
+ const OPERATION_OPTION_SKIP: string | null
411
+ const OPERATION_OPTION_TYPE_FILTER: string | null
412
+ const PADDING: number
413
+ const PADDING_SMALL: number
414
+ const PLUGIN_AUTHOR: string | null
415
+ const PLUGIN_DESCRIPTION: string | null
416
+ const PLUGIN_LICENSE: string | null
417
+ const PLUGIN_LIST_VAR: string | null
418
+ const PLUGIN_NAME: string | null
419
+ const PLUGIN_PATH_VAR: string | null
420
+ const PLUGIN_RANKS_VAR: string | null
421
+ const PLUGIN_SITE: string | null
422
+ const PLUGIN_VERSION: string | null
423
+ const SOURCE_REMAINING_UNKNOWN: number
424
+ function date_time_from_iso8601(date: string | null): GLib.DateTime
425
+ /**
426
+ * Deinitializes the Grilo library.
427
+ *
428
+ * Call this function after finalizing using Grilo, in order to free and clean
429
+ * up all the resources created.
430
+ */
431
+ function deinit(): void
432
+ function g_value_dup(value: any): any
433
+ function g_value_free(value: any): void
434
+ function g_value_hashtable_new(): GLib.HashTable
435
+ function g_value_hashtable_new_direct(): GLib.HashTable
436
+ function g_value_new(g_type: GObject.GType): any
437
+ /**
438
+ * Initializes the Grilo library
439
+ * @param argv list of arguments
440
+ */
441
+ function init(argv: string[] | null): /* argv */ string[] | null
442
+ /**
443
+ * Returns a #GOptionGroup with Grilo's argument specifications.
444
+ *
445
+ * This function is useful if you want to integrate Grilo with other
446
+ * libraries that use the GOption commandline parser
447
+ * (see g_option_context_add_group() ).
448
+ * @returns a pointer to Grilo's option group. Should be dereferenced after use.
449
+ */
450
+ function init_get_option_group(): GLib.OptionGroup
451
+ /**
452
+ * Configure a set of log domains. The default configuration is to display
453
+ * warning and error messages only for all the log domains.
454
+ *
455
+ * The configuration string follows the following grammar:
456
+ *
457
+ *
458
+ * ```
459
+ * config-list: config | config ',' config-list
460
+ * config: domain ':' level
461
+ * domain: '*' | [a-zA-Z0-9]+
462
+ * level: '*' | '-' | named-level | num-level
463
+ * named-level: "none" | "error" | "warning" | "message" | "info" | "debug"
464
+ * num-level: [0-5]
465
+ * ```
466
+ *
467
+ *
468
+ * examples:
469
+ * <itemizedlist>
470
+ * <listitem><para>"*:*": maximum verbosity for all the log domains</para>
471
+ * </listitem>
472
+ * <listitem><para>"*:-": don't print any message</para></listitem>
473
+ * <listitem><para>"media-source:debug,metadata-source:debug": prints debug,
474
+ * info, message warning and error messages for the media-source and
475
+ * metadata-source log domains</para></listitem>
476
+ * </itemizedlist>
477
+ *
478
+ * <note>It's possible to override the log configuration at runtime by
479
+ * defining the GRL_DEBUG environment variable to a configuration string
480
+ * as described above</note>
481
+ * @param config A string describing the wanted log configuration
482
+ */
483
+ function log_configure(config: string | null): void
484
+ function marshal_VOID__BOXED_ENUM_BOOLEAN(closure: GObject.TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null): void
485
+ /**
486
+ * Retrieves the description associated with the key
487
+ * @param key key to look up
488
+ * @returns the description of the key
489
+ */
490
+ function metadata_key_get_desc(key: KeyID): string | null
491
+ /**
492
+ * Retrieves the name associated with the key
493
+ * @param key key to look up
494
+ * @returns The name of the key
495
+ */
496
+ function metadata_key_get_name(key: KeyID): string | null
497
+ /**
498
+ * Retrieves the expected type for values associated with this key
499
+ * @param key key to look up
500
+ * @returns the expected value type
501
+ */
502
+ function metadata_key_get_type(key: KeyID): GObject.GType
503
+ function metadata_key_setup_system_keys(registry: Registry): void
504
+ /**
505
+ * Goes though all available media sources until it finds one capable of
506
+ * constructing a GrlMedia object representing the media resource exposed
507
+ * by `uri`.
508
+ *
509
+ * This method is asynchronous.
510
+ * @param uri A URI that can be used to identify a media resource
511
+ * @param keys List of metadata keys we want to obtain.
512
+ * @param options options wanted for that operation
513
+ * @param callback the user defined callback
514
+ */
515
+ function multiple_get_media_from_uri(uri: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResolveCb): void
516
+ /**
517
+ * Search for `text` in all the sources specified in `sources`.
518
+ *
519
+ * If `text` is `NULL` then NULL-text searchs will be used for each searchable
520
+ * plugin (see #grl_source_search for more details).
521
+ *
522
+ * This method is asynchronous.
523
+ * @param sources a #GList of #GrlSource<!-- -->s to search from (%NULL for all searchable sources)
524
+ * @param text the text to search for
525
+ * @param keys the #GList of #GrlKeyID to retrieve
526
+ * @param options options wanted for that operation
527
+ * @param callback the user defined callback
528
+ * @returns the operation identifier
529
+ */
530
+ function multiple_search(sources: Source[] | null, text: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
531
+ /**
532
+ * Search for `text` in all the sources specified in `sources`.
533
+ *
534
+ * This method is synchronous.
535
+ * @param sources a #GList of #GrlSource<!-- -->s where to search from (%NULL for all available sources with search capability)
536
+ * @param text the text to search for
537
+ * @param keys the #GList of #GrlKeyID to retrieve
538
+ * @param options options wanted for that operation
539
+ * @returns a list with #GrlMedia elements
540
+ */
541
+ function multiple_search_sync(sources: Source[] | null, text: string | null, keys: KeyID[], options: OperationOptions): Media[]
542
+ /**
543
+ * Cancel an operation.
544
+ * @param operation_id the identifier of a running operation
545
+ */
546
+ function operation_cancel(operation_id: number): void
547
+ function operation_generate_id(): number
548
+ /**
549
+ * Obtains the previously attached data
550
+ * @param operation_id the identifier of a running operation
551
+ * @returns The previously attached data.
552
+ */
553
+ function operation_get_data(operation_id: number): any | null
554
+ function operation_init(): void
555
+ function operation_remove(operation_id: number): void
556
+ /**
557
+ * Attach a pointer to the specific operation.
558
+ * @param operation_id the identifier of a running operation
559
+ * @param user_data the data to attach
560
+ */
561
+ function operation_set_data(operation_id: number, user_data: any | null): void
562
+ /**
563
+ * Attach a pointer to the specific operation.
564
+ *
565
+ * Note that the `destroy_func` callback is not called if `user_data` is %NULL.
566
+ * @param operation_id the identifier of a running operation
567
+ * @param user_data the data to attach
568
+ * @param destroy_func function to release `user_data` when the operation terminates
569
+ */
570
+ function operation_set_data_full(operation_id: number, user_data: any | null, destroy_func: GLib.DestroyNotify | null): void
571
+ function operation_set_private_data(operation_id: number, private_data: any | null, cancel_cb: OperationCancelCb): void
572
+ /**
573
+ * Grilo browsing implements a paging mechanism through `skip` and `count` values.
574
+ *
575
+ * But there are some services (like Jamendo or Flickr) where paging is done
576
+ * through a page number and page size: user request all elements in a page,
577
+ * specifying in most cases what is the page size.
578
+ *
579
+ * This function is a helper for this task, computing from `skip` and `count` what
580
+ * is the optimal value of page size (limited by `max_page_size)`, which page
581
+ * should the user request, and where requested data start inside the page.
582
+ *
583
+ * By optimal we mean that it computes those values so only one page is required
584
+ * to satisfy the data, using the smallest page size. If user is limiting page
585
+ * size, then more requests to services might be needed. But still page size
586
+ * will be an optimal value.
587
+ *
588
+ * If `page_size` is `NULL,` then page size will be `max_page_size`. If the later
589
+ * is also 0, then page size will be #G_MAXUINT.
590
+ * @param skip number of elements to skip
591
+ * @param count number of elements to retrieve
592
+ * @param max_page_size maximum value for page size (0 for unlimited size)
593
+ * @param page_size optimal page size
594
+ * @param page_number page which contain the first element to retrieve (starting at 1)
595
+ * @param internal_offset in the `page_number,` offset where first element can be found (starting at 0)
596
+ */
597
+ function paging_translate(skip: number, count: number, max_page_size: number, page_size: number, page_number: number, internal_offset: number): void
598
+ function range_value_hashtable_insert(hash_table: GLib.HashTable, key: any | null, min: any, max: any): void
599
+ function range_value_hashtable_new(): GLib.HashTable
600
+ interface OperationCancelCb {
601
+ (data: any | null): void
602
+ }
603
+ /**
604
+ * Prototype for the callback passed to grl_source_remove()
605
+ * @callback
606
+ * @param source a source
607
+ * @param media a data transfer object
608
+ * @param error possible #GError generated at processing
609
+ */
610
+ interface SourceRemoveCb {
611
+ (source: Source, media: Media, error: GLib.Error | null): void
612
+ }
613
+ /**
614
+ * Prototype for the callback passed to grl_source_resolve(). If the URI did
615
+ * not resolve to a valid media record, `media` will be %NULL. If there was an
616
+ * error during resolution, `error` will be set.
617
+ *
618
+ * If `media` is non-%NULL, ownership of it is transferred to the callback, and
619
+ * it must be freed afterwards using g_object_unref().
620
+ * @callback
621
+ * @param source a source
622
+ * @param operation_id operation identifier
623
+ * @param media a data transfer object
624
+ * @param error possible #GError generated at processing
625
+ */
626
+ interface SourceResolveCb {
627
+ (source: Source, operation_id: number, media: Media, error: GLib.Error | null): void
628
+ }
629
+ /**
630
+ * Prototype for the callback passed to the media sources' methods
631
+ * @callback
632
+ * @param source a source
633
+ * @param operation_id operation identifier
634
+ * @param media a data transfer object
635
+ * @param remaining the number of remaining #GrlMedia to process, or GRL_SOURCE_REMAINING_UNKNOWN if it is unknown
636
+ * @param error possible #GError generated at processing
637
+ */
638
+ interface SourceResultCb {
639
+ (source: Source, operation_id: number, media: Media | null, remaining: number, error: GLib.Error | null): void
640
+ }
641
+ /**
642
+ * Prototype for the callback passed to grl_source_store_foo functions
643
+ * @callback
644
+ * @param source a source
645
+ * @param media a #GrlMedia transfer object
646
+ * @param failed_keys #GList of keys that could not be updated, if any
647
+ * @param error possible #GError generated
648
+ */
649
+ interface SourceStoreCb {
650
+ (source: Source, media: Media, failed_keys: KeyID[], error: GLib.Error | null): void
651
+ }
652
+ module Caps {
653
+
654
+ // Constructor properties interface
655
+
656
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
657
+ }
658
+
659
+ }
660
+
661
+ interface Caps {
662
+
663
+ // Own fields of Grl-0.2.Grl.Caps
664
+
665
+ parent: GObject.Object
666
+
667
+ // Owm methods of Grl-0.2.Grl.Caps
668
+
669
+ get_key_filter(): KeyID[]
670
+ get_key_range_filter(): KeyID[]
671
+ get_type_filter(): TypeFilter
672
+ /**
673
+ * Checks if `key` is supported for filtering in `caps`.
674
+ * @param key a #GrlKeyID
675
+ * @returns %TRUE if @key can be used for filtering
676
+ */
677
+ is_key_filter(key: KeyID): boolean
678
+ /**
679
+ * Checks if `key` is supported for filtering by range in `caps`.
680
+ * @param key a #GrlKeyID
681
+ * @returns %TRUE if @key can be used for filtering
682
+ */
683
+ is_key_range_filter(key: KeyID): boolean
684
+ set_key_filter(keys: KeyID[]): void
685
+ set_key_range_filter(keys: KeyID[]): void
686
+ /**
687
+ * Sets the supported filter capability.
688
+ * @param filter a #GrlTypeFilter
689
+ */
690
+ set_type_filter(filter: TypeFilter): void
691
+ /**
692
+ * Checks whether (`key,` `value)` are authorized by `caps`.
693
+ * @param key a key to test
694
+ * @param value the value corresponding to `key` to test against `caps`
695
+ * @returns %TRUE if (@key, @value) obey to @caps, %FALSE otherwise.
696
+ */
697
+ test_option(key: string | null, value: any): boolean
698
+
699
+ // Class property signals of Grl-0.2.Grl.Caps
700
+
701
+ connect(sigName: string, callback: (...args: any[]) => void): number
702
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
703
+ emit(sigName: string, ...args: any[]): void
704
+ disconnect(id: number): void
705
+ }
706
+
707
+ class Caps extends GObject.Object {
708
+
709
+ // Own properties of Grl-0.2.Grl.Caps
710
+
711
+ static name: string
712
+ static $gtype: GObject.GType<Caps>
713
+
714
+ // Constructors of Grl-0.2.Grl.Caps
715
+
716
+ constructor(config?: Caps.ConstructorProperties)
717
+ /**
718
+ * Creates a new caps object.
719
+ * @constructor
720
+ * @returns a new caps object.
721
+ */
722
+ constructor()
723
+ /**
724
+ * Creates a new caps object.
725
+ * @constructor
726
+ * @returns a new caps object.
727
+ */
728
+ static new(): Caps
729
+ _init(config?: Caps.ConstructorProperties): void
730
+ }
731
+
732
+ module Config {
733
+
734
+ // Constructor properties interface
735
+
736
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
737
+ }
738
+
739
+ }
740
+
741
+ interface Config {
742
+
743
+ // Own fields of Grl-0.2.Grl.Config
744
+
745
+ parent: GObject.Object
746
+ priv: ConfigPrivate
747
+ _grl_reserved: any[]
748
+
749
+ // Owm methods of Grl-0.2.Grl.Config
750
+
751
+ get_api_key(): string | null
752
+ get_api_key_blob(size: number): number
753
+ get_api_secret(): string | null
754
+ get_api_token(): string | null
755
+ get_api_token_secret(): string | null
756
+ /**
757
+ * Gets the value of `param` encoded as base64. If `size` is not %NULL, it puts
758
+ * there the size of the value.
759
+ * @param param a binary type parameter
760
+ * @param size place for size of value
761
+ * @returns @param value
762
+ */
763
+ get_binary(param: string | null, size: number | null): number
764
+ get_boolean(param: string | null): boolean
765
+ get_float(param: string | null): number
766
+ get_int(param: string | null): number
767
+ get_password(): string | null
768
+ get_plugin(): string | null
769
+ get_source(): string | null
770
+ get_string(param: string | null): string | null
771
+ get_username(): string | null
772
+ has_param(param: string | null): boolean
773
+ /**
774
+ * Set `param` `value`.
775
+ * @param param a parameter
776
+ * @param value value
777
+ */
778
+ set(param: string | null, value: any): void
779
+ /**
780
+ * Set the webservice API key in the configuration
781
+ * @param key the API key
782
+ */
783
+ set_api_key(key: string | null): void
784
+ /**
785
+ * Set the binary API key in the configuration
786
+ * @param blob the binary API key blob
787
+ * @param size the size of the blob
788
+ */
789
+ set_api_key_blob(blob: number, size: number): void
790
+ /**
791
+ * Set the webservice passphrase in the configuration
792
+ * @param secret the webservice passphrase
793
+ */
794
+ set_api_secret(secret: string | null): void
795
+ /**
796
+ * Set the webservice API token in the configuration
797
+ * @param token the API token
798
+ */
799
+ set_api_token(token: string | null): void
800
+ /**
801
+ * Set the webservice API token secret in the configuration
802
+ * (Needed by OAuth)
803
+ * @param secret the API token
804
+ */
805
+ set_api_token_secret(secret: string | null): void
806
+ /**
807
+ * Set `param` value.
808
+ * @param param a binary type parameter
809
+ * @param blob a base64 encoded binary value
810
+ * @param size size of `value`
811
+ */
812
+ set_binary(param: string | null, blob: number, size: number): void
813
+ /**
814
+ * Set `param` `value`.
815
+ * @param param a boolean type parameter
816
+ * @param value a value
817
+ */
818
+ set_boolean(param: string | null, value: boolean): void
819
+ /**
820
+ * Set `param` `value`.
821
+ * @param param a float type parameter
822
+ * @param value a value
823
+ */
824
+ set_float(param: string | null, value: number): void
825
+ /**
826
+ * Set `param` `value`.
827
+ * @param param an integer type parameter
828
+ * @param value a value
829
+ */
830
+ set_int(param: string | null, value: number): void
831
+ /**
832
+ * Set the password in the configuration
833
+ * @param password the password
834
+ */
835
+ set_password(password: string | null): void
836
+ /**
837
+ * Set the plugin key in the configuration
838
+ * @param plugin the plugin id
839
+ */
840
+ set_plugin(plugin: string | null): void
841
+ /**
842
+ * Set the source key in the configuration
843
+ * @param source the source id
844
+ */
845
+ set_source(source: string | null): void
846
+ /**
847
+ * Set `param` `value`.
848
+ * @param param a string type parameter
849
+ * @param value a value
850
+ */
851
+ set_string(param: string | null, value: string | null): void
852
+ /**
853
+ * Set the username in the configuration
854
+ * @param username the username
855
+ */
856
+ set_username(username: string | null): void
857
+
858
+ // Class property signals of Grl-0.2.Grl.Config
859
+
860
+ connect(sigName: string, callback: (...args: any[]) => void): number
861
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
862
+ emit(sigName: string, ...args: any[]): void
863
+ disconnect(id: number): void
864
+ }
865
+
866
+ class Config extends GObject.Object {
867
+
868
+ // Own properties of Grl-0.2.Grl.Config
869
+
870
+ static name: string
871
+ static $gtype: GObject.GType<Config>
872
+
873
+ // Constructors of Grl-0.2.Grl.Config
874
+
875
+ constructor(config?: Config.ConstructorProperties)
876
+ /**
877
+ * Creates a new data config object that will be associated with a plugin
878
+ * (if `source` is NULL), or a specific source spawned from a plugin (if
879
+ * `source` is not NULL). The latter may be useful for plugins
880
+ * spawning various sources, each one needing a different configuration.
881
+ * @constructor
882
+ * @param plugin plugin id for this configuration
883
+ * @param source source id for this configuration
884
+ * @returns a newly-allocated data config. The data config associated with the plugin should not be freed until the plugin has been unloaded.
885
+ */
886
+ constructor(plugin: string | null, source: string | null)
887
+ /**
888
+ * Creates a new data config object that will be associated with a plugin
889
+ * (if `source` is NULL), or a specific source spawned from a plugin (if
890
+ * `source` is not NULL). The latter may be useful for plugins
891
+ * spawning various sources, each one needing a different configuration.
892
+ * @constructor
893
+ * @param plugin plugin id for this configuration
894
+ * @param source source id for this configuration
895
+ * @returns a newly-allocated data config. The data config associated with the plugin should not be freed until the plugin has been unloaded.
896
+ */
897
+ static new(plugin: string | null, source: string | null): Config
898
+ _init(config?: Config.ConstructorProperties): void
899
+ }
900
+
901
+ module Data {
902
+
903
+ // Constructor properties interface
904
+
905
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
906
+ }
907
+
908
+ }
909
+
910
+ interface Data {
911
+
912
+ // Own fields of Grl-0.2.Grl.Data
913
+
914
+ parent: GObject.Object
915
+ priv: DataPrivate
916
+ _grl_reserved: any[]
917
+
918
+ // Owm methods of Grl-0.2.Grl.Data
919
+
920
+ /**
921
+ * Appends a new binary value for `key` in `data`.
922
+ * @param key key to append
923
+ * @param buf the buffer containing the new value
924
+ * @param size size of buffer
925
+ */
926
+ add_binary(key: KeyID, buf: number, size: number): void
927
+ /**
928
+ * Appends a new boxed value for `key` in `data`.
929
+ * @param key key to append
930
+ * @param boxed the new value
931
+ */
932
+ add_boxed(key: KeyID, boxed: any | null): void
933
+ /**
934
+ * Appends a new float value for `key` in `data`.
935
+ * @param key key to append
936
+ * @param floatvalue the new value
937
+ */
938
+ add_float(key: KeyID, floatvalue: number): void
939
+ /**
940
+ * Appends a new int value for `key` in `data`.
941
+ * @param key key to append
942
+ * @param intvalue the new value
943
+ */
944
+ add_int(key: KeyID, intvalue: number): void
945
+ /**
946
+ * Appends a new int64 value for `key` in `data`.
947
+ * @param key key to append
948
+ * @param intvalue the new value
949
+ */
950
+ add_int64(key: KeyID, intvalue: number): void
951
+ /**
952
+ * Adds a new set of values into `data`.
953
+ *
954
+ * All keys in `prop` must be related among them.
955
+ *
956
+ * `data` will take the ownership of `relkeys,` so do not modify it.
957
+ * @param relkeys a set of related properties with their values
958
+ */
959
+ add_related_keys(relkeys: RelatedKeys): void
960
+ /**
961
+ * Appends a new string value for `key` in `data`.
962
+ * @param key key to append
963
+ * @param strvalue the new value
964
+ */
965
+ add_string(key: KeyID, strvalue: string | null): void
966
+ /**
967
+ * Makes a deep copy of `data` and all its contents.
968
+ * @returns a new #GrlData. Free it with #g_object_unref.
969
+ */
970
+ dup(): Data
971
+ /**
972
+ * Get the first value from `data` associated with `key`.
973
+ * @param key key to look up.
974
+ * @returns a #GValue. This value should not be modified nor freed by user.
975
+ */
976
+ get(key: KeyID): any
977
+ /**
978
+ * Returns the first binary value associated with `key` from `data`. If `key` has
979
+ * no first value, or value is not a gfloat, or `key` is not in data, then %NULL
980
+ * is returned.
981
+ * @param key key to use
982
+ * @returns buffer location associated with the @key, or %NULL in other case. If successful @size will be set the to the buffer size.
983
+ */
984
+ get_binary(key: KeyID): [ /* returnType */ number, /* size */ number ]
985
+ get_boolean(key: KeyID): boolean
986
+ /**
987
+ * Returns the first boxed value associated with `key` from `data`. If `key` has
988
+ * no first value, that value is not of a boxed type, or `key` is not in `data,`
989
+ * then %NULL is returned.
990
+ * @param key key to use
991
+ * @returns the boxed instance associated with @key if possible, or %NULL in other cases. The caller should not change nor free the value.
992
+ */
993
+ get_boxed(key: KeyID): any | null
994
+ /**
995
+ * Returns the first float value associated with `key` from `data`. If `key` has no
996
+ * first value, or value is not a gfloat, or `key` is not in data, then 0 is
997
+ * returned.
998
+ * @param key key to use
999
+ * @returns float value associated with @key, or 0 in other case.
1000
+ */
1001
+ get_float(key: KeyID): number
1002
+ /**
1003
+ * Returns the first int value associated with `key` from `data`. If `key` has no
1004
+ * first value, or value is not a gint, or `key` is not in data, then 0 is
1005
+ * returned.
1006
+ * @param key key to use
1007
+ * @returns int value associated with @key, or 0 in other case.
1008
+ */
1009
+ get_int(key: KeyID): number
1010
+ /**
1011
+ * Returns the first int64 value associated with `key` from `data`. If `key` has no
1012
+ * first value, or value is not a gint, or `key` is not in data, then 0 is
1013
+ * returned.
1014
+ * @param key key to use
1015
+ * @returns int value associated with @key, or 0 in other case.
1016
+ */
1017
+ get_int64(key: KeyID): number
1018
+ /**
1019
+ * Returns a list with keys contained in `data`.
1020
+ * @returns an array with the keys. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
1021
+ */
1022
+ get_keys(): KeyID[]
1023
+ /**
1024
+ * Returns a set containing the values for `key` and related keys at position
1025
+ * `index` from `data`.
1026
+ *
1027
+ * If user changes any of the values in the related keys, the changes will
1028
+ * become permanent.
1029
+ * @param key a metadata key
1030
+ * @param index element to retrieve, starting at 0
1031
+ * @returns a #GrlRelatedKeys. Do not free it.
1032
+ */
1033
+ get_related_keys(key: KeyID, index: number): RelatedKeys
1034
+ /**
1035
+ * Returns all non-%NULL values for `key` from `data`. This ignores related keys.
1036
+ * @param key a metadata key
1037
+ * @returns a #GList with values. Do not change or free the values. Free the list with #g_list_free.
1038
+ */
1039
+ get_single_values_for_key(key: KeyID): any[]
1040
+ /**
1041
+ * Returns all non-%NULL values for `key` from `data`. `key` must have been
1042
+ * registered as a string-type key. This ignores related keys.
1043
+ * @param key a metadata key
1044
+ * @returns a #GList with values. Do not change or free the strings. Free the list with #g_list_free.
1045
+ */
1046
+ get_single_values_for_key_string(key: KeyID): string[]
1047
+ /**
1048
+ * Returns the first string value associated with `key` from `data`. If `key` has
1049
+ * no first value, or value is not string, or `key` is not in `data,` then %NULL
1050
+ * is returned.
1051
+ * @param key key to use
1052
+ * @returns string associated with @key, or %NULL in other case. Caller should not change nor free the value.
1053
+ */
1054
+ get_string(key: KeyID): string | null
1055
+ /**
1056
+ * Checks if `key` is in `data`.
1057
+ * @param key key to search
1058
+ * @returns %TRUE if @key is in @data, %FALSE in other case.
1059
+ */
1060
+ has_key(key: KeyID): boolean
1061
+ /**
1062
+ * Returns how many values `key` or related keys have in `data:` if `key` has no
1063
+ * value, but a related key has, then it is counted as positive.
1064
+ *
1065
+ * As example, let's think in three related keys, K1, K2 and K3, and then thinks
1066
+ * we have added several values for those keys, as:
1067
+ *
1068
+ * (V10, V20, V30),, (V11, NULL, V31), (V12, NULL, V32)
1069
+ *
1070
+ * Therefore, when invoking grl_data_length (data, K2) it will return 3:
1071
+ * considering K2 and the related keys (K1 and K3), there are 3 values.
1072
+ * @param key a metadata key
1073
+ * @returns number of values
1074
+ */
1075
+ length(key: KeyID): number
1076
+ /**
1077
+ * Removes the first value for `key` from `data`. If there are other keys related
1078
+ * to `key` their values will also be removed from `data`.
1079
+ * @param key key to remove
1080
+ */
1081
+ remove(key: KeyID): void
1082
+ /**
1083
+ * Removes the value at position `index` for `key` from `data`. If there are other
1084
+ * keys related to `key,` their values at position `index` will also be removed
1085
+ * from `data`.
1086
+ * @param key a metadata key
1087
+ * @param index index of key to be removed, starting at 0
1088
+ */
1089
+ remove_nth(key: KeyID, index: number): void
1090
+ /**
1091
+ * Sets the first value associated with `key` in `data`. If key already has a
1092
+ * value old value is freed and the new one is set.
1093
+ *
1094
+ * Also, checks that `value` is compliant with `key` specification, modifying it
1095
+ * accordingly. For instance, if `key` requires a number between 0 and 10, but
1096
+ * `value` is outside this range, it will be adapted accordingly.
1097
+ * @param key key to change or add
1098
+ * @param value the new value
1099
+ */
1100
+ set(key: KeyID, value: any): void
1101
+ /**
1102
+ * Sets the first binary value associated with `key` in `data`. If `key` already
1103
+ * has a first value old value is replaced by the new one.
1104
+ * @param key key to change or add
1105
+ * @param buf buffer holding the data
1106
+ * @param size size of the buffer
1107
+ */
1108
+ set_binary(key: KeyID, buf: number, size: number): void
1109
+ /**
1110
+ * Sets the first boolean value associated with `key` in `data`. If `key` already
1111
+ * has a first value, old value is replaced by the new one.
1112
+ * @param key key to change or add
1113
+ * @param boolvalue the new value
1114
+ */
1115
+ set_boolean(key: KeyID, boolvalue: boolean): void
1116
+ /**
1117
+ * Sets the first boxed value associated with `key` in `data`. If `key` already
1118
+ * has a value, the old value is freed and the new one is set.
1119
+ * @param key key to change or add
1120
+ * @param boxed the new value
1121
+ */
1122
+ set_boxed(key: KeyID, boxed: any | null): void
1123
+ /**
1124
+ * Sets the first float value associated with `key` in `data`. If `key` already has
1125
+ * a first value old value is replaced by the new one.
1126
+ * @param key key to change or add
1127
+ * @param floatvalue the new value
1128
+ */
1129
+ set_float(key: KeyID, floatvalue: number): void
1130
+ /**
1131
+ * Sets the first int value associated with `key` in `data`. If `key` already has a
1132
+ * first value old value is replaced by the new one.
1133
+ * @param key key to change or add
1134
+ * @param intvalue the new value
1135
+ */
1136
+ set_int(key: KeyID, intvalue: number): void
1137
+ /**
1138
+ * Sets the first int64 value associated with `key` in `data`. If `key` already has a
1139
+ * first value old value is replaced by the new one.
1140
+ * @param key key to change or add
1141
+ * @param intvalue the new value
1142
+ */
1143
+ set_int64(key: KeyID, intvalue: number): void
1144
+ /**
1145
+ * Updates the values at position `index` in `data` with values in `relkeys`.
1146
+ *
1147
+ * `data` will take ownership of `relkeys,` so do not free it after invoking this
1148
+ * function.
1149
+ * @param relkeys a set of related keys
1150
+ * @param index position to be updated, starting at 0
1151
+ */
1152
+ set_related_keys(relkeys: RelatedKeys, index: number): void
1153
+ /**
1154
+ * Sets the first string value associated with `key` in `data`. If `key` already
1155
+ * has a value old value is freed and the new one is set.
1156
+ * @param key key to change or add
1157
+ * @param strvalue the new value
1158
+ */
1159
+ set_string(key: KeyID, strvalue: string | null): void
1160
+
1161
+ // Class property signals of Grl-0.2.Grl.Data
1162
+
1163
+ connect(sigName: string, callback: (...args: any[]) => void): number
1164
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1165
+ emit(sigName: string, ...args: any[]): void
1166
+ disconnect(id: number): void
1167
+ }
1168
+
1169
+ class Data extends GObject.Object {
1170
+
1171
+ // Own properties of Grl-0.2.Grl.Data
1172
+
1173
+ static name: string
1174
+ static $gtype: GObject.GType<Data>
1175
+
1176
+ // Constructors of Grl-0.2.Grl.Data
1177
+
1178
+ constructor(config?: Data.ConstructorProperties)
1179
+ /**
1180
+ * Creates a new data object.
1181
+ * @constructor
1182
+ * @returns a new data object.
1183
+ */
1184
+ constructor()
1185
+ /**
1186
+ * Creates a new data object.
1187
+ * @constructor
1188
+ * @returns a new data object.
1189
+ */
1190
+ static new(): Data
1191
+ _init(config?: Data.ConstructorProperties): void
1192
+ }
1193
+
1194
+ module Media {
1195
+
1196
+ // Constructor properties interface
1197
+
1198
+ interface ConstructorProperties extends Data.ConstructorProperties {
1199
+ }
1200
+
1201
+ }
1202
+
1203
+ interface Media {
1204
+
1205
+ // Own fields of Grl-0.2.Grl.Media
1206
+
1207
+ parent: Data & GObject.Object
1208
+
1209
+ // Owm methods of Grl-0.2.Grl.Media
1210
+
1211
+ /**
1212
+ * Adds a new author to `media`.
1213
+ * @param author an author for `media`
1214
+ */
1215
+ add_author(author: string | null): void
1216
+ /**
1217
+ * Adds a new external player to `media`.
1218
+ * @param player an external player for `media`
1219
+ */
1220
+ add_external_player(player: string | null): void
1221
+ /**
1222
+ * Adds a new external url to `media`.
1223
+ * @param url an external url for `media`
1224
+ */
1225
+ add_external_url(url: string | null): void
1226
+ /**
1227
+ * Adds the keyword describing the `media`.
1228
+ * @param keyword a keyword describing the media
1229
+ */
1230
+ add_keyword(keyword: string | null): void
1231
+ /**
1232
+ * Adds regional publication and certification information for `region`.
1233
+ * @param region the region's ISO-3166-1 code
1234
+ * @param publication_date the publication date
1235
+ * @param certificate the age certification
1236
+ */
1237
+ add_region_data(region: string | null, publication_date: GLib.DateTime, certificate: string | null): void
1238
+ /**
1239
+ * Adds a new thumbnail to `media`.
1240
+ * @param thumbnail a thumbnail for `media`
1241
+ */
1242
+ add_thumbnail(thumbnail: string | null): void
1243
+ /**
1244
+ * Adds a new thumbnail to `media`.
1245
+ * @param thumbnail a buffer containing the thumbnail for `media`
1246
+ * @param size size of buffer
1247
+ */
1248
+ add_thumbnail_binary(thumbnail: number, size: number): void
1249
+ /**
1250
+ * Adds a new media's URL with its mime-type.
1251
+ * @param url a media's URL
1252
+ * @param mime th `url` mime type
1253
+ */
1254
+ add_url_data(url: string | null, mime: string | null): void
1255
+ get_author(): string | null
1256
+ get_author_nth(index: number): string | null
1257
+ /**
1258
+ * Returns the media's first age certificate.
1259
+ * This should usually be the media's most relevant
1260
+ * age certificate. Use grl_media_get_region_data_nth() to
1261
+ * get other age certificates.
1262
+ * @returns the media's age certification
1263
+ */
1264
+ get_certificate(): string | null
1265
+ get_creation_date(): GLib.DateTime
1266
+ get_description(): string | null
1267
+ get_duration(): number
1268
+ get_external_url(): string | null
1269
+ get_external_url_nth(index: number): string | null
1270
+ get_favourite(): boolean
1271
+ get_id(): string | null
1272
+ get_keyword(): string | null
1273
+ get_keyword_nth(index: number): string | null
1274
+ get_last_played(): string | null
1275
+ get_last_position(): number
1276
+ get_license(): string | null
1277
+ get_mime(): string | null
1278
+ get_modification_date(): GLib.DateTime
1279
+ get_play_count(): number
1280
+ get_player(): string | null
1281
+ get_player_nth(index: number): string | null
1282
+ get_publication_date(): GLib.DateTime
1283
+ get_rating(): number
1284
+ get_region(): string | null
1285
+ /**
1286
+ * Returns the media's age certificate and publication date for the first region.
1287
+ * This should usually be the media's most relevant region.
1288
+ * Use grl_media_get_region_data_nth() to get the age certificate and
1289
+ * publication date for other regions.
1290
+ * @returns the ISO-3166-1 of the region where the media was published (owned by @media).
1291
+ */
1292
+ get_region_data(): [ /* returnType */ string | null, /* publication_date */ GLib.DateTime, /* certificate */ string | null ]
1293
+ /**
1294
+ * Returns the media's age certificate and publication date for one region.
1295
+ * Use grl_data_length() with GRL_METADATA_KEY_REGION to discover
1296
+ * how many regions are available. For instance:
1297
+ * <informalexample>
1298
+ * <programlisting role="C"><![CDATA[
1299
+ * guint count = grl_data_length (GRL_DATA (media), GRL_METADATA_KEY_REGION);
1300
+ * guint i;
1301
+ * for (i = 0; i < count; ++i) {
1302
+ * const GDateTime* publication_date = NULL;
1303
+ * const gchar* certificate = NULL;
1304
+ * const gchar* region =
1305
+ * grl_media_get_region_data_nth (media, i,
1306
+ * &publication_date, &certificate);
1307
+ * ...
1308
+ * }
1309
+ * ]]></programlisting>
1310
+ * </informalexample>
1311
+ * @param index element to retrieve
1312
+ * @returns the ISO-3166-1 of the region where the media was published (owned by @media).
1313
+ */
1314
+ get_region_data_nth(index: number): [ /* returnType */ string | null, /* publication_date */ GLib.DateTime, /* certificate */ string | null ]
1315
+ get_site(): string | null
1316
+ get_size(): number
1317
+ get_source(): string | null
1318
+ get_start_time(): number
1319
+ get_studio(): string | null
1320
+ get_thumbnail(): string | null
1321
+ get_thumbnail_binary(size: number): number
1322
+ get_thumbnail_binary_nth(size: number, index: number): number
1323
+ get_thumbnail_nth(index: number): string | null
1324
+ get_title(): string | null
1325
+ get_url(): string | null
1326
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1327
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1328
+ /**
1329
+ * Serializes a GrlMedia into a string. It does a basic serialization.
1330
+ *
1331
+ * See grl_media_serialize_extended() to get more serialization approaches.
1332
+ * @returns serialized media
1333
+ */
1334
+ serialize(): string | null
1335
+ /**
1336
+ * Set the media's author
1337
+ * @param author the media's author
1338
+ */
1339
+ set_author(author: string | null): void
1340
+ /**
1341
+ * Set the media's first age certification.
1342
+ * This should usually be the media's most relevant
1343
+ * age certificate. Use grl_media_set_region_data() to
1344
+ * set other age certificates.
1345
+ * @param certificate The age certificate of the media
1346
+ */
1347
+ set_certificate(certificate: string | null): void
1348
+ /**
1349
+ * Set the creation_date of the media
1350
+ * @param creation_date date when media was created
1351
+ */
1352
+ set_creation_date(creation_date: GLib.DateTime): void
1353
+ /**
1354
+ * Set the media's description
1355
+ * @param description the description
1356
+ */
1357
+ set_description(description: string | null): void
1358
+ /**
1359
+ * Set the media's duration
1360
+ * @param duration the duration in seconds
1361
+ */
1362
+ set_duration(duration: number): void
1363
+ /**
1364
+ * Set the location of a player for the media (usually a flash player)
1365
+ * @param player location of an external player for this media
1366
+ */
1367
+ set_external_player(player: string | null): void
1368
+ /**
1369
+ * Set an external location where users can play the media
1370
+ * @param url external location where this media can be played.
1371
+ */
1372
+ set_external_url(url: string | null): void
1373
+ /**
1374
+ * Set if the media is favourite or not
1375
+ * @param favourite whether the item is favourite or not
1376
+ */
1377
+ set_favourite(favourite: boolean): void
1378
+ /**
1379
+ * Set the media identifier
1380
+ * @param id the identifier of the media
1381
+ */
1382
+ set_id(id: string | null): void
1383
+ /**
1384
+ * Sets the keyword describing the `media`.
1385
+ * @param keyword a keyword describing the media
1386
+ */
1387
+ set_keyword(keyword: string | null): void
1388
+ /**
1389
+ * Set the media last played date
1390
+ * @param last_played date when the media was last played
1391
+ */
1392
+ set_last_played(last_played: string | null): void
1393
+ /**
1394
+ * Set the media last played position
1395
+ * @param last_position second at which the media playback was interrupted
1396
+ */
1397
+ set_last_position(last_position: number): void
1398
+ /**
1399
+ * Set the media license
1400
+ * @param license The license of the media
1401
+ */
1402
+ set_license(license: string | null): void
1403
+ /**
1404
+ * Set the media's mime-type
1405
+ * @param mime the mime type
1406
+ */
1407
+ set_mime(mime: string | null): void
1408
+ /**
1409
+ * Set the modification date of the media
1410
+ * @param modification_date date when the media was last modified
1411
+ */
1412
+ set_modification_date(modification_date: GLib.DateTime): void
1413
+ /**
1414
+ * Set the media play count
1415
+ * @param play_count the play count
1416
+ */
1417
+ set_play_count(play_count: number): void
1418
+ /**
1419
+ * Set the publication date of `media`.
1420
+ * @param date the date
1421
+ */
1422
+ set_publication_date(date: GLib.DateTime): void
1423
+ /**
1424
+ * This method receives a rating and its scale and normalizes it on a scale
1425
+ * from 0...5 to match the usual five-star rating.
1426
+ * @param rating a rating value
1427
+ * @param max maximum rating value
1428
+ */
1429
+ set_rating(rating: number, max: number): void
1430
+ /**
1431
+ * Sets the `region` where `media` was published.
1432
+ * @param region the region's ISO-3166-1 code
1433
+ */
1434
+ set_region(region: string | null): void
1435
+ /**
1436
+ * Sets regional publication and certification information for `region`.
1437
+ * @param region the region's ISO-3166-1 code
1438
+ * @param publication_date the publication date
1439
+ * @param certificate the age certification
1440
+ */
1441
+ set_region_data(region: string | null, publication_date: GLib.DateTime, certificate: string | null): void
1442
+ /**
1443
+ * Set the media's site. A site is a website about the media such as a
1444
+ * studio's promotional website for a movie.
1445
+ * @param site the site
1446
+ */
1447
+ set_site(site: string | null): void
1448
+ /**
1449
+ * Set the size of the media
1450
+ * @param size the size in bytes
1451
+ */
1452
+ set_size(size: number): void
1453
+ /**
1454
+ * Set the media's source
1455
+ * @param source the source
1456
+ */
1457
+ set_source(source: string | null): void
1458
+ /**
1459
+ * Set the media studio
1460
+ * @param studio The studio the media is from
1461
+ */
1462
+ set_studio(studio: string | null): void
1463
+ /**
1464
+ * Set the media's thumbnail URL
1465
+ * @param thumbnail the thumbnail URL
1466
+ */
1467
+ set_thumbnail(thumbnail: string | null): void
1468
+ /**
1469
+ * Set the media's binary thumbnail
1470
+ * @param thumbnail thumbnail buffer
1471
+ * @param size thumbnail buffer size
1472
+ */
1473
+ set_thumbnail_binary(thumbnail: number, size: number): void
1474
+ /**
1475
+ * Set the media's title
1476
+ * @param title the title
1477
+ */
1478
+ set_title(title: string | null): void
1479
+ /**
1480
+ * Set the media's URL
1481
+ * @param url the media's URL
1482
+ */
1483
+ set_url(url: string | null): void
1484
+ /**
1485
+ * Set the media's URL and its mime-type.
1486
+ * @param url the media's URL
1487
+ * @param mime the `url` mime type
1488
+ */
1489
+ set_url_data(url: string | null, mime: string | null): void
1490
+
1491
+ // Class property signals of Grl-0.2.Grl.Media
1492
+
1493
+ connect(sigName: string, callback: (...args: any[]) => void): number
1494
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1495
+ emit(sigName: string, ...args: any[]): void
1496
+ disconnect(id: number): void
1497
+ }
1498
+
1499
+ class Media extends Data {
1500
+
1501
+ // Own properties of Grl-0.2.Grl.Media
1502
+
1503
+ static name: string
1504
+ static $gtype: GObject.GType<Media>
1505
+
1506
+ // Constructors of Grl-0.2.Grl.Media
1507
+
1508
+ constructor(config?: Media.ConstructorProperties)
1509
+ /**
1510
+ * Creates a new data media object.
1511
+ * @constructor
1512
+ * @returns a newly-allocated data media.
1513
+ */
1514
+ constructor()
1515
+ /**
1516
+ * Creates a new data media object.
1517
+ * @constructor
1518
+ * @returns a newly-allocated data media.
1519
+ */
1520
+ static new(): Media
1521
+
1522
+ // Overloads of new
1523
+
1524
+ /**
1525
+ * Creates a new data object.
1526
+ * @constructor
1527
+ * @returns a new data object.
1528
+ */
1529
+ static new(): Data
1530
+ _init(config?: Media.ConstructorProperties): void
1531
+ /**
1532
+ * Unserializes a GrlMedia.
1533
+ * @param serial a serialized media
1534
+ * @returns the GrlMedia from the serial
1535
+ */
1536
+ static unserialize(serial: string | null): Media
1537
+ }
1538
+
1539
+ module MediaAudio {
1540
+
1541
+ // Constructor properties interface
1542
+
1543
+ interface ConstructorProperties extends Media.ConstructorProperties {
1544
+ }
1545
+
1546
+ }
1547
+
1548
+ interface MediaAudio {
1549
+
1550
+ // Own fields of Grl-0.2.Grl.MediaAudio
1551
+
1552
+ parent: Media & Data & GObject.Object & GObject.Object
1553
+
1554
+ // Owm methods of Grl-0.2.Grl.MediaAudio
1555
+
1556
+ /**
1557
+ * Adds a new artist to `audio`.
1558
+ * @param artist an audio's artist
1559
+ */
1560
+ add_artist(artist: string | null): void
1561
+ /**
1562
+ * Adds a new genre to `audio`.
1563
+ * @param genre an audio's genre
1564
+ */
1565
+ add_genre(genre: string | null): void
1566
+ /**
1567
+ * Adds a new lyrics to `audio`.
1568
+ * @param lyrics an audio's lyrics
1569
+ */
1570
+ add_lyrics(lyrics: string | null): void
1571
+ /**
1572
+ * Adds a new MusicBrainz artist id to `audio`.
1573
+ * @param mb_artist_id a MusicBrainz artist identifier
1574
+ */
1575
+ add_mb_artist_id(mb_artist_id: string | null): void
1576
+ /**
1577
+ * Sets all the keys related with the URL of a media resource and adds it to
1578
+ * `audio` (useful for resources with more than one URL).
1579
+ * @param url an audio's url
1580
+ * @param mime the `url` mime-type
1581
+ * @param bitrate the `url` bitrate, or -1 to ignore
1582
+ */
1583
+ add_url_data(url: string | null, mime: string | null, bitrate: number): void
1584
+
1585
+ // Overloads of add_url_data
1586
+
1587
+ /**
1588
+ * Adds a new media's URL with its mime-type.
1589
+ * @param url a media's URL
1590
+ * @param mime th `url` mime type
1591
+ */
1592
+ add_url_data(url: string | null, mime: string | null): void
1593
+ get_album(): string | null
1594
+ get_artist(): string | null
1595
+ get_artist_nth(index: number): string | null
1596
+ get_bitrate(): number
1597
+ get_genre(): string | null
1598
+ get_genre_nth(index: number): string | null
1599
+ get_lyrics(): string | null
1600
+ get_lyrics_nth(index: number): string | null
1601
+ get_mb_album_id(): string | null
1602
+ get_mb_artist_id(): string | null
1603
+ get_mb_artist_id_nth(index: number): string | null
1604
+ get_mb_recording_id(): string | null
1605
+ get_mb_track_id(): string | null
1606
+ get_track_number(): number
1607
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null, /* bitrate */ number ]
1608
+
1609
+ // Overloads of get_url_data
1610
+
1611
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1612
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null, /* bitrate */ number ]
1613
+
1614
+ // Overloads of get_url_data_nth
1615
+
1616
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1617
+ /**
1618
+ * Set the album of the audio
1619
+ * @param album the audio's album
1620
+ */
1621
+ set_album(album: string | null): void
1622
+ /**
1623
+ * Set the artist of the audio
1624
+ * @param artist the audio's artist
1625
+ */
1626
+ set_artist(artist: string | null): void
1627
+ /**
1628
+ * Set the bitrate of the audio
1629
+ * @param bitrate the audio's bitrate
1630
+ */
1631
+ set_bitrate(bitrate: number): void
1632
+ /**
1633
+ * Set the genre of the audio
1634
+ * @param genre the audio's genre
1635
+ */
1636
+ set_genre(genre: string | null): void
1637
+ /**
1638
+ * Set the lyrics of the audio
1639
+ * @param lyrics the audio's lyrics
1640
+ */
1641
+ set_lyrics(lyrics: string | null): void
1642
+ /**
1643
+ * Set the MusicBrainz album identifier of the audio
1644
+ * @param mb_album_id the MusicBrainz album identifier
1645
+ */
1646
+ set_mb_album_id(mb_album_id: string | null): void
1647
+ /**
1648
+ * Set the MusicBrainz artist identifier of the audio
1649
+ * @param mb_artist_id the MusicBrainz artist identifier
1650
+ */
1651
+ set_mb_artist_id(mb_artist_id: string | null): void
1652
+ /**
1653
+ * Set the MusicBrainz recording identifier of the audio
1654
+ * @param mb_recording_id the MusicBrainz recording identifier
1655
+ */
1656
+ set_mb_recording_id(mb_recording_id: string | null): void
1657
+ /**
1658
+ * Set the MusicBrainz track identifier of the audio
1659
+ * @param mb_track_id the MusicBrainz track identifier
1660
+ */
1661
+ set_mb_track_id(mb_track_id: string | null): void
1662
+ /**
1663
+ * Set the track number of the audio
1664
+ * @param track_number the audio's track number
1665
+ */
1666
+ set_track_number(track_number: number): void
1667
+ /**
1668
+ * Sets all the keys related with the URL of an audio resource in one go.
1669
+ * @param url the audio's url
1670
+ * @param mime the `url` mime-type
1671
+ * @param bitrate the `url` bitrate, or -1 to ignore
1672
+ */
1673
+ set_url_data(url: string | null, mime: string | null, bitrate: number): void
1674
+
1675
+ // Overloads of set_url_data
1676
+
1677
+ /**
1678
+ * Set the media's URL and its mime-type.
1679
+ * @param url the media's URL
1680
+ * @param mime the `url` mime type
1681
+ */
1682
+ set_url_data(url: string | null, mime: string | null): void
1683
+
1684
+ // Class property signals of Grl-0.2.Grl.MediaAudio
1685
+
1686
+ connect(sigName: string, callback: (...args: any[]) => void): number
1687
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1688
+ emit(sigName: string, ...args: any[]): void
1689
+ disconnect(id: number): void
1690
+ }
1691
+
1692
+ class MediaAudio extends Media {
1693
+
1694
+ // Own properties of Grl-0.2.Grl.MediaAudio
1695
+
1696
+ static name: string
1697
+ static $gtype: GObject.GType<MediaAudio>
1698
+
1699
+ // Constructors of Grl-0.2.Grl.MediaAudio
1700
+
1701
+ constructor(config?: MediaAudio.ConstructorProperties)
1702
+ /**
1703
+ * Creates a new data audio object.
1704
+ * @constructor
1705
+ * @returns a newly-allocated data audio.
1706
+ */
1707
+ constructor()
1708
+ /**
1709
+ * Creates a new data audio object.
1710
+ * @constructor
1711
+ * @returns a newly-allocated data audio.
1712
+ */
1713
+ static new(): MediaAudio
1714
+
1715
+ // Overloads of new
1716
+
1717
+ /**
1718
+ * Creates a new data media object.
1719
+ * @constructor
1720
+ * @returns a newly-allocated data media.
1721
+ */
1722
+ static new(): Media
1723
+ /**
1724
+ * Creates a new data object.
1725
+ * @constructor
1726
+ * @returns a new data object.
1727
+ */
1728
+ static new(): Data
1729
+ _init(config?: MediaAudio.ConstructorProperties): void
1730
+ }
1731
+
1732
+ module MediaBox {
1733
+
1734
+ // Constructor properties interface
1735
+
1736
+ interface ConstructorProperties extends Media.ConstructorProperties {
1737
+ }
1738
+
1739
+ }
1740
+
1741
+ interface MediaBox {
1742
+
1743
+ // Own fields of Grl-0.2.Grl.MediaBox
1744
+
1745
+ parent: Media & Data & GObject.Object & GObject.Object
1746
+
1747
+ // Owm methods of Grl-0.2.Grl.MediaBox
1748
+
1749
+ /**
1750
+ * Number of children of this box.
1751
+ * @returns number of children, or #GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if unknown.
1752
+ */
1753
+ get_childcount(): number
1754
+ /**
1755
+ * Sets the number of children of this box. Use
1756
+ * #GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN if it is unknown.
1757
+ * @param childcount number of children
1758
+ */
1759
+ set_childcount(childcount: number): void
1760
+
1761
+ // Class property signals of Grl-0.2.Grl.MediaBox
1762
+
1763
+ connect(sigName: string, callback: (...args: any[]) => void): number
1764
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1765
+ emit(sigName: string, ...args: any[]): void
1766
+ disconnect(id: number): void
1767
+ }
1768
+
1769
+ class MediaBox extends Media {
1770
+
1771
+ // Own properties of Grl-0.2.Grl.MediaBox
1772
+
1773
+ static name: string
1774
+ static $gtype: GObject.GType<MediaBox>
1775
+
1776
+ // Constructors of Grl-0.2.Grl.MediaBox
1777
+
1778
+ constructor(config?: MediaBox.ConstructorProperties)
1779
+ /**
1780
+ * Creates a new data box object.
1781
+ * @constructor
1782
+ * @returns a newly-allocated data box.
1783
+ */
1784
+ constructor()
1785
+ /**
1786
+ * Creates a new data box object.
1787
+ * @constructor
1788
+ * @returns a newly-allocated data box.
1789
+ */
1790
+ static new(): MediaBox
1791
+
1792
+ // Overloads of new
1793
+
1794
+ /**
1795
+ * Creates a new data media object.
1796
+ * @constructor
1797
+ * @returns a newly-allocated data media.
1798
+ */
1799
+ static new(): Media
1800
+ /**
1801
+ * Creates a new data object.
1802
+ * @constructor
1803
+ * @returns a new data object.
1804
+ */
1805
+ static new(): Data
1806
+ _init(config?: MediaBox.ConstructorProperties): void
1807
+ }
1808
+
1809
+ module MediaImage {
1810
+
1811
+ // Constructor properties interface
1812
+
1813
+ interface ConstructorProperties extends Media.ConstructorProperties {
1814
+ }
1815
+
1816
+ }
1817
+
1818
+ interface MediaImage {
1819
+
1820
+ // Own fields of Grl-0.2.Grl.MediaImage
1821
+
1822
+ parent: Media & Data & GObject.Object & GObject.Object
1823
+
1824
+ // Owm methods of Grl-0.2.Grl.MediaImage
1825
+
1826
+ /**
1827
+ * Sets all the keys related with the URL of a media resource and adds it to
1828
+ * `image` (useful for resources with more than one URL).
1829
+ * @param url a image's url
1830
+ * @param mime image mime-type
1831
+ * @param width image width, or -1 to ignore
1832
+ * @param height image height, or -1 to ignore
1833
+ */
1834
+ add_url_data(url: string | null, mime: string | null, width: number, height: number): void
1835
+
1836
+ // Overloads of add_url_data
1837
+
1838
+ /**
1839
+ * Adds a new media's URL with its mime-type.
1840
+ * @param url a media's URL
1841
+ * @param mime th `url` mime type
1842
+ */
1843
+ add_url_data(url: string | null, mime: string | null): void
1844
+ get_camera_model(): string | null
1845
+ get_exposure_time(): number
1846
+ get_flash_used(): string | null
1847
+ get_height(): number
1848
+ get_iso_speed(): number
1849
+ get_orientation(): number
1850
+ get_url_data(width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
1851
+
1852
+ // Overloads of get_url_data
1853
+
1854
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
1855
+ get_url_data_nth(index: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
1856
+
1857
+ // Overloads of get_url_data_nth
1858
+
1859
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
1860
+ get_width(): number
1861
+ set_camera_model(camera_model: string | null): void
1862
+ set_exposure_time(exposure_time: number): void
1863
+ set_flash_used(flash_used: string | null): void
1864
+ /**
1865
+ * Set the height of the image
1866
+ * @param height the image's height
1867
+ */
1868
+ set_height(height: number): void
1869
+ /**
1870
+ * Set the iso_speed of the image
1871
+ * @param iso_speed picture's iso speed
1872
+ */
1873
+ set_iso_speed(iso_speed: number): void
1874
+ /**
1875
+ * Set the orientation of the image
1876
+ * @param orientation degrees clockwise orientation of the picture
1877
+ */
1878
+ set_orientation(orientation: number): void
1879
+ /**
1880
+ * Set the size of the image
1881
+ * @param width the image's width
1882
+ * @param height the image's height
1883
+ */
1884
+ set_size(width: number, height: number): void
1885
+
1886
+ // Overloads of set_size
1887
+
1888
+ /**
1889
+ * Set the size of the media
1890
+ * @param size the size in bytes
1891
+ */
1892
+ set_size(size: number): void
1893
+ /**
1894
+ * Sets all the keys related with the URL of an image resource in one go.
1895
+ * @param url the image's url
1896
+ * @param mime image mime-type
1897
+ * @param width image width, or -1 to ignore
1898
+ * @param height image height, or -1 to ignore
1899
+ */
1900
+ set_url_data(url: string | null, mime: string | null, width: number, height: number): void
1901
+
1902
+ // Overloads of set_url_data
1903
+
1904
+ /**
1905
+ * Set the media's URL and its mime-type.
1906
+ * @param url the media's URL
1907
+ * @param mime the `url` mime type
1908
+ */
1909
+ set_url_data(url: string | null, mime: string | null): void
1910
+ /**
1911
+ * Set the width of the image
1912
+ * @param width the image's width
1913
+ */
1914
+ set_width(width: number): void
1915
+
1916
+ // Class property signals of Grl-0.2.Grl.MediaImage
1917
+
1918
+ connect(sigName: string, callback: (...args: any[]) => void): number
1919
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1920
+ emit(sigName: string, ...args: any[]): void
1921
+ disconnect(id: number): void
1922
+ }
1923
+
1924
+ class MediaImage extends Media {
1925
+
1926
+ // Own properties of Grl-0.2.Grl.MediaImage
1927
+
1928
+ static name: string
1929
+ static $gtype: GObject.GType<MediaImage>
1930
+
1931
+ // Constructors of Grl-0.2.Grl.MediaImage
1932
+
1933
+ constructor(config?: MediaImage.ConstructorProperties)
1934
+ /**
1935
+ * Creates a new data image object.
1936
+ * @constructor
1937
+ * @returns a newly-allocated data image.
1938
+ */
1939
+ constructor()
1940
+ /**
1941
+ * Creates a new data image object.
1942
+ * @constructor
1943
+ * @returns a newly-allocated data image.
1944
+ */
1945
+ static new(): MediaImage
1946
+
1947
+ // Overloads of new
1948
+
1949
+ /**
1950
+ * Creates a new data media object.
1951
+ * @constructor
1952
+ * @returns a newly-allocated data media.
1953
+ */
1954
+ static new(): Media
1955
+ /**
1956
+ * Creates a new data object.
1957
+ * @constructor
1958
+ * @returns a new data object.
1959
+ */
1960
+ static new(): Data
1961
+ _init(config?: MediaImage.ConstructorProperties): void
1962
+ }
1963
+
1964
+ module MediaVideo {
1965
+
1966
+ // Constructor properties interface
1967
+
1968
+ interface ConstructorProperties extends Media.ConstructorProperties {
1969
+ }
1970
+
1971
+ }
1972
+
1973
+ interface MediaVideo {
1974
+
1975
+ // Own fields of Grl-0.2.Grl.MediaVideo
1976
+
1977
+ parent: Media & Data & GObject.Object & GObject.Object
1978
+
1979
+ // Owm methods of Grl-0.2.Grl.MediaVideo
1980
+
1981
+ /**
1982
+ * Adds the director of the movie.
1983
+ * @param director director of the movie
1984
+ */
1985
+ add_director(director: string | null): void
1986
+ /**
1987
+ * Adds the actor performing in the movie.
1988
+ * @param performer an actor performing in the movie
1989
+ */
1990
+ add_performer(performer: string | null): void
1991
+ /**
1992
+ * Adds the producer of the movie.
1993
+ * @param producer producer of the movie
1994
+ */
1995
+ add_producer(producer: string | null): void
1996
+ /**
1997
+ * Sets all the keys related with the URL of a media resource and adds it to
1998
+ * `video` (useful for resources with more than one URL).
1999
+ * @param url a video's url
2000
+ * @param mime video mime-type
2001
+ * @param framerate video framerate, or -1 to ignore
2002
+ * @param width video width, or -1 to ignore
2003
+ * @param height video height, or -1 to ignore
2004
+ */
2005
+ add_url_data(url: string | null, mime: string | null, framerate: number, width: number, height: number): void
2006
+
2007
+ // Overloads of add_url_data
2008
+
2009
+ /**
2010
+ * Adds a new media's URL with its mime-type.
2011
+ * @param url a media's URL
2012
+ * @param mime th `url` mime type
2013
+ */
2014
+ add_url_data(url: string | null, mime: string | null): void
2015
+ get_director(): string | null
2016
+ get_director_nth(index: number): string | null
2017
+ get_episode(): number
2018
+ get_episode_title(): string | null
2019
+ get_framerate(): number
2020
+ get_height(): number
2021
+ get_original_title(): string | null
2022
+ get_performer(): string | null
2023
+ get_performer_nth(index: number): string | null
2024
+ get_producer(): string | null
2025
+ get_producer_nth(index: number): string | null
2026
+ get_season(): number
2027
+ get_show(): string | null
2028
+ get_url_data(framerate: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
2029
+
2030
+ // Overloads of get_url_data
2031
+
2032
+ get_url_data(): [ /* returnType */ string | null, /* mime */ string | null ]
2033
+ get_url_data_nth(index: number, framerate: number, width: number, height: number): [ /* returnType */ string | null, /* mime */ string | null ]
2034
+
2035
+ // Overloads of get_url_data_nth
2036
+
2037
+ get_url_data_nth(index: number): [ /* returnType */ string | null, /* mime */ string | null ]
2038
+ get_width(): number
2039
+ /**
2040
+ * Sets the director of the movie.
2041
+ * @param director director of the movie
2042
+ */
2043
+ set_director(director: string | null): void
2044
+ /**
2045
+ * Sets the episode number of the video
2046
+ * @param episode the video's episode
2047
+ */
2048
+ set_episode(episode: number): void
2049
+ /**
2050
+ * Sets the title of an episode
2051
+ * @param episode_title the title of the episode
2052
+ */
2053
+ set_episode_title(episode_title: string | null): void
2054
+ /**
2055
+ * Set the framerate of the video
2056
+ * @param framerate the video's framerate
2057
+ */
2058
+ set_framerate(framerate: number): void
2059
+ /**
2060
+ * Set the height of the video
2061
+ * @param height the video's height
2062
+ */
2063
+ set_height(height: number): void
2064
+ /**
2065
+ * Sets the original, untranslated title of the movie.
2066
+ * @param original_title original, untranslated title of the movie
2067
+ */
2068
+ set_original_title(original_title: string | null): void
2069
+ /**
2070
+ * Sets the actor performing in the movie.
2071
+ * @param performer an actor performing in the movie
2072
+ */
2073
+ set_performer(performer: string | null): void
2074
+ /**
2075
+ * Sets the producer of the movie.
2076
+ * @param producer producer of the movie
2077
+ */
2078
+ set_producer(producer: string | null): void
2079
+ /**
2080
+ * Sets the season number of the video
2081
+ * @param season the video's season
2082
+ */
2083
+ set_season(season: number): void
2084
+ /**
2085
+ * Sets the show title of the video
2086
+ * @param show the video's show name
2087
+ */
2088
+ set_show(show: string | null): void
2089
+ /**
2090
+ * Set the width and the height of the video
2091
+ * @param width the video's width
2092
+ * @param height the video's height
2093
+ */
2094
+ set_size(width: number, height: number): void
2095
+
2096
+ // Overloads of set_size
2097
+
2098
+ /**
2099
+ * Set the size of the media
2100
+ * @param size the size in bytes
2101
+ */
2102
+ set_size(size: number): void
2103
+ /**
2104
+ * Sets all the keys related with the URL of a video resource in one go.
2105
+ * @param url the video's url
2106
+ * @param mime video mime-type
2107
+ * @param framerate video framerate, or -1 to ignore
2108
+ * @param width video width, or -1 to ignore
2109
+ * @param height video height, or -1 to ignore
2110
+ */
2111
+ set_url_data(url: string | null, mime: string | null, framerate: number, width: number, height: number): void
2112
+
2113
+ // Overloads of set_url_data
2114
+
2115
+ /**
2116
+ * Set the media's URL and its mime-type.
2117
+ * @param url the media's URL
2118
+ * @param mime the `url` mime type
2119
+ */
2120
+ set_url_data(url: string | null, mime: string | null): void
2121
+ /**
2122
+ * Set the width of the video
2123
+ * @param width the video's width
2124
+ */
2125
+ set_width(width: number): void
2126
+
2127
+ // Class property signals of Grl-0.2.Grl.MediaVideo
2128
+
2129
+ connect(sigName: string, callback: (...args: any[]) => void): number
2130
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2131
+ emit(sigName: string, ...args: any[]): void
2132
+ disconnect(id: number): void
2133
+ }
2134
+
2135
+ class MediaVideo extends Media {
2136
+
2137
+ // Own properties of Grl-0.2.Grl.MediaVideo
2138
+
2139
+ static name: string
2140
+ static $gtype: GObject.GType<MediaVideo>
2141
+
2142
+ // Constructors of Grl-0.2.Grl.MediaVideo
2143
+
2144
+ constructor(config?: MediaVideo.ConstructorProperties)
2145
+ /**
2146
+ * Creates a new data video object.
2147
+ * @constructor
2148
+ * @returns a newly-allocated data video.
2149
+ */
2150
+ constructor()
2151
+ /**
2152
+ * Creates a new data video object.
2153
+ * @constructor
2154
+ * @returns a newly-allocated data video.
2155
+ */
2156
+ static new(): MediaVideo
2157
+
2158
+ // Overloads of new
2159
+
2160
+ /**
2161
+ * Creates a new data media object.
2162
+ * @constructor
2163
+ * @returns a newly-allocated data media.
2164
+ */
2165
+ static new(): Media
2166
+ /**
2167
+ * Creates a new data object.
2168
+ * @constructor
2169
+ * @returns a new data object.
2170
+ */
2171
+ static new(): Data
2172
+ _init(config?: MediaVideo.ConstructorProperties): void
2173
+ }
2174
+
2175
+ module OperationOptions {
2176
+
2177
+ // Constructor properties interface
2178
+
2179
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2180
+ }
2181
+
2182
+ }
2183
+
2184
+ interface OperationOptions {
2185
+
2186
+ // Own fields of Grl-0.2.Grl.OperationOptions
2187
+
2188
+ parent: GObject.Object
2189
+
2190
+ // Owm methods of Grl-0.2.Grl.OperationOptions
2191
+
2192
+ copy(): OperationOptions
2193
+ /**
2194
+ * Get the count option, that is, the number of elements to retrieve in an
2195
+ * operation done with `options`.
2196
+ * @returns the value of the count option, or a default value if it is not set.
2197
+ */
2198
+ get_count(): number
2199
+ get_flags(): ResolutionFlags
2200
+ get_key_filter(key: KeyID): any
2201
+ get_key_filter_list(): KeyID[]
2202
+ /**
2203
+ * Stores the limits of the range in the filter for `key` in `min_value` and
2204
+ * `max_value`. If some of the values has no limit, it will set a %NULL.
2205
+ * @param key a #GrlKeyID
2206
+ */
2207
+ get_key_range_filter(key: KeyID): [ /* min_value */ any, /* max_value */ any ]
2208
+ get_key_range_filter_list(): KeyID[]
2209
+ get_resolution_flags(): ResolutionFlags
2210
+ /**
2211
+ * Get the skip option, that is, the number of elements to skip before
2212
+ * retrieving media items in an operation done with `options`.
2213
+ * @returns the value of the skip option, or a default value if it is not set.
2214
+ */
2215
+ get_skip(): number
2216
+ get_type_filter(): TypeFilter
2217
+ /**
2218
+ * This is an internal method that shouldn't be used outside of Grilo.
2219
+ * @param key an operation option key
2220
+ * @returns whether @key is set in @options.
2221
+ */
2222
+ key_is_set(key: string | null): boolean
2223
+ /**
2224
+ * Check whether `options` obey to `caps`.
2225
+ * Optionally provide the options that match (respectively don't match) `caps`
2226
+ * in `supported_options` (respectively `unsupported_options)`.
2227
+ * This would typically (but not necessarily) be used with a
2228
+ * #GrlOperationOptions instance that was created with %NULL caps.
2229
+ * @param caps capabilities against which we want to test `options`
2230
+ * @returns %TRUE if @options obey to @caps, %FALSE otherwise.
2231
+ */
2232
+ obey_caps(caps: Caps): [ /* returnType */ boolean, /* supported_options */ OperationOptions, /* unsupported_options */ OperationOptions ]
2233
+ /**
2234
+ * Set the count option for an operation. Will only succeed if `count` obey to
2235
+ * the inherent capabilities of `options`.
2236
+ * @param count number of elements to retrieve in an operation
2237
+ * @returns %TRUE if @count could be set, %FALSE otherwise.
2238
+ */
2239
+ set_count(count: number): boolean
2240
+ /**
2241
+ * Set the resolution flags for an operation. Will only succeed if `flags` obey
2242
+ * to the inherent capabilities of `options`.
2243
+ * @param flags the resolution flags to be set for an operation. See #GrlResolutionFlags for possible values.
2244
+ * @returns %TRUE if @flags could be set, %FALSE otherwise.
2245
+ */
2246
+ set_flags(flags: ResolutionFlags): boolean
2247
+ set_key_filters(filters: GLib.HashTable): boolean
2248
+ /**
2249
+ * Set filter as "`key` == `value"`.
2250
+ * @param key a #GrlKeyID
2251
+ * @param value a #GValue
2252
+ * @returns %TRUE on success
2253
+ */
2254
+ set_key_filter_value(key: KeyID, value: any): boolean
2255
+ /**
2256
+ * Set filter as "`min_value` <= `key` <= `max_value"`.
2257
+ *
2258
+ * If `min_value` is %NULL, then filter is "`key` <= `max_value"`.
2259
+ *
2260
+ * If `max_value` is %NULL, then filter is "`key` >= `min_value"`.
2261
+ * @param key a #GrlKeyID
2262
+ * @param min_value minimum value for range
2263
+ * @param max_value maximum value for range
2264
+ * @returns %TRUE on success
2265
+ */
2266
+ set_key_range_filter_value(key: KeyID, min_value: any | null, max_value: any | null): boolean
2267
+ /**
2268
+ * Set the resolution flags for an operation. Will only succeed if `flags` obey
2269
+ * to the inherent capabilities of `options`.
2270
+ * @param flags the resolution flags to be set for an operation. See #GrlResolutionFlags for possible values.
2271
+ * @returns %TRUE if @flags could be set, %FALSE otherwise.
2272
+ */
2273
+ set_resolution_flags(flags: ResolutionFlags): boolean
2274
+ /**
2275
+ * Set the skip option for an operation. Will only succeed if `skip` obeys to the
2276
+ * inherent capabilities of `options`.
2277
+ * @param skip number of elements to skip in an operation
2278
+ * @returns %TRUE if @skip could be set, %FALSE otherwise.
2279
+ */
2280
+ set_skip(skip: number): boolean
2281
+ /**
2282
+ * Set the type of media filter for an operation. Only those media elements that
2283
+ * match the `filter` will be returned. Will only succeed if `filter` obey to the
2284
+ * inherent capabilities of `options`.
2285
+ * @param filter the type of media to get
2286
+ * @returns %TRUE if @flags could be set, %FALSE otherwise
2287
+ */
2288
+ set_type_filter(filter: TypeFilter): boolean
2289
+
2290
+ // Class property signals of Grl-0.2.Grl.OperationOptions
2291
+
2292
+ connect(sigName: string, callback: (...args: any[]) => void): number
2293
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2294
+ emit(sigName: string, ...args: any[]): void
2295
+ disconnect(id: number): void
2296
+ }
2297
+
2298
+ class OperationOptions extends GObject.Object {
2299
+
2300
+ // Own properties of Grl-0.2.Grl.OperationOptions
2301
+
2302
+ static name: string
2303
+ static $gtype: GObject.GType<OperationOptions>
2304
+
2305
+ // Constructors of Grl-0.2.Grl.OperationOptions
2306
+
2307
+ constructor(config?: OperationOptions.ConstructorProperties)
2308
+ /**
2309
+ * Creates a new GrlOperationOptions object.
2310
+ * @constructor
2311
+ * @param caps caps that options will have to match. If %NULL, all options will be accepted.
2312
+ * @returns a new GrlOperationOptions instance.
2313
+ */
2314
+ constructor(caps: Caps | null)
2315
+ /**
2316
+ * Creates a new GrlOperationOptions object.
2317
+ * @constructor
2318
+ * @param caps caps that options will have to match. If %NULL, all options will be accepted.
2319
+ * @returns a new GrlOperationOptions instance.
2320
+ */
2321
+ static new(caps: Caps | null): OperationOptions
2322
+ _init(config?: OperationOptions.ConstructorProperties): void
2323
+ }
2324
+
2325
+ module Plugin {
2326
+
2327
+ // Constructor properties interface
2328
+
2329
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2330
+ }
2331
+
2332
+ }
2333
+
2334
+ interface Plugin {
2335
+
2336
+ // Own properties of Grl-0.2.Grl.Plugin
2337
+
2338
+ /**
2339
+ * `TRUE` if plugin is loaded.
2340
+ */
2341
+ readonly loaded: boolean
2342
+
2343
+ // Own fields of Grl-0.2.Grl.Plugin
2344
+
2345
+ parent: GObject.Object
2346
+
2347
+ // Owm methods of Grl-0.2.Grl.Plugin
2348
+
2349
+ /**
2350
+ * Get the author of the plugin
2351
+ * @returns the author of the @plugin
2352
+ */
2353
+ get_author(): string | null
2354
+ /**
2355
+ * Get the description of the plugin
2356
+ * @returns the description of the @plugin
2357
+ */
2358
+ get_description(): string | null
2359
+ /**
2360
+ * Get the filename containing the plugin
2361
+ * @returns the filename containing @plugin
2362
+ */
2363
+ get_filename(): string | null
2364
+ /**
2365
+ * Get the id of the plugin
2366
+ * @returns the id of the @plugin
2367
+ */
2368
+ get_id(): string | null
2369
+ /**
2370
+ * Get the information of the `plugin` that is associated with the given key
2371
+ * @param key a key representing information about this plugin
2372
+ * @returns the information assigned to the given @key or NULL if there is no such information
2373
+ */
2374
+ get_info(key: string | null): string | null
2375
+ /**
2376
+ * Returns a list of keys that can be queried to retrieve information about the
2377
+ * plugin.
2378
+ * @returns a #GList of strings containing the keys. The content of the list is owned by the plugin and should not be modified or freed. Use g_list_free() when done using the list.
2379
+ */
2380
+ get_info_keys(): string[]
2381
+ /**
2382
+ * Get the license of the plugin
2383
+ * @returns the license of the @plugin
2384
+ */
2385
+ get_license(): string | null
2386
+ /**
2387
+ * Get the name of the plugin
2388
+ * @returns the name of the @plugin
2389
+ */
2390
+ get_name(): string | null
2391
+ /**
2392
+ * Get the site of the plugin
2393
+ * @returns the site of the @plugin
2394
+ */
2395
+ get_site(): string | null
2396
+ /**
2397
+ * Gets the sources belonging to `plugin`.
2398
+ * @returns a #GList of #GrlSource<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2399
+ */
2400
+ get_sources(): Source[]
2401
+ /**
2402
+ * Get the version of the plugin
2403
+ * @returns the version of the @plugin
2404
+ */
2405
+ get_version(): string | null
2406
+ /**
2407
+ * Load the plugin
2408
+ * @param configurations a list of configurations
2409
+ * @returns @TRUE if loaded was successful
2410
+ */
2411
+ load(configurations: Config[]): boolean
2412
+ register_keys(): void
2413
+ set_filename(filename: string | null): void
2414
+ set_id(id: string | null): void
2415
+ set_info(key: string | null, value: string | null): void
2416
+ set_load_func(load_function: any | null): void
2417
+ set_module(module: GModule.Module): void
2418
+ set_optional_info(info: GLib.HashTable): void
2419
+ set_register_keys_func(register_keys_function: any | null): void
2420
+ set_unload_func(unload_function: any | null): void
2421
+ unload(): void
2422
+
2423
+ // Class property signals of Grl-0.2.Grl.Plugin
2424
+
2425
+ connect(sigName: "notify::loaded", callback: (($obj: Plugin, pspec: GObject.ParamSpec) => void)): number
2426
+ connect_after(sigName: "notify::loaded", callback: (($obj: Plugin, pspec: GObject.ParamSpec) => void)): number
2427
+ emit(sigName: "notify::loaded", ...args: any[]): void
2428
+ connect(sigName: string, callback: (...args: any[]) => void): number
2429
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2430
+ emit(sigName: string, ...args: any[]): void
2431
+ disconnect(id: number): void
2432
+ }
2433
+
2434
+ class Plugin extends GObject.Object {
2435
+
2436
+ // Own properties of Grl-0.2.Grl.Plugin
2437
+
2438
+ static name: string
2439
+ static $gtype: GObject.GType<Plugin>
2440
+
2441
+ // Constructors of Grl-0.2.Grl.Plugin
2442
+
2443
+ constructor(config?: Plugin.ConstructorProperties)
2444
+ _init(config?: Plugin.ConstructorProperties): void
2445
+ }
2446
+
2447
+ module Registry {
2448
+
2449
+ // Signal callback interfaces
2450
+
2451
+ /**
2452
+ * Signal callback interface for `metadata-key-added`
2453
+ */
2454
+ interface MetadataKeyAddedSignalCallback {
2455
+ ($obj: Registry, key: string | null): void
2456
+ }
2457
+
2458
+ /**
2459
+ * Signal callback interface for `source-added`
2460
+ */
2461
+ interface SourceAddedSignalCallback {
2462
+ ($obj: Registry, source: Source): void
2463
+ }
2464
+
2465
+ /**
2466
+ * Signal callback interface for `source-removed`
2467
+ */
2468
+ interface SourceRemovedSignalCallback {
2469
+ ($obj: Registry, source: Source): void
2470
+ }
2471
+
2472
+
2473
+ // Constructor properties interface
2474
+
2475
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2476
+ }
2477
+
2478
+ }
2479
+
2480
+ interface Registry {
2481
+
2482
+ // Own fields of Grl-0.2.Grl.Registry
2483
+
2484
+ parent: GObject.Object
2485
+
2486
+ // Owm methods of Grl-0.2.Grl.Registry
2487
+
2488
+ /**
2489
+ * Add a configuration for a plugin/source.
2490
+ * @param config a configuration set
2491
+ * @returns %TRUE on success
2492
+ */
2493
+ add_config(config: Config): boolean
2494
+ /**
2495
+ * Load plugin configurations from a .ini-like config file.
2496
+ * @param config_file a key-value file containing the configuration
2497
+ * @returns %TRUE on success
2498
+ */
2499
+ add_config_from_file(config_file: string | null): boolean
2500
+ /**
2501
+ * Load plugin configurations from a .ini-like resource file.
2502
+ * @param resource_path a key-value file containing the configuration
2503
+ * @returns %TRUE on success
2504
+ */
2505
+ add_config_from_resource(resource_path: string | null): boolean
2506
+ /**
2507
+ * Set this path as part of default paths to load plugins.
2508
+ * @param path a path with plugins
2509
+ */
2510
+ add_directory(path: string | null): void
2511
+ /**
2512
+ * Returns a list with all registered keys in system.
2513
+ * @returns a #GList with all the available #GrlKeyID<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2514
+ */
2515
+ get_metadata_keys(): KeyID[]
2516
+ /**
2517
+ * This function will return all the available plugins in the `registry`.
2518
+ *
2519
+ * If `only_loaded` is %TRUE, the plugin list will contain only plugins that are
2520
+ * loaded.
2521
+ * @param only_loaded whether the returned list shall include only loaded plugins
2522
+ * @returns a #GList of available #GrlPlugin<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2523
+ */
2524
+ get_plugins(only_loaded: boolean): Plugin[]
2525
+ /**
2526
+ * This function will return all the available sources in the `registry`.
2527
+ *
2528
+ * If `ranked` is %TRUE, the source list will be ordered by rank.
2529
+ * @param ranked whether the returned list shall be returned ordered by rank
2530
+ * @returns a #GList of available #GrlSource<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2531
+ */
2532
+ get_sources(ranked: boolean): Source[]
2533
+ /**
2534
+ * Give an array of all the available sources in the `registry` capable of
2535
+ * perform the operations requested in `ops`.
2536
+ *
2537
+ * If `ranked` is %TRUE, the source list will be ordered by rank.
2538
+ * @param ops a bitwise mangle of the requested operations.
2539
+ * @param ranked whether the returned list shall be returned ordered by rank
2540
+ * @returns a #GList of available #GrlSource<!-- -->s. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2541
+ */
2542
+ get_sources_by_operations(ops: SupportedOps, ranked: boolean): Source[]
2543
+ /**
2544
+ * Load all the modules available in the default directory path.
2545
+ *
2546
+ * The default directory path can be changed through the environment
2547
+ * variable %GRL_PLUGIN_PATH and it can contain several paths separated
2548
+ * by ":"
2549
+ * @returns %FALSE% is all the configured plugin paths are invalid, %TRUE% otherwise.
2550
+ */
2551
+ load_all_plugins(): boolean
2552
+ /**
2553
+ * Loads a module from shared object file stored in `path`
2554
+ * @param library_filename the path to the so file
2555
+ * @returns %TRUE if the module is loaded correctly
2556
+ */
2557
+ load_plugin(library_filename: string | null): boolean
2558
+ /**
2559
+ * Loads plugin identified by `plugin_id`.
2560
+ *
2561
+ * This requires the XML plugin information file to define a "module" key with
2562
+ * the name of the module that provides the plugin or the absolute path of the
2563
+ * actual module file.
2564
+ * @param plugin_id plugin identifier
2565
+ * @returns %TRUE if the plugin is loaded correctly
2566
+ */
2567
+ load_plugin_by_id(plugin_id: string | null): boolean
2568
+ /**
2569
+ * Loads a set of modules from directory in `path` which contains
2570
+ * a group shared object files.
2571
+ * @param path the path to the directory
2572
+ * @returns %TRUE if the directory is valid.
2573
+ */
2574
+ load_plugin_directory(path: string | null): boolean
2575
+ /**
2576
+ * Look up for the metadata key with name `key_name`.
2577
+ * @param key_name the key name
2578
+ * @returns The metadata key, or GRL_METADATA_KEY_INVALID if not found
2579
+ */
2580
+ lookup_metadata_key(key_name: string | null): KeyID
2581
+ /**
2582
+ * Returns `key` description.
2583
+ * @param key a metadata key
2584
+ * @returns metadata key description, or @NULL if not found
2585
+ */
2586
+ lookup_metadata_key_desc(key: KeyID): string | null
2587
+ /**
2588
+ * Returns `key` name.
2589
+ * @param key a metadata key
2590
+ * @returns metadata key name, or @NULL if not found
2591
+ */
2592
+ lookup_metadata_key_name(key: KeyID): string | null
2593
+ /**
2594
+ * Look up the list of keys that have a relation with `key`.
2595
+ *
2596
+ * `key` is included in that list.
2597
+ * @param key a metadata key
2598
+ * @returns a #GList of related keys, or @NULL if key is invalid.
2599
+ */
2600
+ lookup_metadata_key_relation(key: KeyID): KeyID[]
2601
+ /**
2602
+ * Returns `key` expected value type.
2603
+ * @param key a metadata key
2604
+ * @returns metadata key type, or @G_TYPE_INVALID if not found
2605
+ */
2606
+ lookup_metadata_key_type(key: KeyID): GObject.GType
2607
+ /**
2608
+ * This function will search and retrieve a plugin given its identifier.
2609
+ * @param plugin_id the id of a plugin
2610
+ * @returns The plugin found
2611
+ */
2612
+ lookup_plugin(plugin_id: string | null): Plugin
2613
+ /**
2614
+ * This function will search and retrieve a source given its identifier.
2615
+ * @param source_id the id of a source
2616
+ * @returns The source found.
2617
+ */
2618
+ lookup_source(source_id: string | null): Source
2619
+ /**
2620
+ * Validates `value` content complies with the key specification. That is, it has
2621
+ * the expected type, and value are within the range specified in key (for
2622
+ * integer values).
2623
+ * @param key a metadata key
2624
+ * @param value value to be validate
2625
+ * @returns %TRUE if complies
2626
+ */
2627
+ metadata_key_validate(key: KeyID, value: any): boolean
2628
+ /**
2629
+ * Registers a metadata key
2630
+ * @param param_spec The definition of the key to register
2631
+ * @returns The #GrlKeyID registered.
2632
+ */
2633
+ register_metadata_key(param_spec: GObject.ParamSpec): KeyID
2634
+ /**
2635
+ * Creates a relation between `key1` and `key2`, meaning that the values of both
2636
+ * keys are somehow related.
2637
+ *
2638
+ * One example of a relation would be the one between the URI of a media
2639
+ * resource and its mime-type: they are both tied together and one does not make
2640
+ * sense without the other.
2641
+ *
2642
+ * Relations between keys allow the framework to provide all the data that is
2643
+ * somehow related when any of the related keys are requested.
2644
+ * @param key1 key involved in relationship
2645
+ * @param key2 key involved in relationship
2646
+ */
2647
+ register_metadata_key_relation(key1: KeyID, key2: KeyID): void
2648
+ register_metadata_key_system(param_spec: GObject.ParamSpec, key: KeyID): KeyID
2649
+ /**
2650
+ * Register a `source` in the `registry` with the given `plugin` information
2651
+ * @param plugin the plugin which owns the source
2652
+ * @param source the source to register
2653
+ * @returns %TRUE if success, %FALSE% otherwise.
2654
+ */
2655
+ register_source(plugin: Plugin, source: Source): boolean
2656
+ restrict_plugins(plugins: string | null): void
2657
+ shutdown(): void
2658
+ /**
2659
+ * Unload from memory a module identified by `plugin_id`. This means call the
2660
+ * module's deinit function.
2661
+ * @param plugin_id the identifier of the plugin
2662
+ * @returns %TRUE% on success.
2663
+ */
2664
+ unload_plugin(plugin_id: string | null): boolean
2665
+ /**
2666
+ * Removes the `source` from the `registry` hash table
2667
+ * @param source the source to unregister
2668
+ * @returns %TRUE if success, %FALSE% otherwise.
2669
+ */
2670
+ unregister_source(source: Source): boolean
2671
+
2672
+ // Own signals of Grl-0.2.Grl.Registry
2673
+
2674
+ connect(sigName: "metadata-key-added", callback: Registry.MetadataKeyAddedSignalCallback): number
2675
+ connect_after(sigName: "metadata-key-added", callback: Registry.MetadataKeyAddedSignalCallback): number
2676
+ emit(sigName: "metadata-key-added", key: string | null, ...args: any[]): void
2677
+ connect(sigName: "source-added", callback: Registry.SourceAddedSignalCallback): number
2678
+ connect_after(sigName: "source-added", callback: Registry.SourceAddedSignalCallback): number
2679
+ emit(sigName: "source-added", source: Source, ...args: any[]): void
2680
+ connect(sigName: "source-removed", callback: Registry.SourceRemovedSignalCallback): number
2681
+ connect_after(sigName: "source-removed", callback: Registry.SourceRemovedSignalCallback): number
2682
+ emit(sigName: "source-removed", source: Source, ...args: any[]): void
2683
+
2684
+ // Class property signals of Grl-0.2.Grl.Registry
2685
+
2686
+ connect(sigName: string, callback: (...args: any[]) => void): number
2687
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2688
+ emit(sigName: string, ...args: any[]): void
2689
+ disconnect(id: number): void
2690
+ }
2691
+
2692
+ class Registry extends GObject.Object {
2693
+
2694
+ // Own properties of Grl-0.2.Grl.Registry
2695
+
2696
+ static name: string
2697
+ static $gtype: GObject.GType<Registry>
2698
+
2699
+ // Constructors of Grl-0.2.Grl.Registry
2700
+
2701
+ constructor(config?: Registry.ConstructorProperties)
2702
+ _init(config?: Registry.ConstructorProperties): void
2703
+ /**
2704
+ * As the registry is designed to work as a singleton, this
2705
+ * method is in charge of creating the only instance or
2706
+ * returned it if it is already in memory.
2707
+ * @returns a new or an already created instance of the registry. It is NOT MT-safe
2708
+ */
2709
+ static get_default(): Registry
2710
+ }
2711
+
2712
+ module RelatedKeys {
2713
+
2714
+ // Constructor properties interface
2715
+
2716
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2717
+ }
2718
+
2719
+ }
2720
+
2721
+ interface RelatedKeys {
2722
+
2723
+ // Own fields of Grl-0.2.Grl.RelatedKeys
2724
+
2725
+ parent: GObject.Object
2726
+
2727
+ // Owm methods of Grl-0.2.Grl.RelatedKeys
2728
+
2729
+ /**
2730
+ * Makes a deep copy of `relkeys` and its contents.
2731
+ * @returns a new #GrlRelatedKeys. Free it with #g_object_unref.
2732
+ */
2733
+ dup(): RelatedKeys
2734
+ /**
2735
+ * Get the value associated with `key` from `relkeys`. If it does not contain any
2736
+ * value, %NULL will be returned.
2737
+ * @param key key to look up.
2738
+ * @returns a #GValue. This value should not be modified nor freed by user.
2739
+ */
2740
+ get(key: KeyID): any
2741
+ /**
2742
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2743
+ * or value is not a binary, or `key` is not in `relkeys,` then 0 is returned.
2744
+ * @param key key to use
2745
+ * @returns buffer location associated with @key, or %NULL in other case. If successful @size will be set to the buffer size.
2746
+ */
2747
+ get_binary(key: KeyID): [ /* returnType */ number, /* size */ number ]
2748
+ /**
2749
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2750
+ * or value is not a gboolean, or `key` is not in `relkeys,` then %FALSE is
2751
+ * returned.
2752
+ * @param key key to use
2753
+ * @returns float value associated with @key, or %FALSE in other case.
2754
+ */
2755
+ get_boolean(key: KeyID): boolean
2756
+ /**
2757
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2758
+ * the value is not of a boxed type, or `key` is not in `relkeys,` then %NULL is
2759
+ * returned.
2760
+ * @param key key to use
2761
+ * @returns the #GBoxed value associated with @key if possible, or %NULL in other case. The caller should not change nor free the value.
2762
+ */
2763
+ get_boxed(key: KeyID): any | null
2764
+ /**
2765
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2766
+ * or value is not a gfloat, or `key` is not in `relkeys,` then 0 is returned.
2767
+ * @param key key to use
2768
+ * @returns float value associated with @key, or 0 in other case.
2769
+ */
2770
+ get_float(key: KeyID): number
2771
+ /**
2772
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2773
+ * or value is not a gint, or `key` is not in `relkeys,` then 0 is returned.
2774
+ * @param key key to use
2775
+ * @returns int value associated with @key, or 0 in other case.
2776
+ */
2777
+ get_int(key: KeyID): number
2778
+ /**
2779
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2780
+ * or value is not a gint64, or `key` is not in `relkeys,` then 0 is returned.
2781
+ * @param key key to use
2782
+ * @returns int64 value associated with @key, or 0 in other case.
2783
+ */
2784
+ get_int64(key: KeyID): number
2785
+ /**
2786
+ * Returns a list with keys contained in `relkeys`.
2787
+ * @returns a list with the keys. The content of the list should not be modified or freed. Use g_list_free() when done using the list.
2788
+ */
2789
+ get_keys(): KeyID[]
2790
+ /**
2791
+ * Returns the value associated with `key` from `relkeys`. If `key` has no value,
2792
+ * or value is not string, or `key` is not in `relkeys,` then %NULL is returned.
2793
+ * @param key key to use
2794
+ * @returns string associated with @key, or %NULL in other case. Caller should not change nor free the value.
2795
+ */
2796
+ get_string(key: KeyID): string | null
2797
+ /**
2798
+ * Checks if `key` is in `relkeys`.
2799
+ * @param key key to search
2800
+ * @returns %TRUE if @key is in @relkeys, %FALSE in other case.
2801
+ */
2802
+ has_key(key: KeyID): boolean
2803
+ /**
2804
+ * Removes `key` from `relkeys` set.
2805
+ * @param key key to remove
2806
+ */
2807
+ remove(key: KeyID): void
2808
+ /**
2809
+ * Sets the value associated with `key` into `relkeys`. Old value is freed and
2810
+ * the new one is set.
2811
+ *
2812
+ * Also, checks that `value` is compliant with `key` specification, modifying it
2813
+ * accordingly. For instance, if `key` requires a number between 0 and 10, but
2814
+ * value is outside this range, it will be adapted accordingly.
2815
+ * @param key key to change or add
2816
+ * @param value the new value
2817
+ */
2818
+ set(key: KeyID, value: any): void
2819
+ /**
2820
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2821
+ * registered as a binary-type key. Old value is replaced by the new one.
2822
+ * @param key key to change or add
2823
+ * @param buf buffer holding the relkeys
2824
+ * @param size size of the buffer
2825
+ */
2826
+ set_binary(key: KeyID, buf: number, size: number): void
2827
+ /**
2828
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2829
+ * registered as a boolean-type key. Old value is replaced by the new one.
2830
+ * @param key key to change or add
2831
+ * @param booleanvalue the new value
2832
+ */
2833
+ set_boolean(key: KeyID, booleanvalue: boolean): void
2834
+ /**
2835
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2836
+ * registered as a boxed-type key. Old value is freed and the new one is set.
2837
+ * @param key key to change or add
2838
+ * @param boxed the new value
2839
+ */
2840
+ set_boxed(key: KeyID, boxed: any | null): void
2841
+ /**
2842
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2843
+ * registered as a float-type key. Old value is replaced by the new one.
2844
+ * @param key key to change or add
2845
+ * @param floatvalue the new value
2846
+ */
2847
+ set_float(key: KeyID, floatvalue: number): void
2848
+ /**
2849
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2850
+ * registered as an int-type key. Old value is replaced by the new one.
2851
+ * @param key key to change or add
2852
+ * @param intvalue the new value
2853
+ */
2854
+ set_int(key: KeyID, intvalue: number): void
2855
+ /**
2856
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2857
+ * registered as a int64-type key. Old value is replaced by the new one.
2858
+ * @param key key to change or add
2859
+ * @param intvalue the new value
2860
+ */
2861
+ set_int64(key: KeyID, intvalue: number): void
2862
+ /**
2863
+ * Sets the value associated with `key` into `relkeys`. `key` must have been
2864
+ * registered as a strying-type key. Old value is freed and the new one is set.
2865
+ * @param key key to change or add
2866
+ * @param strvalue the new value
2867
+ */
2868
+ set_string(key: KeyID, strvalue: string | null): void
2869
+
2870
+ // Class property signals of Grl-0.2.Grl.RelatedKeys
2871
+
2872
+ connect(sigName: string, callback: (...args: any[]) => void): number
2873
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
2874
+ emit(sigName: string, ...args: any[]): void
2875
+ disconnect(id: number): void
2876
+ }
2877
+
2878
+ class RelatedKeys extends GObject.Object {
2879
+
2880
+ // Own properties of Grl-0.2.Grl.RelatedKeys
2881
+
2882
+ static name: string
2883
+ static $gtype: GObject.GType<RelatedKeys>
2884
+
2885
+ // Constructors of Grl-0.2.Grl.RelatedKeys
2886
+
2887
+ constructor(config?: RelatedKeys.ConstructorProperties)
2888
+ /**
2889
+ * Creates a new #GrlRelatedKeys instance that can be used to store related
2890
+ * keys and their values.
2891
+ * @constructor
2892
+ * @returns a new object.
2893
+ */
2894
+ constructor()
2895
+ /**
2896
+ * Creates a new #GrlRelatedKeys instance that can be used to store related
2897
+ * keys and their values.
2898
+ * @constructor
2899
+ * @returns a new object.
2900
+ */
2901
+ static new(): RelatedKeys
2902
+ _init(config?: RelatedKeys.ConstructorProperties): void
2903
+ }
2904
+
2905
+ module Source {
2906
+
2907
+ // Signal callback interfaces
2908
+
2909
+ /**
2910
+ * Signal callback interface for `content-changed`
2911
+ */
2912
+ interface ContentChangedSignalCallback {
2913
+ ($obj: Source, changed_medias: Media[], change_type: SourceChangeType, location_unknown: boolean): void
2914
+ }
2915
+
2916
+
2917
+ // Constructor properties interface
2918
+
2919
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
2920
+
2921
+ // Own constructor properties of Grl-0.2.Grl.Source
2922
+
2923
+ /**
2924
+ * Transparently split queries with count requests
2925
+ * bigger than a certain threshold into smaller queries.
2926
+ */
2927
+ auto_split_threshold?: number | null
2928
+ /**
2929
+ * Plugin the source belongs to
2930
+ */
2931
+ plugin?: Plugin | null
2932
+ /**
2933
+ * Source rank
2934
+ */
2935
+ rank?: number | null
2936
+ /**
2937
+ * A description of the source
2938
+ */
2939
+ source_desc?: string | null
2940
+ /**
2941
+ * #GIcon representing the source
2942
+ */
2943
+ source_icon?: Gio.Icon | null
2944
+ /**
2945
+ * The identifier of the source.
2946
+ */
2947
+ source_id?: string | null
2948
+ /**
2949
+ * The name of the source.
2950
+ */
2951
+ source_name?: string | null
2952
+ /**
2953
+ * A string array of tags relevant this source.
2954
+ *
2955
+ * The tags are arbitrary, and applications should just pass over the tags
2956
+ * it does not understand. Applications would usually use this to either
2957
+ * group sources together, or hide certain sources: a radio application
2958
+ * would filter for %GRL_MEDIA_TYPE_AUDIO in GrlSource::supported-media as
2959
+ * well as "radio" being listed in the tags.
2960
+ *
2961
+ * To avoid irrelevant content being listed in applications, sources
2962
+ * such as generic video sites should not be tagged as "cinema" or
2963
+ * "tv" as they contain a lot of content that's not either of those.
2964
+ *
2965
+ * This is a list of commonly used values:
2966
+ *
2967
+ * - "cinema", or "tv"
2968
+ * The content served is from cinema or TV sources. For example, a
2969
+ * source for movie trailers would select the former, a source for
2970
+ * streaming live TV would select the latter.
2971
+ *
2972
+ * - "radio"
2973
+ * The content served is from streaming radios.
2974
+ *
2975
+ * - "music"
2976
+ * The content served is music, for example, music stores such as
2977
+ * Jamendo or Magnatune.
2978
+ *
2979
+ * - "country:country-code"
2980
+ * The content is mostly relevant to users from a particular country,
2981
+ * such as a national broadcaster. For example, BBC content would be
2982
+ * tagged as "country:uk". Country codes should be an ISO-639-1 or
2983
+ * ISO-639-2 code.
2984
+ *
2985
+ * - "protocol:protocol-name"
2986
+ * The content browsing or searching uses a particular protocol, such
2987
+ * as DLNA/UPnP or DMAP/DAAP. This makes it easier to whitelist or
2988
+ * blacklist sources rather than matching the implementation specific
2989
+ * source ID. Examples are "protocol:dlna" and "protocol:dmap".
2990
+ *
2991
+ * - "localhost", or "localuser"
2992
+ * The content is served from the machine the application is running on,
2993
+ * or by an application the user is running. Applications might choose to
2994
+ * avoid showing the user's own data in their interfaces, or integrate it
2995
+ * in the user's local collection.
2996
+ *
2997
+ * "net:local", or "net:internet"
2998
+ * The source requires a connection to the local network, or a connection
2999
+ * to the Internet. Sources with those tags will be automatically hidden
3000
+ * from the application's reach when such networks aren't available, or
3001
+ * we're not connected to a network.
3002
+ *
3003
+ * "net:plaintext"
3004
+ * The source makes requests over plain text, non-encrypted, network channels,
3005
+ * such as using HTTP to do searches or lookups. Applications would usually
3006
+ * disable those by default, so that privacy is respected by default, and no
3007
+ * data is leaked unintentionally.
3008
+ */
3009
+ source_tags?: string[] | null
3010
+ /**
3011
+ * List of supported media types by this source.
3012
+ */
3013
+ supported_media?: MediaType | null
3014
+ }
3015
+
3016
+ }
3017
+
3018
+ interface Source {
3019
+
3020
+ // Own properties of Grl-0.2.Grl.Source
3021
+
3022
+ /**
3023
+ * Transparently split queries with count requests
3024
+ * bigger than a certain threshold into smaller queries.
3025
+ */
3026
+ auto_split_threshold: number
3027
+ /**
3028
+ * Plugin the source belongs to
3029
+ */
3030
+ plugin: Plugin
3031
+ /**
3032
+ * Source rank
3033
+ */
3034
+ rank: number
3035
+ /**
3036
+ * A description of the source
3037
+ */
3038
+ source_desc: string | null
3039
+ /**
3040
+ * #GIcon representing the source
3041
+ */
3042
+ source_icon: Gio.Icon
3043
+ /**
3044
+ * The identifier of the source.
3045
+ */
3046
+ source_id: string | null
3047
+ /**
3048
+ * The name of the source.
3049
+ */
3050
+ source_name: string | null
3051
+ /**
3052
+ * A string array of tags relevant this source.
3053
+ *
3054
+ * The tags are arbitrary, and applications should just pass over the tags
3055
+ * it does not understand. Applications would usually use this to either
3056
+ * group sources together, or hide certain sources: a radio application
3057
+ * would filter for %GRL_MEDIA_TYPE_AUDIO in GrlSource::supported-media as
3058
+ * well as "radio" being listed in the tags.
3059
+ *
3060
+ * To avoid irrelevant content being listed in applications, sources
3061
+ * such as generic video sites should not be tagged as "cinema" or
3062
+ * "tv" as they contain a lot of content that's not either of those.
3063
+ *
3064
+ * This is a list of commonly used values:
3065
+ *
3066
+ * - "cinema", or "tv"
3067
+ * The content served is from cinema or TV sources. For example, a
3068
+ * source for movie trailers would select the former, a source for
3069
+ * streaming live TV would select the latter.
3070
+ *
3071
+ * - "radio"
3072
+ * The content served is from streaming radios.
3073
+ *
3074
+ * - "music"
3075
+ * The content served is music, for example, music stores such as
3076
+ * Jamendo or Magnatune.
3077
+ *
3078
+ * - "country:country-code"
3079
+ * The content is mostly relevant to users from a particular country,
3080
+ * such as a national broadcaster. For example, BBC content would be
3081
+ * tagged as "country:uk". Country codes should be an ISO-639-1 or
3082
+ * ISO-639-2 code.
3083
+ *
3084
+ * - "protocol:protocol-name"
3085
+ * The content browsing or searching uses a particular protocol, such
3086
+ * as DLNA/UPnP or DMAP/DAAP. This makes it easier to whitelist or
3087
+ * blacklist sources rather than matching the implementation specific
3088
+ * source ID. Examples are "protocol:dlna" and "protocol:dmap".
3089
+ *
3090
+ * - "localhost", or "localuser"
3091
+ * The content is served from the machine the application is running on,
3092
+ * or by an application the user is running. Applications might choose to
3093
+ * avoid showing the user's own data in their interfaces, or integrate it
3094
+ * in the user's local collection.
3095
+ *
3096
+ * "net:local", or "net:internet"
3097
+ * The source requires a connection to the local network, or a connection
3098
+ * to the Internet. Sources with those tags will be automatically hidden
3099
+ * from the application's reach when such networks aren't available, or
3100
+ * we're not connected to a network.
3101
+ *
3102
+ * "net:plaintext"
3103
+ * The source makes requests over plain text, non-encrypted, network channels,
3104
+ * such as using HTTP to do searches or lookups. Applications would usually
3105
+ * disable those by default, so that privacy is respected by default, and no
3106
+ * data is leaked unintentionally.
3107
+ */
3108
+ source_tags: string[]
3109
+ /**
3110
+ * List of supported media types by this source.
3111
+ */
3112
+ supported_media: MediaType
3113
+
3114
+ // Own fields of Grl-0.2.Grl.Source
3115
+
3116
+ parent: GObject.Object
3117
+
3118
+ // Owm methods of Grl-0.2.Grl.Source
3119
+
3120
+ /**
3121
+ * Browse from media elements through an available list.
3122
+ *
3123
+ * This method is asynchronous.
3124
+ * @param container a container of data transfer objects
3125
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3126
+ * @param options options wanted for that operation
3127
+ * @param callback the user defined callback
3128
+ * @returns the operation identifier
3129
+ */
3130
+ browse(container: Media | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
3131
+ /**
3132
+ * Browse media elements through an available
3133
+ * list.
3134
+ *
3135
+ * This method is synchronous.
3136
+ * @param container a container of data transfer objects
3137
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3138
+ * @param options options wanted for that operation
3139
+ * @returns a #GList with #GrlMedia elements. After use g_object_unref() every element and g_list_free() the list.
3140
+ */
3141
+ browse_sync(container: Media | null, keys: KeyID[], options: OperationOptions): Media[]
3142
+ /**
3143
+ * Gets how much elements the source is able to handle in a single request.
3144
+ *
3145
+ * See #grl_source_set_auto_split_threshold()
3146
+ * @returns the assigned threshold, or 0 if there is no threshold
3147
+ */
3148
+ get_auto_split_threshold(): number
3149
+ /**
3150
+ * Get the capabilities of `source` for `operation`.
3151
+ * @param operation a supported operation. Even though the type allows to specify several operations, only one should be provided here.
3152
+ * @returns The capabilities
3153
+ */
3154
+ get_caps(operation: SupportedOps): Caps
3155
+ get_description(): string | null
3156
+ get_icon(): Gio.Icon
3157
+ get_id(): string | null
3158
+ /**
3159
+ * Creates an instance of #GrlMedia representing the media resource
3160
+ * exposed at `uri`.
3161
+ *
3162
+ * It is recommended to call grl_source_test_media_from_uri() before invoking
3163
+ * this to check whether the target source can theoretically do the resolution.
3164
+ *
3165
+ * This method is asynchronous.
3166
+ * @param uri A URI that can be used to identify a media resource
3167
+ * @param keys A list of keys to resolve
3168
+ * @param options options wanted for that operation
3169
+ * @param callback the user defined callback
3170
+ * @returns the operation identifier
3171
+ */
3172
+ get_media_from_uri(uri: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResolveCb): number
3173
+ /**
3174
+ * Creates an instance of #GrlMedia representing the media resource
3175
+ * exposed at `uri`.
3176
+ *
3177
+ * It is recommended to call grl_source_test_media_from_uri() before
3178
+ * invoking this to check whether the target source can theoretically do the
3179
+ * resolution.
3180
+ *
3181
+ * This method is synchronous.
3182
+ * @param uri A URI that can be used to identify a media resource
3183
+ * @param keys a list of keys to resolve
3184
+ * @param options options wanted for that operation
3185
+ * @returns a filled #GrlMedia
3186
+ */
3187
+ get_media_from_uri_sync(uri: string | null, keys: KeyID[], options: OperationOptions): Media
3188
+ get_name(): string | null
3189
+ get_plugin(): Plugin
3190
+ /**
3191
+ * Gets the source rank
3192
+ * @returns rank value
3193
+ */
3194
+ get_rank(): number
3195
+ /**
3196
+ * Gets the supported type of medias `source` can deal with.
3197
+ * @returns a #GrlMediaType value
3198
+ */
3199
+ get_supported_media(): MediaType
3200
+ get_tags(): string[]
3201
+ /**
3202
+ * Checks whether `key_id` may be resolved with `source` for `media,` so that the
3203
+ * caller can avoid calling grl_source_resolve() if it can be known in
3204
+ * advance it will fail.
3205
+ *
3206
+ * If the resolution is known to be impossible because more keys are needed in
3207
+ * `media,` and `missing_keys` is not `NULL,` it is populated with the list of
3208
+ * GrlKeyID that would be needed.
3209
+ *
3210
+ * This function is synchronous and should not block.
3211
+ * @param media a media on which we want more metadata
3212
+ * @param key_id the key corresponding to a metadata we might want
3213
+ * @param missing_keys an optional originally empty list
3214
+ * @returns @TRUE if there's a possibility that @source resolves @key_id for @media, @FALSE otherwise.
3215
+ */
3216
+ may_resolve(media: Media, key_id: KeyID, missing_keys: KeyID[]): boolean
3217
+ /**
3218
+ * Emits "content-changed" signal to notify subscribers that a change ocurred
3219
+ * in `source`.
3220
+ *
3221
+ * See #grl_source_notify_change_list() function.
3222
+ *
3223
+ * <note>
3224
+ * <para>
3225
+ * This function is intended to be used only by plugins.
3226
+ * </para>
3227
+ * </note>
3228
+ * @param media the media which has changed, or `NULL` to use the root box.
3229
+ * @param change_type the type of change
3230
+ * @param location_unknown if change has happened in `media` or any descendant
3231
+ */
3232
+ notify_change(media: Media | null, change_type: SourceChangeType, location_unknown: boolean): void
3233
+ /**
3234
+ * Emits "content-changed" signal to notify subscribers that a change ocurred
3235
+ * in `source`.
3236
+ *
3237
+ * The function will take ownership of `changed` medias and it should not be
3238
+ * manipulated in any way by the caller after invoking this function. If that is
3239
+ * needed, the caller must ref the array in advance.
3240
+ *
3241
+ * See GrlSource::content-changed signal.
3242
+ *
3243
+ * <note>
3244
+ * <para>
3245
+ * This function is intended to be used only by plugins.
3246
+ * </para>
3247
+ * </note>
3248
+ * @param changed_medias the list of medias that have changed
3249
+ * @param change_type the type of change
3250
+ * @param location_unknown if change has happpened in `media` or any descendant
3251
+ */
3252
+ notify_change_list(changed_medias: Media[], change_type: SourceChangeType, location_unknown: boolean): void
3253
+ /**
3254
+ * Starts emitting ::content-changed signals when `source` discovers changes in
3255
+ * the content. This instructs `source` to setup the machinery needed to be aware
3256
+ * of changes in the content.
3257
+ * @returns @TRUE if initialization has succeed.
3258
+ */
3259
+ notify_change_start(): boolean
3260
+ /**
3261
+ * This will drop emission of ::content-changed signals from `source`. When this
3262
+ * is done `source` should stop the machinery required for it to track changes in
3263
+ * the content.
3264
+ * @returns @TRUE if stop has succeed.
3265
+ */
3266
+ notify_change_stop(): boolean
3267
+ /**
3268
+ * Execute a specialized query (specific for each provider) on a media
3269
+ * repository.
3270
+ *
3271
+ * It is different from grl_source_search() semantically, because the query
3272
+ * implies a carefully crafted string, rather than a simple string to search.
3273
+ *
3274
+ * This method is asynchronous.
3275
+ * @param query the query to process
3276
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3277
+ * @param options options wanted for that operation
3278
+ * @param callback the user defined callback
3279
+ * @returns the operation identifier
3280
+ */
3281
+ query(query: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
3282
+ /**
3283
+ * Execute a specialized query (specific for each provider) on a media
3284
+ * repository.
3285
+ *
3286
+ * This method is synchronous.
3287
+ * @param query the query to process
3288
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3289
+ * @param options options wanted for that operation
3290
+ * @returns a #GList with #GrlMedia elements. After use g_object_unref() every element and g_list_free() the list.
3291
+ */
3292
+ query_sync(query: string | null, keys: KeyID[], options: OperationOptions): Media[]
3293
+ /**
3294
+ * Remove a `media` from the `source` repository.
3295
+ *
3296
+ * This method is asynchronous.
3297
+ * @param media a data transfer object
3298
+ * @param callback the user defined callback
3299
+ */
3300
+ remove(media: Media, callback: SourceRemoveCb): void
3301
+ /**
3302
+ * Remove a `media` from the `source` repository.
3303
+ *
3304
+ * This method is synchronous.
3305
+ * @param media a data transfer object
3306
+ */
3307
+ remove_sync(media: Media): void
3308
+ /**
3309
+ * This method is intended to fetch the requested keys of metadata of
3310
+ * a given `media` to the media source.
3311
+ *
3312
+ * This method is asynchronous.
3313
+ * @param media a data transfer object
3314
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3315
+ * @param options options to pass to this operation
3316
+ * @param callback the user defined callback
3317
+ * @returns the operation identifie
3318
+ */
3319
+ resolve(media: Media | null, keys: KeyID[], options: OperationOptions, callback: SourceResolveCb): number
3320
+ /**
3321
+ * This method is intended to fetch the requested keys of metadata of
3322
+ * a given `media` to the media source.
3323
+ *
3324
+ * This method is synchronous.
3325
+ * @param media a data transfer object
3326
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3327
+ * @param options options to pass to this operation
3328
+ * @returns a filled #GrlMedia
3329
+ */
3330
+ resolve_sync(media: Media | null, keys: KeyID[], options: OperationOptions): Media
3331
+ /**
3332
+ * Search for the `text` string in a source for data identified with that string.
3333
+ *
3334
+ * If `text` is `NULL` then no text filter will be applied, and thus, no media
3335
+ * items from `source` will be filtered. If `source` does not support NULL-text
3336
+ * search operations it should notiy the client by setting
3337
+ * `GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED` in `callback'`s error parameter.
3338
+ *
3339
+ * This method is asynchronous.
3340
+ * @param text the text to search
3341
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3342
+ * @param options options wanted for that operation
3343
+ * @param callback the user defined callback
3344
+ * @returns the operation identifier
3345
+ */
3346
+ search(text: string | null, keys: KeyID[], options: OperationOptions, callback: SourceResultCb): number
3347
+ /**
3348
+ * Search for the `text` string in a source for data identified with that string.
3349
+ *
3350
+ * If `text` is `NULL` then no text filter will be applied, and thus, no media
3351
+ * items from `source` will be filtered. If `source` does not support NULL-text
3352
+ * search operations it should notiy the client by setting
3353
+ * `GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED` in the error parameter.
3354
+ *
3355
+ * This method is synchronous.
3356
+ * @param text the text to search
3357
+ * @param keys the #GList of #GrlKeyID<!-- -->s to request
3358
+ * @param options options wanted for that operation
3359
+ * @returns a #GList with #GrlMedia elements. After use g_object_unref() every element and g_list_free() the list.
3360
+ */
3361
+ search_sync(text: string | null, keys: KeyID[], options: OperationOptions): Media[]
3362
+ /**
3363
+ * Sets how much elements the source is able to handle in a single request.
3364
+ *
3365
+ * If user, during a search or browsing operation, asks for more elements than
3366
+ * the threshold, the request will be automatically splitted in chunks, so up to
3367
+ * `threshold` elements will be asked in each request.
3368
+ *
3369
+ * Source will act as if user were asking just a chunk, and user won't notice
3370
+ * that the request was chunked.
3371
+ *
3372
+ * <note>
3373
+ * <para>
3374
+ * This function is intended to be used only by plugins.
3375
+ * </para>
3376
+ * </note>
3377
+ * @param threshold the threshold to set
3378
+ */
3379
+ set_auto_split_threshold(threshold: number): void
3380
+ /**
3381
+ * Similar to grl_source_supported_keys(), but these keys
3382
+ * are marked as slow because of the amount of traffic/processing needed
3383
+ * to fetch them.
3384
+ * @returns a #GList with the keys
3385
+ */
3386
+ slow_keys(): KeyID[]
3387
+ /**
3388
+ * Store the `media` into the `parent` container
3389
+ *
3390
+ * This method is asynchronous.
3391
+ * @param parent a parent to store the data transfer objects
3392
+ * @param media a data transfer object
3393
+ * @param flags flags to configure specific behaviour of the operation
3394
+ * @param callback the user defined callback
3395
+ */
3396
+ store(parent: MediaBox | null, media: Media, flags: WriteFlags, callback: SourceStoreCb): void
3397
+ /**
3398
+ * Get the values for `keys` from `media` and store it permanently. After
3399
+ * calling this method, future queries that return this media object
3400
+ * shall return this new values for the selected keys.
3401
+ *
3402
+ * This function is asynchronous and uses the Glib's main loop.
3403
+ * @param media the #GrlMedia object that we want to operate on.
3404
+ * @param keys a list of #GrlKeyID whose values we want to change.
3405
+ * @param flags Flags to configure specific behaviors of the operation.
3406
+ * @param callback the callback to execute when the operation is finished.
3407
+ */
3408
+ store_metadata(media: Media, keys: KeyID[] | null, flags: WriteFlags, callback: SourceStoreCb): void
3409
+ /**
3410
+ * Update `keys` values from `media` in the `source`. After calling this method,
3411
+ * future queries that return this media object shall return this new value for
3412
+ * the selected key.
3413
+ *
3414
+ * This function is synchronous.
3415
+ * @param media the #GrlMedia object that we want to operate on
3416
+ * @param keys a list of #GrlKeyID whose values we want to change
3417
+ * @param flags Flags to configure specific behaviors of the operation.
3418
+ * @returns a #GList of keys that could not be updated, or @NULL
3419
+ */
3420
+ store_metadata_sync(media: Media, keys: KeyID[] | null, flags: WriteFlags): KeyID[]
3421
+ /**
3422
+ * Store the `media` into the `parent` container.
3423
+ *
3424
+ * This method is synchronous.
3425
+ * @param parent a #GrlMediaBox to store the data transfer objects
3426
+ * @param media a #GrlMedia data transfer object
3427
+ * @param flags flags to configure specific behaviour of the operation
3428
+ */
3429
+ store_sync(parent: MediaBox | null, media: Media, flags: WriteFlags): void
3430
+ /**
3431
+ * Get a list of #GrlKeyID, which describe a metadata types that this
3432
+ * source can fetch and store.
3433
+ * @returns a #GList with the keys
3434
+ */
3435
+ supported_keys(): KeyID[]
3436
+ /**
3437
+ * By default the derived objects of #GrlSource can only resolve.
3438
+ * @returns a bitwise mangle with the supported operations by the source
3439
+ */
3440
+ supported_operations(): number
3441
+ /**
3442
+ * Tests whether `source` can instantiate a #GrlMedia object representing
3443
+ * the media resource exposed at `uri`.
3444
+ * @param uri A URI that can be used to identify a media resource
3445
+ * @returns %TRUE if it can, %FALSE otherwise. This method is synchronous.
3446
+ */
3447
+ test_media_from_uri(uri: string | null): boolean
3448
+ /**
3449
+ * Similar to grl_source_supported_keys(), but these keys
3450
+ * are marked as writable, meaning the source allows the client
3451
+ * to provide new values for these keys that will be stored permanently.
3452
+ * @returns a #GList with the keys
3453
+ */
3454
+ writable_keys(): KeyID[]
3455
+
3456
+ // Own virtual methods of Grl-0.2.Grl.Source
3457
+
3458
+ vfunc_browse(bs: SourceBrowseSpec): void
3459
+ vfunc_cancel(operation_id: number): void
3460
+ /**
3461
+ * Get the capabilities of `source` for `operation`.
3462
+ * @virtual
3463
+ * @param operation a supported operation. Even though the type allows to specify several operations, only one should be provided here.
3464
+ * @returns The capabilities
3465
+ */
3466
+ vfunc_get_caps(operation: SupportedOps): Caps
3467
+ /**
3468
+ * Checks whether `key_id` may be resolved with `source` for `media,` so that the
3469
+ * caller can avoid calling grl_source_resolve() if it can be known in
3470
+ * advance it will fail.
3471
+ *
3472
+ * If the resolution is known to be impossible because more keys are needed in
3473
+ * `media,` and `missing_keys` is not `NULL,` it is populated with the list of
3474
+ * GrlKeyID that would be needed.
3475
+ *
3476
+ * This function is synchronous and should not block.
3477
+ * @virtual
3478
+ * @param media a media on which we want more metadata
3479
+ * @param key_id the key corresponding to a metadata we might want
3480
+ * @param missing_keys an optional originally empty list
3481
+ * @returns @TRUE if there's a possibility that @source resolves @key_id for @media, @FALSE otherwise.
3482
+ */
3483
+ vfunc_may_resolve(media: Media, key_id: KeyID, missing_keys: KeyID[]): boolean
3484
+ vfunc_media_from_uri(mfus: SourceMediaFromUriSpec): void
3485
+ /**
3486
+ * Starts emitting ::content-changed signals when `source` discovers changes in
3487
+ * the content. This instructs `source` to setup the machinery needed to be aware
3488
+ * of changes in the content.
3489
+ * @virtual
3490
+ * @returns @TRUE if initialization has succeed.
3491
+ */
3492
+ vfunc_notify_change_start(): boolean
3493
+ /**
3494
+ * This will drop emission of ::content-changed signals from `source`. When this
3495
+ * is done `source` should stop the machinery required for it to track changes in
3496
+ * the content.
3497
+ * @virtual
3498
+ * @returns @TRUE if stop has succeed.
3499
+ */
3500
+ vfunc_notify_change_stop(): boolean
3501
+ vfunc_query(qs: SourceQuerySpec): void
3502
+ vfunc_remove(rs: SourceRemoveSpec): void
3503
+ vfunc_resolve(ms: SourceResolveSpec): void
3504
+ vfunc_search(ss: SourceSearchSpec): void
3505
+ /**
3506
+ * Similar to grl_source_supported_keys(), but these keys
3507
+ * are marked as slow because of the amount of traffic/processing needed
3508
+ * to fetch them.
3509
+ * @virtual
3510
+ * @returns a #GList with the keys
3511
+ */
3512
+ vfunc_slow_keys(): KeyID[]
3513
+ vfunc_store(ss: SourceStoreSpec): void
3514
+ vfunc_store_metadata(sms: SourceStoreMetadataSpec): void
3515
+ /**
3516
+ * Get a list of #GrlKeyID, which describe a metadata types that this
3517
+ * source can fetch and store.
3518
+ * @virtual
3519
+ * @returns a #GList with the keys
3520
+ */
3521
+ vfunc_supported_keys(): KeyID[]
3522
+ vfunc_supported_operations(): SupportedOps
3523
+ /**
3524
+ * Tests whether `source` can instantiate a #GrlMedia object representing
3525
+ * the media resource exposed at `uri`.
3526
+ * @virtual
3527
+ * @param uri A URI that can be used to identify a media resource
3528
+ * @returns %TRUE if it can, %FALSE otherwise. This method is synchronous.
3529
+ */
3530
+ vfunc_test_media_from_uri(uri: string | null): boolean
3531
+ /**
3532
+ * Similar to grl_source_supported_keys(), but these keys
3533
+ * are marked as writable, meaning the source allows the client
3534
+ * to provide new values for these keys that will be stored permanently.
3535
+ * @virtual
3536
+ * @returns a #GList with the keys
3537
+ */
3538
+ vfunc_writable_keys(): KeyID[]
3539
+
3540
+ // Own signals of Grl-0.2.Grl.Source
3541
+
3542
+ connect(sigName: "content-changed", callback: Source.ContentChangedSignalCallback): number
3543
+ connect_after(sigName: "content-changed", callback: Source.ContentChangedSignalCallback): number
3544
+ emit(sigName: "content-changed", changed_medias: Media[], change_type: SourceChangeType, location_unknown: boolean, ...args: any[]): void
3545
+
3546
+ // Class property signals of Grl-0.2.Grl.Source
3547
+
3548
+ connect(sigName: "notify::auto-split-threshold", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3549
+ connect_after(sigName: "notify::auto-split-threshold", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3550
+ emit(sigName: "notify::auto-split-threshold", ...args: any[]): void
3551
+ connect(sigName: "notify::plugin", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3552
+ connect_after(sigName: "notify::plugin", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3553
+ emit(sigName: "notify::plugin", ...args: any[]): void
3554
+ connect(sigName: "notify::rank", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3555
+ connect_after(sigName: "notify::rank", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3556
+ emit(sigName: "notify::rank", ...args: any[]): void
3557
+ connect(sigName: "notify::source-desc", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3558
+ connect_after(sigName: "notify::source-desc", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3559
+ emit(sigName: "notify::source-desc", ...args: any[]): void
3560
+ connect(sigName: "notify::source-icon", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3561
+ connect_after(sigName: "notify::source-icon", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3562
+ emit(sigName: "notify::source-icon", ...args: any[]): void
3563
+ connect(sigName: "notify::source-id", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3564
+ connect_after(sigName: "notify::source-id", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3565
+ emit(sigName: "notify::source-id", ...args: any[]): void
3566
+ connect(sigName: "notify::source-name", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3567
+ connect_after(sigName: "notify::source-name", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3568
+ emit(sigName: "notify::source-name", ...args: any[]): void
3569
+ connect(sigName: "notify::source-tags", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3570
+ connect_after(sigName: "notify::source-tags", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3571
+ emit(sigName: "notify::source-tags", ...args: any[]): void
3572
+ connect(sigName: "notify::supported-media", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3573
+ connect_after(sigName: "notify::supported-media", callback: (($obj: Source, pspec: GObject.ParamSpec) => void)): number
3574
+ emit(sigName: "notify::supported-media", ...args: any[]): void
3575
+ connect(sigName: string, callback: (...args: any[]) => void): number
3576
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
3577
+ emit(sigName: string, ...args: any[]): void
3578
+ disconnect(id: number): void
3579
+ }
3580
+
3581
+ class Source extends GObject.Object {
3582
+
3583
+ // Own properties of Grl-0.2.Grl.Source
3584
+
3585
+ static name: string
3586
+ static $gtype: GObject.GType<Source>
3587
+
3588
+ // Constructors of Grl-0.2.Grl.Source
3589
+
3590
+ constructor(config?: Source.ConstructorProperties)
3591
+ _init(config?: Source.ConstructorProperties): void
3592
+ }
3593
+
3594
+ interface CapsClass {
3595
+
3596
+ // Own fields of Grl-0.2.Grl.CapsClass
3597
+
3598
+ /**
3599
+ * the parent class structure
3600
+ * @field
3601
+ */
3602
+ parent: GObject.ObjectClass
3603
+ }
3604
+
3605
+ /**
3606
+ * Grilo Capabilities class.
3607
+ * @record
3608
+ */
3609
+ abstract class CapsClass {
3610
+
3611
+ // Own properties of Grl-0.2.Grl.CapsClass
3612
+
3613
+ static name: string
3614
+ }
3615
+
3616
+ interface CapsPrivate {
3617
+ }
3618
+
3619
+ class CapsPrivate {
3620
+
3621
+ // Own properties of Grl-0.2.Grl.CapsPrivate
3622
+
3623
+ static name: string
3624
+ }
3625
+
3626
+ interface ConfigClass {
3627
+
3628
+ // Own fields of Grl-0.2.Grl.ConfigClass
3629
+
3630
+ /**
3631
+ * the parent class structure
3632
+ * @field
3633
+ */
3634
+ parent_class: GObject.ObjectClass
3635
+ }
3636
+
3637
+ /**
3638
+ * Grilo Config Class
3639
+ * @record
3640
+ */
3641
+ abstract class ConfigClass {
3642
+
3643
+ // Own properties of Grl-0.2.Grl.ConfigClass
3644
+
3645
+ static name: string
3646
+ }
3647
+
3648
+ interface ConfigPrivate {
3649
+ }
3650
+
3651
+ class ConfigPrivate {
3652
+
3653
+ // Own properties of Grl-0.2.Grl.ConfigPrivate
3654
+
3655
+ static name: string
3656
+ }
3657
+
3658
+ interface DataClass {
3659
+
3660
+ // Own fields of Grl-0.2.Grl.DataClass
3661
+
3662
+ /**
3663
+ * the parent class structure
3664
+ * @field
3665
+ */
3666
+ parent_class: GObject.ObjectClass
3667
+ }
3668
+
3669
+ /**
3670
+ * Grilo Data class
3671
+ * @record
3672
+ */
3673
+ abstract class DataClass {
3674
+
3675
+ // Own properties of Grl-0.2.Grl.DataClass
3676
+
3677
+ static name: string
3678
+ }
3679
+
3680
+ interface DataPrivate {
3681
+ }
3682
+
3683
+ class DataPrivate {
3684
+
3685
+ // Own properties of Grl-0.2.Grl.DataPrivate
3686
+
3687
+ static name: string
3688
+ }
3689
+
3690
+ interface LogDomain {
3691
+
3692
+ // Owm methods of Grl-0.2.Grl.LogDomain
3693
+
3694
+ /**
3695
+ * Releases `domain`.
3696
+ */
3697
+ free(): void
3698
+ }
3699
+
3700
+ class LogDomain {
3701
+
3702
+ // Own properties of Grl-0.2.Grl.LogDomain
3703
+
3704
+ static name: string
3705
+ }
3706
+
3707
+ interface MediaAudioClass {
3708
+
3709
+ // Own fields of Grl-0.2.Grl.MediaAudioClass
3710
+
3711
+ /**
3712
+ * the parent class structure
3713
+ * @field
3714
+ */
3715
+ parent_class: MediaClass
3716
+ }
3717
+
3718
+ /**
3719
+ * Grilo Media audio Class
3720
+ * @record
3721
+ */
3722
+ abstract class MediaAudioClass {
3723
+
3724
+ // Own properties of Grl-0.2.Grl.MediaAudioClass
3725
+
3726
+ static name: string
3727
+ }
3728
+
3729
+ interface MediaBoxClass {
3730
+
3731
+ // Own fields of Grl-0.2.Grl.MediaBoxClass
3732
+
3733
+ /**
3734
+ * the parent class structure
3735
+ * @field
3736
+ */
3737
+ parent_class: MediaClass
3738
+ }
3739
+
3740
+ /**
3741
+ * Grilo Media box Class
3742
+ * @record
3743
+ */
3744
+ abstract class MediaBoxClass {
3745
+
3746
+ // Own properties of Grl-0.2.Grl.MediaBoxClass
3747
+
3748
+ static name: string
3749
+ }
3750
+
3751
+ interface MediaClass {
3752
+
3753
+ // Own fields of Grl-0.2.Grl.MediaClass
3754
+
3755
+ /**
3756
+ * the parent class structure
3757
+ * @field
3758
+ */
3759
+ parent_class: DataClass
3760
+ }
3761
+
3762
+ /**
3763
+ * Grilo Media Class
3764
+ * @record
3765
+ */
3766
+ abstract class MediaClass {
3767
+
3768
+ // Own properties of Grl-0.2.Grl.MediaClass
3769
+
3770
+ static name: string
3771
+ }
3772
+
3773
+ interface MediaImageClass {
3774
+
3775
+ // Own fields of Grl-0.2.Grl.MediaImageClass
3776
+
3777
+ /**
3778
+ * the parent class structure
3779
+ * @field
3780
+ */
3781
+ parent_class: MediaClass
3782
+ }
3783
+
3784
+ /**
3785
+ * Grilo Media image Class
3786
+ * @record
3787
+ */
3788
+ abstract class MediaImageClass {
3789
+
3790
+ // Own properties of Grl-0.2.Grl.MediaImageClass
3791
+
3792
+ static name: string
3793
+ }
3794
+
3795
+ interface MediaVideoClass {
3796
+
3797
+ // Own fields of Grl-0.2.Grl.MediaVideoClass
3798
+
3799
+ /**
3800
+ * the parent class structure
3801
+ * @field
3802
+ */
3803
+ parent_class: MediaClass
3804
+ }
3805
+
3806
+ /**
3807
+ * Grilo Media video Class
3808
+ * @record
3809
+ */
3810
+ abstract class MediaVideoClass {
3811
+
3812
+ // Own properties of Grl-0.2.Grl.MediaVideoClass
3813
+
3814
+ static name: string
3815
+ }
3816
+
3817
+ interface OperationOptionsClass {
3818
+
3819
+ // Own fields of Grl-0.2.Grl.OperationOptionsClass
3820
+
3821
+ /**
3822
+ * the parent class structure
3823
+ * @field
3824
+ */
3825
+ parent: GObject.ObjectClass
3826
+ }
3827
+
3828
+ /**
3829
+ * Grilo Operation Options class.
3830
+ * @record
3831
+ */
3832
+ abstract class OperationOptionsClass {
3833
+
3834
+ // Own properties of Grl-0.2.Grl.OperationOptionsClass
3835
+
3836
+ static name: string
3837
+ }
3838
+
3839
+ interface OperationOptionsPrivate {
3840
+ }
3841
+
3842
+ class OperationOptionsPrivate {
3843
+
3844
+ // Own properties of Grl-0.2.Grl.OperationOptionsPrivate
3845
+
3846
+ static name: string
3847
+ }
3848
+
3849
+ interface PluginClass {
3850
+
3851
+ // Own fields of Grl-0.2.Grl.PluginClass
3852
+
3853
+ /**
3854
+ * the parent class structure
3855
+ * @field
3856
+ */
3857
+ parent_class: GObject.ObjectClass
3858
+ }
3859
+
3860
+ abstract class PluginClass {
3861
+
3862
+ // Own properties of Grl-0.2.Grl.PluginClass
3863
+
3864
+ static name: string
3865
+ }
3866
+
3867
+ interface PluginDescriptor {
3868
+
3869
+ // Own fields of Grl-0.2.Grl.PluginDescriptor
3870
+
3871
+ /**
3872
+ * the module identifier
3873
+ * @field
3874
+ */
3875
+ plugin_id: string | null
3876
+ plugin_deinit: (plugin: Plugin) => void
3877
+ /**
3878
+ * the #GModule instance.
3879
+ * @field
3880
+ */
3881
+ module: GModule.Module
3882
+ plugin_register_keys: (registry: Registry, plugin: Plugin) => void
3883
+ }
3884
+
3885
+ /**
3886
+ * This structure is used for the module loader
3887
+ * @record
3888
+ */
3889
+ class PluginDescriptor {
3890
+
3891
+ // Own properties of Grl-0.2.Grl.PluginDescriptor
3892
+
3893
+ static name: string
3894
+ }
3895
+
3896
+ interface PluginPrivate {
3897
+ }
3898
+
3899
+ class PluginPrivate {
3900
+
3901
+ // Own properties of Grl-0.2.Grl.PluginPrivate
3902
+
3903
+ static name: string
3904
+ }
3905
+
3906
+ interface RangeValue {
3907
+
3908
+ // Own fields of Grl-0.2.Grl.RangeValue
3909
+
3910
+ min: any
3911
+ max: any
3912
+
3913
+ // Owm methods of Grl-0.2.Grl.RangeValue
3914
+
3915
+ dup(): RangeValue
3916
+ free(): void
3917
+ }
3918
+
3919
+ class RangeValue {
3920
+
3921
+ // Own properties of Grl-0.2.Grl.RangeValue
3922
+
3923
+ static name: string
3924
+
3925
+ // Constructors of Grl-0.2.Grl.RangeValue
3926
+
3927
+ constructor(min: any, max: any)
3928
+ static new(min: any, max: any): RangeValue
3929
+ static hashtable_insert(hash_table: GLib.HashTable, key: any | null, min: any, max: any): void
3930
+ static hashtable_new(): GLib.HashTable
3931
+ }
3932
+
3933
+ interface RegistryClass {
3934
+
3935
+ // Own fields of Grl-0.2.Grl.RegistryClass
3936
+
3937
+ /**
3938
+ * the parent class structure
3939
+ * @field
3940
+ */
3941
+ parent_class: GObject.ObjectClass
3942
+ }
3943
+
3944
+ /**
3945
+ * Grilo Registry class. Dynamic loader of plugins.
3946
+ * @record
3947
+ */
3948
+ abstract class RegistryClass {
3949
+
3950
+ // Own properties of Grl-0.2.Grl.RegistryClass
3951
+
3952
+ static name: string
3953
+ }
3954
+
3955
+ interface RegistryPrivate {
3956
+ }
3957
+
3958
+ class RegistryPrivate {
3959
+
3960
+ // Own properties of Grl-0.2.Grl.RegistryPrivate
3961
+
3962
+ static name: string
3963
+ }
3964
+
3965
+ interface RelatedKeysClass {
3966
+
3967
+ // Own fields of Grl-0.2.Grl.RelatedKeysClass
3968
+
3969
+ /**
3970
+ * the parent class structure
3971
+ * @field
3972
+ */
3973
+ parent_class: GObject.ObjectClass
3974
+ }
3975
+
3976
+ /**
3977
+ * Grilo Data Multivalued class
3978
+ * @record
3979
+ */
3980
+ abstract class RelatedKeysClass {
3981
+
3982
+ // Own properties of Grl-0.2.Grl.RelatedKeysClass
3983
+
3984
+ static name: string
3985
+ }
3986
+
3987
+ interface RelatedKeysPrivate {
3988
+ }
3989
+
3990
+ class RelatedKeysPrivate {
3991
+
3992
+ // Own properties of Grl-0.2.Grl.RelatedKeysPrivate
3993
+
3994
+ static name: string
3995
+ }
3996
+
3997
+ interface SourceBrowseSpec {
3998
+
3999
+ // Own fields of Grl-0.2.Grl.SourceBrowseSpec
4000
+
4001
+ /**
4002
+ * a source
4003
+ * @field
4004
+ */
4005
+ source: Source
4006
+ /**
4007
+ * operation identifier
4008
+ * @field
4009
+ */
4010
+ operation_id: number
4011
+ /**
4012
+ * a container of data transfer objects
4013
+ * @field
4014
+ */
4015
+ container: Media
4016
+ /**
4017
+ * the #GList of #GrlKeyID<!-- -->s to request
4018
+ * @field
4019
+ */
4020
+ keys: any[]
4021
+ /**
4022
+ * options wanted for that operation
4023
+ * @field
4024
+ */
4025
+ options: OperationOptions
4026
+ /**
4027
+ * the user defined callback
4028
+ * @field
4029
+ */
4030
+ callback: SourceResultCb
4031
+ /**
4032
+ * the user data to pass in the callback
4033
+ * @field
4034
+ */
4035
+ user_data: any
4036
+ }
4037
+
4038
+ /**
4039
+ * Data transport structure used internally by the plugins which support
4040
+ * browse vmethod.
4041
+ * @record
4042
+ */
4043
+ class SourceBrowseSpec {
4044
+
4045
+ // Own properties of Grl-0.2.Grl.SourceBrowseSpec
4046
+
4047
+ static name: string
4048
+ }
4049
+
4050
+ interface SourceClass {
4051
+
4052
+ // Own fields of Grl-0.2.Grl.SourceClass
4053
+
4054
+ /**
4055
+ * the parent class structure
4056
+ * @field
4057
+ */
4058
+ parent_class: GObject.ObjectClass
4059
+ supported_operations: (source: Source) => SupportedOps
4060
+ supported_keys: (source: Source) => KeyID[]
4061
+ slow_keys: (source: Source) => KeyID[]
4062
+ writable_keys: (source: Source) => KeyID[]
4063
+ get_caps: (source: Source, operation: SupportedOps) => Caps
4064
+ resolve: (source: Source, ms: SourceResolveSpec) => void
4065
+ may_resolve: (source: Source, media: Media, key_id: KeyID, missing_keys: KeyID[]) => boolean
4066
+ test_media_from_uri: (source: Source, uri: string | null) => boolean
4067
+ media_from_uri: (source: Source, mfus: SourceMediaFromUriSpec) => void
4068
+ browse: (source: Source, bs: SourceBrowseSpec) => void
4069
+ search: (source: Source, ss: SourceSearchSpec) => void
4070
+ query: (source: Source, qs: SourceQuerySpec) => void
4071
+ remove: (source: Source, rs: SourceRemoveSpec) => void
4072
+ store: (source: Source, ss: SourceStoreSpec) => void
4073
+ store_metadata: (source: Source, sms: SourceStoreMetadataSpec) => void
4074
+ cancel: (source: Source, operation_id: number) => void
4075
+ notify_change_start: (source: Source) => boolean
4076
+ notify_change_stop: (source: Source) => boolean
4077
+ }
4078
+
4079
+ /**
4080
+ * Grilo Source class. Override the vmethods to implement the
4081
+ * element functionality.
4082
+ * @record
4083
+ */
4084
+ abstract class SourceClass {
4085
+
4086
+ // Own properties of Grl-0.2.Grl.SourceClass
4087
+
4088
+ static name: string
4089
+ }
4090
+
4091
+ interface SourceMediaFromUriSpec {
4092
+
4093
+ // Own fields of Grl-0.2.Grl.SourceMediaFromUriSpec
4094
+
4095
+ /**
4096
+ * a source
4097
+ * @field
4098
+ */
4099
+ source: Source
4100
+ /**
4101
+ * operation identifier
4102
+ * @field
4103
+ */
4104
+ operation_id: number
4105
+ /**
4106
+ * A URI that can be used to identify a media resource
4107
+ * @field
4108
+ */
4109
+ uri: string | null
4110
+ /**
4111
+ * Metadata keys to resolve
4112
+ * @field
4113
+ */
4114
+ keys: any[]
4115
+ /**
4116
+ * options wanted for that operation
4117
+ * @field
4118
+ */
4119
+ options: OperationOptions
4120
+ /**
4121
+ * the user defined callback
4122
+ * @field
4123
+ */
4124
+ callback: SourceResolveCb
4125
+ /**
4126
+ * the user data to pass in the callback
4127
+ * @field
4128
+ */
4129
+ user_data: any
4130
+ }
4131
+
4132
+ /**
4133
+ * Data transport structure used internally by the plugins which support
4134
+ * media_from_uri vmethod.
4135
+ * @record
4136
+ */
4137
+ class SourceMediaFromUriSpec {
4138
+
4139
+ // Own properties of Grl-0.2.Grl.SourceMediaFromUriSpec
4140
+
4141
+ static name: string
4142
+ }
4143
+
4144
+ interface SourcePrivate {
4145
+ }
4146
+
4147
+ class SourcePrivate {
4148
+
4149
+ // Own properties of Grl-0.2.Grl.SourcePrivate
4150
+
4151
+ static name: string
4152
+ }
4153
+
4154
+ interface SourceQuerySpec {
4155
+
4156
+ // Own fields of Grl-0.2.Grl.SourceQuerySpec
4157
+
4158
+ /**
4159
+ * a source
4160
+ * @field
4161
+ */
4162
+ source: Source
4163
+ /**
4164
+ * operation identifier
4165
+ * @field
4166
+ */
4167
+ operation_id: number
4168
+ /**
4169
+ * the query to process
4170
+ * @field
4171
+ */
4172
+ query: string | null
4173
+ /**
4174
+ * the #GList of #GrlKeyID<!-- -->s to request
4175
+ * @field
4176
+ */
4177
+ keys: any[]
4178
+ /**
4179
+ * options wanted for that operation
4180
+ * @field
4181
+ */
4182
+ options: OperationOptions
4183
+ /**
4184
+ * the user defined callback
4185
+ * @field
4186
+ */
4187
+ callback: SourceResultCb
4188
+ /**
4189
+ * the user data to pass in the callback
4190
+ * @field
4191
+ */
4192
+ user_data: any
4193
+ }
4194
+
4195
+ /**
4196
+ * Data transport structure used internally by the plugins which support
4197
+ * query vmethod.
4198
+ * @record
4199
+ */
4200
+ class SourceQuerySpec {
4201
+
4202
+ // Own properties of Grl-0.2.Grl.SourceQuerySpec
4203
+
4204
+ static name: string
4205
+ }
4206
+
4207
+ interface SourceRemoveSpec {
4208
+
4209
+ // Own fields of Grl-0.2.Grl.SourceRemoveSpec
4210
+
4211
+ /**
4212
+ * a source
4213
+ * @field
4214
+ */
4215
+ source: Source
4216
+ /**
4217
+ * media identifier to remove
4218
+ * @field
4219
+ */
4220
+ media_id: string | null
4221
+ /**
4222
+ * a data transfer object
4223
+ * @field
4224
+ */
4225
+ media: Media
4226
+ /**
4227
+ * the user defined callback
4228
+ * @field
4229
+ */
4230
+ callback: SourceRemoveCb
4231
+ /**
4232
+ * the user data to pass in the callback
4233
+ * @field
4234
+ */
4235
+ user_data: any
4236
+ }
4237
+
4238
+ /**
4239
+ * Data transport structure used internally by the plugins which support
4240
+ * store vmethod.
4241
+ * @record
4242
+ */
4243
+ class SourceRemoveSpec {
4244
+
4245
+ // Own properties of Grl-0.2.Grl.SourceRemoveSpec
4246
+
4247
+ static name: string
4248
+ }
4249
+
4250
+ interface SourceResolveSpec {
4251
+
4252
+ // Own fields of Grl-0.2.Grl.SourceResolveSpec
4253
+
4254
+ /**
4255
+ * a source
4256
+ * @field
4257
+ */
4258
+ source: Source
4259
+ /**
4260
+ * operation identifier
4261
+ * @field
4262
+ */
4263
+ operation_id: number
4264
+ /**
4265
+ * a data transfer object
4266
+ * @field
4267
+ */
4268
+ media: Media
4269
+ /**
4270
+ * the #GList of #GrlKeyID<!-- -->s to request
4271
+ * @field
4272
+ */
4273
+ keys: any[]
4274
+ /**
4275
+ * options wanted for that operation
4276
+ * @field
4277
+ */
4278
+ options: OperationOptions
4279
+ /**
4280
+ * the user defined callback
4281
+ * @field
4282
+ */
4283
+ callback: SourceResolveCb
4284
+ /**
4285
+ * the user data to pass in the callback
4286
+ * @field
4287
+ */
4288
+ user_data: any
4289
+ }
4290
+
4291
+ /**
4292
+ * Data transport structure used internally by the plugins which support
4293
+ * resolve vmethod.
4294
+ * @record
4295
+ */
4296
+ class SourceResolveSpec {
4297
+
4298
+ // Own properties of Grl-0.2.Grl.SourceResolveSpec
4299
+
4300
+ static name: string
4301
+ }
4302
+
4303
+ interface SourceSearchSpec {
4304
+
4305
+ // Own fields of Grl-0.2.Grl.SourceSearchSpec
4306
+
4307
+ /**
4308
+ * a source
4309
+ * @field
4310
+ */
4311
+ source: Source
4312
+ /**
4313
+ * operation identifier
4314
+ * @field
4315
+ */
4316
+ operation_id: number
4317
+ /**
4318
+ * the text to search
4319
+ * @field
4320
+ */
4321
+ text: string | null
4322
+ /**
4323
+ * the #GList of #GrlKeyID<!-- -->s to request
4324
+ * @field
4325
+ */
4326
+ keys: any[]
4327
+ /**
4328
+ * options wanted for that operation
4329
+ * @field
4330
+ */
4331
+ options: OperationOptions
4332
+ /**
4333
+ * the user defined callback
4334
+ * @field
4335
+ */
4336
+ callback: SourceResultCb
4337
+ /**
4338
+ * the user data to pass in the callback
4339
+ * @field
4340
+ */
4341
+ user_data: any
4342
+ }
4343
+
4344
+ /**
4345
+ * Data transport structure used internally by the plugins which support
4346
+ * search vmethod.
4347
+ * @record
4348
+ */
4349
+ class SourceSearchSpec {
4350
+
4351
+ // Own properties of Grl-0.2.Grl.SourceSearchSpec
4352
+
4353
+ static name: string
4354
+ }
4355
+
4356
+ interface SourceStoreMetadataSpec {
4357
+
4358
+ // Own fields of Grl-0.2.Grl.SourceStoreMetadataSpec
4359
+
4360
+ /**
4361
+ * a source
4362
+ * @field
4363
+ */
4364
+ source: Source
4365
+ /**
4366
+ * a #GrlMedia transfer object
4367
+ * @field
4368
+ */
4369
+ media: Media
4370
+ /**
4371
+ * List of keys to be stored/updated.
4372
+ * @field
4373
+ */
4374
+ keys: any[]
4375
+ /**
4376
+ * Flags to control specific bahviors of the set metadata operation.
4377
+ * @field
4378
+ */
4379
+ flags: WriteFlags
4380
+ /**
4381
+ * the callback passed to grl_source_store_metadata()
4382
+ * @field
4383
+ */
4384
+ callback: SourceStoreCb
4385
+ /**
4386
+ * user data passed to grl_source_store_metadata()
4387
+ * @field
4388
+ */
4389
+ user_data: any
4390
+ /**
4391
+ * for internal use of the framework only.
4392
+ * @field
4393
+ */
4394
+ failed_keys: any[]
4395
+ }
4396
+
4397
+ /**
4398
+ * Data transport structure used internally by the plugins which support
4399
+ * store_metadata vmethod.
4400
+ * @record
4401
+ */
4402
+ class SourceStoreMetadataSpec {
4403
+
4404
+ // Own properties of Grl-0.2.Grl.SourceStoreMetadataSpec
4405
+
4406
+ static name: string
4407
+ }
4408
+
4409
+ interface SourceStoreSpec {
4410
+
4411
+ // Own fields of Grl-0.2.Grl.SourceStoreSpec
4412
+
4413
+ /**
4414
+ * a media source
4415
+ * @field
4416
+ */
4417
+ source: Source
4418
+ /**
4419
+ * a parent to store the data transfer objects
4420
+ * @field
4421
+ */
4422
+ parent: MediaBox
4423
+ /**
4424
+ * a data transfer object
4425
+ * @field
4426
+ */
4427
+ media: Media
4428
+ /**
4429
+ * the user defined callback
4430
+ * @field
4431
+ */
4432
+ callback: SourceStoreCb
4433
+ /**
4434
+ * the user data to pass in the callback
4435
+ * @field
4436
+ */
4437
+ user_data: any
4438
+ }
4439
+
4440
+ /**
4441
+ * Data transport structure used internally by the plugins which support
4442
+ * store vmethod.
4443
+ * @record
4444
+ */
4445
+ class SourceStoreSpec {
4446
+
4447
+ // Own properties of Grl-0.2.Grl.SourceStoreSpec
4448
+
4449
+ static name: string
4450
+ }
4451
+
4452
+ type KeyID = number
4453
+ /**
4454
+ * Name of the imported GIR library
4455
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
4456
+ */
4457
+ const __name__: string
4458
+ /**
4459
+ * Version of the imported GIR library
4460
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
4461
+ */
4462
+ const __version__: string
4463
+ }
4464
+
4465
+ export default Grl;
4466
+ // END