Members
(constant) packages :Partial.<Record.<string, Partial.<Record.<string, TypelibResolver>>>>
Package definitions for GObject introspection typelibs.
Organized by namespace and version, each entry maps to a resolver function
that returns the appropriate package names for the current OS.
Type:
- Partial.<Record.<string, Partial.<Record.<string, TypelibResolver>>>>
- Source:
Methods
(async) findInstallCommand(cancellable) → {Promise.<(InstallCommandResolver|null)>}
Finds the command to install OS packages. Prefers PackageKit pkgcli/pkcon
when available. Falls back to native package managers with pkexec.
Parameters:
| Name | Type | Description |
|---|---|---|
cancellable |
Gio.Cancellable | null | Optional cancellable for aborting the operation. |
- Source:
Returns:
A function that generates
the command line, or null if no suitable installation method is found.
- Type
- Promise.<(InstallCommandResolver|null)>
(async) findTerminalCommand(cancellable) → {Promise.<(TerminalCommandResolver|null)>}
Finds a terminal emulator to run commands in.
Checks for GNOME Console (kgx), gnome-terminal, and xdg-terminal-exec in order.
Parameters:
| Name | Type | Description |
|---|---|---|
cancellable |
Gio.Cancellable | null | Optional cancellable for aborting the operation. |
- Source:
Returns:
A function that generates
the command line, or null if no suitable terminal is found.
- Type
- Promise.<(TerminalCommandResolver|null)>
(async) findTerminalInstallCommand(cancellable) → {Promise.<(InstallCommandResolver|null)>}
Finds the command to install OS packages. Prefers PackageKit CLI when
available. Wraps the command to launch it in a terminal emulator.
Combines the results of findTerminalCommand and findInstallCommand to create
a complete installation command that runs in a terminal.
Parameters:
| Name | Type | Description |
|---|---|---|
cancellable |
Gio.Cancellable | null | Optional cancellable for aborting the operation. |
- Source:
Returns:
A function that,
given the list of packages, generates the installation command,
wrapped for terminal execution, or null if terminal or install command not found.
- Type
- Promise.<(InstallCommandResolver|null)>
require(versions) → {Partial.<Record.<string, any>>}
Import multiple GObject libraries and return the imported modules.
Parameters:
| Name | Type | Description |
|---|---|---|
versions |
Partial.<Record.<string, string>> | An object with namespaces as keys and verions as values. |
- Source:
Throws:
-
-
If a known library is not installed.
- Type
- MissingDependencies
-
-
-
If unknown library is requested.
- Type
- Error
-
Returns:
Imported modules.
- Type
- Partial.<Record.<string, any>>
Type Definitions
InstallCommandResolver(pkgs) → {Array.<string>}
A function that, given a list of packages, generates the installation command.
Parameters:
| Name | Type | Description |
|---|---|---|
pkgs |
Iterable.<string> | List of package names to install. |
- Source:
Returns:
Command line, as argument list (argv).
- Type
- Array.<string>
TerminalCommandResolver(argv) → {Array.<string>}
A function that, given a list of arguments, generates the command line
to run the specified command in a terminal emulator.
Parameters:
| Name | Type | Description |
|---|---|---|
argv |
Iterable.<string> | Command line arguments to run in terminal. |
- Source:
Returns:
Command line, as argument list (argv).
- Type
- Array.<string>
TypelibInfo
Information about typelib dependency - object with typelib file name
and an optional list of OS packages to install.
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
filename |
string | File name of the library. | |
packages |
Array.<string> | null |
<optional> |
List of OS packages that need to be installed to use this library. |
- Source:
TypelibResolver() → {TypelibInfo}
Function that resolves typelib package name(s) for the current distro.
- Source:
Returns:
Typelib file name and optional package list.
- Type
- TypelibInfo