@gjsify/utils 0.0.4 → 0.1.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 +26 -0
- package/lib/esm/base64.js +72 -0
- package/lib/esm/byte-array.js +6 -0
- package/lib/esm/cli.js +1 -2
- package/lib/esm/defer.js +6 -0
- package/lib/esm/encoding.js +35 -0
- package/lib/esm/fs.js +2 -1
- package/lib/esm/gio-errors.js +98 -0
- package/lib/esm/gio.js +39 -0
- package/lib/esm/globals.js +8 -0
- package/lib/esm/index.js +10 -8
- package/lib/esm/main-loop.js +28 -0
- package/lib/esm/next-tick.js +6 -0
- package/lib/esm/structured-clone.js +169 -0
- package/lib/types/base64.d.ts +8 -0
- package/lib/types/byte-array.d.ts +7 -0
- package/lib/types/defer.d.ts +7 -0
- package/lib/types/encoding.d.ts +11 -0
- package/lib/types/gio-errors.d.ts +28 -0
- package/lib/types/gio.d.ts +17 -0
- package/lib/types/globals.d.ts +5 -0
- package/lib/types/index.d.ts +10 -8
- package/lib/types/main-loop.d.ts +20 -0
- package/lib/types/next-tick.d.ts +5 -0
- package/lib/types/structured-clone.d.ts +15 -0
- package/package.json +18 -20
- package/src/base64.ts +78 -0
- package/src/byte-array.ts +12 -0
- package/src/defer.ts +11 -0
- package/src/encoding.ts +36 -0
- package/src/fs.ts +2 -2
- package/src/gio-errors.ts +101 -0
- package/src/gio.ts +67 -0
- package/src/globals.ts +13 -0
- package/src/index.ts +10 -9
- package/src/main-loop.ts +62 -0
- package/src/next-tick.ts +16 -0
- package/src/structured-clone.ts +242 -0
- package/src/test.ts +1 -3
- package/tsconfig.json +27 -10
- package/tsconfig.tsbuildinfo +1 -0
- package/lib/cjs/cancel-handler.js +0 -22
- package/lib/cjs/cli.js +0 -11
- package/lib/cjs/error.js +0 -21
- package/lib/cjs/file.js +0 -13
- package/lib/cjs/fs.js +0 -21
- package/lib/cjs/index.js +0 -14
- package/lib/cjs/log.js +0 -159
- package/lib/cjs/message.js +0 -13
- package/lib/cjs/os.js +0 -81
- package/lib/cjs/path.js +0 -50
- package/lib/cjs/process.js +0 -41
- package/lib/cjs/system.js +0 -47
- package/lib/cjs/tty.js +0 -13
- package/lib/cjs/types/cancel-signals.js +0 -0
- package/lib/cjs/types/error-data.js +0 -0
- package/lib/cjs/types/index.js +0 -8
- package/lib/cjs/types/signal-methods.js +0 -0
- package/lib/cjs/types/stack-trace-frame.js +0 -0
- package/lib/cjs/types/structured-log-data.js +0 -0
- package/lib/cjs/types/uncaught-exception-data.js +0 -0
- package/lib/cjs/types/unhandled-rejection-data.js +0 -0
- package/lib/cjs/types/user-info.js +0 -0
- package/lib/cjs/version.js +0 -7
- package/lib/esm/cancel-handler.js +0 -22
- package/lib/esm/log.js +0 -159
- package/lib/esm/os.js +0 -81
- package/lib/esm/process.js +0 -41
- package/lib/esm/system.js +0 -47
- package/lib/esm/tty.js +0 -13
- package/lib/esm/types/cancel-signals.js +0 -0
- package/lib/esm/types/error-data.js +0 -0
- package/lib/esm/types/index.js +0 -8
- package/lib/esm/types/signal-methods.js +0 -0
- package/lib/esm/types/stack-trace-frame.js +0 -0
- package/lib/esm/types/structured-log-data.js +0 -0
- package/lib/esm/types/uncaught-exception-data.js +0 -0
- package/lib/esm/types/unhandled-rejection-data.js +0 -0
- package/lib/esm/types/user-info.js +0 -0
- package/lib/esm/version.js +0 -7
- package/lib/types/cancel-handler.d.ts +0 -4
- package/lib/types/log.d.ts +0 -29
- package/lib/types/os.d.ts +0 -7
- package/lib/types/process.d.ts +0 -6
- package/lib/types/system.d.ts +0 -5
- package/lib/types/tty.d.ts +0 -5
- package/lib/types/types/cancel-signals.d.ts +0 -5
- package/lib/types/types/error-data.d.ts +0 -7
- package/lib/types/types/index.d.ts +0 -8
- package/lib/types/types/signal-methods.d.ts +0 -62
- package/lib/types/types/stack-trace-frame.d.ts +0 -6
- package/lib/types/types/structured-log-data.d.ts +0 -5
- package/lib/types/types/uncaught-exception-data.d.ts +0 -4
- package/lib/types/types/unhandled-rejection-data.d.ts +0 -5
- package/lib/types/types/user-info.d.ts +0 -8
- package/lib/types/version.d.ts +0 -1
- package/src/cancel-handler.ts +0 -24
- package/src/log.ts +0 -218
- package/src/os.ts +0 -94
- package/src/process.spec.ts +0 -24
- package/src/process.ts +0 -46
- package/src/system.ts +0 -56
- package/src/tty.spec.ts +0 -10
- package/src/tty.ts +0 -10
- package/src/types/cancel-signals.ts +0 -6
- package/src/types/error-data.ts +0 -8
- package/src/types/index.ts +0 -8
- package/src/types/signal-methods.ts +0 -63
- package/src/types/stack-trace-frame.ts +0 -7
- package/src/types/structured-log-data.ts +0 -5
- package/src/types/uncaught-exception-data.ts +0 -5
- package/src/types/unhandled-rejection-data.ts +0 -6
- package/src/types/user-info.ts +0 -9
- package/src/version.ts +0 -4
- package/test.gjs.js +0 -34758
- package/test.gjs.js.map +0 -7
- package/test.gjs.js.meta.json +0 -1
- package/tsconfig.types.json +0 -7
- package/tsconfig.types.tsbuildinfo +0 -1
package/src/types/error-data.ts
DELETED
package/src/types/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './cancel-signals.js';
|
|
2
|
-
export * from './error-data.js';
|
|
3
|
-
export * from './signal-methods.js';
|
|
4
|
-
export * from './stack-trace-frame.js';
|
|
5
|
-
export * from './structured-log-data.js';
|
|
6
|
-
export * from './uncaught-exception-data.js';
|
|
7
|
-
export * from './unhandled-rejection-data.js';
|
|
8
|
-
export * from './user-info.js';
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// TODO: Use Methods interface from @girs/gjs instead
|
|
2
|
-
/**
|
|
3
|
-
* You can use the `Signals.addSignalMethods` method to apply the `Signals` convenience methods to an `Object`.
|
|
4
|
-
* Generally, this is called on an object prototype, but may also be called on an object instance.
|
|
5
|
-
* You can use this Interface for this object or prototype to make the methods in typescript known
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const Signals = imports.signals;
|
|
9
|
-
*
|
|
10
|
-
* // Define an interface with the same name of your class to make the methods known
|
|
11
|
-
* interface Events extends SignalMethods {}
|
|
12
|
-
*
|
|
13
|
-
* class Events {}
|
|
14
|
-
* Signals.addSignalMethods(Events.prototype);
|
|
15
|
-
*
|
|
16
|
-
* const events = new Events();
|
|
17
|
-
*
|
|
18
|
-
* // Typescript will not complain here
|
|
19
|
-
* events.emit("test-signal", "test argument");
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export interface SignalMethods {
|
|
23
|
-
/**
|
|
24
|
-
* Connects a callback to a signal for an object. Pass the returned ID to
|
|
25
|
-
* `disconect()` to remove the handler.
|
|
26
|
-
*
|
|
27
|
-
* If `callback` returns `true`, emission will stop and no other handlers will be
|
|
28
|
-
* invoked.
|
|
29
|
-
*
|
|
30
|
-
* > Warning: Unlike GObject signals, `this` within a signal callback will always
|
|
31
|
-
* > refer to the global object (ie. `globalThis`).
|
|
32
|
-
*
|
|
33
|
-
* @param sigName A signal name
|
|
34
|
-
* @param callback A callback function
|
|
35
|
-
* @returns A handler ID
|
|
36
|
-
*/
|
|
37
|
-
connect(sigName: string, callback: (self: any, ...args: any[]) => void): number;
|
|
38
|
-
/**
|
|
39
|
-
* Emits a signal for an object. Emission stops if a signal handler returns `true`.
|
|
40
|
-
*
|
|
41
|
-
* Unlike GObject signals, it is not necessary to declare signals or define their
|
|
42
|
-
* signature. Simply call `emit()` with whatever signal name you wish, with
|
|
43
|
-
* whatever arguments you wish.
|
|
44
|
-
* @param sigName A signal name
|
|
45
|
-
* @param args Any number of arguments, of any type
|
|
46
|
-
*/
|
|
47
|
-
emit(sigName: string, ...args: any[]): void;
|
|
48
|
-
/**
|
|
49
|
-
* Disconnects a handler for a signal.
|
|
50
|
-
* @param id The ID of the handler to be disconnected
|
|
51
|
-
*/
|
|
52
|
-
disconnect(id: number): void;
|
|
53
|
-
/**
|
|
54
|
-
* Disconnects all signal handlers for an object.
|
|
55
|
-
*/
|
|
56
|
-
disconnectAll(): void
|
|
57
|
-
/**
|
|
58
|
-
* Checks if a handler ID is connected.
|
|
59
|
-
* @param id The ID of the handler to be disconnected
|
|
60
|
-
* @returns `true` if connected, or `false` if not
|
|
61
|
-
*/
|
|
62
|
-
signalHandlerIsConnected(id: number): boolean;
|
|
63
|
-
}
|
package/src/types/user-info.ts
DELETED
package/src/version.ts
DELETED