@girs/xreaderview-1.5 4.2.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,25 +5,25 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/xreaderview-1.5)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for XreaderView-1.5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for XreaderView-1.5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
9
 
10
10
  ## Install
11
11
 
12
- To use this type definitions, install them with NPM:
12
+ Install the type definitions with npm:
13
13
  ```bash
14
14
  npm install @girs/xreaderview-1.5
15
15
  ```
16
16
 
17
17
  ## Usage
18
18
 
19
- You can import this package into your project like this:
19
+ Import it like any other module:
20
20
  ```ts
21
21
  import XreaderView from '@girs/xreaderview-1.5';
22
22
  ```
23
23
 
24
24
  ### Ambient Modules
25
25
 
26
- 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.
26
+ [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
27
  For this you need to include `@girs/xreaderview-1.5` or `@girs/xreaderview-1.5/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/xreaderview-1.5'
42
42
  }
43
43
  ```
44
44
 
45
- Now you can import the ambient module with TypeScript support:
45
+ The ambient module now resolves with types:
46
46
 
47
47
  ```ts
48
48
  import XreaderView from 'gi://XreaderView?version=1.5';
@@ -50,7 +50,7 @@ import XreaderView from 'gi://XreaderView?version=1.5';
50
50
 
51
51
  ### Global import
52
52
 
53
- You can also import the module with Typescript support using the global `imports.gi` object of GJS.
53
+ GJS's global `imports.gi` works too, with types.
54
54
  For this you need to include `@girs/xreaderview-1.5` or `@girs/xreaderview-1.5/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/xreaderview-1.5'
69
69
  }
70
70
  ```
71
71
 
72
- Now you have also type support for this, too:
72
+ That form carries types as well:
73
73
 
74
74
  ```ts
75
75
  const XreaderView = imports.gi.XreaderView;
@@ -77,7 +77,7 @@ const XreaderView = imports.gi.XreaderView;
77
77
 
78
78
  ### Bundle
79
79
 
80
- 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).
80
+ Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
81
81
 
82
82
  ## Other packages
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/xreaderview-1.5",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for XreaderView-1.5",
5
5
  "type": "module",
6
6
  "module": "xreaderview-1.5.js",
@@ -36,21 +36,21 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.2.0",
40
- "@girs/xreaderdocument-1.5": "^4.2.0",
41
- "@girs/gtk-3.0": "^4.2.0",
42
- "@girs/xlib-2.0": "^4.2.0",
43
- "@girs/gdk-3.0": "^4.2.0",
44
- "@girs/cairo-1.0": "^4.2.0",
45
- "@girs/gobject-2.0": "^4.2.0",
46
- "@girs/glib-2.0": "^4.2.0",
47
- "@girs/pango-1.0": "^4.2.0",
48
- "@girs/harfbuzz-0.0": "^4.2.0",
49
- "@girs/freetype2-2.0": "^4.2.0",
50
- "@girs/gio-2.0": "^4.2.0",
51
- "@girs/gmodule-2.0": "^4.2.0",
52
- "@girs/gdkpixbuf-2.0": "^4.2.0",
53
- "@girs/atk-1.0": "^4.2.0" },
39
+ "@girs/gjs": "^4.4.0",
40
+ "@girs/xreaderdocument-1.5": "^4.4.0",
41
+ "@girs/gtk-3.0": "^4.4.0",
42
+ "@girs/xlib-2.0": "^4.4.0",
43
+ "@girs/gdk-3.0": "^4.4.0",
44
+ "@girs/cairo-1.0": "^4.4.0",
45
+ "@girs/gobject-2.0": "^4.4.0",
46
+ "@girs/glib-2.0": "^4.4.0",
47
+ "@girs/pango-1.0": "^4.4.0",
48
+ "@girs/harfbuzz-0.0": "^4.4.0",
49
+ "@girs/freetype2-2.0": "^4.4.0",
50
+ "@girs/gio-2.0": "^4.4.0",
51
+ "@girs/gmodule-2.0": "^4.4.0",
52
+ "@girs/gdkpixbuf-2.0": "^4.4.0",
53
+ "@girs/atk-1.0": "^4.4.0" },
54
54
  "devDependencies": {
55
55
  "typescript": "*"
56
56
  },
