@girs/template-1.0 3.36.1-3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/package.json +54 -0
- package/template-1.0.cjs +9 -0
- package/template-1.0.d.cts +565 -0
- package/template-1.0.d.ts +570 -0
- package/template-1.0.js +8 -0
- package/tsconfig.doc.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# Template-1.0
|
|
3
|
+
|
|
4
|
+
GJS TypeScript type definitions for Template-1.0, generated from library version 3.36.1 using [ts-for-gir](https://github.com/gjsify/ts-for-gjs) v3.0.0-beta.12.
|
|
5
|
+
|
|
6
|
+
Template-GLib is a library to generate text from a template and user defined state. Template-GLib allows you to access properties on GObjects as well as call simple methods via GObject-Introspection Template-GLib does not use a language runtime, so it is safe to use from any GObject-Introspectable language.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
To use this type definitions, install them with NPM like this:
|
|
11
|
+
```bash
|
|
12
|
+
npm install @girs/template-1.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
You can import this package into your project like this:
|
|
18
|
+
```ts
|
|
19
|
+
import Template from '@girs/template-1.0';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or if you prefer CommonJS, you can also use this:
|
|
23
|
+
```ts
|
|
24
|
+
const Template = require('@girs/template-1.0');
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules), you can also import this module like you would do this in JavaScript:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import Template from 'gi://Template?version=1.0';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@girs/template-1.0",
|
|
3
|
+
"version": "3.36.1-3.0.0-beta.12",
|
|
4
|
+
"description": "GJS TypeScript type definitions for Template-1.0, generated from library version 3.36.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "template-1.0.js",
|
|
7
|
+
"main": "template-1.0.js",
|
|
8
|
+
"typedoc": {
|
|
9
|
+
"entryPoint": "./template-1.0.d.ts",
|
|
10
|
+
"readmeFile": "./README.md",
|
|
11
|
+
"displayName": "Template-1.0",
|
|
12
|
+
"tsconfig": "./tsconfig.doc.json"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./template-1.0.d.ts",
|
|
18
|
+
"default": "./template-1.0.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"types": "./template-1.0.d.cts",
|
|
22
|
+
"default": "./template-1.0.cjs"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "yarn test:esm && yarn test:cjs",
|
|
28
|
+
"test:esm": "tsc --noEmit template-1.0.d.ts",
|
|
29
|
+
"test:cjs": "tsc --noEmit template-1.0.d.cts"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@girs/gio-2.0": "^2.75.1-3.0.0-beta.12",
|
|
33
|
+
"@girs/glib-2.0": "^2.75.1-3.0.0-beta.12",
|
|
34
|
+
"@girs/gobject-2.0": "^2.75.1-3.0.0-beta.12"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"typescript": "^*"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"Gir",
|
|
41
|
+
"TypeScript",
|
|
42
|
+
"Template-1.0"
|
|
43
|
+
],
|
|
44
|
+
"author": "ts-for-gir",
|
|
45
|
+
"license": "Apache-2.0",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/gjsify/ts-for-gir.git"
|
|
49
|
+
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/gjsify/ts-for-gir/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/gjsify/ts-for-gir#readme"
|
|
54
|
+
}
|
package/template-1.0.cjs
ADDED
|
@@ -0,0 +1,565 @@
|
|
|
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
|
+
* Template-1.0
|
|
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
|
+
|
|
16
|
+
export enum Error {
|
|
17
|
+
INVALID_STATE,
|
|
18
|
+
TEMPLATE_NOT_FOUND,
|
|
19
|
+
CIRCULAR_INCLUDE,
|
|
20
|
+
SYNTAX_ERROR,
|
|
21
|
+
LEXER_FAILURE,
|
|
22
|
+
TYPE_MISMATCH,
|
|
23
|
+
INVALID_OP_CODE,
|
|
24
|
+
DIVIDE_BY_ZERO,
|
|
25
|
+
MISSING_SYMBOL,
|
|
26
|
+
SYMBOL_REDEFINED,
|
|
27
|
+
NOT_AN_OBJECT,
|
|
28
|
+
NULL_POINTER,
|
|
29
|
+
NO_SUCH_PROPERTY,
|
|
30
|
+
GI_FAILURE,
|
|
31
|
+
RUNTIME_ERROR,
|
|
32
|
+
NOT_IMPLEMENTED,
|
|
33
|
+
NOT_A_VALUE,
|
|
34
|
+
NOT_A_FUNCTION,
|
|
35
|
+
}
|
|
36
|
+
export enum ExprBuiltin {
|
|
37
|
+
ABS,
|
|
38
|
+
CEIL,
|
|
39
|
+
FLOOR,
|
|
40
|
+
HEX,
|
|
41
|
+
LOG,
|
|
42
|
+
PRINT,
|
|
43
|
+
REPR,
|
|
44
|
+
SQRT,
|
|
45
|
+
TYPEOF,
|
|
46
|
+
ASSERT,
|
|
47
|
+
SIN,
|
|
48
|
+
TAN,
|
|
49
|
+
COS,
|
|
50
|
+
PRINTERR,
|
|
51
|
+
CAST_BYTE,
|
|
52
|
+
CAST_CHAR,
|
|
53
|
+
CAST_I32,
|
|
54
|
+
CAST_U32,
|
|
55
|
+
CAST_I64,
|
|
56
|
+
CAST_U64,
|
|
57
|
+
CAST_FLOAT,
|
|
58
|
+
CAST_DOUBLE,
|
|
59
|
+
CAST_BOOL,
|
|
60
|
+
}
|
|
61
|
+
export enum ExprType {
|
|
62
|
+
ADD,
|
|
63
|
+
SUB,
|
|
64
|
+
MUL,
|
|
65
|
+
DIV,
|
|
66
|
+
BOOLEAN,
|
|
67
|
+
NUMBER,
|
|
68
|
+
STRING,
|
|
69
|
+
GT,
|
|
70
|
+
LT,
|
|
71
|
+
NE,
|
|
72
|
+
EQ,
|
|
73
|
+
GTE,
|
|
74
|
+
LTE,
|
|
75
|
+
UNARY_MINUS,
|
|
76
|
+
STMT_LIST,
|
|
77
|
+
IF,
|
|
78
|
+
WHILE,
|
|
79
|
+
SYMBOL_REF,
|
|
80
|
+
SYMBOL_ASSIGN,
|
|
81
|
+
FN_CALL,
|
|
82
|
+
ANON_FN_CALL,
|
|
83
|
+
USER_FN_CALL,
|
|
84
|
+
GETATTR,
|
|
85
|
+
SETATTR,
|
|
86
|
+
GI_CALL,
|
|
87
|
+
REQUIRE,
|
|
88
|
+
AND,
|
|
89
|
+
OR,
|
|
90
|
+
INVERT_BOOLEAN,
|
|
91
|
+
ARGS,
|
|
92
|
+
FUNC,
|
|
93
|
+
NOP,
|
|
94
|
+
NULL,
|
|
95
|
+
}
|
|
96
|
+
export enum SymbolType {
|
|
97
|
+
EXPR,
|
|
98
|
+
VALUE,
|
|
99
|
+
}
|
|
100
|
+
export const ENABLE_TRACE: number
|
|
101
|
+
export const LOG_LEVEL_TRACE: number
|
|
102
|
+
/**
|
|
103
|
+
* Template-GLibl major version component (e.g. 1 if %TMPL_VERSION is 1.2.3)
|
|
104
|
+
*/
|
|
105
|
+
export const MAJOR_VERSION: number
|
|
106
|
+
/**
|
|
107
|
+
* Template-GLibl micro version component (e.g. 3 if %TMPL_VERSION is 1.2.3)
|
|
108
|
+
*/
|
|
109
|
+
export const MICRO_VERSION: number
|
|
110
|
+
/**
|
|
111
|
+
* Template-GLibl minor version component (e.g. 2 if %TMPL_VERSION is 1.2.3)
|
|
112
|
+
*/
|
|
113
|
+
export const MINOR_VERSION: number
|
|
114
|
+
/**
|
|
115
|
+
* Template-GLib version, encoded as a string, useful for printing and
|
|
116
|
+
* concatenation.
|
|
117
|
+
*/
|
|
118
|
+
export const VERSION_S: string | null
|
|
119
|
+
export function error_quark(): GLib.Quark
|
|
120
|
+
export function expr_from_string(str: string | null): Expr
|
|
121
|
+
export interface ScopeResolver {
|
|
122
|
+
(scope: Scope, name: string | null, symbol: Symbol): boolean
|
|
123
|
+
}
|
|
124
|
+
export module Template {
|
|
125
|
+
|
|
126
|
+
// Constructor properties interface
|
|
127
|
+
|
|
128
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
129
|
+
|
|
130
|
+
// Own constructor properties of Template-1.0.Template.Template
|
|
131
|
+
|
|
132
|
+
locator?: TemplateLocator | null
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface Template {
|
|
138
|
+
|
|
139
|
+
// Own properties of Template-1.0.Template.Template
|
|
140
|
+
|
|
141
|
+
locator: TemplateLocator
|
|
142
|
+
|
|
143
|
+
// Own fields of Template-1.0.Template.Template
|
|
144
|
+
|
|
145
|
+
parent_instance: GObject.Object
|
|
146
|
+
|
|
147
|
+
// Owm methods of Template-1.0.Template.Template
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Expands a template into `stream` using the `scope` provided.
|
|
151
|
+
*
|
|
152
|
+
* `scope` should have all of the variables set that are required to expand
|
|
153
|
+
* the template, or you will get a symbol reference error and %FALSE will
|
|
154
|
+
* be returned.
|
|
155
|
+
*
|
|
156
|
+
* To set a symbol value, get the symbol with tmpl_scope_get() and assign
|
|
157
|
+
* a value using tmpl_scope_assign_value() or similar methods.
|
|
158
|
+
* @param stream a #GOutputStream to write the results to
|
|
159
|
+
* @param scope A #TmplScope containing state for the template, or %NULL.
|
|
160
|
+
* @param cancellable An optional cancellable for the operation.
|
|
161
|
+
* @returns %TRUE if successful, otherwise %FALSE and @error is set.
|
|
162
|
+
*/
|
|
163
|
+
expand(stream: Gio.OutputStream, scope: Scope | null, cancellable: Gio.Cancellable | null): boolean
|
|
164
|
+
/**
|
|
165
|
+
* Expands the template and returns the result as a string.
|
|
166
|
+
* @param scope A #TmplScope or %NULL.
|
|
167
|
+
* @returns A newly allocated string, or %NULL upon failure.
|
|
168
|
+
*/
|
|
169
|
+
expand_string(scope: Scope | null): string | null
|
|
170
|
+
/**
|
|
171
|
+
* Gets the template locator used when resolving template includes.
|
|
172
|
+
* @returns a #TmplTemplateLocator or %NULL.
|
|
173
|
+
*/
|
|
174
|
+
get_locator(): TemplateLocator
|
|
175
|
+
parse(stream: Gio.InputStream, cancellable: Gio.Cancellable | null): boolean
|
|
176
|
+
parse_file(file: Gio.File, cancellable: Gio.Cancellable | null): boolean
|
|
177
|
+
parse_path(path: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
178
|
+
parse_resource(path: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
179
|
+
parse_string(input: string | null): boolean
|
|
180
|
+
set_locator(locator: TemplateLocator): void
|
|
181
|
+
|
|
182
|
+
// Class property signals of Template-1.0.Template.Template
|
|
183
|
+
|
|
184
|
+
connect(sigName: "notify::locator", callback: (($obj: Template, pspec: GObject.ParamSpec) => void)): number
|
|
185
|
+
connect_after(sigName: "notify::locator", callback: (($obj: Template, pspec: GObject.ParamSpec) => void)): number
|
|
186
|
+
emit(sigName: "notify::locator", ...args: any[]): void
|
|
187
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
188
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
189
|
+
emit(sigName: string, ...args: any[]): void
|
|
190
|
+
disconnect(id: number): void
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export class Template extends GObject.Object {
|
|
194
|
+
|
|
195
|
+
// Own properties of Template-1.0.Template.Template
|
|
196
|
+
|
|
197
|
+
static name: string
|
|
198
|
+
static $gtype: GObject.GType<Template>
|
|
199
|
+
|
|
200
|
+
// Constructors of Template-1.0.Template.Template
|
|
201
|
+
|
|
202
|
+
constructor(config?: Template.ConstructorProperties)
|
|
203
|
+
/**
|
|
204
|
+
* Creates a new #TmplTemplate.
|
|
205
|
+
*
|
|
206
|
+
* If `locator` is specified, `locator` will be used to resolve include
|
|
207
|
+
* directives when parsing the template.
|
|
208
|
+
* @constructor
|
|
209
|
+
* @param locator A #TmplTemplateLocator or %NULL.
|
|
210
|
+
* @returns A #TmplTemplate.
|
|
211
|
+
*/
|
|
212
|
+
constructor(locator: TemplateLocator | null)
|
|
213
|
+
/**
|
|
214
|
+
* Creates a new #TmplTemplate.
|
|
215
|
+
*
|
|
216
|
+
* If `locator` is specified, `locator` will be used to resolve include
|
|
217
|
+
* directives when parsing the template.
|
|
218
|
+
* @constructor
|
|
219
|
+
* @param locator A #TmplTemplateLocator or %NULL.
|
|
220
|
+
* @returns A #TmplTemplate.
|
|
221
|
+
*/
|
|
222
|
+
static new(locator: TemplateLocator | null): Template
|
|
223
|
+
_init(config?: Template.ConstructorProperties): void
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export module TemplateLocator {
|
|
227
|
+
|
|
228
|
+
// Constructor properties interface
|
|
229
|
+
|
|
230
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface TemplateLocator {
|
|
236
|
+
|
|
237
|
+
// Own fields of Template-1.0.Template.TemplateLocator
|
|
238
|
+
|
|
239
|
+
parent_instance: GObject.Object
|
|
240
|
+
|
|
241
|
+
// Owm methods of Template-1.0.Template.TemplateLocator
|
|
242
|
+
|
|
243
|
+
append_search_path(path: string | null): void
|
|
244
|
+
/**
|
|
245
|
+
* Gets the current search path used by the template locator.
|
|
246
|
+
* @returns A %NULL-terminated array of strings.
|
|
247
|
+
*/
|
|
248
|
+
get_search_path(): string[]
|
|
249
|
+
/**
|
|
250
|
+
* This will resolve the relative path using the search paths found within
|
|
251
|
+
* the template loader.
|
|
252
|
+
* @param path a relative path to the file
|
|
253
|
+
* @returns A #GInputStream or %NULL and @error is set.
|
|
254
|
+
*/
|
|
255
|
+
locate(path: string | null): Gio.InputStream
|
|
256
|
+
prepend_search_path(path: string | null): void
|
|
257
|
+
|
|
258
|
+
// Own virtual methods of Template-1.0.Template.TemplateLocator
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* This will resolve the relative path using the search paths found within
|
|
262
|
+
* the template loader.
|
|
263
|
+
* @virtual
|
|
264
|
+
* @param path a relative path to the file
|
|
265
|
+
* @returns A #GInputStream or %NULL and @error is set.
|
|
266
|
+
*/
|
|
267
|
+
vfunc_locate(path: string | null): Gio.InputStream
|
|
268
|
+
|
|
269
|
+
// Class property signals of Template-1.0.Template.TemplateLocator
|
|
270
|
+
|
|
271
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
272
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
273
|
+
emit(sigName: string, ...args: any[]): void
|
|
274
|
+
disconnect(id: number): void
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The #TmplTemplateLoader class is used to specify how templates
|
|
279
|
+
* should be loaded. This can be used directly by your code that
|
|
280
|
+
* will compile the data streams into #TmplTemplate instances, or
|
|
281
|
+
* by a #TmplTemplate that is resolving includes from the
|
|
282
|
+
* `{{include "path.tmpl"}}` directive.
|
|
283
|
+
*
|
|
284
|
+
* See #TmplTemplate:locator for more information.
|
|
285
|
+
* @class
|
|
286
|
+
*/
|
|
287
|
+
export class TemplateLocator extends GObject.Object {
|
|
288
|
+
|
|
289
|
+
// Own properties of Template-1.0.Template.TemplateLocator
|
|
290
|
+
|
|
291
|
+
static name: string
|
|
292
|
+
static $gtype: GObject.GType<TemplateLocator>
|
|
293
|
+
|
|
294
|
+
// Constructors of Template-1.0.Template.TemplateLocator
|
|
295
|
+
|
|
296
|
+
constructor(config?: TemplateLocator.ConstructorProperties)
|
|
297
|
+
constructor()
|
|
298
|
+
static new(): TemplateLocator
|
|
299
|
+
_init(config?: TemplateLocator.ConstructorProperties): void
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface Scope {
|
|
303
|
+
|
|
304
|
+
// Owm methods of Template-1.0.Template.Scope
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Gets a string if the symbol `name` is a string.
|
|
308
|
+
*
|
|
309
|
+
* Otherwise, %NULL is returned.
|
|
310
|
+
* @param name
|
|
311
|
+
* @returns a string or %NULL
|
|
312
|
+
*/
|
|
313
|
+
dup_string(name: string | null): string | null
|
|
314
|
+
/**
|
|
315
|
+
* If the symbol could not be found, it will be allocated.
|
|
316
|
+
* @param name
|
|
317
|
+
* @returns A #TmplSymbol.
|
|
318
|
+
*/
|
|
319
|
+
get(name: string | null): Symbol
|
|
320
|
+
/**
|
|
321
|
+
* Gets the names of all symbols within the scope.
|
|
322
|
+
* @param recursive if the parent scopes should be included
|
|
323
|
+
* @returns an array containing the names of all symbols within the scope.
|
|
324
|
+
*/
|
|
325
|
+
list_symbols(recursive: boolean): string[]
|
|
326
|
+
/**
|
|
327
|
+
* Creates a new scope to contain variables and custom expressions,
|
|
328
|
+
* If `parent` is set, the parent scope will be inherited.
|
|
329
|
+
* @returns A newly created #TmplScope.
|
|
330
|
+
*/
|
|
331
|
+
new_with_parent(): Scope
|
|
332
|
+
/**
|
|
333
|
+
* If the symbol could not be found, %NULL is returned.
|
|
334
|
+
* @param name
|
|
335
|
+
* @returns A #TmplSymbol or %NULL.
|
|
336
|
+
*/
|
|
337
|
+
peek(name: string | null): Symbol | null
|
|
338
|
+
ref(): Scope
|
|
339
|
+
/**
|
|
340
|
+
* Imports `namespace_` into `self` so it can be used by expressions.
|
|
341
|
+
* @param namespace_ the namespace to import into the scope
|
|
342
|
+
* @param version the version of `namespace_` to import
|
|
343
|
+
* @returns %TRUE if successful; otherwise %FALSE
|
|
344
|
+
*/
|
|
345
|
+
require(namespace_: string | null, version: string | null): boolean
|
|
346
|
+
/**
|
|
347
|
+
* If the symbol already exists, it will be overwritten.
|
|
348
|
+
*
|
|
349
|
+
* If `symbol` is %NULL, the symbol will be removed from scope.
|
|
350
|
+
* @param name the name of the symbol
|
|
351
|
+
* @param symbol An #TmplSymbol or %NULL.
|
|
352
|
+
*/
|
|
353
|
+
set(name: string | null, symbol: Symbol | null): void
|
|
354
|
+
/**
|
|
355
|
+
* Sets the value of the symbol named `name` to a gboolean value of `value`.
|
|
356
|
+
* @param name a name for the symbol
|
|
357
|
+
* @param value a #gboolean
|
|
358
|
+
*/
|
|
359
|
+
set_boolean(name: string | null, value: boolean): void
|
|
360
|
+
/**
|
|
361
|
+
* Sets the value of the symbol named `name` to a gdouble value of `value`.
|
|
362
|
+
* @param name a name for the symbol
|
|
363
|
+
* @param value a #gdouble
|
|
364
|
+
*/
|
|
365
|
+
set_double(name: string | null, value: number): void
|
|
366
|
+
set_null(name: string | null): void
|
|
367
|
+
/**
|
|
368
|
+
* Sets the value of the symbol named `name` to the object `value`.
|
|
369
|
+
* @param name a name for the symbol
|
|
370
|
+
* @param value a #GObject or %NULL.
|
|
371
|
+
*/
|
|
372
|
+
set_object(name: string | null, value: GObject.Object | null): void
|
|
373
|
+
set_resolver(resolver: ScopeResolver): void
|
|
374
|
+
/**
|
|
375
|
+
* Sets the value of the symbol named `name` to a string matching `value`.
|
|
376
|
+
* @param name a name for the symbol
|
|
377
|
+
* @param value A string or %NULL.
|
|
378
|
+
*/
|
|
379
|
+
set_string(name: string | null, value: string | null): void
|
|
380
|
+
/**
|
|
381
|
+
* Sets the value of the symbol named `name` to the strv `value`.
|
|
382
|
+
* @param name a name for the symbol
|
|
383
|
+
* @param value the value to set it to, or %NULL
|
|
384
|
+
*/
|
|
385
|
+
set_strv(name: string | null, value: string[] | null): void
|
|
386
|
+
/**
|
|
387
|
+
* Sets the contents of the symbol named `name` to the value `value`.
|
|
388
|
+
* @param name a name for the symbol
|
|
389
|
+
* @param value A #GValue or %NULL
|
|
390
|
+
*/
|
|
391
|
+
set_value(name: string | null, value: any | null): void
|
|
392
|
+
/**
|
|
393
|
+
* Sets the value of the symbol named `name` to the variant `value`.
|
|
394
|
+
*
|
|
395
|
+
* If `value` has a floating reference, it is consumed.
|
|
396
|
+
* @param name a name for the symbol
|
|
397
|
+
* @param value the variant to set it to, or %NULL
|
|
398
|
+
*/
|
|
399
|
+
set_variant(name: string | null, value: GLib.Variant | null): void
|
|
400
|
+
/**
|
|
401
|
+
* Sets the symbol named `name` to `symbol` in `scope`.
|
|
402
|
+
*
|
|
403
|
+
* This differs from tmpl_scope_set() in that it takes ownership
|
|
404
|
+
* of `symbol`.
|
|
405
|
+
* @param name The name of the symbol
|
|
406
|
+
* @param symbol A #TmplSymbol or %NULL
|
|
407
|
+
*/
|
|
408
|
+
take(name: string | null, symbol: Symbol | null): void
|
|
409
|
+
unref(): void
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export class Scope {
|
|
413
|
+
|
|
414
|
+
// Own properties of Template-1.0.Template.Scope
|
|
415
|
+
|
|
416
|
+
static name: string
|
|
417
|
+
|
|
418
|
+
// Constructors of Template-1.0.Template.Scope
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Creates a new scope to contain variables and custom expressions,
|
|
422
|
+
* @constructor
|
|
423
|
+
* @returns A newly created #TmplScope.
|
|
424
|
+
*/
|
|
425
|
+
constructor()
|
|
426
|
+
/**
|
|
427
|
+
* Creates a new scope to contain variables and custom expressions,
|
|
428
|
+
* @constructor
|
|
429
|
+
* @returns A newly created #TmplScope.
|
|
430
|
+
*/
|
|
431
|
+
static new(): Scope
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export interface Symbol {
|
|
435
|
+
|
|
436
|
+
// Owm methods of Template-1.0.Template.Symbol
|
|
437
|
+
|
|
438
|
+
assign_boolean(v_bool: boolean): void
|
|
439
|
+
assign_double(v_double: number): void
|
|
440
|
+
/**
|
|
441
|
+
* Sets the value to the object `v_object`.
|
|
442
|
+
* @param v_object a #GObject or %NULL.
|
|
443
|
+
*/
|
|
444
|
+
assign_object(v_object: GObject.Object | null): void
|
|
445
|
+
assign_string(v_string: string | null): void
|
|
446
|
+
/**
|
|
447
|
+
* Sets the value to the strv `strv`.
|
|
448
|
+
* @param strv the value to set, or %NULL
|
|
449
|
+
*/
|
|
450
|
+
assign_strv(strv: string[] | null): void
|
|
451
|
+
assign_value(value: any): void
|
|
452
|
+
/**
|
|
453
|
+
* Sets the value to the #GVariant `v_variant`.
|
|
454
|
+
*
|
|
455
|
+
* If `v_variant` has a floating reference, it is consumed.
|
|
456
|
+
* @param v_variant a #GVariant or %NULL.
|
|
457
|
+
*/
|
|
458
|
+
assign_variant(v_variant: GLib.Variant | null): void
|
|
459
|
+
get_boxed(): any | null
|
|
460
|
+
get_expr(): [ /* returnType */ Expr, /* params */ string[] | null ]
|
|
461
|
+
get_symbol_type(): SymbolType
|
|
462
|
+
get_value(value: any): void
|
|
463
|
+
holds(type: GObject.GType): boolean
|
|
464
|
+
ref(): Symbol
|
|
465
|
+
unref(): void
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export class Symbol {
|
|
469
|
+
|
|
470
|
+
// Own properties of Template-1.0.Template.Symbol
|
|
471
|
+
|
|
472
|
+
static name: string
|
|
473
|
+
|
|
474
|
+
// Constructors of Template-1.0.Template.Symbol
|
|
475
|
+
|
|
476
|
+
constructor()
|
|
477
|
+
static new(): Symbol
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface TemplateClass {
|
|
481
|
+
|
|
482
|
+
// Own fields of Template-1.0.Template.TemplateClass
|
|
483
|
+
|
|
484
|
+
parent_class: GObject.ObjectClass
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export abstract class TemplateClass {
|
|
488
|
+
|
|
489
|
+
// Own properties of Template-1.0.Template.TemplateClass
|
|
490
|
+
|
|
491
|
+
static name: string
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface TemplateLocatorClass {
|
|
495
|
+
|
|
496
|
+
// Own fields of Template-1.0.Template.TemplateLocatorClass
|
|
497
|
+
|
|
498
|
+
parent_instance: GObject.ObjectClass
|
|
499
|
+
locate: (self: TemplateLocator, path: string | null) => Gio.InputStream
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export abstract class TemplateLocatorClass {
|
|
503
|
+
|
|
504
|
+
// Own properties of Template-1.0.Template.TemplateLocatorClass
|
|
505
|
+
|
|
506
|
+
static name: string
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export interface Expr {
|
|
510
|
+
|
|
511
|
+
// Owm methods of Template-1.0.Template.Expr
|
|
512
|
+
|
|
513
|
+
eval(scope: Scope, return_value: any): boolean
|
|
514
|
+
new_anon_call(params: Expr): Expr
|
|
515
|
+
new_getattr(attr: string | null): Expr
|
|
516
|
+
new_gi_call(name: string | null, params: Expr): Expr
|
|
517
|
+
new_invert_boolean(): Expr
|
|
518
|
+
new_setattr(attr: string | null, right: Expr): Expr
|
|
519
|
+
ref(): Expr
|
|
520
|
+
unref(): void
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export class Expr {
|
|
524
|
+
|
|
525
|
+
// Own properties of Template-1.0.Template.Expr
|
|
526
|
+
|
|
527
|
+
static name: string
|
|
528
|
+
|
|
529
|
+
// Constructors of Template-1.0.Template.Expr
|
|
530
|
+
|
|
531
|
+
static new_boolean(value: boolean): Expr
|
|
532
|
+
static new_flow(type: ExprType, condition: Expr, primary: Expr, secondary: Expr): Expr
|
|
533
|
+
static new_fn_call(builtin: ExprBuiltin, param: Expr): Expr
|
|
534
|
+
static new_func(name: string | null, symlist: string | null, list: Expr): Expr
|
|
535
|
+
static new_nop(): Expr
|
|
536
|
+
static new_null(): Expr
|
|
537
|
+
static new_number(value: number): Expr
|
|
538
|
+
static new_require(typelib: string | null, version: string | null): Expr
|
|
539
|
+
static new_simple(type: ExprType, left: Expr, right: Expr): Expr
|
|
540
|
+
/**
|
|
541
|
+
* Creates a new statement list for which the last item will be
|
|
542
|
+
* used as the "return value" from execution.
|
|
543
|
+
* @constructor
|
|
544
|
+
* @param stmts a #GPtrArray of #TmplExpr which will be evaluated in sequence.
|
|
545
|
+
* @returns a new #TmplExpr
|
|
546
|
+
*/
|
|
547
|
+
static new_stmt_list(stmts: Expr[]): Expr
|
|
548
|
+
static new_string(value: string | null, length: number): Expr
|
|
549
|
+
static new_symbol_assign(symbol: string | null, right: Expr): Expr
|
|
550
|
+
static new_symbol_ref(symbol: string | null): Expr
|
|
551
|
+
static new_user_fn_call(name: string | null, param: Expr): Expr
|
|
552
|
+
static from_string(str: string | null): Expr
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Name of the imported GIR library
|
|
557
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
558
|
+
*/
|
|
559
|
+
export const __name__: string
|
|
560
|
+
/**
|
|
561
|
+
* Version of the imported GIR library
|
|
562
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
563
|
+
*/
|
|
564
|
+
export const __version__: string
|
|
565
|
+
// END
|
|
@@ -0,0 +1,570 @@
|
|
|
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
|
+
* Template-1.0
|
|
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
|
+
|
|
16
|
+
export namespace Template {
|
|
17
|
+
|
|
18
|
+
enum Error {
|
|
19
|
+
INVALID_STATE,
|
|
20
|
+
TEMPLATE_NOT_FOUND,
|
|
21
|
+
CIRCULAR_INCLUDE,
|
|
22
|
+
SYNTAX_ERROR,
|
|
23
|
+
LEXER_FAILURE,
|
|
24
|
+
TYPE_MISMATCH,
|
|
25
|
+
INVALID_OP_CODE,
|
|
26
|
+
DIVIDE_BY_ZERO,
|
|
27
|
+
MISSING_SYMBOL,
|
|
28
|
+
SYMBOL_REDEFINED,
|
|
29
|
+
NOT_AN_OBJECT,
|
|
30
|
+
NULL_POINTER,
|
|
31
|
+
NO_SUCH_PROPERTY,
|
|
32
|
+
GI_FAILURE,
|
|
33
|
+
RUNTIME_ERROR,
|
|
34
|
+
NOT_IMPLEMENTED,
|
|
35
|
+
NOT_A_VALUE,
|
|
36
|
+
NOT_A_FUNCTION,
|
|
37
|
+
}
|
|
38
|
+
enum ExprBuiltin {
|
|
39
|
+
ABS,
|
|
40
|
+
CEIL,
|
|
41
|
+
FLOOR,
|
|
42
|
+
HEX,
|
|
43
|
+
LOG,
|
|
44
|
+
PRINT,
|
|
45
|
+
REPR,
|
|
46
|
+
SQRT,
|
|
47
|
+
TYPEOF,
|
|
48
|
+
ASSERT,
|
|
49
|
+
SIN,
|
|
50
|
+
TAN,
|
|
51
|
+
COS,
|
|
52
|
+
PRINTERR,
|
|
53
|
+
CAST_BYTE,
|
|
54
|
+
CAST_CHAR,
|
|
55
|
+
CAST_I32,
|
|
56
|
+
CAST_U32,
|
|
57
|
+
CAST_I64,
|
|
58
|
+
CAST_U64,
|
|
59
|
+
CAST_FLOAT,
|
|
60
|
+
CAST_DOUBLE,
|
|
61
|
+
CAST_BOOL,
|
|
62
|
+
}
|
|
63
|
+
enum ExprType {
|
|
64
|
+
ADD,
|
|
65
|
+
SUB,
|
|
66
|
+
MUL,
|
|
67
|
+
DIV,
|
|
68
|
+
BOOLEAN,
|
|
69
|
+
NUMBER,
|
|
70
|
+
STRING,
|
|
71
|
+
GT,
|
|
72
|
+
LT,
|
|
73
|
+
NE,
|
|
74
|
+
EQ,
|
|
75
|
+
GTE,
|
|
76
|
+
LTE,
|
|
77
|
+
UNARY_MINUS,
|
|
78
|
+
STMT_LIST,
|
|
79
|
+
IF,
|
|
80
|
+
WHILE,
|
|
81
|
+
SYMBOL_REF,
|
|
82
|
+
SYMBOL_ASSIGN,
|
|
83
|
+
FN_CALL,
|
|
84
|
+
ANON_FN_CALL,
|
|
85
|
+
USER_FN_CALL,
|
|
86
|
+
GETATTR,
|
|
87
|
+
SETATTR,
|
|
88
|
+
GI_CALL,
|
|
89
|
+
REQUIRE,
|
|
90
|
+
AND,
|
|
91
|
+
OR,
|
|
92
|
+
INVERT_BOOLEAN,
|
|
93
|
+
ARGS,
|
|
94
|
+
FUNC,
|
|
95
|
+
NOP,
|
|
96
|
+
NULL,
|
|
97
|
+
}
|
|
98
|
+
enum SymbolType {
|
|
99
|
+
EXPR,
|
|
100
|
+
VALUE,
|
|
101
|
+
}
|
|
102
|
+
const ENABLE_TRACE: number
|
|
103
|
+
const LOG_LEVEL_TRACE: number
|
|
104
|
+
/**
|
|
105
|
+
* Template-GLibl major version component (e.g. 1 if %TMPL_VERSION is 1.2.3)
|
|
106
|
+
*/
|
|
107
|
+
const MAJOR_VERSION: number
|
|
108
|
+
/**
|
|
109
|
+
* Template-GLibl micro version component (e.g. 3 if %TMPL_VERSION is 1.2.3)
|
|
110
|
+
*/
|
|
111
|
+
const MICRO_VERSION: number
|
|
112
|
+
/**
|
|
113
|
+
* Template-GLibl minor version component (e.g. 2 if %TMPL_VERSION is 1.2.3)
|
|
114
|
+
*/
|
|
115
|
+
const MINOR_VERSION: number
|
|
116
|
+
/**
|
|
117
|
+
* Template-GLib version, encoded as a string, useful for printing and
|
|
118
|
+
* concatenation.
|
|
119
|
+
*/
|
|
120
|
+
const VERSION_S: string | null
|
|
121
|
+
function error_quark(): GLib.Quark
|
|
122
|
+
function expr_from_string(str: string | null): Expr
|
|
123
|
+
interface ScopeResolver {
|
|
124
|
+
(scope: Scope, name: string | null, symbol: Symbol): boolean
|
|
125
|
+
}
|
|
126
|
+
module Template {
|
|
127
|
+
|
|
128
|
+
// Constructor properties interface
|
|
129
|
+
|
|
130
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
131
|
+
|
|
132
|
+
// Own constructor properties of Template-1.0.Template.Template
|
|
133
|
+
|
|
134
|
+
locator?: TemplateLocator | null
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface Template {
|
|
140
|
+
|
|
141
|
+
// Own properties of Template-1.0.Template.Template
|
|
142
|
+
|
|
143
|
+
locator: TemplateLocator
|
|
144
|
+
|
|
145
|
+
// Own fields of Template-1.0.Template.Template
|
|
146
|
+
|
|
147
|
+
parent_instance: GObject.Object
|
|
148
|
+
|
|
149
|
+
// Owm methods of Template-1.0.Template.Template
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Expands a template into `stream` using the `scope` provided.
|
|
153
|
+
*
|
|
154
|
+
* `scope` should have all of the variables set that are required to expand
|
|
155
|
+
* the template, or you will get a symbol reference error and %FALSE will
|
|
156
|
+
* be returned.
|
|
157
|
+
*
|
|
158
|
+
* To set a symbol value, get the symbol with tmpl_scope_get() and assign
|
|
159
|
+
* a value using tmpl_scope_assign_value() or similar methods.
|
|
160
|
+
* @param stream a #GOutputStream to write the results to
|
|
161
|
+
* @param scope A #TmplScope containing state for the template, or %NULL.
|
|
162
|
+
* @param cancellable An optional cancellable for the operation.
|
|
163
|
+
* @returns %TRUE if successful, otherwise %FALSE and @error is set.
|
|
164
|
+
*/
|
|
165
|
+
expand(stream: Gio.OutputStream, scope: Scope | null, cancellable: Gio.Cancellable | null): boolean
|
|
166
|
+
/**
|
|
167
|
+
* Expands the template and returns the result as a string.
|
|
168
|
+
* @param scope A #TmplScope or %NULL.
|
|
169
|
+
* @returns A newly allocated string, or %NULL upon failure.
|
|
170
|
+
*/
|
|
171
|
+
expand_string(scope: Scope | null): string | null
|
|
172
|
+
/**
|
|
173
|
+
* Gets the template locator used when resolving template includes.
|
|
174
|
+
* @returns a #TmplTemplateLocator or %NULL.
|
|
175
|
+
*/
|
|
176
|
+
get_locator(): TemplateLocator
|
|
177
|
+
parse(stream: Gio.InputStream, cancellable: Gio.Cancellable | null): boolean
|
|
178
|
+
parse_file(file: Gio.File, cancellable: Gio.Cancellable | null): boolean
|
|
179
|
+
parse_path(path: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
180
|
+
parse_resource(path: string | null, cancellable: Gio.Cancellable | null): boolean
|
|
181
|
+
parse_string(input: string | null): boolean
|
|
182
|
+
set_locator(locator: TemplateLocator): void
|
|
183
|
+
|
|
184
|
+
// Class property signals of Template-1.0.Template.Template
|
|
185
|
+
|
|
186
|
+
connect(sigName: "notify::locator", callback: (($obj: Template, pspec: GObject.ParamSpec) => void)): number
|
|
187
|
+
connect_after(sigName: "notify::locator", callback: (($obj: Template, pspec: GObject.ParamSpec) => void)): number
|
|
188
|
+
emit(sigName: "notify::locator", ...args: any[]): void
|
|
189
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
190
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
191
|
+
emit(sigName: string, ...args: any[]): void
|
|
192
|
+
disconnect(id: number): void
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
class Template extends GObject.Object {
|
|
196
|
+
|
|
197
|
+
// Own properties of Template-1.0.Template.Template
|
|
198
|
+
|
|
199
|
+
static name: string
|
|
200
|
+
static $gtype: GObject.GType<Template>
|
|
201
|
+
|
|
202
|
+
// Constructors of Template-1.0.Template.Template
|
|
203
|
+
|
|
204
|
+
constructor(config?: Template.ConstructorProperties)
|
|
205
|
+
/**
|
|
206
|
+
* Creates a new #TmplTemplate.
|
|
207
|
+
*
|
|
208
|
+
* If `locator` is specified, `locator` will be used to resolve include
|
|
209
|
+
* directives when parsing the template.
|
|
210
|
+
* @constructor
|
|
211
|
+
* @param locator A #TmplTemplateLocator or %NULL.
|
|
212
|
+
* @returns A #TmplTemplate.
|
|
213
|
+
*/
|
|
214
|
+
constructor(locator: TemplateLocator | null)
|
|
215
|
+
/**
|
|
216
|
+
* Creates a new #TmplTemplate.
|
|
217
|
+
*
|
|
218
|
+
* If `locator` is specified, `locator` will be used to resolve include
|
|
219
|
+
* directives when parsing the template.
|
|
220
|
+
* @constructor
|
|
221
|
+
* @param locator A #TmplTemplateLocator or %NULL.
|
|
222
|
+
* @returns A #TmplTemplate.
|
|
223
|
+
*/
|
|
224
|
+
static new(locator: TemplateLocator | null): Template
|
|
225
|
+
_init(config?: Template.ConstructorProperties): void
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
module TemplateLocator {
|
|
229
|
+
|
|
230
|
+
// Constructor properties interface
|
|
231
|
+
|
|
232
|
+
interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface TemplateLocator {
|
|
238
|
+
|
|
239
|
+
// Own fields of Template-1.0.Template.TemplateLocator
|
|
240
|
+
|
|
241
|
+
parent_instance: GObject.Object
|
|
242
|
+
|
|
243
|
+
// Owm methods of Template-1.0.Template.TemplateLocator
|
|
244
|
+
|
|
245
|
+
append_search_path(path: string | null): void
|
|
246
|
+
/**
|
|
247
|
+
* Gets the current search path used by the template locator.
|
|
248
|
+
* @returns A %NULL-terminated array of strings.
|
|
249
|
+
*/
|
|
250
|
+
get_search_path(): string[]
|
|
251
|
+
/**
|
|
252
|
+
* This will resolve the relative path using the search paths found within
|
|
253
|
+
* the template loader.
|
|
254
|
+
* @param path a relative path to the file
|
|
255
|
+
* @returns A #GInputStream or %NULL and @error is set.
|
|
256
|
+
*/
|
|
257
|
+
locate(path: string | null): Gio.InputStream
|
|
258
|
+
prepend_search_path(path: string | null): void
|
|
259
|
+
|
|
260
|
+
// Own virtual methods of Template-1.0.Template.TemplateLocator
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* This will resolve the relative path using the search paths found within
|
|
264
|
+
* the template loader.
|
|
265
|
+
* @virtual
|
|
266
|
+
* @param path a relative path to the file
|
|
267
|
+
* @returns A #GInputStream or %NULL and @error is set.
|
|
268
|
+
*/
|
|
269
|
+
vfunc_locate(path: string | null): Gio.InputStream
|
|
270
|
+
|
|
271
|
+
// Class property signals of Template-1.0.Template.TemplateLocator
|
|
272
|
+
|
|
273
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
274
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
275
|
+
emit(sigName: string, ...args: any[]): void
|
|
276
|
+
disconnect(id: number): void
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* The #TmplTemplateLoader class is used to specify how templates
|
|
281
|
+
* should be loaded. This can be used directly by your code that
|
|
282
|
+
* will compile the data streams into #TmplTemplate instances, or
|
|
283
|
+
* by a #TmplTemplate that is resolving includes from the
|
|
284
|
+
* `{{include "path.tmpl"}}` directive.
|
|
285
|
+
*
|
|
286
|
+
* See #TmplTemplate:locator for more information.
|
|
287
|
+
* @class
|
|
288
|
+
*/
|
|
289
|
+
class TemplateLocator extends GObject.Object {
|
|
290
|
+
|
|
291
|
+
// Own properties of Template-1.0.Template.TemplateLocator
|
|
292
|
+
|
|
293
|
+
static name: string
|
|
294
|
+
static $gtype: GObject.GType<TemplateLocator>
|
|
295
|
+
|
|
296
|
+
// Constructors of Template-1.0.Template.TemplateLocator
|
|
297
|
+
|
|
298
|
+
constructor(config?: TemplateLocator.ConstructorProperties)
|
|
299
|
+
constructor()
|
|
300
|
+
static new(): TemplateLocator
|
|
301
|
+
_init(config?: TemplateLocator.ConstructorProperties): void
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
interface Scope {
|
|
305
|
+
|
|
306
|
+
// Owm methods of Template-1.0.Template.Scope
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Gets a string if the symbol `name` is a string.
|
|
310
|
+
*
|
|
311
|
+
* Otherwise, %NULL is returned.
|
|
312
|
+
* @param name
|
|
313
|
+
* @returns a string or %NULL
|
|
314
|
+
*/
|
|
315
|
+
dup_string(name: string | null): string | null
|
|
316
|
+
/**
|
|
317
|
+
* If the symbol could not be found, it will be allocated.
|
|
318
|
+
* @param name
|
|
319
|
+
* @returns A #TmplSymbol.
|
|
320
|
+
*/
|
|
321
|
+
get(name: string | null): Symbol
|
|
322
|
+
/**
|
|
323
|
+
* Gets the names of all symbols within the scope.
|
|
324
|
+
* @param recursive if the parent scopes should be included
|
|
325
|
+
* @returns an array containing the names of all symbols within the scope.
|
|
326
|
+
*/
|
|
327
|
+
list_symbols(recursive: boolean): string[]
|
|
328
|
+
/**
|
|
329
|
+
* Creates a new scope to contain variables and custom expressions,
|
|
330
|
+
* If `parent` is set, the parent scope will be inherited.
|
|
331
|
+
* @returns A newly created #TmplScope.
|
|
332
|
+
*/
|
|
333
|
+
new_with_parent(): Scope
|
|
334
|
+
/**
|
|
335
|
+
* If the symbol could not be found, %NULL is returned.
|
|
336
|
+
* @param name
|
|
337
|
+
* @returns A #TmplSymbol or %NULL.
|
|
338
|
+
*/
|
|
339
|
+
peek(name: string | null): Symbol | null
|
|
340
|
+
ref(): Scope
|
|
341
|
+
/**
|
|
342
|
+
* Imports `namespace_` into `self` so it can be used by expressions.
|
|
343
|
+
* @param namespace_ the namespace to import into the scope
|
|
344
|
+
* @param version the version of `namespace_` to import
|
|
345
|
+
* @returns %TRUE if successful; otherwise %FALSE
|
|
346
|
+
*/
|
|
347
|
+
require(namespace_: string | null, version: string | null): boolean
|
|
348
|
+
/**
|
|
349
|
+
* If the symbol already exists, it will be overwritten.
|
|
350
|
+
*
|
|
351
|
+
* If `symbol` is %NULL, the symbol will be removed from scope.
|
|
352
|
+
* @param name the name of the symbol
|
|
353
|
+
* @param symbol An #TmplSymbol or %NULL.
|
|
354
|
+
*/
|
|
355
|
+
set(name: string | null, symbol: Symbol | null): void
|
|
356
|
+
/**
|
|
357
|
+
* Sets the value of the symbol named `name` to a gboolean value of `value`.
|
|
358
|
+
* @param name a name for the symbol
|
|
359
|
+
* @param value a #gboolean
|
|
360
|
+
*/
|
|
361
|
+
set_boolean(name: string | null, value: boolean): void
|
|
362
|
+
/**
|
|
363
|
+
* Sets the value of the symbol named `name` to a gdouble value of `value`.
|
|
364
|
+
* @param name a name for the symbol
|
|
365
|
+
* @param value a #gdouble
|
|
366
|
+
*/
|
|
367
|
+
set_double(name: string | null, value: number): void
|
|
368
|
+
set_null(name: string | null): void
|
|
369
|
+
/**
|
|
370
|
+
* Sets the value of the symbol named `name` to the object `value`.
|
|
371
|
+
* @param name a name for the symbol
|
|
372
|
+
* @param value a #GObject or %NULL.
|
|
373
|
+
*/
|
|
374
|
+
set_object(name: string | null, value: GObject.Object | null): void
|
|
375
|
+
set_resolver(resolver: ScopeResolver): void
|
|
376
|
+
/**
|
|
377
|
+
* Sets the value of the symbol named `name` to a string matching `value`.
|
|
378
|
+
* @param name a name for the symbol
|
|
379
|
+
* @param value A string or %NULL.
|
|
380
|
+
*/
|
|
381
|
+
set_string(name: string | null, value: string | null): void
|
|
382
|
+
/**
|
|
383
|
+
* Sets the value of the symbol named `name` to the strv `value`.
|
|
384
|
+
* @param name a name for the symbol
|
|
385
|
+
* @param value the value to set it to, or %NULL
|
|
386
|
+
*/
|
|
387
|
+
set_strv(name: string | null, value: string[] | null): void
|
|
388
|
+
/**
|
|
389
|
+
* Sets the contents of the symbol named `name` to the value `value`.
|
|
390
|
+
* @param name a name for the symbol
|
|
391
|
+
* @param value A #GValue or %NULL
|
|
392
|
+
*/
|
|
393
|
+
set_value(name: string | null, value: any | null): void
|
|
394
|
+
/**
|
|
395
|
+
* Sets the value of the symbol named `name` to the variant `value`.
|
|
396
|
+
*
|
|
397
|
+
* If `value` has a floating reference, it is consumed.
|
|
398
|
+
* @param name a name for the symbol
|
|
399
|
+
* @param value the variant to set it to, or %NULL
|
|
400
|
+
*/
|
|
401
|
+
set_variant(name: string | null, value: GLib.Variant | null): void
|
|
402
|
+
/**
|
|
403
|
+
* Sets the symbol named `name` to `symbol` in `scope`.
|
|
404
|
+
*
|
|
405
|
+
* This differs from tmpl_scope_set() in that it takes ownership
|
|
406
|
+
* of `symbol`.
|
|
407
|
+
* @param name The name of the symbol
|
|
408
|
+
* @param symbol A #TmplSymbol or %NULL
|
|
409
|
+
*/
|
|
410
|
+
take(name: string | null, symbol: Symbol | null): void
|
|
411
|
+
unref(): void
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
class Scope {
|
|
415
|
+
|
|
416
|
+
// Own properties of Template-1.0.Template.Scope
|
|
417
|
+
|
|
418
|
+
static name: string
|
|
419
|
+
|
|
420
|
+
// Constructors of Template-1.0.Template.Scope
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Creates a new scope to contain variables and custom expressions,
|
|
424
|
+
* @constructor
|
|
425
|
+
* @returns A newly created #TmplScope.
|
|
426
|
+
*/
|
|
427
|
+
constructor()
|
|
428
|
+
/**
|
|
429
|
+
* Creates a new scope to contain variables and custom expressions,
|
|
430
|
+
* @constructor
|
|
431
|
+
* @returns A newly created #TmplScope.
|
|
432
|
+
*/
|
|
433
|
+
static new(): Scope
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
interface Symbol {
|
|
437
|
+
|
|
438
|
+
// Owm methods of Template-1.0.Template.Symbol
|
|
439
|
+
|
|
440
|
+
assign_boolean(v_bool: boolean): void
|
|
441
|
+
assign_double(v_double: number): void
|
|
442
|
+
/**
|
|
443
|
+
* Sets the value to the object `v_object`.
|
|
444
|
+
* @param v_object a #GObject or %NULL.
|
|
445
|
+
*/
|
|
446
|
+
assign_object(v_object: GObject.Object | null): void
|
|
447
|
+
assign_string(v_string: string | null): void
|
|
448
|
+
/**
|
|
449
|
+
* Sets the value to the strv `strv`.
|
|
450
|
+
* @param strv the value to set, or %NULL
|
|
451
|
+
*/
|
|
452
|
+
assign_strv(strv: string[] | null): void
|
|
453
|
+
assign_value(value: any): void
|
|
454
|
+
/**
|
|
455
|
+
* Sets the value to the #GVariant `v_variant`.
|
|
456
|
+
*
|
|
457
|
+
* If `v_variant` has a floating reference, it is consumed.
|
|
458
|
+
* @param v_variant a #GVariant or %NULL.
|
|
459
|
+
*/
|
|
460
|
+
assign_variant(v_variant: GLib.Variant | null): void
|
|
461
|
+
get_boxed(): any | null
|
|
462
|
+
get_expr(): [ /* returnType */ Expr, /* params */ string[] | null ]
|
|
463
|
+
get_symbol_type(): SymbolType
|
|
464
|
+
get_value(value: any): void
|
|
465
|
+
holds(type: GObject.GType): boolean
|
|
466
|
+
ref(): Symbol
|
|
467
|
+
unref(): void
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
class Symbol {
|
|
471
|
+
|
|
472
|
+
// Own properties of Template-1.0.Template.Symbol
|
|
473
|
+
|
|
474
|
+
static name: string
|
|
475
|
+
|
|
476
|
+
// Constructors of Template-1.0.Template.Symbol
|
|
477
|
+
|
|
478
|
+
constructor()
|
|
479
|
+
static new(): Symbol
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
interface TemplateClass {
|
|
483
|
+
|
|
484
|
+
// Own fields of Template-1.0.Template.TemplateClass
|
|
485
|
+
|
|
486
|
+
parent_class: GObject.ObjectClass
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
abstract class TemplateClass {
|
|
490
|
+
|
|
491
|
+
// Own properties of Template-1.0.Template.TemplateClass
|
|
492
|
+
|
|
493
|
+
static name: string
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
interface TemplateLocatorClass {
|
|
497
|
+
|
|
498
|
+
// Own fields of Template-1.0.Template.TemplateLocatorClass
|
|
499
|
+
|
|
500
|
+
parent_instance: GObject.ObjectClass
|
|
501
|
+
locate: (self: TemplateLocator, path: string | null) => Gio.InputStream
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
abstract class TemplateLocatorClass {
|
|
505
|
+
|
|
506
|
+
// Own properties of Template-1.0.Template.TemplateLocatorClass
|
|
507
|
+
|
|
508
|
+
static name: string
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
interface Expr {
|
|
512
|
+
|
|
513
|
+
// Owm methods of Template-1.0.Template.Expr
|
|
514
|
+
|
|
515
|
+
eval(scope: Scope, return_value: any): boolean
|
|
516
|
+
new_anon_call(params: Expr): Expr
|
|
517
|
+
new_getattr(attr: string | null): Expr
|
|
518
|
+
new_gi_call(name: string | null, params: Expr): Expr
|
|
519
|
+
new_invert_boolean(): Expr
|
|
520
|
+
new_setattr(attr: string | null, right: Expr): Expr
|
|
521
|
+
ref(): Expr
|
|
522
|
+
unref(): void
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
class Expr {
|
|
526
|
+
|
|
527
|
+
// Own properties of Template-1.0.Template.Expr
|
|
528
|
+
|
|
529
|
+
static name: string
|
|
530
|
+
|
|
531
|
+
// Constructors of Template-1.0.Template.Expr
|
|
532
|
+
|
|
533
|
+
static new_boolean(value: boolean): Expr
|
|
534
|
+
static new_flow(type: ExprType, condition: Expr, primary: Expr, secondary: Expr): Expr
|
|
535
|
+
static new_fn_call(builtin: ExprBuiltin, param: Expr): Expr
|
|
536
|
+
static new_func(name: string | null, symlist: string | null, list: Expr): Expr
|
|
537
|
+
static new_nop(): Expr
|
|
538
|
+
static new_null(): Expr
|
|
539
|
+
static new_number(value: number): Expr
|
|
540
|
+
static new_require(typelib: string | null, version: string | null): Expr
|
|
541
|
+
static new_simple(type: ExprType, left: Expr, right: Expr): Expr
|
|
542
|
+
/**
|
|
543
|
+
* Creates a new statement list for which the last item will be
|
|
544
|
+
* used as the "return value" from execution.
|
|
545
|
+
* @constructor
|
|
546
|
+
* @param stmts a #GPtrArray of #TmplExpr which will be evaluated in sequence.
|
|
547
|
+
* @returns a new #TmplExpr
|
|
548
|
+
*/
|
|
549
|
+
static new_stmt_list(stmts: Expr[]): Expr
|
|
550
|
+
static new_string(value: string | null, length: number): Expr
|
|
551
|
+
static new_symbol_assign(symbol: string | null, right: Expr): Expr
|
|
552
|
+
static new_symbol_ref(symbol: string | null): Expr
|
|
553
|
+
static new_user_fn_call(name: string | null, param: Expr): Expr
|
|
554
|
+
static from_string(str: string | null): Expr
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Name of the imported GIR library
|
|
559
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
560
|
+
*/
|
|
561
|
+
const __name__: string
|
|
562
|
+
/**
|
|
563
|
+
* Version of the imported GIR library
|
|
564
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
565
|
+
*/
|
|
566
|
+
const __version__: string
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export default Template;
|
|
570
|
+
// END
|
package/template-1.0.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// General settings for code interpretation
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"experimentalDecorators": true,
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"noEmitOnError": false,
|
|
10
|
+
"baseUrl": "./",
|
|
11
|
+
"rootDir": ".",
|
|
12
|
+
// General settings for code generation
|
|
13
|
+
"removeComments": false,
|
|
14
|
+
"inlineSourceMap": false,
|
|
15
|
+
"inlineSources": false,
|
|
16
|
+
"newLine": "LF"
|
|
17
|
+
},
|
|
18
|
+
"include": ["./template-1.0.d.ts"]
|
|
19
|
+
}
|