@types/electron-installer-dmg
TypeScript icon, indicating that this package has built-in type declarations

4.0.3 • Public • Published

Installation

npm install --save @types/electron-installer-dmg

Summary

This package contains type definitions for electron-installer-dmg (https://github.com/electron-userland/electron-installer-dmg).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/electron-installer-dmg.

index.d.ts

import appdmg = require("appdmg");

declare namespace createDMG {
    interface Content {
        path: string;
        type: "link" | "file";
        x: number;
        y: number;
    }

    interface CreateOptions {
        /**
         * Additional options to pass through to [`appdmg`](https://npm.im/appdmg).
         * You can use this to set additional features like `background-color` and `code-sign`.
         * See the docs of the `appdmg` module for all possible options.
         */
        additionalDMGOptions?: Partial<appdmg.Specification>;
        /**
         * The `.app` directory generated by
         * [electron-packager](https://github.com/electron-userland/electron-packager).
         */
        appPath: string;
        /** Path to the background for the DMG window. Background image should be of size 658×498. */
        background?: string;
        /**
         * The content that will appear in the window when user opens the .dmg file.
         * [Default: Array of two icons, application and application destination folder].
         */
        contents?: Content[] | ((opts: ContentsOptions) => Content[]);
        /** Enable debug message output. */
        debug?: boolean;
        /** Disk image format. [Default: `UDZO`]. */
        format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
        /** Path to the icon to use for the app in the DMG window. */
        icon?: string;
        /** How big to make the icon for the app in the DMG. [Default: `80`]. */
        iconSize?: number;
        /** The application name. */
        name: string;
        /** The directory to put the DMG into. [Default: `process.cwd()`]. */
        out?: string;
        /** Overwrite an existing DMG file if if already exists. */
        overwrite?: boolean;
        /** The title of the produced DMG, which will be shown when mounted. */
        title?: string;
    }

    /**
     * Options passed to the `contents` function.
     */
    // Note: In the actual implementation, the entire `CreateOptions` object is
    // passed to the `contents` function, but in the type we omit the `contents`
    // field to avoid recursion.
    type ContentsOptions = Omit<CreateOptions, "contents">;
}

declare function createDMG(createOptions: createDMG.CreateOptions): Promise<createDMG.CreateOptions>;

export = createDMG;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/appdmg

Credits

These definitions were written by Florian Imdahl.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/electron-installer-dmg

Weekly Downloads

1,069

Version

4.0.3

License

MIT

Unpacked Size

7.45 kB

Total Files

5

Last publish

Collaborators

  • types