Files
zulip-desktop/typings.d.ts
Priyank Patel c34b4f9151 tsconfig: Remove declare module * declaration and normalize imports.
The change in this commits are pretty involved but cannot be split
into small commits. The main changes in this commits are:
    * Remove declare module * now that we don't need it
    * Normalize import paths so typescript is happy

Previously, we were using wrong import paths and so typescript couldn't
really provide full types information for imports. The wrong paths isn't
a bug because it was done to make sure it work when it was imported via a
script tag; we fix this by using require inside the script tag in main.html.

Also, did audit to make sure we correctly use __dirname not that it's
value will be diffrent, it won't be js/ but will be respective to the file
path of the module.
2019-07-17 00:22:17 +05:30

55 lines
1.6 KiB
TypeScript

declare module 'adm-zip';
declare module 'auto-launch';
declare module 'is-online';
declare module 'request';
declare module 'semver';
declare module '@electron-elements/send-feedback';
declare module 'node-mac-notifier';
declare module 'electron-connect';
declare module 'electron-is-dev';
declare module 'electron-spellchecker';
declare module 'escape-html';
declare module 'fs-extra';
declare module 'wurl';
interface PageParamsObject {
realm_uri: string;
default_language: string;
}
declare var page_params: PageParamsObject;
// since requestIdleCallback didn't make it into lib.dom.d.ts yet
declare function requestIdleCallback(callback: Function, options?: object): void;
// Patch Notification object so we can implement our side
// of Notification classes which we export into zulip side through
// preload.js; if we don't do his extending Notification will throw error.
// Relevant code is in app/renderer/js/notification/default-notification.ts
// and the relevant function is requestPermission.
declare var PatchedNotification: {
prototype: Notification;
new(title: string, options?: NotificationOptions): Notification;
readonly maxActions: number;
readonly permission: NotificationPermission;
requestPermission(): void;
}
// This is mostly zulip side of code we access from window
interface Window {
$: any;
narrow: any
Notification: typeof PatchedNotification;
}
// typescript doesn't have up to date NotificationOptions yet
interface NotificationOptions {
silent?: boolean;
}
interface ZulipWebWindow extends Window {
electron_bridge: any;
tray: any;
$: any;
lightbox: any;
}