mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-27 18:13:45 +00:00
typescript: Migrate index.js to typescript.
This commit is contained in:
committed by
Akash Nimare
parent
1182af23e4
commit
2b19cdecf2
@@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
remote: { app }
|
||||
} = require('electron');
|
||||
import { remote } from 'electron';
|
||||
|
||||
const params = require('../utils/params-util.js');
|
||||
const DefaultNotification = require('./default-notification');
|
||||
const { appId, loadBots } = require('./helpers');
|
||||
import * as params from '../utils/params-util';
|
||||
import DefaultNotification from './default-notification';
|
||||
import { appId, loadBots } from './helpers';
|
||||
|
||||
const { app } = remote;
|
||||
|
||||
// From https://github.com/felixrieseberg/electron-windows-notifications#appusermodelid
|
||||
// On windows 8 we have to explicitly set the appUserModelId otherwise notification won't work.
|
||||
@@ -15,12 +15,11 @@ app.setAppUserModelId(appId);
|
||||
window.Notification = DefaultNotification;
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
const DarwinNotification = require('./darwin-notifications');
|
||||
window.Notification = DarwinNotification;
|
||||
window.Notification = require('./darwin-notifications');
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
// eslint-disable-next-line no-undef, camelcase
|
||||
// eslint-disable-next-line no-undef, @typescript-eslint/camelcase
|
||||
if (params.isPageParams() && page_params.realm_uri) {
|
||||
loadBots();
|
||||
}
|
||||
5
typings.d.ts
vendored
5
typings.d.ts
vendored
@@ -4,7 +4,7 @@
|
||||
// are not supported
|
||||
declare module '*';
|
||||
|
||||
declare var page_params: object;
|
||||
declare var page_params: any;
|
||||
|
||||
// since requestIdleCallback didn't make it into lib.dom.d.ts yet
|
||||
declare function requestIdleCallback(callback: Function, options?: object): void;
|
||||
@@ -12,5 +12,6 @@ declare function requestIdleCallback(callback: Function, options?: object): void
|
||||
// This is mostly zulip side of code we access from window
|
||||
interface Window {
|
||||
$: any;
|
||||
narrow: any;
|
||||
narrow: any
|
||||
Notification: typeof Notification;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user