diff --git a/types/electron-winstaller/electron-winstaller-tests.ts b/types/electron-winstaller/electron-winstaller-tests.ts new file mode 100644 index 0000000000..91c1923522 --- /dev/null +++ b/types/electron-winstaller/electron-winstaller-tests.ts @@ -0,0 +1,14 @@ +import * as electronInstaller from "electron-winstaller"; + +const options: electronInstaller.Options = { + appDirectory: '/tmp/build/my-app-64', + outputDirectory: '/tmp/build/installer64', + authors: 'My App Inc.', + exe: 'myapp.exe' +}; + +const resultPromise = electronInstaller.createWindowsInstaller(options); + +resultPromise.then( + () => console.log("It worked!"), + (e) => console.log(`No dice: ${e.message}`)); diff --git a/types/electron-winstaller/index.d.ts b/types/electron-winstaller/index.d.ts new file mode 100644 index 0000000000..bfc294d2a8 --- /dev/null +++ b/types/electron-winstaller/index.d.ts @@ -0,0 +1,115 @@ +// Type definitions for electron-winstaller 2.6 +// Project: https://github.com/electron/windows-installer +// Definitions by: Brendan Forster +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function convertVersion(version: string): string; + +export function createWindowsInstaller(options: Options): Promise; + +export interface Options { + /** + * The folder path of your Electron app + */ + appDirectory: string; + /** + * The folder path to create the .exe installer in. + * + * Defaults to the installer folder at the project root. + */ + outputDirectory?: string; + /** + * The local path to a `.gif` file to display during install. + */ + loadingGif?: string; + /** + * The authors value for the nuget package metadata. + * + * Defaults to the `author` field from your app's package.json file when unspecified. + */ + authors: string; + /** + * The owners value for the nuget package metadata. + * + * Defaults to the `authors` field when unspecified. + */ + owners?: string; + /** + * The name of your app's main `.exe` file. + * + * This uses the `name` field in your app's package.json file with an added `.exe` extension when unspecified. + */ + exe?: string; + /** + * The description value for the nuget package metadata. + * + * Defaults to the `description` field from your app's package.json file when unspecified. + */ + description?: string; + /** + * The version value for the nuget package metadata. + * + * Defaults to the `version` field from your app's package.json file when unspecified. + */ + version?: string; + /** + * The title value for the nuget package metadata. + * + * Defaults to the `productName` field and then the `name` field from your app's package.json file when unspecified. + */ + title?: string; + /** + * Windows Application Model ID (appId). + * + * Defaults to the name field in your app's package.json file. + */ + name?: string; + /** + * The path to an Authenticode Code Signing Certificate + */ + certificateFile?: string; + /** + * The password to decrypt the certificate given in `certificateFile` + */ + certificatePassword?: string; + /** + * Params to pass to signtool. + * + * Overrides `certificateFile` and `certificatePassword`. + */ + signWithParams?: string; + /** + * A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). + * + * Defaults to the Atom icon. + */ + iconUrl?: string; + /** + * The ICO file to use as the icon for the generated Setup.exe + */ + setupIcon?: string; + /** + * The name to use for the generated Setup.exe file + */ + setupExe?: string; + /** + * The name to use for the generated Setup.msi file + */ + setupMsi?: string; + /** + * Should Squirrel.Windows create an MSI installer? + */ + noMsi?: boolean; + /** + * Should Squirrel.Windows delta packages? (disable only if necessary, they are a Good Thing) + */ + noDelta?: boolean; + /** + * A URL to your existing updates. If given, these will be downloaded to create delta updates + */ + remoteReleases?: string; + /** + * Authentication token for remote updates + */ + remoteToken?: string; +} diff --git a/types/electron-winstaller/tsconfig.json b/types/electron-winstaller/tsconfig.json new file mode 100644 index 0000000000..f208c4761f --- /dev/null +++ b/types/electron-winstaller/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "electron-winstaller-tests.ts" + ] +} diff --git a/types/electron-winstaller/tslint.json b/types/electron-winstaller/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/electron-winstaller/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}