Convert dock_icon.js to TypeScript

This commit is contained in:
Evan Hahn 2021-01-21 17:58:38 -06:00 committed by Scott Nonnenberg
parent 932e44e3bf
commit f404904a49
4 changed files with 20 additions and 24 deletions

View file

@ -1,20 +0,0 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const { app } = require('electron');
const dockIcon = {};
dockIcon.show = () => {
if (process.platform === 'darwin') {
app.dock.show();
}
};
dockIcon.hide = () => {
if (process.platform === 'darwin') {
app.dock.hide();
}
};
module.exports = dockIcon;

View file

@ -1,11 +1,11 @@
// Copyright 2017-2020 Signal Messenger, LLC
// Copyright 2017-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const path = require('path');
const fs = require('fs');
const { app, Menu, Tray } = require('electron');
const dockIcon = require('./dock_icon');
const dockIcon = require('../ts/dock_icon');
let trayContextMenu = null;
let tray = null;

View file

@ -1,4 +1,4 @@
// Copyright 2017-2020 Signal Messenger, LLC
// Copyright 2017-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable no-console */
@ -85,7 +85,7 @@ const attachmentChannel = require('./app/attachment_channel');
const bounce = require('./ts/services/bounce');
const updater = require('./ts/updater/index');
const createTrayIcon = require('./app/tray_icon');
const dockIcon = require('./app/dock_icon');
const dockIcon = require('./ts/dock_icon');
const ephemeralConfig = require('./app/ephemeral_config');
const logging = require('./app/logging');
const sql = require('./ts/sql/Server').default;

16
ts/dock_icon.ts Normal file
View file

@ -0,0 +1,16 @@
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { app } from 'electron';
export function show(): void {
if (process.platform === 'darwin') {
app.dock.show();
}
}
export function hide(): void {
if (process.platform === 'darwin') {
app.dock.hide();
}
}