@girs/atspi-2.0 2.0.0-4.0.0-beta.2 → 2.0.0-4.0.0-beta.3

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.
Files changed (3) hide show
  1. package/README.md +1 -19
  2. package/atspi-2.0.d.ts +35 -119
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/atspi-2.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Atspi-2.0, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.2.
8
+ GJS TypeScript type definitions for Atspi-2.0, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
9
9
 
10
10
 
11
11
  ## Install
@@ -22,11 +22,6 @@ You can import this package into your project like this:
22
22
  import Atspi from '@girs/atspi-2.0';
23
23
  ```
24
24
 
25
- Or if you prefer CommonJS, you can also use this:
26
- ```ts
27
- const Atspi = require('@girs/atspi-2.0');
28
- ```
29
-
30
25
  ### Ambient Modules
31
26
 
32
27
  You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
@@ -81,19 +76,6 @@ Now you have also type support for this, too:
81
76
  const Atspi = imports.gi.Atspi;
82
77
  ```
83
78
 
84
-
85
- ### ESM vs. CommonJS
86
-
87
- GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
88
-
89
- In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
90
-
91
- On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
92
-
93
- This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
94
-
95
- Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
96
-
97
79
  ### Bundle
98
80
 
99
81
  Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
package/atspi-2.0.d.ts CHANGED
@@ -2225,7 +2225,7 @@ export namespace Atspi {
2225
2225
  * Gets the #AtspiAction interface for an #AtspiAccessible.
2226
2226
  * @returns a pointer to an #AtspiAction interface instance, or NULL if @obj does not implement #AtspiAction.
2227
2227
  */
2228
- get_action(): Action;
2228
+ get_action_iface(): Action;
2229
2229
  /**
2230
2230
  * Gets the #AtspiAction interface for an #AtspiAccessible.
2231
2231
  * @returns a pointer to an #AtspiAction interface instance, or NULL if @obj does not implement #AtspiAction.
@@ -2274,7 +2274,7 @@ export namespace Atspi {
2274
2274
  * Gets the #AtspiCollection interface for an #AtspiAccessible.
2275
2275
  * @returns a pointer to an #AtspiCollection interface instance, or NULL if @obj does not implement #AtspiCollection.
2276
2276
  */
2277
- get_collection(): Collection;
2277
+ get_collection_iface(): Collection;
2278
2278
  /**
2279
2279
  * Gets the #AtspiCollection interface for an #AtspiAccessible.
2280
2280
  * @returns a pointer to an #AtspiCollection interface instance, or NULL if @obj does not implement #AtspiCollection.
@@ -2284,7 +2284,7 @@ export namespace Atspi {
2284
2284
  * Gets the #AtspiComponent interface for an #AtspiAccessible.
2285
2285
  * @returns a pointer to an #AtspiComponent interface instance, or NULL if @obj does not implement #AtspiComponent.
2286
2286
  */
2287
- get_component(): Component;
2287
+ get_component_iface(): Component;
2288
2288
  /**
2289
2289
  * Gets the #AtspiComponent interface for an #AtspiAccessible.
2290
2290
  * @returns a pointer to an #AtspiComponent interface instance, or NULL if @obj does not implement #AtspiComponent.
@@ -2299,7 +2299,7 @@ export namespace Atspi {
2299
2299
  * Gets the #AtspiDocument interface for an #AtspiAccessible.
2300
2300
  * @returns a pointer to an #AtspiDocument interface instance, or NULL if @obj does not implement #AtspiDocument.
2301
2301
  */
2302
- get_document(): Document;
2302
+ get_document_iface(): Document;
2303
2303
  /**
2304
2304
  * Gets the #AtspiDocument interface for an #AtspiAccessible.
2305
2305
  * @returns a pointer to an #AtspiDocument interface instance, or NULL if @obj does not implement #AtspiDocument.
@@ -2309,19 +2309,12 @@ export namespace Atspi {
2309
2309
  * Gets the #AtspiEditableText interface for an #AtspiAccessible.
2310
2310
  * @returns a pointer to an #AtspiEditableText interface instance, or NULL if @obj does not implement #AtspiEditableText.
2311
2311
  */
2312
- get_editable_text(): EditableText;
2312
+ get_editable_text_iface(): EditableText;
2313
2313
  /**
2314
2314
  * Gets the #AtspiEditableText interface for an #AtspiAccessible.
2315
2315
  * @returns a pointer to an #AtspiEditableText interface instance, or NULL if @obj does not implement #AtspiEditableText.
2316
2316
  */
2317
2317
  get_editable_text_iface(): EditableText;
2318
- /**
2319
- * Gets the help text associated with the accessible, if set. When this is
2320
- * present, it provides information that a screen reader can relay to the user
2321
- * to explain how to interact with the object.
2322
- * @returns a character string representing the help text for the #AtspiAccessible object or NULL on exception.
2323
- */
2324
- get_help_text(): string;
2325
2318
  /**
2326
2319
  * Gets the #AtspiHyperlink interface for an #AtspiAccessible.
2327
2320
  * @returns the #AtspiHyperlink object associated with the given #AtspiAccessible, or NULL if not supported.
@@ -2331,7 +2324,7 @@ export namespace Atspi {
2331
2324
  * Gets the #AtspiHypertext interface for an #AtspiAccessible.
2332
2325
  * @returns a pointer to an #AtspiHypertext interface instance, or NULL if @obj does not implement #AtspiHypertext.
2333
2326
  */
2334
- get_hypertext(): Hypertext;
2327
+ get_hypertext_iface(): Hypertext;
2335
2328
  /**
2336
2329
  * Gets the #AtspiHypertext interface for an #AtspiAccessible.
2337
2330
  * @returns a pointer to an #AtspiHypertext interface instance, or NULL if @obj does not implement #AtspiHypertext.
@@ -2347,7 +2340,7 @@ export namespace Atspi {
2347
2340
  * Gets the #AtspiImage interface for an #AtspiAccessible.
2348
2341
  * @returns a pointer to an #AtspiImage interface instance, or NULL if @obj does not implement #AtspiImage.
2349
2342
  */
2350
- get_image(): Image;
2343
+ get_image_iface(): Image;
2351
2344
  /**
2352
2345
  * Gets the #AtspiImage interface for an #AtspiAccessible.
2353
2346
  * @returns a pointer to an #AtspiImage interface instance, or NULL if @obj does not implement #AtspiImage.
@@ -2413,9 +2406,7 @@ export namespace Atspi {
2413
2406
  * Gets the #AtspiSelection interface for an #AtspiAccessible.
2414
2407
  * @returns a pointer to an #AtspiSelection interface instance, or NULL if @obj does not implement #AtspiSelection.
2415
2408
  */
2416
- get_selection(): Selection;
2417
- // Conflicted with Atspi.Text.get_selection
2418
- get_selection(...args: never[]): any;
2409
+ get_selection_iface(): Selection;
2419
2410
  /**
2420
2411
  * Gets the #AtspiSelection interface for an #AtspiAccessible.
2421
2412
  * @returns a pointer to an #AtspiSelection interface instance, or NULL if @obj does not implement #AtspiSelection.
@@ -2430,9 +2421,7 @@ export namespace Atspi {
2430
2421
  * Gets the #AtspiTable interface for an #AtspiAccessible.
2431
2422
  * @returns a pointer to an #AtspiTable interface instance, or NULL if @obj does not implement #AtspiTable.
2432
2423
  */
2433
- get_table(): Table;
2434
- // Conflicted with Atspi.TableCell.get_table
2435
- get_table(...args: never[]): any;
2424
+ get_table_iface(): Table;
2436
2425
  /**
2437
2426
  * Gets the #AtspiTableCell interface for an #AtspiAccessible.
2438
2427
  * @returns a pointer to an #AtspiTableCell interface instance, or NULL if @obj does not implement #AtspiTable.
@@ -2447,9 +2436,7 @@ export namespace Atspi {
2447
2436
  * Gets the #AtspiTable interface for an #AtspiAccessible.
2448
2437
  * @returns a pointer to an #AtspiText interface instance, or NULL if @obj does not implement #AtspiText.
2449
2438
  */
2450
- get_text(): Text;
2451
- // Conflicted with Atspi.Text.get_text
2452
- get_text(...args: never[]): any;
2439
+ get_text_iface(): Text;
2453
2440
  /**
2454
2441
  * Gets the #AtspiTable interface for an #AtspiAccessible.
2455
2442
  * @returns a pointer to an #AtspiText interface instance, or NULL if @obj does not implement #AtspiText.
@@ -2471,7 +2458,7 @@ export namespace Atspi {
2471
2458
  * Gets the #AtspiTable interface for an #AtspiAccessible.
2472
2459
  * @returns a pointer to an #AtspiValue interface instance, or NULL if @obj does not implement #AtspiValue.
2473
2460
  */
2474
- get_value(): Value;
2461
+ get_value_iface(): Value;
2475
2462
  /**
2476
2463
  * Gets the #AtspiTable interface for an #AtspiAccessible.
2477
2464
  * @returns a pointer to an #AtspiValue interface instance, or NULL if @obj does not implement #AtspiValue.
@@ -2737,21 +2724,6 @@ export namespace Atspi {
2737
2724
  * @returns a #gint indicating the page count of an #AccessibleDocument object.
2738
2725
  */
2739
2726
  get_page_count(): number;
2740
- /**
2741
- * Returns an array of AtspiTextSelections within this document.
2742
- * @returns a GArray of AtspiTextSelection structures representing the selection.
2743
- */
2744
- get_text_selections(): TextSelection[];
2745
- /**
2746
- * Makes 1 or more selections within this document denoted by the given
2747
- * array of AtspiTextSelections. Any existing physical selection (inside or
2748
- * outside this document) is replaced by the new selections. All objects within
2749
- * the given selection ranges must be descendants of this document. Otherwise
2750
- * FALSE will be returned.
2751
- * @param selections a GArray of AtspiTextSelections to be selected.
2752
- * @returns TRUE if the selection was made successfully; FALSE otherwise.
2753
- */
2754
- set_text_selections(selections: TextSelection[]): boolean;
2755
2727
  /**
2756
2728
  * Copies text from an #AtspiEditableText object into the system clipboard.
2757
2729
  *
@@ -3172,6 +3144,11 @@ export namespace Atspi {
3172
3144
  * @returns a gint representing the number of rows occupied by this cell, or 0 if the cell does not implement this method.
3173
3145
  */
3174
3146
  get_row_span(): number;
3147
+ /**
3148
+ * Returns a reference to the accessible of the containing table.
3149
+ * @returns the AtspiAccessible for the containing table.
3150
+ */
3151
+ get_table(): Accessible;
3175
3152
  /**
3176
3153
  * Selects some text (adds a text selection) in an #AtspiText object.
3177
3154
  * @param start_offset the starting offset of the desired new selection.
@@ -3282,6 +3259,12 @@ export namespace Atspi {
3282
3259
  * @returns An #AtspiRect giving the position and size of the specified range of text.
3283
3260
  */
3284
3261
  get_range_extents(start_offset: number, end_offset: number, type: CoordType): Rect;
3262
+ /**
3263
+ * Gets the bounds of the `selection_num-th` active text selection for an
3264
+ * #AtspiText object.
3265
+ * @param selection_num a #gint indicating which selection to query.
3266
+ */
3267
+ get_selection(selection_num: number): Range;
3285
3268
  /**
3286
3269
  * Gets a portion of the text exposed through an #AtspiText according to a given `offset`
3287
3270
  * and a specific `granularity,` along with the start and end offsets defining the
@@ -3318,6 +3301,17 @@ export namespace Atspi {
3318
3301
  * @returns a newly allocated string containing the text at the @offset bounded by the specified @granularity. Use g_free() to free the returned string. Returns %NULL if the offset is invalid or no implementation is available.
3319
3302
  */
3320
3303
  get_string_at_offset(offset: number, granularity: TextGranularity): TextRange;
3304
+ /**
3305
+ * Gets a range of text from an #AtspiText object. The number of bytes
3306
+ * in the returned string may exceed either end_offset or start_offset, since
3307
+ * UTF-8 is a variable-width encoding.
3308
+ * @param start_offset a #gint indicating the start of the desired text range.
3309
+ * @param end_offset a #gint indicating the first character past the desired range.
3310
+ * @returns a text string containing characters from @start_offset to @end_offset-1, inclusive, encoded as UTF-8.
3311
+ */
3312
+ get_text(start_offset: number, end_offset: number): string;
3313
+ // Conflicted with Atspi.Value.get_text
3314
+ get_text(...args: never[]): any;
3321
3315
  /**
3322
3316
  * Gets delimited text from an #AtspiText object which follows a given
3323
3317
  * text offset.
@@ -3591,7 +3585,7 @@ export namespace Atspi {
3591
3585
  * static void
3592
3586
  * my_object_class_init (MyObjectClass *klass)
3593
3587
  * {
3594
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
3588
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
3595
3589
  * 0, 100,
3596
3590
  * 50,
3597
3591
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -3823,20 +3817,7 @@ export namespace Atspi {
3823
3817
 
3824
3818
  // Own virtual methods of Atspi.Device
3825
3819
 
3826
- vfunc_add_key_grab(kd: KeyDefinition): boolean;
3827
- /**
3828
- * Synthesizes a mouse event at a specific screen coordinate.
3829
- * Most AT clients should use the #AccessibleAction interface when
3830
- * tempted to generate mouse events, rather than this method.
3831
- * Event names: b1p = button 1 press; b2r = button 2 release;
3832
- * b3c = button 3 click; b2d = button 2 double-click;
3833
- * abs = absolute motion; rel = relative motion.
3834
- * @param obj The #AtspiAccessible that should receive the click.
3835
- * @param x a #gint indicating the x coordinate of the mouse event, relative to @obj..
3836
- * @param y a #gint indicating the y coordinate of the mouse event, relative to @obj..
3837
- * @param name a string indicating which mouse event to be synthesized (e.g. "b1p", "b1c", "b2r", "rel", "abs").
3838
- */
3839
- vfunc_generate_mouse_event(obj: Accessible, x: number, y: number, name: string): void;
3820
+ vfunc_add_key_grab(kd: KeyDefinition): void;
3840
3821
  /**
3841
3822
  * Returns the locked modifiers (ie, num lock, caps lock) associated with this
3842
3823
  * keyboard.
@@ -3891,19 +3872,6 @@ export namespace Atspi {
3891
3872
  * pressed or released.
3892
3873
  */
3893
3874
  add_key_watcher(): void;
3894
- /**
3895
- * Synthesizes a mouse event at a specific screen coordinate.
3896
- * Most AT clients should use the #AccessibleAction interface when
3897
- * tempted to generate mouse events, rather than this method.
3898
- * Event names: b1p = button 1 press; b2r = button 2 release;
3899
- * b3c = button 3 click; b2d = button 2 double-click;
3900
- * abs = absolute motion; rel = relative motion.
3901
- * @param obj The #AtspiAccessible that should receive the click.
3902
- * @param x a #gint indicating the x coordinate of the mouse event, relative to @obj..
3903
- * @param y a #gint indicating the y coordinate of the mouse event, relative to @obj..
3904
- * @param name a string indicating which mouse event to be synthesized (e.g. "b1p", "b1c", "b2r", "rel", "abs").
3905
- */
3906
- generate_mouse_event(obj: Accessible, x: number, y: number, name: string): void;
3907
3875
  get_grab_by_id(id: number): KeyDefinition;
3908
3876
  /**
3909
3877
  * Returns the locked modifiers (ie, num lock, caps lock) associated with this
@@ -4708,43 +4676,6 @@ export namespace Atspi {
4708
4676
  _init(...args: any[]): void;
4709
4677
  }
4710
4678
 
4711
- /**
4712
- * This structure represents a single text selection within a document. This
4713
- * selection is defined by two points in the content, where each one is defined
4714
- * by an AtkObject supporting the AtkText interface and a character offset
4715
- * relative to it.
4716
- *
4717
- * The end object must appear after the start object in the accessibility tree,
4718
- * i.e. the end object must be reachable from the start object by navigating
4719
- * forward (next, first child etc).
4720
- *
4721
- * This struct also contains a `start_is_active` boolean, to communicate if the
4722
- * start of the selection is the active point or not.
4723
- *
4724
- * The active point corresponds to the user's focus or point of interest. The
4725
- * user moves the active point to expand or collapse the range. The anchor
4726
- * point is the other point of the range and typically remains constant. In
4727
- * most cases, anchor is the start of the range and active is the end. However,
4728
- * when selecting backwards (e.g. pressing shift+left arrow in a text field),
4729
- * the start of the range is the active point, as the user moves this to
4730
- * manipulate the selection.
4731
- */
4732
- class TextSelection {
4733
- static $gtype: GObject.GType<TextSelection>;
4734
-
4735
- // Own fields of Atspi.TextSelection
4736
-
4737
- start_object: Accessible;
4738
- start_offset: number;
4739
- end_object: Accessible;
4740
- end_offset: number;
4741
- start_is_active: boolean;
4742
-
4743
- // Constructors of Atspi.TextSelection
4744
-
4745
- _init(...args: any[]): void;
4746
- }
4747
-
4748
4679
  module Action {
4749
4680
  // Constructor properties interface
4750
4681
 
@@ -5080,21 +5011,6 @@ export namespace Atspi {
5080
5011
  * @returns a #gint indicating the page count of an #AccessibleDocument object.
5081
5012
  */
5082
5013
  get_page_count(): number;
5083
- /**
5084
- * Returns an array of AtspiTextSelections within this document.
5085
- * @returns a GArray of AtspiTextSelection structures representing the selection.
5086
- */
5087
- get_text_selections(): TextSelection[];
5088
- /**
5089
- * Makes 1 or more selections within this document denoted by the given
5090
- * array of AtspiTextSelections. Any existing physical selection (inside or
5091
- * outside this document) is replaced by the new selections. All objects within
5092
- * the given selection ranges must be descendants of this document. Otherwise
5093
- * FALSE will be returned.
5094
- * @param selections a GArray of AtspiTextSelections to be selected.
5095
- * @returns TRUE if the selection was made successfully; FALSE otherwise.
5096
- */
5097
- set_text_selections(selections: TextSelection[]): boolean;
5098
5014
  }
5099
5015
 
5100
5016
  export const Document: DocumentNamespace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/atspi-2.0",
3
- "version": "2.0.0-4.0.0-beta.2",
3
+ "version": "2.0.0-4.0.0-beta.3",
4
4
  "description": "GJS TypeScript type definitions for Atspi-2.0, generated from library version 2.0.0",
5
5
  "type": "module",
6
6
  "module": "atspi-2.0.js",
@@ -26,10 +26,10 @@
26
26
  "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit atspi-2.0.d.ts"
27
27
  },
28
28
  "dependencies": {
29
- "@girs/dbus-1.0": "^1.0.0-4.0.0-beta.2",
30
- "@girs/gjs": "^4.0.0-beta.2",
31
- "@girs/glib-2.0": "^2.80.0-4.0.0-beta.2",
32
- "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.2"
29
+ "@girs/dbus-1.0": "^1.0.0-4.0.0-beta.3",
30
+ "@girs/gjs": "^4.0.0-beta.3",
31
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
32
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "typescript": "*"