UNPKG

@reforged/maker-appimage

Version:

An AppImage maker implementation for the Electron Forge.

99 lines 3.82 kB
import EventEmitter from "events"; import type { MakerOptions } from "@electron-forge/maker-base"; import type { SemVer } from "semver"; type AppImageArch = "x86_64" | "aarch64" | "armhf" | "i686"; export type ForgeArch = "x64" | "arm64" | "armv7l" | "ia32" | "mips64el" | "universal"; export interface MakerMeta extends MakerOptions { targetArch: ForgeArch; } /** Function argument definitions for {@linkcode mkSqFsEvt}. */ interface mkSqFSListenerArgs { close: [ /** A returned code when process normally exits. */ code: number | null, /** A signal which closed the process. */ signal: NodeJS.Signals | null, /** A message printed to STDERR, if available. */ msg?: string ]; progress: [ /** A number from range 0-100 indicating the current progress made on creating the image. */ percent: number ]; error: [ error: Error ]; } type mkSqFSEvtListen<T extends keyof mkSqFSListenerArgs> = [ eventName: T, listener: (..._: mkSqFSListenerArgs[T]) => void ]; /** An `EventListener` interface with parsed events from mksquashfs child process. */ interface mkSqFsEvt extends EventEmitter { /** * Emitted when `mksquashfs` process has been closed. */ on(..._: mkSqFSEvtListen<"close">): this; /** * Emitted once `mksquashfs` process has been closed. */ once(..._: mkSqFSEvtListen<"close">): this; /** * Emitted when `mksquashfs` process has been closed. */ addListener(..._: mkSqFSEvtListen<"close">): this; /** * Emitted when `mksquashfs` process has been closed. */ removeListener(..._: mkSqFSEvtListen<"close">): this; /** * Emitted whenever a progress has been made on SquashFS image generation. */ on(..._: mkSqFSEvtListen<"progress">): this; /** * Emitted whenever a progress has been made on SquashFS image generation. */ once(..._: mkSqFSEvtListen<"progress">): this; /** * Emitted whenever a progress has been made on SquashFS image generation. */ addListener(..._: mkSqFSEvtListen<"progress">): this; /** * Emitted whenever a progress has been made on SquashFS image generation. */ removeListener(..._: mkSqFSEvtListen<"progress">): this; /** Emitted whenever process has threw an error. */ on(..._: mkSqFSEvtListen<"error">): this; /** Emitted whenever process has threw an error. */ once(..._: mkSqFSEvtListen<"error">): this; /** Emitted whenever process has threw an error. */ addListener(..._: mkSqFSEvtListen<"error">): this; /** Emitted whenever process has threw an error. */ removeListener(..._: mkSqFSEvtListen<"error">): this; } export declare function generateDesktop(desktopEntry: Partial<Record<string, string[] | string | null>>, actions?: Record<string, Partial<Record<string, string | null>> & { Name: string; }>): string; /** * A wrapper for `mksquashfs` binary. * * @returns An event used to watch for `mksquashfs` changes, including the job progress (in percent – as float number). */ export declare function mkSquashFs(...argv: string[]): mkSqFsEvt; /** * Returns the version of `mksquashfs` binary, as `SemVer` value. * * Under the hood, it executes `mksquashfs` with `-version`, parses * the `stdout` and tries to coerce it to `SemVer`. */ export declare function getSquashFsVer(): SemVer; /** * Concatenates files and/or buffers into a new buffer. */ export declare function joinFiles(...filesAndBuffers: readonly (string | ArrayBufferLike | Uint8Array)[]): Promise<Uint8Array<ArrayBuffer>>; /** * Maps Node.js architecture to the AppImage-friendly format. */ export declare const mapArch: Readonly<Partial<Record<ForgeArch, AppImageArch>>>; export {}; //# sourceMappingURL=utils.d.ts.map