@@ -102,6 +102,23 @@ export interface Widgets {
102
102
  /** Every GType this namespace can create. A consumer derives its own tag map. */
103
103
  export type WidgetGType = keyof Widgets;
104
104
 
105
+ // ---------------------------------------------------------------------------
106
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
107
+ //
108
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
109
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
110
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
111
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
112
+ // more rows in `Widgets`: concatenate them when you mean both.
113
+ // ---------------------------------------------------------------------------
114
+
115
+ export interface ChildHolders {
116
+
117
+ }
118
+
119
+ /** Every GType this namespace holds a child in without it being a widget. */
120
+ export type ChildHolderGType = keyof ChildHolders;
121
+
105
122
  /** The writable, optional, GObject-keyed property surface of one GType. */
106
123
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
107
124
 
@@ -137,6 +154,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
137
154
  /** Widget GType -> every declaration its members come from, self first. */
138
155
  export const DECLS: Readonly<Record<string, readonly string[]>>;
139
156
 
157
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
158
+ export const CHILD_HOLDERS: readonly string[];
159
+
140
160
  /** Enum GType -> the nicks this surface offers. */
141
161
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
142
162
 
@@ -22,6 +22,12 @@ export const DECLS = {
22
22
  EvViewPresentation: ['EvViewPresentation', 'GtkWidget', 'GtkBuildable'],
23
23
  };
24
24
 
25
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
26
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
27
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
28
+ // from a list — the count is in the provenance line above.
29
+ export const CHILD_HOLDERS = [];
30
+
25
31
  export const ENUM_NICKS = {
26
32
  EvJobPriority: ['priority-urgent', 'priority-high', 'priority-low', 'priority-none', 'n-priorities'],
27
33
  EvJobRunMode: ['thread', 'main-loop'],
@@ -1754,36 +1754,42 @@ export namespace XreaderView {
1754
1754
  * display overlayed graphics, like the overshoot indication,
1755
1755
  * at the right position.
1756
1756
  * @returns `true` if `border` has been set
1757
+ * @since 3.16
1757
1758
  */
1758
1759
  get_border(): [boolean, Gtk.Border];
1759
1760
 
1760
1761
  /**
1761
1762
  * Retrieves the {@link Gtk.Adjustment} used for horizontal scrolling.
1762
1763
  * @returns horizontal {@link Gtk.Adjustment}.
1764
+ * @since 3.0
1763
1765
  */
1764
1766
  get_hadjustment(): Gtk.Adjustment;
1765
1767
 
1766
1768
  /**
1767
1769
  * Gets the horizontal {@link Gtk.ScrollablePolicy}.
1768
1770
  * @returns The horizontal {@link Gtk.ScrollablePolicy}.
1771
+ * @since 3.0
1769
1772
  */
1770
1773
  get_hscroll_policy(): Gtk.ScrollablePolicy;
1771
1774
 
1772
1775
  /**
1773
1776
  * Retrieves the {@link Gtk.Adjustment} used for vertical scrolling.
1774
1777
  * @returns vertical {@link Gtk.Adjustment}.
1778
+ * @since 3.0
1775
1779
  */
1776
1780
  get_vadjustment(): Gtk.Adjustment;
1777
1781
 
1778
1782
  /**
1779
1783
  * Gets the vertical {@link Gtk.ScrollablePolicy}.
1780
1784
  * @returns The vertical {@link Gtk.ScrollablePolicy}.
1785
+ * @since 3.0
1781
1786
  */
1782
1787
  get_vscroll_policy(): Gtk.ScrollablePolicy;
1783
1788
 
1784
1789
  /**
1785
1790
  * Sets the horizontal adjustment of the {@link Gtk.Scrollable}.
1786
1791
  * @param hadjustment a {@link Gtk.Adjustment}
1792
+ * @since 3.0
1787
1793
  */
1788
1794
  set_hadjustment(hadjustment: Gtk.Adjustment | null): void;
1789
1795
 
@@ -1792,12 +1798,14 @@ export namespace XreaderView {
1792
1798
  * horizontal scrolling should start below the minimum width or
1793
1799
  * below the natural width.
1794
1800
  * @param policy the horizontal {@link Gtk.ScrollablePolicy}
1801
+ * @since 3.0
1795
1802
  */
1796
1803
  set_hscroll_policy(policy: Gtk.ScrollablePolicy): void;
1797
1804
 
1798
1805
  /**
1799
1806
  * Sets the vertical adjustment of the {@link Gtk.Scrollable}.
1800
1807
  * @param vadjustment a {@link Gtk.Adjustment}
1808
+ * @since 3.0
1801
1809
  */
1802
1810
  set_vadjustment(vadjustment: Gtk.Adjustment | null): void;
1803
1811
 
@@ -1806,6 +1814,7 @@ export namespace XreaderView {
1806
1814
  * vertical scrolling should start below the minimum height or
1807
1815
  * below the natural height.
1808
1816
  * @param policy the vertical {@link Gtk.ScrollablePolicy}
1817
+ * @since 3.0
1809
1818
  */
1810
1819
  set_vscroll_policy(policy: Gtk.ScrollablePolicy): void;
1811
1820
 
@@ -1815,6 +1824,7 @@ export namespace XreaderView {
1815
1824
  * be treeview headers. GTK+ can use this information to
1816
1825
  * display overlayed graphics, like the overshoot indication,
1817
1826
  * at the right position.
1827
+ * @since 3.16
1818
1828
  * @virtual
1819
1829
  */
1820
1830
  vfunc_get_border(): [boolean, Gtk.Border];
@@ -1994,6 +2004,7 @@ export namespace XreaderView {
1994
2004
  * @param builder a {@link Gtk.Builder}
1995
2005
  * @param child child to add
1996
2006
  * @param type kind of child or `null`
2007
+ * @since 2.12
1997
2008
  */
1998
2009
  add_child(builder: Gtk.Builder, child: GObject.Object, type: string | null): void;
1999
2010
 
@@ -2005,6 +2016,7 @@ export namespace XreaderView {
2005
2016
  * @param builder {@link Gtk.Builder} used to construct this object
2006
2017
  * @param name name of child to construct
2007
2018
  * @returns the constructed child
2019
+ * @since 2.12
2008
2020
  */
2009
2021
  construct_child<T = GObject.Object>(builder: Gtk.Builder, name: string): T;
2010
2022
 
@@ -2015,6 +2027,7 @@ export namespace XreaderView {
2015
2027
  * @param child child object or `null` for non-child tags
2016
2028
  * @param tagname the name of the tag
2017
2029
  * @param data user data created in custom_tag_start
2030
+ * @since 2.12
2018
2031
  */
2019
2032
  custom_finished(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
2020
2033
 
@@ -2025,6 +2038,7 @@ export namespace XreaderView {
2025
2038
  * @param child child object or `null` for non-child tags
2026
2039
  * @param tagname name of tag
2027
2040
  * @param data user data that will be passed in to parser functions
2041
+ * @since 2.12
2028
2042
  */
2029
2043
  custom_tag_end(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
2030
2044
 
@@ -2034,6 +2048,7 @@ export namespace XreaderView {
2034
2048
  * @param child child object or `null` for non-child tags
2035
2049
  * @param tagname name of tag
2036
2050
  * @returns `true` if a object has a custom implementation, `false` if it doesn't.
2051
+ * @since 2.12
2037
2052
  */
2038
2053
  custom_tag_start(builder: Gtk.Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, null];
2039
2054
 
@@ -2042,6 +2057,7 @@ export namespace XreaderView {
2042
2057
  * @param builder a {@link Gtk.Builder}
2043
2058
  * @param childname name of child
2044
2059
  * @returns the internal child of the buildable object
2060
+ * @since 2.12
2045
2061
  */
2046
2062
  get_internal_child<T = GObject.Object>(builder: Gtk.Builder, childname: string): T;
2047
2063
 
@@ -2052,6 +2068,7 @@ export namespace XreaderView {
2052
2068
  * [GtkBuilder UI definition][BUILDER-UI]
2053
2069
  * used to construct the `buildable`.
2054
2070
  * @returns the name set with `gtk_buildable_set_name()`
2071
+ * @since 2.12
2055
2072
  */
2056
2073
  get_name(): string;
2057
2074
 
@@ -2062,6 +2079,7 @@ export namespace XreaderView {
2062
2079
  * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()`
2063
2080
  * is called on a builder.
2064
2081
  * @param builder a {@link Gtk.Builder}
2082
+ * @since 2.12
2065
2083
  */
2066
2084
  parser_finished(builder: Gtk.Builder): void;
2067
2085
 
@@ -2070,12 +2088,14 @@ export namespace XreaderView {
2070
2088
  * @param builder a {@link Gtk.Builder}
2071
2089
  * @param name name of property
2072
2090
  * @param value value of property
2091
+ * @since 2.12
2073
2092
  */
2074
2093
  set_buildable_property(builder: Gtk.Builder, name: string, value: GObject.Value | any): void;
2075
2094
 
2076
2095
  /**
2077
2096
  * Sets the name of the `buildable` object.
2078
2097
  * @param name name to set
2098
+ * @since 2.12
2079
2099
  */
2080
2100
  set_name(name: string): void;
2081
2101
 
@@ -2085,6 +2105,7 @@ export namespace XreaderView {
2085
2105
  * @param builder a {@link Gtk.Builder}
2086
2106
  * @param child child to add
2087
2107
  * @param type kind of child or `null`
2108
+ * @since 2.12
2088
2109
  * @virtual
2089
2110
  */
2090
2111
  vfunc_add_child(builder: Gtk.Builder, child: GObject.Object, type: string | null): void;
@@ -2096,6 +2117,7 @@ export namespace XreaderView {
2096
2117
  * specified in the UI definition.
2097
2118
  * @param builder {@link Gtk.Builder} used to construct this object
2098
2119
  * @param name name of child to construct
2120
+ * @since 2.12
2099
2121
  * @virtual
2100
2122
  */
2101
2123
  vfunc_construct_child<T = GObject.Object>(builder: Gtk.Builder, name: string): T;
@@ -2107,6 +2129,7 @@ export namespace XreaderView {
2107
2129
  * @param child child object or `null` for non-child tags
2108
2130
  * @param tagname the name of the tag
2109
2131
  * @param data user data created in custom_tag_start
2132
+ * @since 2.12
2110
2133
  * @virtual
2111
2134
  */
2112
2135
  vfunc_custom_finished(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
@@ -2118,6 +2141,7 @@ export namespace XreaderView {
2118
2141
  * @param child child object or `null` for non-child tags
2119
2142
  * @param tagname name of tag
2120
2143
  * @param data user data that will be passed in to parser functions
2144
+ * @since 2.12
2121
2145
  * @virtual
2122
2146
  */
2123
2147
  vfunc_custom_tag_end(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
@@ -2127,6 +2151,7 @@ export namespace XreaderView {
2127
2151
  * @param builder a {@link Gtk.Builder} used to construct this object
2128
2152
  * @param child child object or `null` for non-child tags
2129
2153
  * @param tagname name of tag
2154
+ * @since 2.12
2130
2155
  * @virtual
2131
2156
  */
2132
2157
  vfunc_custom_tag_start(builder: Gtk.Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, never];
@@ -2135,6 +2160,7 @@ export namespace XreaderView {
2135
2160
  * Get the internal child called `childname` of the `buildable` object.
2136
2161
  * @param builder a {@link Gtk.Builder}
2137
2162
  * @param childname name of child
2163
+ * @since 2.12
2138
2164
  * @virtual
2139
2165
  */
2140
2166
  vfunc_get_internal_child<T = GObject.Object>(builder: Gtk.Builder, childname: string): T;
@@ -2145,6 +2171,7 @@ export namespace XreaderView {
2145
2171
  * {@link Gtk.Builder} sets the name based on the
2146
2172
  * [GtkBuilder UI definition][BUILDER-UI]
2147
2173
  * used to construct the `buildable`.
2174
+ * @since 2.12
2148
2175
  * @virtual
2149
2176
  */
2150
2177
  vfunc_get_name(): string;
@@ -2156,6 +2183,7 @@ export namespace XreaderView {
2156
2183
  * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()`
2157
2184
  * is called on a builder.
2158
2185
  * @param builder a {@link Gtk.Builder}
2186
+ * @since 2.12
2159
2187
  * @virtual
2160
2188
  */
2161
2189
  vfunc_parser_finished(builder: Gtk.Builder): void;
@@ -2165,6 +2193,7 @@ export namespace XreaderView {
2165
2193
  * @param builder a {@link Gtk.Builder}
2166
2194
  * @param name name of property
2167
2195
  * @param value value of property
2196
+ * @since 2.12
2168
2197
  * @virtual
2169
2198
  */
2170
2199
  vfunc_set_buildable_property(builder: Gtk.Builder, name: string, value: unknown): void;
@@ -2172,6 +2201,7 @@ export namespace XreaderView {
2172
2201
  /**
2173
2202
  * Sets the name of the `buildable` object.
2174
2203
  * @param name name to set
2204
+ * @since 2.12
2175
2205
  * @virtual
2176
2206
  */
2177
2207
  vfunc_set_name(name: string): void;