Prefer import type
when importing types
This commit is contained in:
parent
0f635af8a9
commit
74fde10ff5
721 changed files with 2037 additions and 1947 deletions
|
@ -2,14 +2,8 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { join } from 'path';
|
||||
import {
|
||||
BrowserWindow,
|
||||
Menu,
|
||||
NativeImage,
|
||||
Tray,
|
||||
app,
|
||||
nativeImage,
|
||||
} from 'electron';
|
||||
import type { BrowserWindow, NativeImage } from 'electron';
|
||||
import { Menu, Tray, app, nativeImage } from 'electron';
|
||||
import * as log from '../ts/logging/log';
|
||||
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import { app, dialog, clipboard } from 'electron';
|
|||
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { redactAll } from '../ts/util/privacy';
|
||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
||||
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify';
|
||||
|
||||
// We use hard-coded strings until we're able to update these strings from the locale.
|
||||
|
|
|
@ -6,9 +6,9 @@ import { readFileSync } from 'fs';
|
|||
import { merge } from 'lodash';
|
||||
import { setupI18n } from '../ts/util/setupI18n';
|
||||
|
||||
import { LoggerType } from '../ts/types/Logging';
|
||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
||||
import { LocalizerType } from '../ts/types/Util';
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||
import type { LocalizerType } from '../ts/types/Util';
|
||||
|
||||
function normalizeLocaleName(locale: string): string {
|
||||
if (/^en-/.test(locale)) {
|
||||
|
|
|
@ -34,7 +34,8 @@ import { consoleLogger } from '../ts/util/consoleLogger';
|
|||
|
||||
import './startup_config';
|
||||
|
||||
import config, { ConfigType } from './config';
|
||||
import type { ConfigType } from './config';
|
||||
import config from './config';
|
||||
import {
|
||||
Environment,
|
||||
getEnvironment,
|
||||
|
@ -63,7 +64,8 @@ import * as logging from '../ts/logging/main_process_logging';
|
|||
import { MainSQL } from '../ts/sql/main';
|
||||
import * as sqlChannels from './sql_channel';
|
||||
import * as windowState from './window_state';
|
||||
import { createTemplate, MenuOptionsType } from './menu';
|
||||
import type { MenuOptionsType } from './menu';
|
||||
import { createTemplate } from './menu';
|
||||
import { installFileHandler, installWebHandler } from './protocol_filter';
|
||||
import * as OS from '../ts/OS';
|
||||
import { isProduction } from '../ts/util/version';
|
||||
|
@ -87,7 +89,8 @@ import { SettingsChannel } from '../ts/main/settingsChannel';
|
|||
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url';
|
||||
import { getHeicConverter } from '../ts/workers/heicConverterMain';
|
||||
|
||||
import { load as loadLocale, LocaleType } from './locale';
|
||||
import type { LocaleType } from './locale';
|
||||
import { load as loadLocale } from './locale';
|
||||
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isString } from 'lodash';
|
||||
import { MenuItemConstructorOptions } from 'electron';
|
||||
import type { MenuItemConstructorOptions } from 'electron';
|
||||
|
||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
||||
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||
|
||||
export type MenuListType = Array<MenuItemConstructorOptions>;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// The list of permissions is here:
|
||||
// https://electronjs.org/docs/api/session#sessetpermissionrequesthandlerhandler
|
||||
|
||||
import { session as ElectronSession } from 'electron';
|
||||
import type { session as ElectronSession } from 'electron';
|
||||
|
||||
import type { ConfigType } from './base_config';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import {
|
||||
import type {
|
||||
protocol as ElectronProtocol,
|
||||
ProtocolRequest,
|
||||
ProtocolResponse,
|
||||
|
|
|
@ -3,15 +3,16 @@
|
|||
|
||||
/* eslint-disable strict */
|
||||
|
||||
import { BrowserWindow, Menu, clipboard, nativeImage } from 'electron';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
import { Menu, clipboard, nativeImage } from 'electron';
|
||||
import { sync as osLocaleSync } from 'os-locale';
|
||||
import { uniq } from 'lodash';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
import { maybeParseUrl } from '../ts/util/url';
|
||||
import { LocaleMessagesType } from '../ts/types/I18N';
|
||||
import type { LocaleMessagesType } from '../ts/types/I18N';
|
||||
|
||||
import { MenuListType } from './menu';
|
||||
import type { MenuListType } from './menu';
|
||||
|
||||
export function getLanguages(
|
||||
userLocale: string,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue