@girs/gjs 4.0.0-beta.2 → 4.0.0-beta.21
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 +1 -1
- package/cairo.d.ts +485 -3
- package/console.d.ts +21 -0
- package/console.js +6 -0
- package/dom.d.ts +51 -63
- package/gettext.d.ts +28 -29
- package/gjs-ambient.d.ts +25 -0
- package/gjs.d.ts +251 -93
- package/index.d.ts +13 -0
- package/index.js +5 -0
- package/package.json +20 -8
- package/system.d.ts +31 -32
- package/tsconfig.json +5 -3
- package/ambient.d.ts +0 -20
- /package/{ambient.js → gjs-ambient.js} +0 -0
package/system.d.ts
CHANGED
|
@@ -7,18 +7,18 @@ import type GObject from '@girs/gobject-2.0';
|
|
|
7
7
|
* subsequent command-line arguments. In other words, `ARGV[0]` in GJS is the same as `argv[1]` in C.
|
|
8
8
|
* @version Gjs 1.68
|
|
9
9
|
*/
|
|
10
|
-
export const programInvocationName: string
|
|
10
|
+
export const programInvocationName: string;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This property contains version information about GJS.
|
|
14
14
|
*/
|
|
15
|
-
export const version: number
|
|
15
|
+
export const version: number;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* The full path of the executed program.
|
|
19
19
|
* @version Gjs 1.68
|
|
20
20
|
*/
|
|
21
|
-
export const programPath: string | null
|
|
21
|
+
export const programPath: string | null;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* A list of arguments passed to the current process.
|
|
@@ -26,7 +26,7 @@ export const programPath: string | null
|
|
|
26
26
|
* it is not equivalent to the platform'`s` argv.
|
|
27
27
|
* @version Gjs 1.68
|
|
28
28
|
*/
|
|
29
|
-
export const programArgs: string[]
|
|
29
|
+
export const programArgs: string[];
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Return the memory address of any object as a string.
|
|
@@ -39,7 +39,7 @@ export const programArgs: string[]
|
|
|
39
39
|
* @param o Any Object
|
|
40
40
|
* @returns A hexadecimal string (e.g. `0xb4f170f0`)
|
|
41
41
|
*/
|
|
42
|
-
export function addressOf(o:
|
|
42
|
+
export function addressOf(o: object): string;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Return the memory address of any GObject as a string.
|
|
@@ -48,7 +48,7 @@ export function addressOf(o: any): string
|
|
|
48
48
|
* @returns A hexadecimal string (e.g. `0xb4f170f0`)
|
|
49
49
|
* @version Gjs 1.58
|
|
50
50
|
*/
|
|
51
|
-
export function addressOfGObject(o: GObject.Object): string
|
|
51
|
+
export function addressOfGObject(o: GObject.Object): string;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Inserts a breakpoint instruction into the code.
|
|
@@ -81,30 +81,30 @@ export function addressOfGObject(o: GObject.Object): string
|
|
|
81
81
|
* breakpoint, so make sure to remove any calls to `System.breakpoint()` when
|
|
82
82
|
* you're done debugging.
|
|
83
83
|
*/
|
|
84
|
-
export function breakpoint(): void
|
|
84
|
+
export function breakpoint(): void;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Clears the timezone cache.
|
|
88
88
|
* This is a workaround for SpiderMonkey Bug [#1004706](https://bugzilla.mozilla.org/show_bug.cgi?id=1004706).
|
|
89
89
|
*/
|
|
90
|
-
export function clearDateCaches(): void
|
|
90
|
+
export function clearDateCaches(): void;
|
|
91
91
|
|
|
92
92
|
/** Runs the garbage collector */
|
|
93
|
-
export function gc(): void
|
|
93
|
+
export function gc(): void;
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Return the reference count of any GObject-derived type. When an object's
|
|
97
97
|
* reference count is zero, it is cleaned up and erased from memory.
|
|
98
98
|
* @param o A {@link GObject.Object}
|
|
99
99
|
*/
|
|
100
|
-
export function refcount(o: GObject.Object): number
|
|
100
|
+
export function refcount(o: GObject.Object): number;
|
|
101
101
|
/**
|
|
102
102
|
* See also: The [heapgraph](https://gitlab.gnome.org/GNOME/gjs/blob/HEAD/tools/heapgraph.md) utility in the GJS repository.
|
|
103
103
|
* Dump a representation of internal heap memory. If `path` is not given, GJS will
|
|
104
104
|
* write the contents to `stdout`.
|
|
105
105
|
* @param path Optional file path
|
|
106
106
|
*/
|
|
107
|
-
export function dumpHeap(path?: string): void
|
|
107
|
+
export function dumpHeap(path?: string): void;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Dump internal garbage collector statistics. If `path` is not given, GJS will
|
|
@@ -132,44 +132,43 @@ export function dumpHeap(path?: string): void
|
|
|
132
132
|
* }
|
|
133
133
|
* }
|
|
134
134
|
* ```
|
|
135
|
-
*
|
|
135
|
+
*
|
|
136
136
|
*/
|
|
137
|
-
export function dumpMemoryInfo(path?: string): void
|
|
137
|
+
export function dumpMemoryInfo(path?: string): void;
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* This works the same as C's exit() function; exits the program, passing a
|
|
141
141
|
* certain error code to the shell. The shell expects the error code to be zero if
|
|
142
142
|
* there was no error, or non-zero (any value you please) to indicate an error.
|
|
143
|
-
*
|
|
143
|
+
*
|
|
144
144
|
* This value is used by other tools such as `make`; if `make` calls a program that
|
|
145
145
|
* returns a non-zero error code, then `make` aborts the build.
|
|
146
146
|
* @param code An exit code
|
|
147
147
|
*/
|
|
148
|
-
export function exit(code: number):
|
|
148
|
+
export function exit(code: number): never;
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* The System module provides common low-level facilities such as access to
|
|
152
152
|
* process arguments and exit(), as well as a number of useful functions and
|
|
153
153
|
* properties for debugging.
|
|
154
|
-
*
|
|
154
|
+
*
|
|
155
155
|
* Note that the majority of the functions and properties in this module should not
|
|
156
156
|
* be used in normal operation of a GJS application.
|
|
157
157
|
*/
|
|
158
158
|
declare const System: {
|
|
159
|
-
programInvocationName: typeof programInvocationName
|
|
160
|
-
version: typeof version
|
|
161
|
-
programPath: typeof programPath
|
|
162
|
-
programArgs: typeof programArgs
|
|
163
|
-
addressOf: typeof addressOf
|
|
164
|
-
addressOfGObject: typeof addressOfGObject
|
|
165
|
-
breakpoint: typeof breakpoint
|
|
166
|
-
clearDateCaches: typeof clearDateCaches
|
|
167
|
-
gc: typeof gc
|
|
168
|
-
refcount: typeof refcount
|
|
169
|
-
dumpHeap: typeof dumpHeap
|
|
170
|
-
dumpMemoryInfo: typeof dumpMemoryInfo
|
|
171
|
-
exit: typeof exit
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export default System
|
|
159
|
+
programInvocationName: typeof programInvocationName;
|
|
160
|
+
version: typeof version;
|
|
161
|
+
programPath: typeof programPath;
|
|
162
|
+
programArgs: typeof programArgs;
|
|
163
|
+
addressOf: typeof addressOf;
|
|
164
|
+
addressOfGObject: typeof addressOfGObject;
|
|
165
|
+
breakpoint: typeof breakpoint;
|
|
166
|
+
clearDateCaches: typeof clearDateCaches;
|
|
167
|
+
gc: typeof gc;
|
|
168
|
+
refcount: typeof refcount;
|
|
169
|
+
dumpHeap: typeof dumpHeap;
|
|
170
|
+
dumpMemoryInfo: typeof dumpMemoryInfo;
|
|
171
|
+
exit: typeof exit;
|
|
172
|
+
};
|
|
175
173
|
|
|
174
|
+
export default System;
|
package/tsconfig.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
// General settings for code interpretation
|
|
4
4
|
"target": "ESNext",
|
|
5
|
-
"module": "
|
|
5
|
+
"module": "NodeNext",
|
|
6
6
|
"lib": ["ESNext"],
|
|
7
7
|
"types": [],
|
|
8
8
|
"experimentalDecorators": true,
|
|
9
|
-
"moduleResolution": "
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
10
10
|
"noEmit": true,
|
|
11
11
|
"noEmitOnError": false,
|
|
12
12
|
"baseUrl": "./",
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"removeComments": false,
|
|
16
16
|
"inlineSourceMap": false,
|
|
17
17
|
"inlineSources": false,
|
|
18
|
-
"newLine": "LF"
|
|
18
|
+
"newLine": "LF",
|
|
19
|
+
// Show diagnostics
|
|
20
|
+
"diagnostics": true
|
|
19
21
|
},
|
|
20
22
|
"include": ["./dom.d.ts","./gjs.d.ts"]
|
|
21
23
|
}
|
package/ambient.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules
|
|
2
|
-
// https://stackoverflow.com/questions/45099605/ambient-declaration-with-an-imported-type-in-typescript
|
|
3
|
-
|
|
4
|
-
declare module 'gettext' {
|
|
5
|
-
export * from '@girs/gjs/gettext';
|
|
6
|
-
import Gettext from '@girs/gjs/gettext';
|
|
7
|
-
export default Gettext;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module 'system' {
|
|
11
|
-
export * from '@girs/gjs/system';
|
|
12
|
-
import System from '@girs/gjs/system';
|
|
13
|
-
export default System;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module 'cairo' {
|
|
17
|
-
import Cairo from '@girs/gjs/cairo';
|
|
18
|
-
export default Cairo;
|
|
19
|
-
}
|
|
20
|
-
|
|
File without changes
|