Skip to content

Commit

Permalink
fix AboutWindowInfo type is not found (fixes #71)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 2, 2021
1 parent e74ba10 commit 519f993
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
44 changes: 44 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,50 @@ import { app as appMain, BrowserWindow as BrowserWindowMain, shell, ipcMain } fr
import { statSync } from 'fs';
import * as path from 'path';

export interface LicenseEntry {
type: string;
url: string;
}

export interface PackageJson {
productName?: string;
description?: string;
homepage?: string;
license?: string | LicenseEntry;
bugs?: {
url: string;
};
}

export interface AboutWindowInfo {
icon_path: string;
product_name?: string;
copyright?: string;
homepage?: string;
description?: string;
package_json_dir?: string;
about_page_dir?: string;
license?: string;
bug_report_url?: string;
css_path?: string | string[];
adjust_window_size?: boolean;
win_options?: Electron.BrowserWindowConstructorOptions;
open_devtools?: boolean;
use_inner_html?: boolean;
bug_link_text?: string;
use_version_info?: boolean | [string, string][];
show_close_button?: string;
app?: Electron.App;
BrowserWindow?: typeof Electron.BrowserWindow;
ipcMain?: Electron.IpcMain;
}

declare namespace NodeJS {
interface ProcessVersions {
[name: string]: string;
}
}

function loadPackageJson(pkg_path: string): PackageJson {
try {
return require(pkg_path);
Expand Down
45 changes: 0 additions & 45 deletions src/lib.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ipcRenderer, shell } from 'electron';
import type { AboutWindowInfo } from './index';

ipcRenderer.on('about-window:info', (_: any, info: AboutWindowInfo, app_name: string, version: string) => {
// Note: app.getName() was replaced with app.name at Electron v7
Expand Down

0 comments on commit 519f993

Please sign in to comment.