Skip to content

Commit

Permalink
fix(electron): api updates for TS 4.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Jun 26, 2021
1 parent 1140acf commit 976c709
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
23 changes: 19 additions & 4 deletions packages/electron-angular/src/schematics/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,27 @@ export default function (options: XplatElectrontHelpers.SchemaApp) {
ignore: ['**/*.ts'],
output: '',
});
targetConfig[
if (targetConfig[
targetProp
].serve.options.browserTarget = `${electronAppName}:build`;
targetConfig[
].serve.options) {
targetConfig[
targetProp
].serve.options.browserTarget = `${electronAppName}:build`;
}
if (targetConfig[
targetProp
].serve.configurations.production) {
targetConfig[
targetProp
].serve.configurations.production.browserTarget = `${electronAppName}:build:production`;
}
if (targetConfig[
targetProp
].serve.configurations.production.browserTarget = `${electronAppName}:build:production`;
].serve.configurations.development) {
targetConfig[
targetProp
].serve.configurations.development.browserTarget = `${electronAppName}:build:development`;
}
// clear other settings (TODO: may need these in future), for now keep electron options minimal
delete targetConfig[targetProp]['extract-i18n'];
delete targetConfig[targetProp]['test'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import IpcRendererEvent = Electron.IpcRendererEvent;
providedIn: 'root'
})
export class ElectronService {
private readonly _ipc: typeof ipcRenderer;
private _childProcess: typeof childProcess;
private readonly _ipc?: typeof ipcRenderer;
private _childProcess?: typeof childProcess;

constructor(private _log: LogService, private _win: WindowService) {
// Conditional imports
Expand All @@ -29,15 +29,15 @@ export class ElectronService {
this._ipc.on(channel, listener);
}

send(channel: string, ...args): void {
send(channel: string, ...args: any): void {
if (!this._ipc) {
return;
}

this._ipc.send(channel, ...args);
}

sendSync(channel: string, ...args): void {
sendSync(channel: string, ...args: any): void {
if (!this._ipc) {
return;
}
Expand Down

0 comments on commit 976c709

Please sign in to comment.