@girs/zbar-1.0 1.0.0-4.0.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 ADDED
@@ -0,0 +1,104 @@
1
+
2
+ # ZBar-1.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/zbar-1.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/zbar-1.0)
6
+
7
+
8
+ GJS TypeScript type definitions for ZBar-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0.
9
+
10
+
11
+ ## Install
12
+
13
+ To use this type definitions, install them with NPM:
14
+ ```bash
15
+ npm install @girs/zbar-1.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ You can import this package into your project like this:
21
+ ```ts
22
+ import ZBar from '@girs/zbar-1.0';
23
+ ```
24
+
25
+ Or if you prefer CommonJS, you can also use this:
26
+ ```ts
27
+ const ZBar = require('@girs/zbar-1.0');
28
+ ```
29
+
30
+ ### Ambient Modules
31
+
32
+ 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.
33
+ For this you need to include `@girs/zbar-1.0` or `@girs/zbar-1.0/ambient` in your `tsconfig` or entry point Typescript file:
34
+
35
+ `index.ts`:
36
+ ```ts
37
+ import '@girs/zbar-1.0'
38
+ ```
39
+
40
+ `tsconfig.json`:
41
+ ```json
42
+ {
43
+ "compilerOptions": {
44
+ ...
45
+ },
46
+ "include": ["@girs/zbar-1.0"],
47
+ ...
48
+ }
49
+ ```
50
+
51
+ Now you can import the ambient module with TypeScript support:
52
+
53
+ ```ts
54
+ import ZBar from 'gi://ZBar?version=1.0';
55
+ ```
56
+
57
+ ### Global import
58
+
59
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
60
+ For this you need to include `@girs/zbar-1.0` or `@girs/zbar-1.0/import` in your `tsconfig` or entry point Typescript file:
61
+
62
+ `index.ts`:
63
+ ```ts
64
+ import '@girs/zbar-1.0'
65
+ ```
66
+
67
+ `tsconfig.json`:
68
+ ```json
69
+ {
70
+ "compilerOptions": {
71
+ ...
72
+ },
73
+ "include": ["@girs/zbar-1.0"],
74
+ ...
75
+ }
76
+ ```
77
+
78
+ Now you have also type support for this, too:
79
+
80
+ ```ts
81
+ const ZBar = imports.gi.ZBar;
82
+ ```
83
+
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
+ ### Bundle
98
+
99
+ 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).
100
+
101
+ ## Other packages
102
+
103
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
104
+
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@girs/zbar-1.0",
3
+ "version": "1.0.0-4.0.0",
4
+ "description": "GJS TypeScript type definitions for ZBar-1.0, generated from library version 1.0.0",
5
+ "type": "module",
6
+ "module": "zbar-1.0.js",
7
+ "main": "zbar-1.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./zbar-1.0-ambient.d.ts",
11
+ "import": "./zbar-1.0-ambient.js",
12
+ "default": "./zbar-1.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./zbar-1.0-import.d.ts",
16
+ "import": "./zbar-1.0-import.js",
17
+ "default": "./zbar-1.0-import.js"
18
+ },
19
+ ".": {
20
+ "types": "./zbar-1.0.d.ts",
21
+ "import": "./zbar-1.0.js",
22
+ "default": "./zbar-1.0.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit zbar-1.0.d.ts"
27
+ },
28
+ "dependencies": {
29
+ "@girs/atk-1.0": "^2.45.1-4.0.0-beta.1",
30
+ "@girs/cairo-1.0": "^1.0.0-4.0.0-beta.1",
31
+ "@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.1",
32
+ "@girs/gdk-3.0": "^3.24.39-4.0.0-beta.1",
33
+ "@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.1",
34
+ "@girs/gio-2.0": "^2.77.0-4.0.0-beta.1",
35
+ "@girs/gjs": "^4.0.0-beta.1",
36
+ "@girs/glib-2.0": "^2.77.0-4.0.0-beta.1",
37
+ "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.1",
38
+ "@girs/gobject-2.0": "^2.77.0-4.0.0-beta.1",
39
+ "@girs/gtk-3.0": "^3.24.39-4.0.0-beta.1",
40
+ "@girs/harfbuzz-0.0": "^8.1.1-4.0.0-beta.1",
41
+ "@girs/pango-1.0": "^1.51.0-4.0.0-beta.1",
42
+ "@girs/xlib-2.0": "^2.0.0-4.0.0-beta.1"
43
+ },
44
+ "devDependencies": {
45
+ "typescript": "*"
46
+ },
47
+ "keywords": [
48
+ "Gir",
49
+ "TypeScript",
50
+ "types",
51
+ "GObject-Introspection",
52
+ "GJS",
53
+ "ZBar-1.0"
54
+ ],
55
+ "author": "ts-for-gir",
56
+ "license": "MIT",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/gjsify/ts-for-gir.git"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
63
+ },
64
+ "homepage": "https://github.com/gjsify/types/tree/main/zbar-1.0#readme"
65
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ // General settings for code interpretation
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ "lib": ["ESNext"],
7
+ "types": [],
8
+ "experimentalDecorators": true,
9
+ "moduleResolution": "node",
10
+ "noEmit": true,
11
+ "noEmitOnError": false,
12
+ "baseUrl": "./",
13
+ "rootDir": ".",
14
+ // General settings for code generation
15
+ "removeComments": false,
16
+ "inlineSourceMap": false,
17
+ "inlineSources": false,
18
+ "newLine": "LF"
19
+ },
20
+ "include": ["./zbar-1.0.d.ts"]
21
+ }
22
+
23
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./zbar-1.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "ZBar-1.0",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://ZBar?version=1.0' {
3
+ import ZBar from '@girs/zbar-1.0';
4
+ export default ZBar;
5
+ }
6
+
7
+ declare module 'gi://ZBar' {
8
+ import ZBar10 from 'gi://ZBar?version=1.0';
9
+ export default ZBar10;
10
+ }
11
+
12
+
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,12 @@
1
+
2
+ import ZBar10 from '@girs/zbar-1.0';
3
+
4
+ declare global {
5
+ export interface GjsGiImports {
6
+ ZBar: typeof ZBar10;
7
+ }
8
+ }
9
+
10
+ export default GjsGiImports;
11
+
12
+
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
package/zbar-1.0.d.ts ADDED
@@ -0,0 +1,696 @@
1
+ /*
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ */
7
+
8
+ import './zbar-1.0-ambient.d.ts';
9
+
10
+ /**
11
+ * ZBar-1.0
12
+ */
13
+
14
+ import Gtk__ from '@girs/gtk-3.0';
15
+ import type xlib from '@girs/xlib-2.0';
16
+ import type Gdk from '@girs/gdk-3.0';
17
+ import type cairo from '@girs/cairo-1.0';
18
+ import type GObject from '@girs/gobject-2.0';
19
+ import type GLib from '@girs/glib-2.0';
20
+ import type Pango from '@girs/pango-1.0';
21
+ import type HarfBuzz from '@girs/harfbuzz-0.0';
22
+ import type freetype2 from '@girs/freetype2-2.0';
23
+ import type Gio from '@girs/gio-2.0';
24
+ import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
25
+ import type GModule from '@girs/gmodule-2.0';
26
+ import type Atk from '@girs/atk-1.0';
27
+
28
+ export namespace ZBar {
29
+ module Gtk {
30
+ // Signal callback interfaces
31
+
32
+ interface Decoded {
33
+ (symbol_type: number, data: string): void;
34
+ }
35
+
36
+ interface DecodedText {
37
+ (text: string): void;
38
+ }
39
+
40
+ // Constructor properties interface
41
+
42
+ interface ConstructorProps
43
+ extends Gtk__.Widget.ConstructorProps,
44
+ Atk.ImplementorIface.ConstructorProps,
45
+ Gtk__.Buildable.ConstructorProps {
46
+ video_device: string;
47
+ videoDevice: string;
48
+ video_enabled: boolean;
49
+ videoEnabled: boolean;
50
+ video_opened: boolean;
51
+ videoOpened: boolean;
52
+ }
53
+ }
54
+
55
+ class Gtk extends Gtk__.Widget implements Atk.ImplementorIface, Gtk__.Buildable {
56
+ static $gtype: GObject.GType<Gtk>;
57
+
58
+ // Own properties of ZBar.Gtk
59
+
60
+ get video_device(): string;
61
+ set video_device(val: string);
62
+ get videoDevice(): string;
63
+ set videoDevice(val: string);
64
+ get video_enabled(): boolean;
65
+ set video_enabled(val: boolean);
66
+ get videoEnabled(): boolean;
67
+ set videoEnabled(val: boolean);
68
+ get video_opened(): boolean;
69
+ get videoOpened(): boolean;
70
+
71
+ // Own fields of ZBar.Gtk
72
+
73
+ widget: Gtk__.Widget;
74
+
75
+ // Constructors of ZBar.Gtk
76
+
77
+ constructor(properties?: Partial<Gtk.ConstructorProps>, ...args: any[]);
78
+
79
+ _init(...args: any[]): void;
80
+
81
+ static ['new'](): Gtk;
82
+
83
+ // Own signals of ZBar.Gtk
84
+
85
+ connect(id: string, callback: (...args: any[]) => any): number;
86
+ connect_after(id: string, callback: (...args: any[]) => any): number;
87
+ emit(id: string, ...args: any[]): void;
88
+ connect(signal: 'decoded', callback: (_source: this, symbol_type: number, data: string) => void): number;
89
+ connect_after(signal: 'decoded', callback: (_source: this, symbol_type: number, data: string) => void): number;
90
+ emit(signal: 'decoded', symbol_type: number, data: string): void;
91
+ connect(signal: 'decoded-text', callback: (_source: this, text: string) => void): number;
92
+ connect_after(signal: 'decoded-text', callback: (_source: this, text: string) => void): number;
93
+ emit(signal: 'decoded-text', text: string): void;
94
+
95
+ // Own static methods of ZBar.Gtk
96
+
97
+ /**
98
+ * utility function to populate a zbar_image_t from a GdkPixbuf.
99
+ * @param image the zbar library image destination to populate
100
+ * @param pixbuf the GdkPixbuf source
101
+ */
102
+ static image_from_pixbuf(image: any | null, pixbuf: GdkPixbuf.Pixbuf): boolean;
103
+
104
+ // Own virtual methods of ZBar.Gtk
105
+
106
+ vfunc_decoded_text(text: string): void;
107
+ vfunc_scan_image(image: GdkPixbuf.Pixbuf): void;
108
+
109
+ // Own methods of ZBar.Gtk
110
+
111
+ /**
112
+ * retrieve the currently opened video device.
113
+ * @returns the current video device or NULL if no device is opened
114
+ */
115
+ get_video_device(): string;
116
+ /**
117
+ * retrieve the current video enabled state.
118
+ * @returns true if video scanning is currently enabled, false otherwise
119
+ */
120
+ get_video_enabled(): boolean;
121
+ /**
122
+ * retrieve the current video opened state.
123
+ * @returns true if video device is currently opened, false otherwise
124
+ */
125
+ get_video_opened(): boolean;
126
+ /**
127
+ * set video camera resolution.
128
+ * `note` this call must be made before video is initialized
129
+ * @param width width in pixels
130
+ * @param height height in pixels
131
+ */
132
+ request_video_size(width: number, height: number): void;
133
+ scan_image(image: GdkPixbuf.Pixbuf): void;
134
+ /**
135
+ * open a new video device.
136
+ * `note` since opening a device may take some time, this call will
137
+ * return immediately and the device will be opened asynchronously
138
+ * @param video_device the platform specific name of the device to open. use NULL to close a currently opened device.
139
+ */
140
+ set_video_device(video_device?: string | null): void;
141
+ /**
142
+ * enable/disable video scanning.
143
+ * has no effect unless a video device is opened
144
+ * @param video_enabled true to enable video scanning, false to disable
145
+ */
146
+ set_video_enabled(video_enabled: boolean): void;
147
+
148
+ // Inherited methods
149
+ /**
150
+ * Adds a child to `buildable`. `type` is an optional string
151
+ * describing how the child should be added.
152
+ * @param builder a #GtkBuilder
153
+ * @param child child to add
154
+ * @param type kind of child or %NULL
155
+ */
156
+ add_child(builder: Gtk__.Builder, child: GObject.Object, type?: string | null): void;
157
+ /**
158
+ * Constructs a child of `buildable` with the name `name`.
159
+ *
160
+ * #GtkBuilder calls this function if a “constructor” has been
161
+ * specified in the UI definition.
162
+ * @param builder #GtkBuilder used to construct this object
163
+ * @param name name of child to construct
164
+ * @returns the constructed child
165
+ */
166
+ construct_child<T = GObject.Object>(builder: Gtk__.Builder, name: string): T;
167
+ /**
168
+ * This is similar to gtk_buildable_parser_finished() but is
169
+ * called once for each custom tag handled by the `buildable`.
170
+ * @param builder a #GtkBuilder
171
+ * @param child child object or %NULL for non-child tags
172
+ * @param tagname the name of the tag
173
+ * @param data user data created in custom_tag_start
174
+ */
175
+ custom_finished(builder: Gtk__.Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
176
+ /**
177
+ * This is called at the end of each custom element handled by
178
+ * the buildable.
179
+ * @param builder #GtkBuilder used to construct this object
180
+ * @param child child object or %NULL for non-child tags
181
+ * @param tagname name of tag
182
+ * @param data user data that will be passed in to parser functions
183
+ */
184
+ custom_tag_end(builder: Gtk__.Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
185
+ /**
186
+ * This is called for each unknown element under `<child>`.
187
+ * @param builder a #GtkBuilder used to construct this object
188
+ * @param child child object or %NULL for non-child tags
189
+ * @param tagname name of tag
190
+ * @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
191
+ */
192
+ custom_tag_start(
193
+ builder: Gtk__.Builder,
194
+ child: GObject.Object | null,
195
+ tagname: string,
196
+ ): [boolean, GLib.MarkupParser, any];
197
+ /**
198
+ * Get the internal child called `childname` of the `buildable` object.
199
+ * @param builder a #GtkBuilder
200
+ * @param childname name of child
201
+ * @returns the internal child of the buildable object
202
+ */
203
+ get_internal_child<T = GObject.Object>(builder: Gtk__.Builder, childname: string): T;
204
+ /**
205
+ * Gets the name of the `buildable` object.
206
+ *
207
+ * #GtkBuilder sets the name based on the
208
+ * [GtkBuilder UI definition][BUILDER-UI]
209
+ * used to construct the `buildable`.
210
+ * @returns the name set with gtk_buildable_set_name()
211
+ */
212
+ get_name(): string;
213
+ /**
214
+ * Called when the builder finishes the parsing of a
215
+ * [GtkBuilder UI definition][BUILDER-UI].
216
+ * Note that this will be called once for each time
217
+ * gtk_builder_add_from_file() or gtk_builder_add_from_string()
218
+ * is called on a builder.
219
+ * @param builder a #GtkBuilder
220
+ */
221
+ parser_finished(builder: Gtk__.Builder): void;
222
+ /**
223
+ * Sets the property name `name` to `value` on the `buildable` object.
224
+ * @param builder a #GtkBuilder
225
+ * @param name name of property
226
+ * @param value value of property
227
+ */
228
+ set_buildable_property(builder: Gtk__.Builder, name: string, value: GObject.Value | any): void;
229
+ /**
230
+ * Sets the name of the `buildable` object.
231
+ * @param name name to set
232
+ */
233
+ set_name(name: string): void;
234
+ /**
235
+ * Adds a child to `buildable`. `type` is an optional string
236
+ * describing how the child should be added.
237
+ * @param builder a #GtkBuilder
238
+ * @param child child to add
239
+ * @param type kind of child or %NULL
240
+ */
241
+ vfunc_add_child(builder: Gtk__.Builder, child: GObject.Object, type?: string | null): void;
242
+ /**
243
+ * Constructs a child of `buildable` with the name `name`.
244
+ *
245
+ * #GtkBuilder calls this function if a “constructor” has been
246
+ * specified in the UI definition.
247
+ * @param builder #GtkBuilder used to construct this object
248
+ * @param name name of child to construct
249
+ */
250
+ vfunc_construct_child<T = GObject.Object>(builder: Gtk__.Builder, name: string): T;
251
+ /**
252
+ * This is similar to gtk_buildable_parser_finished() but is
253
+ * called once for each custom tag handled by the `buildable`.
254
+ * @param builder a #GtkBuilder
255
+ * @param child child object or %NULL for non-child tags
256
+ * @param tagname the name of the tag
257
+ * @param data user data created in custom_tag_start
258
+ */
259
+ vfunc_custom_finished(
260
+ builder: Gtk__.Builder,
261
+ child: GObject.Object | null,
262
+ tagname: string,
263
+ data?: any | null,
264
+ ): void;
265
+ /**
266
+ * This is called at the end of each custom element handled by
267
+ * the buildable.
268
+ * @param builder #GtkBuilder used to construct this object
269
+ * @param child child object or %NULL for non-child tags
270
+ * @param tagname name of tag
271
+ * @param data user data that will be passed in to parser functions
272
+ */
273
+ vfunc_custom_tag_end(
274
+ builder: Gtk__.Builder,
275
+ child: GObject.Object | null,
276
+ tagname: string,
277
+ data?: any | null,
278
+ ): void;
279
+ /**
280
+ * This is called for each unknown element under `<child>`.
281
+ * @param builder a #GtkBuilder used to construct this object
282
+ * @param child child object or %NULL for non-child tags
283
+ * @param tagname name of tag
284
+ */
285
+ vfunc_custom_tag_start(
286
+ builder: Gtk__.Builder,
287
+ child: GObject.Object | null,
288
+ tagname: string,
289
+ ): [boolean, GLib.MarkupParser, any];
290
+ /**
291
+ * Get the internal child called `childname` of the `buildable` object.
292
+ * @param builder a #GtkBuilder
293
+ * @param childname name of child
294
+ */
295
+ vfunc_get_internal_child<T = GObject.Object>(builder: Gtk__.Builder, childname: string): T;
296
+ /**
297
+ * Gets the name of the `buildable` object.
298
+ *
299
+ * #GtkBuilder sets the name based on the
300
+ * [GtkBuilder UI definition][BUILDER-UI]
301
+ * used to construct the `buildable`.
302
+ */
303
+ vfunc_get_name(): string;
304
+ /**
305
+ * Called when the builder finishes the parsing of a
306
+ * [GtkBuilder UI definition][BUILDER-UI].
307
+ * Note that this will be called once for each time
308
+ * gtk_builder_add_from_file() or gtk_builder_add_from_string()
309
+ * is called on a builder.
310
+ * @param builder a #GtkBuilder
311
+ */
312
+ vfunc_parser_finished(builder: Gtk__.Builder): void;
313
+ /**
314
+ * Sets the property name `name` to `value` on the `buildable` object.
315
+ * @param builder a #GtkBuilder
316
+ * @param name name of property
317
+ * @param value value of property
318
+ */
319
+ vfunc_set_buildable_property(builder: Gtk__.Builder, name: string, value: GObject.Value | any): void;
320
+ /**
321
+ * Sets the name of the `buildable` object.
322
+ * @param name name to set
323
+ */
324
+ vfunc_set_name(name: string): void;
325
+ /**
326
+ * Creates a binding between `source_property` on `source` and `target_property`
327
+ * on `target`.
328
+ *
329
+ * Whenever the `source_property` is changed the `target_property` is
330
+ * updated using the same value. For instance:
331
+ *
332
+ *
333
+ * ```c
334
+ * g_object_bind_property (action, "active", widget, "sensitive", 0);
335
+ * ```
336
+ *
337
+ *
338
+ * Will result in the "sensitive" property of the widget #GObject instance to be
339
+ * updated with the same value of the "active" property of the action #GObject
340
+ * instance.
341
+ *
342
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
343
+ * if `target_property` on `target` changes then the `source_property` on `source`
344
+ * will be updated as well.
345
+ *
346
+ * The binding will automatically be removed when either the `source` or the
347
+ * `target` instances are finalized. To remove the binding without affecting the
348
+ * `source` and the `target` you can just call g_object_unref() on the returned
349
+ * #GBinding instance.
350
+ *
351
+ * Removing the binding by calling g_object_unref() on it must only be done if
352
+ * the binding, `source` and `target` are only used from a single thread and it
353
+ * is clear that both `source` and `target` outlive the binding. Especially it
354
+ * is not safe to rely on this if the binding, `source` or `target` can be
355
+ * finalized from different threads. Keep another reference to the binding and
356
+ * use g_binding_unbind() instead to be on the safe side.
357
+ *
358
+ * A #GObject can have multiple bindings.
359
+ * @param source_property the property on @source to bind
360
+ * @param target the target #GObject
361
+ * @param target_property the property on @target to bind
362
+ * @param flags flags to pass to #GBinding
363
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
364
+ */
365
+ bind_property(
366
+ source_property: string,
367
+ target: GObject.Object,
368
+ target_property: string,
369
+ flags: GObject.BindingFlags,
370
+ ): GObject.Binding;
371
+ /**
372
+ * Complete version of g_object_bind_property().
373
+ *
374
+ * Creates a binding between `source_property` on `source` and `target_property`
375
+ * on `target,` allowing you to set the transformation functions to be used by
376
+ * the binding.
377
+ *
378
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
379
+ * if `target_property` on `target` changes then the `source_property` on `source`
380
+ * will be updated as well. The `transform_from` function is only used in case
381
+ * of bidirectional bindings, otherwise it will be ignored
382
+ *
383
+ * The binding will automatically be removed when either the `source` or the
384
+ * `target` instances are finalized. This will release the reference that is
385
+ * being held on the #GBinding instance; if you want to hold on to the
386
+ * #GBinding instance, you will need to hold a reference to it.
387
+ *
388
+ * To remove the binding, call g_binding_unbind().
389
+ *
390
+ * A #GObject can have multiple bindings.
391
+ *
392
+ * The same `user_data` parameter will be used for both `transform_to`
393
+ * and `transform_from` transformation functions; the `notify` function will
394
+ * be called once, when the binding is removed. If you need different data
395
+ * for each transformation function, please use
396
+ * g_object_bind_property_with_closures() instead.
397
+ * @param source_property the property on @source to bind
398
+ * @param target the target #GObject
399
+ * @param target_property the property on @target to bind
400
+ * @param flags flags to pass to #GBinding
401
+ * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
402
+ * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
403
+ * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
404
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
405
+ */
406
+ bind_property_full(
407
+ source_property: string,
408
+ target: GObject.Object,
409
+ target_property: string,
410
+ flags: GObject.BindingFlags,
411
+ transform_to?: GObject.BindingTransformFunc | null,
412
+ transform_from?: GObject.BindingTransformFunc | null,
413
+ notify?: GLib.DestroyNotify | null,
414
+ ): GObject.Binding;
415
+ // Conflicted with GObject.Object.bind_property_full
416
+ bind_property_full(...args: never[]): any;
417
+ /**
418
+ * This function is intended for #GObject implementations to re-enforce
419
+ * a [floating][floating-ref] object reference. Doing this is seldom
420
+ * required: all #GInitiallyUnowneds are created with a floating reference
421
+ * which usually just needs to be sunken by calling g_object_ref_sink().
422
+ */
423
+ force_floating(): void;
424
+ /**
425
+ * Increases the freeze count on `object`. If the freeze count is
426
+ * non-zero, the emission of "notify" signals on `object` is
427
+ * stopped. The signals are queued until the freeze count is decreased
428
+ * to zero. Duplicate notifications are squashed so that at most one
429
+ * #GObject::notify signal is emitted for each property modified while the
430
+ * object is frozen.
431
+ *
432
+ * This is necessary for accessors that modify multiple properties to prevent
433
+ * premature notification while the object is still being modified.
434
+ */
435
+ freeze_notify(): void;
436
+ /**
437
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
438
+ * @param key name of the key for that association
439
+ * @returns the data if found, or %NULL if no such data exists.
440
+ */
441
+ get_data(key: string): any | null;
442
+ get_property(property_name: string): any;
443
+ /**
444
+ * This function gets back user data pointers stored via
445
+ * g_object_set_qdata().
446
+ * @param quark A #GQuark, naming the user data pointer
447
+ * @returns The user data pointer set, or %NULL
448
+ */
449
+ get_qdata(quark: GLib.Quark): any | null;
450
+ /**
451
+ * Gets `n_properties` properties for an `object`.
452
+ * Obtained properties will be set to `values`. All properties must be valid.
453
+ * Warnings will be emitted and undefined behaviour may result if invalid
454
+ * properties are passed in.
455
+ * @param names the names of each property to get
456
+ * @param values the values of each property to get
457
+ */
458
+ getv(names: string[], values: (GObject.Value | any)[]): void;
459
+ /**
460
+ * Checks whether `object` has a [floating][floating-ref] reference.
461
+ * @returns %TRUE if @object has a floating reference
462
+ */
463
+ is_floating(): boolean;
464
+ /**
465
+ * Emits a "notify" signal for the property `property_name` on `object`.
466
+ *
467
+ * When possible, eg. when signaling a property change from within the class
468
+ * that registered the property, you should use g_object_notify_by_pspec()
469
+ * instead.
470
+ *
471
+ * Note that emission of the notify signal may be blocked with
472
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
473
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
474
+ * called.
475
+ * @param property_name the name of a property installed on the class of @object.
476
+ */
477
+ notify(property_name: string): void;
478
+ /**
479
+ * Emits a "notify" signal for the property specified by `pspec` on `object`.
480
+ *
481
+ * This function omits the property name lookup, hence it is faster than
482
+ * g_object_notify().
483
+ *
484
+ * One way to avoid using g_object_notify() from within the
485
+ * class that registered the properties, and using g_object_notify_by_pspec()
486
+ * instead, is to store the GParamSpec used with
487
+ * g_object_class_install_property() inside a static array, e.g.:
488
+ *
489
+ *
490
+ * ```c
491
+ * typedef enum
492
+ * {
493
+ * PROP_FOO = 1,
494
+ * PROP_LAST
495
+ * } MyObjectProperty;
496
+ *
497
+ * static GParamSpec *properties[PROP_LAST];
498
+ *
499
+ * static void
500
+ * my_object_class_init (MyObjectClass *klass)
501
+ * {
502
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
503
+ * 0, 100,
504
+ * 50,
505
+ * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
506
+ * g_object_class_install_property (gobject_class,
507
+ * PROP_FOO,
508
+ * properties[PROP_FOO]);
509
+ * }
510
+ * ```
511
+ *
512
+ *
513
+ * and then notify a change on the "foo" property with:
514
+ *
515
+ *
516
+ * ```c
517
+ * g_object_notify_by_pspec (self, properties[PROP_FOO]);
518
+ * ```
519
+ *
520
+ * @param pspec the #GParamSpec of a property installed on the class of @object.
521
+ */
522
+ notify_by_pspec(pspec: GObject.ParamSpec): void;
523
+ /**
524
+ * Increases the reference count of `object`.
525
+ *
526
+ * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
527
+ * of `object` will be propagated to the return type (using the GCC typeof()
528
+ * extension), so any casting the caller needs to do on the return type must be
529
+ * explicit.
530
+ * @returns the same @object
531
+ */
532
+ ref(): GObject.Object;
533
+ /**
534
+ * Increase the reference count of `object,` and possibly remove the
535
+ * [floating][floating-ref] reference, if `object` has a floating reference.
536
+ *
537
+ * In other words, if the object is floating, then this call "assumes
538
+ * ownership" of the floating reference, converting it to a normal
539
+ * reference by clearing the floating flag while leaving the reference
540
+ * count unchanged. If the object is not floating, then this call
541
+ * adds a new normal reference increasing the reference count by one.
542
+ *
543
+ * Since GLib 2.56, the type of `object` will be propagated to the return type
544
+ * under the same conditions as for g_object_ref().
545
+ * @returns @object
546
+ */
547
+ ref_sink(): GObject.Object;
548
+ /**
549
+ * Releases all references to other objects. This can be used to break
550
+ * reference cycles.
551
+ *
552
+ * This function should only be called from object system implementations.
553
+ */
554
+ run_dispose(): void;
555
+ /**
556
+ * Each object carries around a table of associations from
557
+ * strings to pointers. This function lets you set an association.
558
+ *
559
+ * If the object already had an association with that name,
560
+ * the old association will be destroyed.
561
+ *
562
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
563
+ * This means a copy of `key` is kept permanently (even after `object` has been
564
+ * finalized) — so it is recommended to only use a small, bounded set of values
565
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
566
+ * @param key name of the key
567
+ * @param data data to associate with that key
568
+ */
569
+ set_data(key: string, data?: any | null): void;
570
+ set_property(property_name: string, value: any): void;
571
+ /**
572
+ * Remove a specified datum from the object's data associations,
573
+ * without invoking the association's destroy handler.
574
+ * @param key name of the key
575
+ * @returns the data if found, or %NULL if no such data exists.
576
+ */
577
+ steal_data(key: string): any | null;
578
+ /**
579
+ * This function gets back user data pointers stored via
580
+ * g_object_set_qdata() and removes the `data` from object
581
+ * without invoking its destroy() function (if any was
582
+ * set).
583
+ * Usually, calling this function is only required to update
584
+ * user data pointers with a destroy notifier, for example:
585
+ *
586
+ * ```c
587
+ * void
588
+ * object_add_to_user_list (GObject *object,
589
+ * const gchar *new_string)
590
+ * {
591
+ * // the quark, naming the object data
592
+ * GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
593
+ * // retrieve the old string list
594
+ * GList *list = g_object_steal_qdata (object, quark_string_list);
595
+ *
596
+ * // prepend new string
597
+ * list = g_list_prepend (list, g_strdup (new_string));
598
+ * // this changed 'list', so we need to set it again
599
+ * g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
600
+ * }
601
+ * static void
602
+ * free_string_list (gpointer data)
603
+ * {
604
+ * GList *node, *list = data;
605
+ *
606
+ * for (node = list; node; node = node->next)
607
+ * g_free (node->data);
608
+ * g_list_free (list);
609
+ * }
610
+ * ```
611
+ *
612
+ * Using g_object_get_qdata() in the above example, instead of
613
+ * g_object_steal_qdata() would have left the destroy function set,
614
+ * and thus the partial string list would have been freed upon
615
+ * g_object_set_qdata_full().
616
+ * @param quark A #GQuark, naming the user data pointer
617
+ * @returns The user data pointer set, or %NULL
618
+ */
619
+ steal_qdata(quark: GLib.Quark): any | null;
620
+ /**
621
+ * Reverts the effect of a previous call to
622
+ * g_object_freeze_notify(). The freeze count is decreased on `object`
623
+ * and when it reaches zero, queued "notify" signals are emitted.
624
+ *
625
+ * Duplicate notifications for each property are squashed so that at most one
626
+ * #GObject::notify signal is emitted for each property, in the reverse order
627
+ * in which they have been queued.
628
+ *
629
+ * It is an error to call this function when the freeze count is zero.
630
+ */
631
+ thaw_notify(): void;
632
+ /**
633
+ * Decreases the reference count of `object`. When its reference count
634
+ * drops to 0, the object is finalized (i.e. its memory is freed).
635
+ *
636
+ * If the pointer to the #GObject may be reused in future (for example, if it is
637
+ * an instance variable of another object), it is recommended to clear the
638
+ * pointer to %NULL rather than retain a dangling pointer to a potentially
639
+ * invalid #GObject instance. Use g_clear_object() for this.
640
+ */
641
+ unref(): void;
642
+ /**
643
+ * This function essentially limits the life time of the `closure` to
644
+ * the life time of the object. That is, when the object is finalized,
645
+ * the `closure` is invalidated by calling g_closure_invalidate() on
646
+ * it, in order to prevent invocations of the closure with a finalized
647
+ * (nonexisting) object. Also, g_object_ref() and g_object_unref() are
648
+ * added as marshal guards to the `closure,` to ensure that an extra
649
+ * reference count is held on `object` during invocation of the
650
+ * `closure`. Usually, this function will be called on closures that
651
+ * use this `object` as closure data.
652
+ * @param closure #GClosure to watch
653
+ */
654
+ watch_closure(closure: GObject.Closure): void;
655
+ vfunc_constructed(): void;
656
+ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
657
+ vfunc_dispose(): void;
658
+ vfunc_finalize(): void;
659
+ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
660
+ /**
661
+ * Emits a "notify" signal for the property `property_name` on `object`.
662
+ *
663
+ * When possible, eg. when signaling a property change from within the class
664
+ * that registered the property, you should use g_object_notify_by_pspec()
665
+ * instead.
666
+ *
667
+ * Note that emission of the notify signal may be blocked with
668
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
669
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
670
+ * called.
671
+ * @param pspec
672
+ */
673
+ vfunc_notify(pspec: GObject.ParamSpec): void;
674
+ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
675
+ disconnect(id: number): void;
676
+ set(properties: { [key: string]: any }): void;
677
+ block_signal_handler(id: number): any;
678
+ unblock_signal_handler(id: number): any;
679
+ stop_emission_by_name(detailedName: string): any;
680
+ }
681
+
682
+ type GtkClass = typeof Gtk;
683
+ /**
684
+ * Name of the imported GIR library
685
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
686
+ */
687
+ const __name__: string;
688
+ /**
689
+ * Version of the imported GIR library
690
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
691
+ */
692
+ const __version__: string;
693
+ }
694
+
695
+ export default ZBar;
696
+ // END
package/zbar-1.0.js ADDED
@@ -0,0 +1,6 @@
1
+
2
+ // @ts-expect-error
3
+ import ZBar from 'gi://ZBar?version=1.0';
4
+ export { ZBar };
5
+ export default ZBar;
6
+