mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-06 06:53:18 +00:00
typescript: Switch to ES import/export syntax.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
@@ -3,9 +3,9 @@ import { app, dialog, shell } from 'electron';
|
|||||||
import { autoUpdater } from 'electron-updater';
|
import { autoUpdater } from 'electron-updater';
|
||||||
import { linuxUpdateNotification } from './linuxupdater'; // Required only in case of linux
|
import { linuxUpdateNotification } from './linuxupdater'; // Required only in case of linux
|
||||||
|
|
||||||
import log = require('electron-log');
|
import log from 'electron-log';
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
import ConfigUtil = require('../renderer/js/utils/config-util');
|
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||||
|
|
||||||
export function appUpdater(updateFromMenu = false): void {
|
export function appUpdater(updateFromMenu = false): void {
|
||||||
// Don't initiate auto-updates in development
|
// Don't initiate auto-updates in development
|
||||||
|
|||||||
@@ -3,17 +3,16 @@ import { sentryInit } from '../renderer/js/utils/sentry-util';
|
|||||||
import { appUpdater } from './autoupdater';
|
import { appUpdater } from './autoupdater';
|
||||||
import { setAutoLaunch } from './startup';
|
import { setAutoLaunch } from './startup';
|
||||||
|
|
||||||
import windowStateKeeper = require('electron-window-state');
|
import windowStateKeeper from 'electron-window-state';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
import electron = require('electron');
|
import electron, { app, ipcMain, session, dialog } from 'electron';
|
||||||
const { app, ipcMain, session, dialog } = electron;
|
|
||||||
|
|
||||||
import AppMenu = require('./menu');
|
import * as AppMenu from './menu';
|
||||||
import BadgeSettings = require('../renderer/js/pages/preference/badge-settings');
|
import * as BadgeSettings from '../renderer/js/pages/preference/badge-settings';
|
||||||
import ConfigUtil = require('../renderer/js/utils/config-util');
|
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||||
import ProxyUtil = require('../renderer/js/utils/proxy-util');
|
import * as ProxyUtil from '../renderer/js/utils/proxy-util';
|
||||||
|
|
||||||
interface PatchedGlobal extends NodeJS.Global {
|
interface PatchedGlobal extends NodeJS.Global {
|
||||||
mainWindowState: windowStateKeeper.State;
|
mainWindowState: windowStateKeeper.State;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { app, Notification } from 'electron';
|
import { app, Notification } from 'electron';
|
||||||
|
|
||||||
import request = require('request');
|
import request from 'request';
|
||||||
import semver = require('semver');
|
import semver from 'semver';
|
||||||
import ConfigUtil = require('../renderer/js/utils/config-util');
|
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||||
import ProxyUtil = require('../renderer/js/utils/proxy-util');
|
import * as ProxyUtil from '../renderer/js/utils/proxy-util';
|
||||||
import LinuxUpdateUtil = require('../renderer/js/utils/linux-update-util');
|
import * as LinuxUpdateUtil from '../renderer/js/utils/linux-update-util';
|
||||||
import Logger = require('../renderer/js/utils/logger-util');
|
import Logger from '../renderer/js/utils/logger-util';
|
||||||
|
|
||||||
const logger = new Logger({
|
const logger = new Logger({
|
||||||
file: 'linux-update-util.log',
|
file: 'linux-update-util.log',
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
import { app, shell, BrowserWindow, Menu, dialog } from 'electron';
|
import { app, shell, BrowserWindow, Menu, dialog } from 'electron';
|
||||||
import { appUpdater } from './autoupdater';
|
import { appUpdater } from './autoupdater';
|
||||||
|
|
||||||
import AdmZip = require('adm-zip');
|
import AdmZip from 'adm-zip';
|
||||||
import fs = require('fs-extra');
|
import fs from 'fs-extra';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import DNDUtil = require('../renderer/js/utils/dnd-util');
|
import * as DNDUtil from '../renderer/js/utils/dnd-util';
|
||||||
import Logger = require('../renderer/js/utils/logger-util');
|
import Logger from '../renderer/js/utils/logger-util';
|
||||||
import ConfigUtil = require('../renderer/js/utils/config-util');
|
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||||
import t = require('../renderer/js/utils/translation-util');
|
import * as t from '../renderer/js/utils/translation-util';
|
||||||
|
|
||||||
const appName = app.name;
|
const appName = app.name;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { app } from 'electron';
|
import { app } from 'electron';
|
||||||
|
|
||||||
import AutoLaunch = require('auto-launch');
|
import AutoLaunch from 'auto-launch';
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
import ConfigUtil = require('../renderer/js/utils/config-util');
|
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||||
|
|
||||||
export const setAutoLaunch = (AutoLaunchValue: boolean): void => {
|
export const setAutoLaunch = (AutoLaunchValue: boolean): void => {
|
||||||
// Don't run this in development
|
// Don't run this in development
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
class BaseComponent {
|
export default class BaseComponent {
|
||||||
generateNodeFromTemplate(template: string): Element | null {
|
generateNodeFromTemplate(template: string): Element | null {
|
||||||
const wrapper = document.createElement('div');
|
const wrapper = document.createElement('div');
|
||||||
wrapper.innerHTML = template;
|
wrapper.innerHTML = template;
|
||||||
return wrapper.firstElementChild;
|
return wrapper.firstElementChild;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BaseComponent;
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import Tab = require('./tab');
|
import Tab from './tab';
|
||||||
|
|
||||||
class FunctionalTab extends Tab {
|
export default class FunctionalTab extends Tab {
|
||||||
$closeButton: Element;
|
$closeButton: Element;
|
||||||
template(): string {
|
template(): string {
|
||||||
return `<div class="tab functional-tab" data-tab-id="${this.props.tabIndex}">
|
return `<div class="tab functional-tab" data-tab-id="${this.props.tabIndex}">
|
||||||
@@ -47,5 +47,3 @@ class FunctionalTab extends Tab {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = FunctionalTab;
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { ipcRenderer, remote } from 'electron';
|
import { ipcRenderer, remote } from 'electron';
|
||||||
|
|
||||||
import LinkUtil = require('../utils/link-util');
|
import * as LinkUtil from '../utils/link-util';
|
||||||
import DomainUtil = require('../utils/domain-util');
|
import * as DomainUtil from '../utils/domain-util';
|
||||||
import ConfigUtil = require('../utils/config-util');
|
import * as ConfigUtil from '../utils/config-util';
|
||||||
import type WebView from './webview';
|
import type WebView from './webview';
|
||||||
|
|
||||||
const { shell, app } = remote;
|
const { shell, app } = remote;
|
||||||
|
|
||||||
const dingSound = new Audio('../resources/sounds/ding.ogg');
|
const dingSound = new Audio('../resources/sounds/ding.ogg');
|
||||||
|
|
||||||
function handleExternalLink(this: WebView, event: Electron.NewWindowEvent): void {
|
export default function handleExternalLink(this: WebView, event: Electron.NewWindowEvent): void {
|
||||||
const { url } = event;
|
const { url } = event;
|
||||||
const domainPrefix = DomainUtil.getDomain(this.props.index).url;
|
const domainPrefix = DomainUtil.getDomain(this.props.index).url;
|
||||||
const downloadPath = ConfigUtil.getConfigItem('downloadsPath', `${app.getPath('downloads')}`);
|
const downloadPath = ConfigUtil.getConfigItem('downloadsPath', `${app.getPath('downloads')}`);
|
||||||
@@ -89,5 +89,3 @@ function handleExternalLink(this: WebView, event: Electron.NewWindowEvent): void
|
|||||||
shell.openExternal(url);
|
shell.openExternal(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = handleExternalLink;
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import Tab = require('./tab');
|
import Tab from './tab';
|
||||||
import SystemUtil = require('../utils/system-util');
|
import * as SystemUtil from '../utils/system-util';
|
||||||
|
|
||||||
class ServerTab extends Tab {
|
export default class ServerTab extends Tab {
|
||||||
$badge: Element;
|
$badge: Element;
|
||||||
|
|
||||||
template(): string {
|
template(): string {
|
||||||
@@ -64,5 +64,3 @@ class ServerTab extends Tab {
|
|||||||
return shortcutText;
|
return shortcutText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ServerTab;
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import WebView = require('./webview');
|
import WebView from './webview';
|
||||||
import BaseComponent = require('./base');
|
import BaseComponent from './base';
|
||||||
|
|
||||||
// TODO: TypeScript - Type annotate props
|
// TODO: TypeScript - Type annotate props
|
||||||
interface TabProps {
|
interface TabProps {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Tab extends BaseComponent {
|
export default class Tab extends BaseComponent {
|
||||||
props: TabProps;
|
props: TabProps;
|
||||||
webview: WebView;
|
webview: WebView;
|
||||||
$el: Element;
|
$el: Element;
|
||||||
@@ -44,5 +44,3 @@ class Tab extends BaseComponent {
|
|||||||
this.webview.$el.parentNode.removeChild(this.webview.$el);
|
this.webview.$el.parentNode.removeChild(this.webview.$el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = Tab;
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import ConfigUtil = require('../utils/config-util');
|
import * as ConfigUtil from '../utils/config-util';
|
||||||
import SystemUtil = require('../utils/system-util');
|
import * as SystemUtil from '../utils/system-util';
|
||||||
import BaseComponent = require('../components/base');
|
import BaseComponent from './base';
|
||||||
import handleExternalLink = require('../components/handle-external-link');
|
import handleExternalLink from './handle-external-link';
|
||||||
|
|
||||||
const { app, dialog } = remote;
|
const { app, dialog } = remote;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ interface WebViewProps {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
class WebView extends BaseComponent {
|
export default class WebView extends BaseComponent {
|
||||||
props: any;
|
props: any;
|
||||||
zoomFactor: number;
|
zoomFactor: number;
|
||||||
badgeCount: number;
|
badgeCount: number;
|
||||||
@@ -301,5 +301,3 @@ class WebView extends BaseComponent {
|
|||||||
this.$el.send(channel, ...param);
|
this.$el.send(channel, ...param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = WebView;
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
import SendFeedback from '@electron-elements/send-feedback';
|
import SendFeedback from '@electron-elements/send-feedback';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
|
|
||||||
const { app } = remote;
|
const { app } = remote;
|
||||||
|
|
||||||
|
|||||||
@@ -3,26 +3,26 @@
|
|||||||
import { ipcRenderer, remote, clipboard, shell } from 'electron';
|
import { ipcRenderer, remote, clipboard, shell } from 'electron';
|
||||||
import { feedbackHolder } from './feedback';
|
import { feedbackHolder } from './feedback';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import escape = require('escape-html');
|
import escape from 'escape-html';
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
const { session, app, Menu, dialog } = remote;
|
const { session, app, Menu, dialog } = remote;
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-unassigned-import
|
// eslint-disable-next-line import/no-unassigned-import
|
||||||
require('./tray');
|
import './tray';
|
||||||
|
|
||||||
import DomainUtil = require('./utils/domain-util');
|
import * as DomainUtil from './utils/domain-util';
|
||||||
import WebView = require('./components/webview');
|
import WebView from './components/webview';
|
||||||
import ServerTab = require('./components/server-tab');
|
import ServerTab from './components/server-tab';
|
||||||
import FunctionalTab = require('./components/functional-tab');
|
import FunctionalTab from './components/functional-tab';
|
||||||
import ConfigUtil = require('./utils/config-util');
|
import * as ConfigUtil from './utils/config-util';
|
||||||
import DNDUtil = require('./utils/dnd-util');
|
import * as DNDUtil from './utils/dnd-util';
|
||||||
import ReconnectUtil = require('./utils/reconnect-util');
|
import ReconnectUtil from './utils/reconnect-util';
|
||||||
import Logger = require('./utils/logger-util');
|
import Logger from './utils/logger-util';
|
||||||
import CommonUtil = require('./utils/common-util');
|
import * as CommonUtil from './utils/common-util';
|
||||||
import EnterpriseUtil = require('./utils/enterprise-util');
|
import * as EnterpriseUtil from './utils/enterprise-util';
|
||||||
import AuthUtil = require('./utils/auth-util');
|
import * as AuthUtil from './utils/auth-util';
|
||||||
import Messages = require('./../../resources/messages');
|
import * as Messages from '../../resources/messages';
|
||||||
|
|
||||||
interface FunctionalTabProps {
|
interface FunctionalTabProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import {
|
|||||||
appId, customReply, focusCurrentServer, parseReply, setupReply
|
appId, customReply, focusCurrentServer, parseReply, setupReply
|
||||||
} from './helpers';
|
} from './helpers';
|
||||||
|
|
||||||
import url = require('url');
|
import url from 'url';
|
||||||
import MacNotifier = require('node-mac-notifier');
|
import MacNotifier from 'node-mac-notifier';
|
||||||
import ConfigUtil = require('../utils/config-util');
|
import * as ConfigUtil from '../utils/config-util';
|
||||||
|
|
||||||
type ReplyHandler = (response: string) => void;
|
type ReplyHandler = (response: string) => void;
|
||||||
type ClickHandler = () => void;
|
type ClickHandler = () => void;
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import { focusCurrentServer } from './helpers';
|
import { focusCurrentServer } from './helpers';
|
||||||
|
|
||||||
import ConfigUtil = require('../utils/config-util');
|
import * as ConfigUtil from '../utils/config-util';
|
||||||
|
|
||||||
const NativeNotification = window.Notification;
|
const NativeNotification = window.Notification;
|
||||||
class BaseNotification extends NativeNotification {
|
export default class BaseNotification extends NativeNotification {
|
||||||
constructor(title: string, opts: NotificationOptions) {
|
constructor(title: string, opts: NotificationOptions) {
|
||||||
opts.silent = true;
|
opts.silent = true;
|
||||||
super(title, opts);
|
super(title, opts);
|
||||||
@@ -28,5 +28,3 @@ class BaseNotification extends NativeNotification {
|
|||||||
return ConfigUtil.getConfigItem('showNotification') ? 'granted' : 'denied';
|
return ConfigUtil.getConfigItem('showNotification') ? 'granted' : 'denied';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BaseNotification;
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
|
|
||||||
import Logger = require('../utils/logger-util');
|
import Logger from '../utils/logger-util';
|
||||||
|
|
||||||
const logger = new Logger({
|
const logger = new Logger({
|
||||||
file: 'errors.log',
|
file: 'errors.log',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { remote } from 'electron';
|
|||||||
import * as params from '../utils/params-util';
|
import * as params from '../utils/params-util';
|
||||||
import { appId, loadBots } from './helpers';
|
import { appId, loadBots } from './helpers';
|
||||||
|
|
||||||
import DefaultNotification = require('./default-notification');
|
import DefaultNotification from './default-notification';
|
||||||
const { app } = remote;
|
const { app } = remote;
|
||||||
|
|
||||||
// From https://github.com/felixrieseberg/electron-windows-notifications#appusermodelid
|
// From https://github.com/felixrieseberg/electron-windows-notifications#appusermodelid
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
import { remote, OpenDialogOptions } from 'electron';
|
import { remote, OpenDialogOptions } from 'electron';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
import CertificateUtil = require('../../utils/certificate-util');
|
import * as CertificateUtil from '../../utils/certificate-util';
|
||||||
import DomainUtil = require('../../utils/domain-util');
|
import * as DomainUtil from '../../utils/domain-util';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
const { dialog } = remote;
|
const { dialog } = remote;
|
||||||
|
|
||||||
class AddCertificate extends BaseComponent {
|
export default class AddCertificate extends BaseComponent {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
_certFile: string;
|
_certFile: string;
|
||||||
@@ -93,5 +93,3 @@ class AddCertificate extends BaseComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = AddCertificate;
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { app } from 'electron';
|
import electron, { app } from 'electron';
|
||||||
|
|
||||||
import electron = require('electron');
|
import * as ConfigUtil from '../../utils/config-util';
|
||||||
import ConfigUtil = require('../../utils/config-util');
|
|
||||||
|
|
||||||
function showBadgeCount(messageCount: number, mainWindow: electron.BrowserWindow): void {
|
function showBadgeCount(messageCount: number, mainWindow: electron.BrowserWindow): void {
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
|
|
||||||
class BaseSection extends BaseComponent {
|
export default class BaseSection extends BaseComponent {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
generateSettingOption(props: any): void {
|
generateSettingOption(props: any): void {
|
||||||
const {$element, disabled, value, clickHandler} = props;
|
const {$element, disabled, value, clickHandler} = props;
|
||||||
@@ -46,5 +46,3 @@ class BaseSection extends BaseComponent {
|
|||||||
ipcRenderer.send('forward-message', 'reload-viewer');
|
ipcRenderer.send('forward-message', 'reload-viewer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BaseSection;
|
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import BaseSection = require('./base-section');
|
import BaseSection from './base-section';
|
||||||
import DomainUtil = require('../../utils/domain-util');
|
import * as DomainUtil from '../../utils/domain-util';
|
||||||
import ServerInfoForm = require('./server-info-form');
|
import ServerInfoForm from './server-info-form';
|
||||||
import AddCertificate = require('./add-certificate');
|
import AddCertificate from './add-certificate';
|
||||||
import FindAccounts = require('./find-accounts');
|
import FindAccounts from './find-accounts';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class ConnectedOrgSection extends BaseSection {
|
export default class ConnectedOrgSection extends BaseSection {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
$serverInfoContainer: Element | null;
|
$serverInfoContainer: Element | null;
|
||||||
@@ -86,5 +86,3 @@ class ConnectedOrgSection extends BaseSection {
|
|||||||
}).init();
|
}).init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ConnectedOrgSection;
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
import { shell } from 'electron';
|
import { shell } from 'electron';
|
||||||
|
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class FindAccounts extends BaseComponent {
|
export default class FindAccounts extends BaseComponent {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
$findAccounts: Element | null;
|
$findAccounts: Element | null;
|
||||||
@@ -74,5 +74,3 @@ class FindAccounts extends BaseComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = FindAccounts;
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { ipcRenderer, remote, OpenDialogOptions } from 'electron';
|
import { ipcRenderer, remote, OpenDialogOptions } from 'electron';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import fs = require('fs-extra');
|
import fs from 'fs-extra';
|
||||||
|
|
||||||
const { app, dialog } = remote;
|
const { app, dialog } = remote;
|
||||||
const currentBrowserWindow = remote.getCurrentWindow();
|
const currentBrowserWindow = remote.getCurrentWindow();
|
||||||
|
|
||||||
import BaseSection = require('./base-section');
|
import BaseSection from './base-section';
|
||||||
import ConfigUtil = require('../../utils/config-util');
|
import * as ConfigUtil from '../../utils/config-util';
|
||||||
import EnterpriseUtil = require('./../../utils/enterprise-util');
|
import * as EnterpriseUtil from '../../utils/enterprise-util';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class GeneralSection extends BaseSection {
|
export default class GeneralSection extends BaseSection {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
constructor(props: any) {
|
constructor(props: any) {
|
||||||
@@ -498,5 +498,3 @@ class GeneralSection extends BaseSection {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = GeneralSection;
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class PreferenceNav extends BaseComponent {
|
export default class PreferenceNav extends BaseComponent {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
navItems: string[];
|
navItems: string[];
|
||||||
@@ -64,5 +64,3 @@ class PreferenceNav extends BaseComponent {
|
|||||||
$item.classList.remove('active');
|
$item.classList.remove('active');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = PreferenceNav;
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import BaseSection = require('./base-section');
|
import BaseSection from './base-section';
|
||||||
import ConfigUtil = require('../../utils/config-util');
|
import * as ConfigUtil from '../../utils/config-util';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class NetworkSection extends BaseSection {
|
export default class NetworkSection extends BaseSection {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
$proxyPAC: HTMLInputElement;
|
$proxyPAC: HTMLInputElement;
|
||||||
@@ -132,5 +132,3 @@ class NetworkSection extends BaseSection {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = NetworkSection;
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
import { shell, ipcRenderer } from 'electron';
|
import { shell, ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
import DomainUtil = require('../../utils/domain-util');
|
import * as DomainUtil from '../../utils/domain-util';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class NewServerForm extends BaseComponent {
|
export default class NewServerForm extends BaseComponent {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
$newServerForm: Element;
|
$newServerForm: Element;
|
||||||
@@ -99,5 +99,3 @@ class NewServerForm extends BaseComponent {
|
|||||||
this.networkSettingsLink();
|
this.networkSettingsLink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = NewServerForm;
|
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
import Nav = require('./nav');
|
import Nav from './nav';
|
||||||
import ServersSection = require('./servers-section');
|
import ServersSection from './servers-section';
|
||||||
import GeneralSection = require('./general-section');
|
import GeneralSection from './general-section';
|
||||||
import NetworkSection = require('./network-section');
|
import NetworkSection from './network-section';
|
||||||
import ConnectedOrgSection = require('./connected-org-section');
|
import ConnectedOrgSection from './connected-org-section';
|
||||||
import ShortcutsSection = require('./shortcuts-section');
|
import ShortcutsSection from './shortcuts-section';
|
||||||
|
|
||||||
type Section = ServersSection | GeneralSection | NetworkSection | ConnectedOrgSection | ShortcutsSection;
|
type Section = ServersSection | GeneralSection | NetworkSection | ConnectedOrgSection | ShortcutsSection;
|
||||||
|
|
||||||
class PreferenceView extends BaseComponent {
|
export default class PreferenceView extends BaseComponent {
|
||||||
$sidebarContainer: Element;
|
$sidebarContainer: Element;
|
||||||
$settingsContainer: Element;
|
$settingsContainer: Element;
|
||||||
nav: Nav;
|
nav: Nav;
|
||||||
@@ -122,5 +122,3 @@ window.addEventListener('load', () => {
|
|||||||
const preferenceView = new PreferenceView();
|
const preferenceView = new PreferenceView();
|
||||||
preferenceView.init();
|
preferenceView.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
export = PreferenceView;
|
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
import { remote, ipcRenderer } from 'electron';
|
import { remote, ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import BaseComponent = require('../../components/base');
|
import BaseComponent from '../../components/base';
|
||||||
import DomainUtil = require('../../utils/domain-util');
|
import * as DomainUtil from '../../utils/domain-util';
|
||||||
import Messages = require('./../../../../resources/messages');
|
import * as Messages from '../../../../resources/messages';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
const { dialog } = remote;
|
const { dialog } = remote;
|
||||||
|
|
||||||
class ServerInfoForm extends BaseComponent {
|
export default class ServerInfoForm extends BaseComponent {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
$serverInfoForm: Element;
|
$serverInfoForm: Element;
|
||||||
@@ -91,5 +91,3 @@ class ServerInfoForm extends BaseComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ServerInfoForm;
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import BaseSection = require('./base-section');
|
import BaseSection from './base-section';
|
||||||
import NewServerForm = require('./new-server-form');
|
import NewServerForm from './new-server-form';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class ServersSection extends BaseSection {
|
export default class ServersSection extends BaseSection {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
$newServerContainer: Element;
|
$newServerContainer: Element;
|
||||||
@@ -46,5 +46,3 @@ class ServersSection extends BaseSection {
|
|||||||
}).init();
|
}).init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ServersSection;
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
import { shell } from 'electron';
|
import { shell } from 'electron';
|
||||||
|
|
||||||
import BaseSection = require('./base-section');
|
import BaseSection from './base-section';
|
||||||
import t = require('../../utils/translation-util');
|
import * as t from '../../utils/translation-util';
|
||||||
|
|
||||||
class ShortcutsSection extends BaseSection {
|
export default class ShortcutsSection extends BaseSection {
|
||||||
// TODO: TypeScript - Here props should be object type
|
// TODO: TypeScript - Here props should be object type
|
||||||
props: any;
|
props: any;
|
||||||
constructor(props: any) {
|
constructor(props: any) {
|
||||||
@@ -341,5 +341,3 @@ class ShortcutsSection extends BaseSection {
|
|||||||
this.openHotkeysExternalLink();
|
this.openHotkeysExternalLink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ShortcutsSection;
|
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
import { ipcRenderer, shell } from 'electron';
|
import { ipcRenderer, shell } from 'electron';
|
||||||
import * as SetupSpellChecker from './spellchecker';
|
import * as SetupSpellChecker from './spellchecker';
|
||||||
|
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
import LinkUtil = require('./utils/link-util');
|
import * as LinkUtil from './utils/link-util';
|
||||||
import params = require('./utils/params-util');
|
import * as params from './utils/params-util';
|
||||||
import AuthUtil = require('./utils/auth-util');
|
import * as AuthUtil from './utils/auth-util';
|
||||||
import ConfigUtil = require('./utils/config-util');
|
import * as ConfigUtil from './utils/config-util';
|
||||||
|
|
||||||
import NetworkError = require('./pages/network');
|
import * as NetworkError from './pages/network';
|
||||||
|
|
||||||
interface PatchedGlobal extends NodeJS.Global {
|
interface PatchedGlobal extends NodeJS.Global {
|
||||||
logout: () => void;
|
logout: () => void;
|
||||||
@@ -20,14 +20,16 @@ interface PatchedGlobal extends NodeJS.Global {
|
|||||||
const globalPatched = global as PatchedGlobal;
|
const globalPatched = global as PatchedGlobal;
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-unassigned-import
|
// eslint-disable-next-line import/no-unassigned-import
|
||||||
require('./notification');
|
import './notification';
|
||||||
|
|
||||||
// Prevent drag and drop event in main process which prevents remote code executaion
|
// Prevent drag and drop event in main process which prevents remote code executaion
|
||||||
require(__dirname + '/shared/preventdrag.js');
|
// eslint-disable-next-line import/no-unassigned-import
|
||||||
|
import './shared/preventdrag';
|
||||||
|
|
||||||
declare let window: ZulipWebWindow;
|
declare let window: ZulipWebWindow;
|
||||||
|
|
||||||
window.electron_bridge = require('./electron-bridge');
|
import electron_bridge from './electron-bridge';
|
||||||
|
window.electron_bridge = electron_bridge;
|
||||||
|
|
||||||
const logout = (): void => {
|
const logout = (): void => {
|
||||||
// Create the menu for the below
|
// Create the menu for the below
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
// This is a security fix. Following function prevents drag and drop event in the app
|
// This is a security fix. Following function prevents drag and drop event in the app
|
||||||
// so that attackers can't execute any remote code within the app
|
// so that attackers can't execute any remote code within the app
|
||||||
// It doesn't affect the compose box so that users can still
|
// It doesn't affect the compose box so that users can still
|
||||||
@@ -15,3 +13,5 @@ const preventDragAndDrop = (): void => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
preventDragAndDrop();
|
preventDragAndDrop();
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import type { Subject } from 'rxjs';
|
import type { Subject } from 'rxjs';
|
||||||
import { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } from 'electron-spellchecker';
|
import { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } from 'electron-spellchecker';
|
||||||
|
|
||||||
import ConfigUtil = require('./utils/config-util');
|
import * as ConfigUtil from './utils/config-util';
|
||||||
import Logger = require('./utils/logger-util');
|
import Logger from './utils/logger-util';
|
||||||
|
|
||||||
declare module 'electron-spellchecker' {
|
declare module 'electron-spellchecker' {
|
||||||
interface SpellCheckHandler {
|
interface SpellCheckHandler {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { ipcRenderer, remote, WebviewTag, NativeImage } from 'electron';
|
import { ipcRenderer, remote, WebviewTag, NativeImage } from 'electron';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import ConfigUtil = require('./utils/config-util.js');
|
import * as ConfigUtil from './utils/config-util';
|
||||||
|
|
||||||
const { Tray, Menu, nativeImage, BrowserWindow, systemPreferences } = remote;
|
const { Tray, Menu, nativeImage, BrowserWindow, systemPreferences } = remote;
|
||||||
|
|
||||||
@@ -214,3 +214,5 @@ ipcRenderer.on('toggletray', toggleTray);
|
|||||||
if (ConfigUtil.getConfigItem('trayIcon', true)) {
|
if (ConfigUtil.getConfigItem('trayIcon', true)) {
|
||||||
createTray();
|
createTray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
|
|
||||||
import cryptoRandomString = require('crypto-random-string');
|
import cryptoRandomString from 'crypto-random-string';
|
||||||
import ConfigUtil = require('./config-util');
|
import * as ConfigUtil from './config-util';
|
||||||
|
|
||||||
const { shell } = remote;
|
const { shell } = remote;
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { remote } from 'electron';
|
|||||||
import { JsonDB } from 'node-json-db';
|
import { JsonDB } from 'node-json-db';
|
||||||
import { initSetUp } from './default-util';
|
import { initSetUp } from './default-util';
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
|
|
||||||
const { app, dialog } = remote;
|
const { app, dialog } = remote;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { JsonDB } from 'node-json-db';
|
import { JsonDB } from 'node-json-db';
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import electron = require('electron');
|
import electron from 'electron';
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
import EnterpriseUtil = require('./enterprise-util');
|
import * as EnterpriseUtil from './enterprise-util';
|
||||||
|
|
||||||
const logger = new Logger({
|
const logger = new Logger({
|
||||||
file: 'config-util.log',
|
file: 'config-util.log',
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import fs = require('fs');
|
import electron from 'electron';
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
let app: Electron.App = null;
|
let app: Electron.App = null;
|
||||||
let setupCompleted = false;
|
let setupCompleted = false;
|
||||||
if (process.type === 'renderer') {
|
if (process.type === 'renderer') {
|
||||||
app = require('electron').remote.app;
|
app = electron.remote.app;
|
||||||
} else {
|
} else {
|
||||||
app = require('electron').app;
|
app = electron.app;
|
||||||
}
|
}
|
||||||
|
|
||||||
const zulipDir = app.getPath('userData');
|
const zulipDir = app.getPath('userData');
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import ConfigUtil = require('./config-util');
|
import * as ConfigUtil from './config-util';
|
||||||
|
|
||||||
// TODO: TypeScript - add to Setting interface
|
// TODO: TypeScript - add to Setting interface
|
||||||
// the list of settings since we have fixed amount of them
|
// the list of settings since we have fixed amount of them
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { JsonDB } from 'node-json-db';
|
import { JsonDB } from 'node-json-db';
|
||||||
|
|
||||||
import escape = require('escape-html');
|
import escape from 'escape-html';
|
||||||
import request = require('request');
|
import request from 'request';
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
import electron = require('electron');
|
import { ipcRenderer, remote } from 'electron';
|
||||||
|
|
||||||
import RequestUtil = require('./request-util');
|
import * as RequestUtil from './request-util';
|
||||||
import EnterpriseUtil = require('./enterprise-util');
|
import * as EnterpriseUtil from './enterprise-util';
|
||||||
import Messages = require('../../../resources/messages');
|
import * as Messages from '../../../resources/messages';
|
||||||
|
|
||||||
const { ipcRenderer } = electron;
|
const { app, dialog } = remote;
|
||||||
const { app, dialog } = electron.remote;
|
|
||||||
|
|
||||||
interface ServerConf {
|
interface ServerConf {
|
||||||
url: string;
|
url: string;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
|
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
|
|
||||||
const logger = new Logger({
|
const logger = new Logger({
|
||||||
file: 'enterprise-util.log',
|
file: 'enterprise-util.log',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// TODO: TypeScript - Add @types/
|
// TODO: TypeScript - Add @types/
|
||||||
import wurl = require('wurl');
|
import wurl from 'wurl';
|
||||||
|
|
||||||
interface IsInternalResponse {
|
interface IsInternalResponse {
|
||||||
isInternalUrl: boolean;
|
isInternalUrl: boolean;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { JsonDB } from 'node-json-db';
|
import { JsonDB } from 'node-json-db';
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import electron = require('electron');
|
import electron from 'electron';
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
|
|
||||||
const remote =
|
const remote =
|
||||||
process.type === 'renderer' ? electron.remote : electron;
|
process.type === 'renderer' ? electron.remote : electron;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { Console as NodeConsole } from 'console'; // eslint-disable-line node/pr
|
|||||||
import { initSetUp } from './default-util';
|
import { initSetUp } from './default-util';
|
||||||
import { sentryInit, captureException } from './sentry-util';
|
import { sentryInit, captureException } from './sentry-util';
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import os = require('os');
|
import os from 'os';
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
import electron = require('electron');
|
import electron from 'electron';
|
||||||
// this interface adds [key: string]: any so
|
// this interface adds [key: string]: any so
|
||||||
// we can do console[type] later on in the code
|
// we can do console[type] later on in the code
|
||||||
interface PatchedConsole extends Console {
|
interface PatchedConsole extends Console {
|
||||||
@@ -44,7 +44,7 @@ if (process.type === 'renderer') {
|
|||||||
const browserConsole: PatchedConsole = console;
|
const browserConsole: PatchedConsole = console;
|
||||||
const logDir = `${app.getPath('userData')}/Logs`;
|
const logDir = `${app.getPath('userData')}/Logs`;
|
||||||
|
|
||||||
class Logger {
|
export default class Logger {
|
||||||
nodeConsole: PatchedConsole;
|
nodeConsole: PatchedConsole;
|
||||||
timestamp?: () => string;
|
timestamp?: () => string;
|
||||||
level: boolean;
|
level: boolean;
|
||||||
@@ -151,5 +151,3 @@ class Logger {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = Logger;
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import url = require('url');
|
import url from 'url';
|
||||||
|
|
||||||
import ConfigUtil = require('./config-util');
|
import * as ConfigUtil from './config-util';
|
||||||
|
|
||||||
export interface ProxyRule {
|
export interface ProxyRule {
|
||||||
hostname?: string;
|
hostname?: string;
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import type WebView from '../components/webview';
|
import type WebView from '../components/webview';
|
||||||
import backoff = require('backoff');
|
import backoff from 'backoff';
|
||||||
import request = require('request');
|
import request from 'request';
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
import RequestUtil = require('./request-util');
|
import * as RequestUtil from './request-util';
|
||||||
import DomainUtil = require('./domain-util');
|
import * as DomainUtil from './domain-util';
|
||||||
|
|
||||||
const logger = new Logger({
|
const logger = new Logger({
|
||||||
file: 'domain-util.log',
|
file: 'domain-util.log',
|
||||||
timestamp: true
|
timestamp: true
|
||||||
});
|
});
|
||||||
|
|
||||||
class ReconnectUtil {
|
export default class ReconnectUtil {
|
||||||
webview: WebView;
|
webview: WebView;
|
||||||
url: string;
|
url: string;
|
||||||
alreadyReloaded: boolean;
|
alreadyReloaded: boolean;
|
||||||
@@ -86,5 +86,3 @@ class ReconnectUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ReconnectUtil;
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from 'fs';
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import ConfigUtil = require('./config-util');
|
import * as ConfigUtil from './config-util';
|
||||||
import Logger = require('./logger-util');
|
import Logger from './logger-util';
|
||||||
import ProxyUtil = require('./proxy-util');
|
import * as ProxyUtil from './proxy-util';
|
||||||
import CertificateUtil = require('./certificate-util');
|
import * as CertificateUtil from './certificate-util';
|
||||||
import SystemUtil = require('./system-util');
|
import * as SystemUtil from './system-util';
|
||||||
|
|
||||||
const { app } = remote;
|
const { app } = remote;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { init } from '@sentry/electron';
|
import { init } from '@sentry/electron';
|
||||||
|
|
||||||
import isDev = require('electron-is-dev');
|
import isDev from 'electron-is-dev';
|
||||||
|
|
||||||
export const sentryInit = (): void => {
|
export const sentryInit = (): void => {
|
||||||
if (!isDev) {
|
if (!isDev) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
|
|
||||||
import os = require('os');
|
import os from 'os';
|
||||||
import ConfigUtil = require('./config-util');
|
import * as ConfigUtil from './config-util';
|
||||||
|
|
||||||
const { app } = remote;
|
const { app } = remote;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import electron = require('electron');
|
import electron from 'electron';
|
||||||
import i18n = require('i18n');
|
import i18n from 'i18n';
|
||||||
|
|
||||||
let app: Electron.App = null;
|
let app: Electron.App = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user