You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Tools: Apply rule @typescript-eslint/ban-types
This commit is contained in:
@ -184,6 +184,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
'rules': {
|
'rules': {
|
||||||
'@typescript-eslint/ban-ts-comment': ['error'],
|
'@typescript-eslint/ban-ts-comment': ['error'],
|
||||||
|
'@typescript-eslint/ban-types': 'error',
|
||||||
'@typescript-eslint/explicit-member-accessibility': ['error'],
|
'@typescript-eslint/explicit-member-accessibility': ['error'],
|
||||||
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
|
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
|
||||||
'@typescript-eslint/array-type': 'error',
|
'@typescript-eslint/array-type': 'error',
|
||||||
|
@ -54,6 +54,7 @@ export default class BaseCommand {
|
|||||||
return r[0];
|
return r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public setDispatcher(fn: Function) {
|
public setDispatcher(fn: Function) {
|
||||||
this.dispatcher_ = fn;
|
this.dispatcher_ = fn;
|
||||||
}
|
}
|
||||||
@ -63,6 +64,7 @@ export default class BaseCommand {
|
|||||||
return this.dispatcher_(action);
|
return this.dispatcher_(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public setStdout(fn: Function) {
|
public setStdout(fn: Function) {
|
||||||
this.stdout_ = fn;
|
this.stdout_ = fn;
|
||||||
}
|
}
|
||||||
@ -71,6 +73,7 @@ export default class BaseCommand {
|
|||||||
if (this.stdout_) this.stdout_(text);
|
if (this.stdout_) this.stdout_(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public setPrompt(fn: Function) {
|
public setPrompt(fn: Function) {
|
||||||
this.prompt_ = fn;
|
this.prompt_ = fn;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import { pathExists, writeFile } from 'fs-extra';
|
|||||||
class Command extends BaseCommand {
|
class Command extends BaseCommand {
|
||||||
|
|
||||||
private syncTargetId_: number = null;
|
private syncTargetId_: number = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private releaseLockFn_: Function = null;
|
private releaseLockFn_: Function = null;
|
||||||
private oneDriveApiUtils_: any = null;
|
private oneDriveApiUtils_: any = null;
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ export default class PluginRunner extends BasePluginRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async run(plugin: Plugin, sandbox: Global): Promise<void> {
|
public async run(plugin: Plugin, sandbox: Global): Promise<void> {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function, reject: Function) => {
|
return new Promise((resolve: Function, reject: Function) => {
|
||||||
const onStarted = () => {
|
const onStarted = () => {
|
||||||
plugin.off('started', onStarted);
|
plugin.off('started', onStarted);
|
||||||
@ -85,6 +86,7 @@ export default class PluginRunner extends BasePluginRunner {
|
|||||||
|
|
||||||
public async waitForSandboxCalls(): Promise<void> {
|
public async waitForSandboxCalls(): Promise<void> {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function, reject: Function) => {
|
return new Promise((resolve: Function, reject: Function) => {
|
||||||
const iid = setInterval(() => {
|
const iid = setInterval(() => {
|
||||||
if (!Object.keys(this.activeSandboxCalls_).length) {
|
if (!Object.keys(this.activeSandboxCalls_).length) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { _ } from '@joplin/lib/locale';
|
import { _ } from '@joplin/lib/locale';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
export default (cmd: any, stdout: Function, store: Function, gui: Function) => {
|
||||||
cmd.setStdout((text: string) => {
|
cmd.setStdout((text: string) => {
|
||||||
return stdout(text);
|
return stdout(text);
|
||||||
|
@ -3,6 +3,7 @@ import Folder from '@joplin/lib/models/Folder';
|
|||||||
import BaseCommand from '../base-command';
|
import BaseCommand from '../base-command';
|
||||||
import setupCommand from '../setupCommand';
|
import setupCommand from '../setupCommand';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export const setupCommandForTesting = (CommandClass: any, stdout: Function = null): BaseCommand => {
|
export const setupCommandForTesting = (CommandClass: any, stdout: Function = null): BaseCommand => {
|
||||||
const command = new CommandClass();
|
const command = new CommandClass();
|
||||||
setupCommand(command, stdout, null, null);
|
setupCommand(command, stdout, null, null);
|
||||||
|
@ -151,6 +151,7 @@ export default class InteropServiceHelper {
|
|||||||
return `${filename}.${fileExtension}`;
|
return `${filename}.${fileExtension}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static async export(_dispatch: Function, module: Module, options: ExportNoteOptions = null) {
|
public static async export(_dispatch: Function, module: Module, options: ExportNoteOptions = null) {
|
||||||
if (!options) options = {};
|
if (!options) options = {};
|
||||||
|
|
||||||
|
@ -88,6 +88,7 @@ export class Bridge {
|
|||||||
// Perhaps the easiest would be to patch electron-context-menu to
|
// Perhaps the easiest would be to patch electron-context-menu to
|
||||||
// support the renderer process again. Or possibly revert to an old
|
// support the renderer process again. Or possibly revert to an old
|
||||||
// version of electron-context-menu.
|
// version of electron-context-menu.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public setupContextMenu(_spellCheckerMenuItemsHandler: Function) {
|
public setupContextMenu(_spellCheckerMenuItemsHandler: Function) {
|
||||||
require('electron-context-menu')({
|
require('electron-context-menu')({
|
||||||
allWindows: [this.window()],
|
allWindows: [this.window()],
|
||||||
@ -255,6 +256,7 @@ export class Bridge {
|
|||||||
return nativeTheme.shouldUseDarkColors;
|
return nativeTheme.shouldUseDarkColors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public addEventListener(name: string, fn: Function) {
|
public addEventListener(name: string, fn: Function) {
|
||||||
if (name === 'nativeThemeUpdated') {
|
if (name === 'nativeThemeUpdated') {
|
||||||
nativeTheme.on('updated', fn);
|
nativeTheme.on('updated', fn);
|
||||||
|
@ -20,6 +20,7 @@ interface Props {
|
|||||||
iconName?: string;
|
iconName?: string;
|
||||||
level?: ButtonLevel;
|
level?: ButtonLevel;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClick?: Function;
|
onClick?: Function;
|
||||||
color?: string;
|
color?: string;
|
||||||
iconAnimation?: string;
|
iconAnimation?: string;
|
||||||
|
@ -6,8 +6,11 @@ const styled = require('styled-components').default;
|
|||||||
interface Props {
|
interface Props {
|
||||||
backButtonTitle?: string;
|
backButtonTitle?: string;
|
||||||
hasChanges?: boolean;
|
hasChanges?: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onCancelClick: Function;
|
onCancelClick: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onSaveClick?: Function;
|
onSaveClick?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onApplyClick?: Function;
|
onApplyClick?: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ const styled = require('styled-components').default;
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
selection: string;
|
selection: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onSelectionChange: Function;
|
onSelectionChange: Function;
|
||||||
sections: any[];
|
sections: any[];
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,13 @@ const RepoApiErrorMessage = styled(StyledMessage)<any>`
|
|||||||
interface Props {
|
interface Props {
|
||||||
value: any;
|
value: any;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onChange: Function;
|
onChange: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderLabel: Function;
|
renderLabel: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderDescription: Function;
|
renderDescription: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderHeader: Function;
|
renderHeader: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ interface Props {
|
|||||||
onSearchQueryChange(event: OnChangeEvent): void;
|
onSearchQueryChange(event: OnChangeEvent): void;
|
||||||
pluginSettings: PluginSettings;
|
pluginSettings: PluginSettings;
|
||||||
onPluginSettingsChange(event: any): void;
|
onPluginSettingsChange(event: any): void;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderDescription: Function;
|
renderDescription: Function;
|
||||||
maxWidth: number;
|
maxWidth: number;
|
||||||
repoApi(): RepositoryApi;
|
repoApi(): RepositoryApi;
|
||||||
|
@ -13,6 +13,7 @@ export interface OnPluginSettingChangeEvent {
|
|||||||
|
|
||||||
type OnPluginSettingChangeHandler = (event: OnPluginSettingChangeEvent)=> void;
|
type OnPluginSettingChangeHandler = (event: OnPluginSettingChangeEvent)=> void;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function(setInstallingPluginIds: Function, pluginSettings: PluginSettings, repoApi: Function, onPluginSettingsChange: OnPluginSettingChangeHandler, isUpdate: boolean) {
|
export default function(setInstallingPluginIds: Function, pluginSettings: PluginSettings, repoApi: Function, onPluginSettingsChange: OnPluginSettingChangeHandler, isUpdate: boolean) {
|
||||||
return useCallback(async (event: ItemEvent) => {
|
return useCallback(async (event: ItemEvent) => {
|
||||||
const pluginId = event.item.manifest.id;
|
const pluginId = event.item.manifest.id;
|
||||||
|
@ -26,8 +26,10 @@ const DialogRoot = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderContent: Function;
|
renderContent: Function;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClose?: Function;
|
onClose?: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,9 @@ import { useEffect, useState, useRef, useCallback } from 'react';
|
|||||||
import { isInsideContainer } from '@joplin/lib/dom';
|
import { isInsideContainer } from '@joplin/lib/dom';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onOkButtonClick: Function;
|
onOkButtonClick: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onCancelButtonClick: Function;
|
onCancelButtonClick: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import FolderIconBox from '../FolderIconBox';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
folderId: string;
|
folderId: string;
|
||||||
parentId: string;
|
parentId: string;
|
||||||
|
@ -5,6 +5,7 @@ import { AppState } from '../app.reducer';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
tip: string;
|
tip: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClick: Function;
|
onClick: Function;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
style: any;
|
style: any;
|
||||||
|
@ -5,6 +5,7 @@ interface Props {
|
|||||||
themeId: number;
|
themeId: number;
|
||||||
style: any;
|
style: any;
|
||||||
iconName: string;
|
iconName: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClick: Function;
|
onClick: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,9 +5,12 @@ interface Props {
|
|||||||
itemHeight: number;
|
itemHeight: number;
|
||||||
items: any[];
|
items: any[];
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onKeyDown?: Function;
|
onKeyDown?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
itemRenderer: Function;
|
itemRenderer: Function;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onNoteDrop?: Function;
|
onNoteDrop?: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@ interface Props {
|
|||||||
pluginHtmlContents: PluginHtmlContents;
|
pluginHtmlContents: PluginHtmlContents;
|
||||||
pluginsLoaded: boolean;
|
pluginsLoaded: boolean;
|
||||||
hasNotesBeingSaved: boolean;
|
hasNotesBeingSaved: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
mainLayout: LayoutItem;
|
mainLayout: LayoutItem;
|
||||||
style: any;
|
style: any;
|
||||||
@ -121,6 +122,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
private isPrinting_: boolean;
|
private isPrinting_: boolean;
|
||||||
private styleKey_: string;
|
private styleKey_: string;
|
||||||
private styles_: any;
|
private styles_: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private promptOnClose_: Function;
|
private promptOnClose_: Function;
|
||||||
|
|
||||||
public constructor(props: Props) {
|
public constructor(props: Props) {
|
||||||
@ -514,6 +516,7 @@ class MainScreenComponent extends React.Component<Props, State> {
|
|||||||
return this.styles_;
|
return this.styles_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private renderNotificationMessage(message: string, callForAction: string, callForActionHandler: Function, callForAction2: string = null, callForActionHandler2: Function = null) {
|
private renderNotificationMessage(message: string, callForAction: string, callForActionHandler: Function, callForAction2: string = null, callForActionHandler2: Function = null) {
|
||||||
const theme = themeStyle(this.props.themeId);
|
const theme = themeStyle(this.props.themeId);
|
||||||
const urlStyle: any = { color: theme.colorWarnUrl, textDecoration: 'underline' };
|
const urlStyle: any = { color: theme.colorWarnUrl, textDecoration: 'underline' };
|
||||||
|
@ -29,6 +29,7 @@ export const runtime = (): CommandRuntime => {
|
|||||||
} else if (uiType === UiType.CommandPalette) {
|
} else if (uiType === UiType.CommandPalette) {
|
||||||
menuItemById('commandPalette').click();
|
menuItemById('commandPalette').click();
|
||||||
} else if (uiType === UiType.ControlledApi) {
|
} else if (uiType === UiType.ControlledApi) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function, reject: Function) => {
|
return new Promise((resolve: Function, reject: Function) => {
|
||||||
const menuItem = PluginManager.instance().menuItems().find((i: any) => i.id === 'controlledApi');
|
const menuItem = PluginManager.instance().menuItems().find((i: any) => i.id === 'controlledApi');
|
||||||
menuItem.userData = {
|
menuItem.userData = {
|
||||||
|
@ -14,6 +14,7 @@ import { PasswordInput } from '../PasswordInput/PasswordInput';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ function getPluginCommandNames(plugins: PluginStates): string[] {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemClick: Function) {
|
function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemClick: Function) {
|
||||||
const output: any = {
|
const output: any = {
|
||||||
label: label,
|
label: label,
|
||||||
@ -108,6 +109,7 @@ const useSwitchProfileMenuItems = (profileConfig: ProfileConfig, menuItemDic: an
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
menuItemProps: any;
|
menuItemProps: any;
|
||||||
routeName: string;
|
routeName: string;
|
||||||
|
@ -9,6 +9,7 @@ interface MultiNoteActionsProps {
|
|||||||
themeId: number;
|
themeId: number;
|
||||||
selectedNoteIds: string[];
|
selectedNoteIds: string[];
|
||||||
notes: any[];
|
notes: any[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
watchedNoteFiles: string[];
|
watchedNoteFiles: string[];
|
||||||
plugins: PluginStates;
|
plugins: PluginStates;
|
||||||
|
@ -10,6 +10,7 @@ interface NoteContentPropertiesDialogProps {
|
|||||||
themeId: number;
|
themeId: number;
|
||||||
text: string;
|
text: string;
|
||||||
markupLanguage: number;
|
markupLanguage: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClose: Function;
|
onClose: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ function markupToHtml() {
|
|||||||
return markupToHtml_;
|
return markupToHtml_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function countElements(text: string, wordSetter: Function, characterSetter: Function, characterNoSpaceSetter: Function, lineSetter: Function) {
|
function countElements(text: string, wordSetter: Function, characterSetter: Function, characterNoSpaceSetter: Function, lineSetter: Function) {
|
||||||
Countable.count(text, (counter: any) => {
|
Countable.count(text, (counter: any) => {
|
||||||
wordSetter(counter.words);
|
wordSetter(counter.words);
|
||||||
|
@ -62,6 +62,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
|||||||
const editorRef = useRef(null);
|
const editorRef = useRef(null);
|
||||||
const rootRef = useRef(null);
|
const rootRef = useRef(null);
|
||||||
const webviewRef = useRef(null);
|
const webviewRef = useRef(null);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const props_onChangeRef = useRef<Function>(null);
|
const props_onChangeRef = useRef<Function>(null);
|
||||||
props_onChangeRef.current = props.onChange;
|
props_onChangeRef.current = props.onChange;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ export default function useKeymap(CodeMirror: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converts a command of the form editor.command to just command
|
// Converts a command of the form editor.command to just command
|
||||||
function editorCommandToCodeMirror(command: String) {
|
function editorCommandToCodeMirror(command: string) {
|
||||||
return command.slice(7); // 7 is the length of editor.
|
return command.slice(7); // 7 is the length of editor.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ export default function useKeymap(CodeMirror: any) {
|
|||||||
// CodeMirror requires a - between keys while Electron want's a +
|
// CodeMirror requires a - between keys while Electron want's a +
|
||||||
// CodeMirror doesn't recognize Option (it uses Alt instead)
|
// CodeMirror doesn't recognize Option (it uses Alt instead)
|
||||||
// CodeMirror requires Shift to be first
|
// CodeMirror requires Shift to be first
|
||||||
function normalizeAccelerator(accelerator: String) {
|
function normalizeAccelerator(accelerator: string) {
|
||||||
const command = accelerator.replace(/\+/g, '-').replace('Option', 'Alt');
|
const command = accelerator.replace(/\+/g, '-').replace('Option', 'Alt');
|
||||||
// From here is taken out of codemirror/lib/codemirror.js
|
// From here is taken out of codemirror/lib/codemirror.js
|
||||||
const parts = command.split(/-(?!$)/);
|
const parts = command.split(/-(?!$)/);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useCallback, useRef } from 'react';
|
import { useCallback, useRef } from 'react';
|
||||||
import shim from '@joplin/lib/shim';
|
import shim from '@joplin/lib/shim';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function useScrollHandler(editorRef: any, webviewRef: any, onScroll: Function) {
|
export default function useScrollHandler(editorRef: any, webviewRef: any, onScroll: Function) {
|
||||||
const scrollTimeoutId_ = useRef<any>(null);
|
const scrollTimeoutId_ = useRef<any>(null);
|
||||||
const scrollPercent_ = useRef(0);
|
const scrollPercent_ = useRef(0);
|
||||||
|
@ -905,9 +905,11 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
|
|||||||
// Need to save the onChange handler to a ref to make sure
|
// Need to save the onChange handler to a ref to make sure
|
||||||
// we call the current one from setTimeout.
|
// we call the current one from setTimeout.
|
||||||
// https://github.com/facebook/react/issues/14010#issuecomment-433788147
|
// https://github.com/facebook/react/issues/14010#issuecomment-433788147
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const props_onChangeRef = useRef<Function>();
|
const props_onChangeRef = useRef<Function>();
|
||||||
props_onChangeRef.current = props.onChange;
|
props_onChangeRef.current = props.onChange;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const prop_htmlToMarkdownRef = useRef<Function>();
|
const prop_htmlToMarkdownRef = useRef<Function>();
|
||||||
prop_htmlToMarkdownRef.current = props.htmlToMarkdown;
|
prop_htmlToMarkdownRef.current = props.htmlToMarkdown;
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ function editableInnerHtml(html: string): string {
|
|||||||
return editable[0].innerHTML;
|
return editable[0].innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function openEditDialog(editor: any, markupToHtml: any, dispatchDidUpdate: Function, editable: any) {
|
export default function openEditDialog(editor: any, markupToHtml: any, dispatchDidUpdate: Function, editable: any) {
|
||||||
const source = editable ? findBlockSource(editable) : newBlockSource();
|
const source = editable ? findBlockSource(editable) : newBlockSource();
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ interface ContextMenuActionOptions {
|
|||||||
|
|
||||||
const contextMenuActionOptions: ContextMenuActionOptions = { current: null };
|
const contextMenuActionOptions: ContextMenuActionOptions = { current: null };
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function(editor: any, plugins: PluginStates, dispatch: Function) {
|
export default function(editor: any, plugins: PluginStates, dispatch: Function) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editor) return () => {};
|
if (!editor) return () => {};
|
||||||
|
@ -3,6 +3,7 @@ import shim from '@joplin/lib/shim';
|
|||||||
|
|
||||||
interface HookDependencies {
|
interface HookDependencies {
|
||||||
editor: any;
|
editor: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onScroll: Function;
|
onScroll: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ async function saveFileData(data: any, filename: string) {
|
|||||||
await writeFile(newFilePath, data);
|
await writeFile(newFilePath, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export async function openItemById(itemId: string, dispatch: Function, hash = '') {
|
export async function openItemById(itemId: string, dispatch: Function, hash = '') {
|
||||||
|
|
||||||
const item = await BaseItem.loadItemById(itemId);
|
const item = await BaseItem.loadItemById(itemId);
|
||||||
@ -68,6 +69,7 @@ export async function openItemById(itemId: string, dispatch: Function, hash = ''
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export function menuItems(dispatch: Function): ContextMenuItems {
|
export function menuItems(dispatch: Function): ContextMenuItems {
|
||||||
return {
|
return {
|
||||||
open: {
|
open: {
|
||||||
@ -194,6 +196,7 @@ export function menuItems(dispatch: Function): ContextMenuItems {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default async function contextMenu(options: ContextMenuOptions, dispatch: Function) {
|
export default async function contextMenu(options: ContextMenuOptions, dispatch: Function) {
|
||||||
const menu = new Menu();
|
const menu = new Menu();
|
||||||
|
|
||||||
|
@ -17,14 +17,18 @@ export interface ContextMenuOptions {
|
|||||||
linkToCopy: string;
|
linkToCopy: string;
|
||||||
textToCopy: string;
|
textToCopy: string;
|
||||||
htmlToCopy: string;
|
htmlToCopy: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
insertContent: Function;
|
insertContent: Function;
|
||||||
isReadOnly?: boolean;
|
isReadOnly?: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
fireEditorEvent: Function;
|
fireEditorEvent: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ContextMenuItem {
|
export interface ContextMenuItem {
|
||||||
label: string;
|
label: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onAction: Function;
|
onAction: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
isActive: Function;
|
isActive: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ export interface NoteEditorProps {
|
|||||||
// style: any;
|
// style: any;
|
||||||
noteId: string;
|
noteId: string;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
selectedNoteIds: string[];
|
selectedNoteIds: string[];
|
||||||
selectedFolderId: string;
|
selectedFolderId: string;
|
||||||
@ -59,9 +60,11 @@ export interface NoteBodyEditorProps {
|
|||||||
onMessage(event: any): void;
|
onMessage(event: any): void;
|
||||||
onScroll(event: any): void;
|
onScroll(event: any): void;
|
||||||
markupToHtml: (markupLanguage: MarkupLanguage, markup: string, options: MarkupToHtmlOptions)=> Promise<RenderResult>;
|
markupToHtml: (markupLanguage: MarkupLanguage, markup: string, options: MarkupToHtmlOptions)=> Promise<RenderResult>;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
htmlToMarkdown: Function;
|
htmlToMarkdown: Function;
|
||||||
allAssets: (markupLanguage: MarkupLanguage, options: AllAssetsOptions)=> Promise<RenderResultPluginAsset[]>;
|
allAssets: (markupLanguage: MarkupLanguage, options: AllAssetsOptions)=> Promise<RenderResultPluginAsset[]>;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
noteToolbar: any;
|
noteToolbar: any;
|
||||||
setLocalSearchResultCount(count: number): void;
|
setLocalSearchResultCount(count: number): void;
|
||||||
@ -70,6 +73,7 @@ export interface NoteBodyEditorProps {
|
|||||||
keyboardMode: string;
|
keyboardMode: string;
|
||||||
resourceInfos: ResourceInfos;
|
resourceInfos: ResourceInfos;
|
||||||
locale: string;
|
locale: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onDrop: Function;
|
onDrop: Function;
|
||||||
noteToolbarButtonInfos: ToolbarButtonInfo[];
|
noteToolbarButtonInfos: ToolbarButtonInfo[];
|
||||||
plugins: PluginStates;
|
plugins: PluginStates;
|
||||||
|
@ -28,6 +28,7 @@ interface HookDependencies {
|
|||||||
onAfterLoad(event: OnLoadEvent): void;
|
onAfterLoad(event: OnLoadEvent): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function installResourceChangeHandler(onResourceChangeHandler: Function) {
|
function installResourceChangeHandler(onResourceChangeHandler: Function) {
|
||||||
ResourceFetcher.instance().on('downloadComplete', onResourceChangeHandler);
|
ResourceFetcher.instance().on('downloadComplete', onResourceChangeHandler);
|
||||||
ResourceFetcher.instance().on('downloadStarted', onResourceChangeHandler);
|
ResourceFetcher.instance().on('downloadStarted', onResourceChangeHandler);
|
||||||
@ -35,6 +36,7 @@ function installResourceChangeHandler(onResourceChangeHandler: Function) {
|
|||||||
ResourceEditWatcher.instance().on('resourceChange', onResourceChangeHandler);
|
ResourceEditWatcher.instance().on('resourceChange', onResourceChangeHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function uninstallResourceChangeHandler(onResourceChangeHandler: Function) {
|
function uninstallResourceChangeHandler(onResourceChangeHandler: Function) {
|
||||||
ResourceFetcher.instance().off('downloadComplete', onResourceChangeHandler);
|
ResourceFetcher.instance().off('downloadComplete', onResourceChangeHandler);
|
||||||
ResourceFetcher.instance().off('downloadStarted', onResourceChangeHandler);
|
ResourceFetcher.instance().off('downloadStarted', onResourceChangeHandler);
|
||||||
|
@ -7,6 +7,7 @@ import ResourceFetcher from '@joplin/lib/services/ResourceFetcher';
|
|||||||
import { reg } from '@joplin/lib/registry';
|
import { reg } from '@joplin/lib/registry';
|
||||||
const bridge = require('@electron/remote').require('./bridge').default;
|
const bridge = require('@electron/remote').require('./bridge').default;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function useMessageHandler(scrollWhenReady: any, setScrollWhenReady: Function, editorRef: any, setLocalSearchResultCount: Function, dispatch: Function, formNote: FormNote) {
|
export default function useMessageHandler(scrollWhenReady: any, setScrollWhenReady: Function, editorRef: any, setLocalSearchResultCount: Function, dispatch: Function, formNote: FormNote) {
|
||||||
return useCallback(async (event: any) => {
|
return useCallback(async (event: any) => {
|
||||||
const msg = event.channel ? event.channel : '';
|
const msg = event.channel ? event.channel : '';
|
||||||
|
@ -24,6 +24,7 @@ function defaultSearchMarkers(): SearchMarkers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function useSearchMarkers(showLocalSearch: boolean, localSearchMarkerOptions: Function, searches: any[], selectedSearchId: string, highlightedWords: any[] = []) {
|
export default function useSearchMarkers(showLocalSearch: boolean, localSearchMarkerOptions: Function, searches: any[], selectedSearchId: string, highlightedWords: any[] = []) {
|
||||||
return useMemo((): SearchMarkers => {
|
return useMemo((): SearchMarkers => {
|
||||||
if (showLocalSearch) return localSearchMarkerOptions();
|
if (showLocalSearch) return localSearchMarkerOptions();
|
||||||
|
@ -15,15 +15,20 @@ const commandsWithDependencies = [
|
|||||||
|
|
||||||
interface HookDependencies {
|
interface HookDependencies {
|
||||||
formNote: FormNote;
|
formNote: FormNote;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
setShowLocalSearch: Function;
|
setShowLocalSearch: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
noteSearchBarRef: any;
|
noteSearchBarRef: any;
|
||||||
editorRef: any;
|
editorRef: any;
|
||||||
titleInputRef: any;
|
titleInputRef: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
saveNoteAndWait: Function;
|
saveNoteAndWait: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
setFormNote: Function;
|
setFormNote: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function editorCommandRuntime(declaration: CommandDeclaration, editorRef: any, setFormNote: Function): CommandRuntime {
|
function editorCommandRuntime(declaration: CommandDeclaration, editorRef: any, setFormNote: Function): CommandRuntime {
|
||||||
const markdownEditorOnly = !Object.keys(joplinCommandToTinyMceCommands).includes(declaration.name);
|
const markdownEditorOnly = !Object.keys(joplinCommandToTinyMceCommands).includes(declaration.name);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ export interface Props {
|
|||||||
themeId: any;
|
themeId: any;
|
||||||
selectedNoteIds: string[];
|
selectedNoteIds: string[];
|
||||||
notes: NoteEntity[];
|
notes: NoteEntity[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
watchedNoteFiles: any[];
|
watchedNoteFiles: any[];
|
||||||
plugins: PluginStates;
|
plugins: PluginStates;
|
||||||
|
@ -13,7 +13,9 @@ const formatcoords = require('formatcoords');
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
noteId: string;
|
noteId: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClose: Function;
|
onClose: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onRevisionLinkClick: Function;
|
onRevisionLinkClick: Function;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
}
|
}
|
||||||
@ -210,6 +212,7 @@ class NotePropertiesDialog extends React.Component<Props, State> {
|
|||||||
public async saveProperty() {
|
public async saveProperty() {
|
||||||
if (!this.state.editedKey) return;
|
if (!this.state.editedKey) return;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function) => {
|
return new Promise((resolve: Function) => {
|
||||||
const newFormNote = { ...this.state.formNote };
|
const newFormNote = { ...this.state.formNote };
|
||||||
|
|
||||||
@ -234,6 +237,7 @@ class NotePropertiesDialog extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async cancelProperty() {
|
public async cancelProperty() {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function) => {
|
return new Promise((resolve: Function) => {
|
||||||
this.okButton.current.focus();
|
this.okButton.current.focus();
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -22,6 +22,7 @@ import shared from '@joplin/lib/components/shared/note-screen-shared';
|
|||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
noteId: string;
|
noteId: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onBack: Function;
|
onBack: Function;
|
||||||
customCss: string;
|
customCss: string;
|
||||||
}
|
}
|
||||||
@ -36,6 +37,7 @@ interface State {
|
|||||||
class NoteRevisionViewerComponent extends React.PureComponent<Props, State> {
|
class NoteRevisionViewerComponent extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
private viewerRef_: any;
|
private viewerRef_: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private helpButton_onClick: Function;
|
private helpButton_onClick: Function;
|
||||||
|
|
||||||
public constructor(props: Props) {
|
public constructor(props: Props) {
|
||||||
|
@ -4,9 +4,13 @@ import { _ } from '@joplin/lib/locale';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onNext: Function;
|
onNext: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onPrevious: Function;
|
onPrevious: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClose: Function;
|
onClose: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onChange: Function;
|
onChange: Function;
|
||||||
query: string;
|
query: string;
|
||||||
searching: boolean;
|
searching: boolean;
|
||||||
|
@ -3,7 +3,9 @@ import * as React from 'react';
|
|||||||
import { reg } from '@joplin/lib/registry';
|
import { reg } from '@joplin/lib/registry';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onDomReady: Function;
|
onDomReady: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onIpcMessage: Function;
|
onIpcMessage: Function;
|
||||||
viewerStyle: any;
|
viewerStyle: any;
|
||||||
contentMaxWidth?: number;
|
contentMaxWidth?: number;
|
||||||
|
@ -27,6 +27,7 @@ const IFrame = styled.iframe`
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
resource: any;
|
resource: any;
|
||||||
pageNo: number;
|
pageNo: number;
|
||||||
|
@ -12,6 +12,7 @@ interface Props {
|
|||||||
visible: boolean;
|
visible: boolean;
|
||||||
style: any;
|
style: any;
|
||||||
buttons: any[];
|
buttons: any[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClose: Function;
|
onClose: Function;
|
||||||
inputType: string;
|
inputType: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
@ -20,6 +20,7 @@ interface Props {
|
|||||||
onResize(event: OnResizeEvent): void;
|
onResize(event: OnResizeEvent): void;
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
renderItem: Function;
|
renderItem: Function;
|
||||||
onMoveButtonClick(event: MoveButtonClickEvent): void;
|
onMoveButtonClick(event: MoveButtonClickEvent): void;
|
||||||
moveMode: boolean;
|
moveMode: boolean;
|
||||||
@ -32,6 +33,7 @@ function itemVisible(item: LayoutItem, moveMode: boolean) {
|
|||||||
return item.visible !== false;
|
return item.visible !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function renderContainer(item: LayoutItem, parent: LayoutItem | null, sizes: LayoutItemSizes, resizedItemMaxSize: Size | null, onResizeStart: Function, onResize: Function, onResizeStop: Function, children: any[], isLastChild: boolean, moveMode: boolean): any {
|
function renderContainer(item: LayoutItem, parent: LayoutItem | null, sizes: LayoutItemSizes, resizedItemMaxSize: Size | null, onResizeStart: Function, onResize: Function, onResizeStop: Function, children: any[], isLastChild: boolean, moveMode: boolean): any {
|
||||||
const style: any = {
|
const style: any = {
|
||||||
display: itemVisible(item, moveMode) ? 'flex' : 'none',
|
display: itemVisible(item, moveMode) ? 'flex' : 'none',
|
||||||
|
@ -8,6 +8,7 @@ export default function iterateItems(layout: LayoutItem, callback: ItemItemCallb
|
|||||||
const result = callback(0, layout, null);
|
const result = callback(0, layout, null);
|
||||||
if (result === false) return;
|
if (result === false) return;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function recurseFind(item: LayoutItem, callback: Function): boolean {
|
function recurseFind(item: LayoutItem, callback: Function): boolean {
|
||||||
if (item.children) {
|
if (item.children) {
|
||||||
for (let childIndex = 0; childIndex < item.children.length; childIndex++) {
|
for (let childIndex = 0; childIndex < item.children.length; childIndex++) {
|
||||||
|
@ -16,6 +16,7 @@ interface Style {
|
|||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
style: Style;
|
style: Style;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ const bridge = require('@electron/remote').require('./bridge').default;
|
|||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
appState: string;
|
appState: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
size: Size;
|
size: Size;
|
||||||
zoomFactor: number;
|
zoomFactor: number;
|
||||||
@ -51,6 +52,7 @@ interface ModalDialogProps {
|
|||||||
interface RegisteredDialogProps {
|
interface RegisteredDialogProps {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
key: string;
|
key: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ export const Root = styled.div`
|
|||||||
interface Props {
|
interface Props {
|
||||||
inputRef?: any;
|
inputRef?: any;
|
||||||
notesParentType: string;
|
notesParentType: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch?: Function;
|
dispatch?: Function;
|
||||||
selectedNoteId: string;
|
selectedNoteId: string;
|
||||||
isFocused?: boolean;
|
isFocused?: boolean;
|
||||||
@ -32,6 +33,7 @@ function SearchBar(props: Props) {
|
|||||||
const searchId = useRef(uuid.create());
|
const searchId = useRef(uuid.create());
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function search(searchId: string, query: string, dispatch: Function) {
|
function search(searchId: string, query: string, dispatch: Function) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'SEARCH_UPDATE',
|
type: 'SEARCH_UPDATE',
|
||||||
|
@ -21,6 +21,7 @@ const { clipboard } = require('electron');
|
|||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
noteIds: string[];
|
noteIds: string[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onClose: Function;
|
onClose: Function;
|
||||||
shares: StateShare[];
|
shares: StateShare[];
|
||||||
syncTargetId: number;
|
syncTargetId: number;
|
||||||
|
@ -51,6 +51,7 @@ const StyledSpanFix = styled.span`
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
folders: any[];
|
folders: any[];
|
||||||
collapsedFolderIds: string[];
|
collapsedFolderIds: string[];
|
||||||
@ -571,6 +572,7 @@ const SidebarComponent = (props: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const renderHeader = (key: string, label: string, iconName: string, contextMenuHandler: Function = null, onPlusButtonClick: Function = null, extraProps: any = {}) => {
|
const renderHeader = (key: string, label: string, iconName: string, contextMenuHandler: Function = null, onPlusButtonClick: Function = null, extraProps: any = {}) => {
|
||||||
const headerClick = extraProps.onClick || null;
|
const headerClick = extraProps.onClick || null;
|
||||||
delete extraProps.onClick;
|
delete extraProps.onClick;
|
||||||
|
@ -15,6 +15,7 @@ import styled from 'styled-components';
|
|||||||
interface Props {
|
interface Props {
|
||||||
themeId: string;
|
themeId: string;
|
||||||
style: any;
|
style: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import StyledLink from '../style/StyledLink';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,6 +151,7 @@ export default function(props: Props) {
|
|||||||
const [joplinCloudPassword, setJoplinCloudPassword] = useState('');
|
const [joplinCloudPassword, setJoplinCloudPassword] = useState('');
|
||||||
const [joplinCloudLoginInProgress, setJoplinCloudLoginInProgress] = useState(false);
|
const [joplinCloudLoginInProgress, setJoplinCloudLoginInProgress] = useState(false);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function closeDialog(dispatch: Function) {
|
function closeDialog(dispatch: Function) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'DIALOG_CLOSE',
|
type: 'DIALOG_CLOSE',
|
||||||
|
@ -36,9 +36,13 @@ interface Props {
|
|||||||
inputRef?: any;
|
inputRef?: any;
|
||||||
value: string;
|
value: string;
|
||||||
onChange(event: OnChangeEvent): void;
|
onChange(event: OnChangeEvent): void;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onFocus?: Function;
|
onFocus?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onBlur?: Function;
|
onBlur?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onKeyDown?: Function;
|
onKeyDown?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onSearchButtonClick: Function;
|
onSearchButtonClick: Function;
|
||||||
searchStarted: boolean;
|
searchStarted: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
|
@ -5,6 +5,7 @@ const Color = require('color');
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
value: boolean;
|
value: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onToggle: Function;
|
onToggle: Function;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ const { clipboard } = require('electron');
|
|||||||
|
|
||||||
interface ContextMenuProps {
|
interface ContextMenuProps {
|
||||||
notes: any[];
|
notes: any[];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
watchedNoteFiles: string[];
|
watchedNoteFiles: string[];
|
||||||
plugins: PluginStates;
|
plugins: PluginStates;
|
||||||
|
@ -37,6 +37,7 @@ interface SearchResult {
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
folders: any[];
|
folders: any[];
|
||||||
showCompletedTodos: boolean;
|
showCompletedTodos: boolean;
|
||||||
@ -61,6 +62,7 @@ interface CommandQuery {
|
|||||||
|
|
||||||
class GotoAnything {
|
class GotoAnything {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public dispatch: Function;
|
public dispatch: Function;
|
||||||
public static Dialog: any;
|
public static Dialog: any;
|
||||||
public static manifest: any;
|
public static manifest: any;
|
||||||
|
@ -2,5 +2,6 @@ import { AppState } from '../../app.reducer';
|
|||||||
|
|
||||||
export interface DesktopCommandContext {
|
export interface DesktopCommandContext {
|
||||||
state: AppState;
|
state: AppState;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,11 @@ export interface Props {
|
|||||||
fitToContent?: boolean;
|
fitToContent?: boolean;
|
||||||
borderBottom?: boolean;
|
borderBottom?: boolean;
|
||||||
theme?: any;
|
theme?: any;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onSubmit?: Function;
|
onSubmit?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onDismiss?: Function;
|
onDismiss?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onReady?: Function;
|
onReady?: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useEffect, useState, useMemo } from 'react';
|
import { useEffect, useState, useMemo } from 'react';
|
||||||
const md5 = require('md5');
|
const md5 = require('md5');
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function(frameWindow: any, isReady: boolean, postMessage: Function, html: string) {
|
export default function(frameWindow: any, isReady: boolean, postMessage: Function, html: string) {
|
||||||
const [loadedHtmlHash, setLoadedHtmlHash] = useState('');
|
const [loadedHtmlHash, setLoadedHtmlHash] = useState('');
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function(postMessage: Function, isReady: boolean, scripts: string[], cssFilePath: string) {
|
export default function(postMessage: Function, isReady: boolean, scripts: string[], cssFilePath: string) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isReady) return;
|
if (!isReady) return;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function(frameWindow: any, onSubmit: Function, onDismiss: Function, loadedHtmlHash: string) {
|
export default function(frameWindow: any, onSubmit: Function, onDismiss: Function, loadedHtmlHash: string) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!frameWindow) return () => {};
|
if (!frameWindow) return () => {};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import PostMessageService, { MessageResponse, ResponderComponentType } from '@joplin/lib/services/PostMessageService';
|
import PostMessageService, { MessageResponse, ResponderComponentType } from '@joplin/lib/services/PostMessageService';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function(frameWindow: any, isReady: boolean, pluginId: string, viewId: string, postMessage: Function) {
|
export default function(frameWindow: any, isReady: boolean, pluginId: string, viewId: string, postMessage: Function) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
PostMessageService.instance().registerResponder(ResponderComponentType.UserWebview, viewId, (message: MessageResponse) => {
|
PostMessageService.instance().registerResponder(ResponderComponentType.UserWebview, viewId, (message: MessageResponse) => {
|
||||||
|
@ -86,6 +86,7 @@ class CameraView extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public renderButton(onPress: Function, iconNameOrIcon: any, style: any) {
|
public renderButton(onPress: Function, iconNameOrIcon: any, style: any) {
|
||||||
let icon = null;
|
let icon = null;
|
||||||
|
|
||||||
|
@ -19,9 +19,13 @@ interface Props {
|
|||||||
noteResources: any;
|
noteResources: any;
|
||||||
paddingBottom: number;
|
paddingBottom: number;
|
||||||
noteHash: string;
|
noteHash: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onJoplinLinkClick: Function;
|
onJoplinLinkClick: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onCheckboxChange?: Function;
|
onCheckboxChange?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onMarkForDownload?: Function;
|
onMarkForDownload?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onLoadEnd?: Function;
|
onLoadEnd?: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import shared from '@joplin/lib/components/shared/note-screen-shared';
|
import shared from '@joplin/lib/components/shared/note-screen-shared';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function useOnMessage(onCheckboxChange: Function, noteBody: string, onMarkForDownload: Function, onJoplinLinkClick: Function, onResourceLongPress: Function) {
|
export default function useOnMessage(onCheckboxChange: Function, noteBody: string, onMarkForDownload: Function, onJoplinLinkClick: Function, onResourceLongPress: Function) {
|
||||||
return useCallback((event: any) => {
|
return useCallback((event: any) => {
|
||||||
// 2021-05-19: Historically this was unescaped twice as it was
|
// 2021-05-19: Historically this was unescaped twice as it was
|
||||||
|
@ -8,6 +8,7 @@ import Resource from '@joplin/lib/models/Resource';
|
|||||||
import { copyToCache } from '../../../utils/ShareUtils';
|
import { copyToCache } from '../../../utils/ShareUtils';
|
||||||
const Share = require('react-native-share').default;
|
const Share = require('react-native-share').default;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default function useOnResourceLongPress(onJoplinLinkClick: Function, dialogBoxRef: any) {
|
export default function useOnResourceLongPress(onJoplinLinkClick: Function, dialogBoxRef: any) {
|
||||||
return useCallback(async (msg: string) => {
|
return useCallback(async (msg: string) => {
|
||||||
try {
|
try {
|
||||||
|
@ -314,6 +314,7 @@ function NoteEditor(props: Props, ref: any) {
|
|||||||
|
|
||||||
const msg = JSON.parse(data);
|
const msg = JSON.parse(data);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const handlers: Record<string, Function> = {
|
const handlers: Record<string, Function> = {
|
||||||
onLog: (event: any) => {
|
onLog: (event: any) => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
|
@ -19,6 +19,7 @@ interface Navigation {
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
navigation: Navigation;
|
navigation: Navigation;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ const { themeStyle } = require('../global-style');
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ const logger = Logger.create('BiometricPopup');
|
|||||||
interface Props {
|
interface Props {
|
||||||
themeId: number;
|
themeId: number;
|
||||||
sensorInfo: SensorInfo;
|
sensorInfo: SensorInfo;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +457,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private renderToggle(key: string, label: string, value: any, updateSettingValue: Function, descriptionComp: any = null) {
|
private renderToggle(key: string, label: string, value: any, updateSettingValue: Function, descriptionComp: any = null) {
|
||||||
const theme = themeStyle(this.props.themeId);
|
const theme = themeStyle(this.props.themeId);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Icon.loadFont().catch((error: any) => { console.info(error); });
|
|||||||
interface Props {
|
interface Props {
|
||||||
syncStarted: boolean;
|
syncStarted: boolean;
|
||||||
themeId: number;
|
themeId: number;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
dispatch: Function;
|
dispatch: Function;
|
||||||
collapsedFolderIds: string[];
|
collapsedFolderIds: string[];
|
||||||
syncReport: any;
|
syncReport: any;
|
||||||
@ -371,6 +372,7 @@ const SideMenuContentComponent = (props: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const renderSidebarButton = (key: string, title: string, iconName: string, onPressHandler: Function = null, selected = false) => {
|
const renderSidebarButton = (key: string, title: string, iconName: string, onPressHandler: Function = null, selected = false) => {
|
||||||
let icon = <Icon name={iconName} style={styles_.sidebarIcon} />;
|
let icon = <Icon name={iconName} style={styles_.sidebarIcon} />;
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ export default (props: Props) => {
|
|||||||
}, [recorder, props.onDismiss]);
|
}, [recorder, props.onDismiss]);
|
||||||
|
|
||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
const components: Record<RecorderState, Function> = {
|
const components: Record<RecorderState, Function> = {
|
||||||
[RecorderState.Loading]: () => _('Loading...'),
|
[RecorderState.Loading]: () => _('Loading...'),
|
||||||
[RecorderState.Recording]: () => _('Please record your voice...'),
|
[RecorderState.Recording]: () => _('Please record your voice...'),
|
||||||
|
@ -410,6 +410,7 @@ function decryptionWorker_resourceMetadataButNotBlobDecrypted() {
|
|||||||
ResourceFetcher.instance().scheduleAutoAddResources();
|
ResourceFetcher.instance().scheduleAutoAddResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
async function initialize(dispatch: Function) {
|
async function initialize(dispatch: Function) {
|
||||||
shimInit();
|
shimInit();
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@ import { Profile, ProfileConfig } from '@joplin/lib/services/profileConfig/types
|
|||||||
import { loadProfileConfig as libLoadProfileConfig, saveProfileConfig as libSaveProfileConfig } from '@joplin/lib/services/profileConfig/index';
|
import { loadProfileConfig as libLoadProfileConfig, saveProfileConfig as libSaveProfileConfig } from '@joplin/lib/services/profileConfig/index';
|
||||||
import RNFetchBlob from 'rn-fetch-blob';
|
import RNFetchBlob from 'rn-fetch-blob';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
let dispatch_: Function = null;
|
let dispatch_: Function = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export const setDispatch = (dispatch: Function) => {
|
export const setDispatch = (dispatch: Function) => {
|
||||||
dispatch_ = dispatch;
|
dispatch_ = dispatch;
|
||||||
};
|
};
|
||||||
|
@ -147,7 +147,9 @@ export const startRecording = (vosk: Vosk, options: StartOptions): Recorder => {
|
|||||||
|
|
||||||
const result: string[] = [];
|
const result: string[] = [];
|
||||||
const eventHandlers: any[] = [];
|
const eventHandlers: any[] = [];
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
let finalResultPromiseResolve: Function = null;
|
let finalResultPromiseResolve: Function = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
let finalResultPromiseReject: Function = null;
|
let finalResultPromiseReject: Function = null;
|
||||||
let finalResultTimeout = false;
|
let finalResultTimeout = false;
|
||||||
|
|
||||||
@ -213,6 +215,7 @@ export const startRecording = (vosk: Vosk, options: StartOptions): Recorder => {
|
|||||||
completeRecording('', new Error('Could not process your message. Please try again.'));
|
completeRecording('', new Error('Could not process your message. Please try again.'));
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function, reject: Function) => {
|
return new Promise((resolve: Function, reject: Function) => {
|
||||||
finalResultPromiseResolve = resolve;
|
finalResultPromiseResolve = resolve;
|
||||||
finalResultPromiseReject = reject;
|
finalResultPromiseReject = reject;
|
||||||
|
@ -11,6 +11,7 @@ type TData = {
|
|||||||
type: string;
|
type: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default (dispatch: Function, folderId: string) => {
|
export default (dispatch: Function, folderId: string) => {
|
||||||
const userInfo = { url: '' };
|
const userInfo = { url: '' };
|
||||||
QuickActions.setShortcutItems([
|
QuickActions.setShortcutItems([
|
||||||
|
@ -7,6 +7,7 @@ const { ToastAndroid } = require('react-native');
|
|||||||
const { PermissionsAndroid } = require('react-native');
|
const { PermissionsAndroid } = require('react-native');
|
||||||
const { Platform } = require('react-native');
|
const { Platform } = require('react-native');
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
export default async (sharedData: SharedData, folderId: string, dispatch: Function) => {
|
export default async (sharedData: SharedData, folderId: string, dispatch: Function) => {
|
||||||
|
|
||||||
if (!!sharedData.resources && sharedData.resources.length > 0) {
|
if (!!sharedData.resources && sharedData.resources.length > 0) {
|
||||||
|
@ -309,6 +309,7 @@ export default class BaseApplication {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public on(eventName: string, callback: Function) {
|
public on(eventName: string, callback: Function) {
|
||||||
return this.eventEmitter_.on(eventName, callback);
|
return this.eventEmitter_.on(eventName, callback);
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ class BaseModel {
|
|||||||
public static TYPE_SMART_FILTER = ModelType.SmartFilter;
|
public static TYPE_SMART_FILTER = ModelType.SmartFilter;
|
||||||
public static TYPE_COMMAND = ModelType.Command;
|
public static TYPE_COMMAND = ModelType.Command;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static dispatch: Function = function() {};
|
public static dispatch: Function = function() {};
|
||||||
private static saveMutexes_: any = {};
|
private static saveMutexes_: any = {};
|
||||||
|
|
||||||
@ -430,6 +431,7 @@ class BaseModel {
|
|||||||
return mutex;
|
return mutex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static releaseSaveMutex(modelOrId: any, release: Function) {
|
public static releaseSaveMutex(modelOrId: any, release: Function) {
|
||||||
if (!release) return;
|
if (!release) return;
|
||||||
if (!modelOrId) return release();
|
if (!modelOrId) return release();
|
||||||
|
@ -7,6 +7,7 @@ import ShareService from './services/share/ShareService';
|
|||||||
|
|
||||||
export default class BaseSyncTarget {
|
export default class BaseSyncTarget {
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static dispatch: Function = () => {};
|
public static dispatch: Function = () => {};
|
||||||
|
|
||||||
private synchronizer_: Synchronizer = null;
|
private synchronizer_: Synchronizer = null;
|
||||||
|
@ -20,6 +20,7 @@ export default class ClipperServer {
|
|||||||
private server_: any = null;
|
private server_: any = null;
|
||||||
private port_: number = null;
|
private port_: number = null;
|
||||||
private api_: Api = null;
|
private api_: Api = null;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private dispatch_: Function;
|
private dispatch_: Function;
|
||||||
|
|
||||||
private static instance_: ClipperServer = null;
|
private static instance_: ClipperServer = null;
|
||||||
@ -52,6 +53,7 @@ export default class ClipperServer {
|
|||||||
return this.logger_;
|
return this.logger_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public setDispatch(d: Function) {
|
public setDispatch(d: Function) {
|
||||||
this.dispatch_ = d;
|
this.dispatch_ = d;
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,13 @@ interface Target extends TargetOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface LoggerWrapper {
|
export interface LoggerWrapper {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
debug: Function;
|
debug: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
info: Function;
|
info: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
warn: Function;
|
warn: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
error: Function;
|
error: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,8 +252,9 @@ class Logger {
|
|||||||
// because that would slow down the main process, especially
|
// because that would slow down the main process, especially
|
||||||
// when many log operations are being done (eg. during sync in
|
// when many log operations are being done (eg. during sync in
|
||||||
// dev mode).
|
// dev mode).
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
let release: Function = null;
|
let release: Function = null;
|
||||||
// eslint-disable-next-line promise/prefer-await-to-then -- Old code before rule was applied
|
/* eslint-disable-next-line promise/prefer-await-to-then, @typescript-eslint/ban-types -- Old code before rule was applied, Old code before rule was applied */
|
||||||
writeToFileMutex_.acquire().then((r: Function) => {
|
writeToFileMutex_.acquire().then((r: Function) => {
|
||||||
release = r;
|
release = r;
|
||||||
return Logger.fsDriver().appendFile(target.path, `${line.join(': ')}\n`, 'utf8');
|
return Logger.fsDriver().appendFile(target.path, `${line.join(': ')}\n`, 'utf8');
|
||||||
|
@ -12,6 +12,7 @@ type IntervalId = number;
|
|||||||
|
|
||||||
interface Interval {
|
interface Interval {
|
||||||
id: IntervalId;
|
id: IntervalId;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
callback: Function;
|
callback: Function;
|
||||||
interval: number;
|
interval: number;
|
||||||
lastIntervalTime: number;
|
lastIntervalTime: number;
|
||||||
@ -29,6 +30,7 @@ export default class PoorManIntervals {
|
|||||||
private static intervalId_: IntervalId = 0;
|
private static intervalId_: IntervalId = 0;
|
||||||
private static intervals_: Intervals = {};
|
private static intervals_: Intervals = {};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static setInterval(callback: Function, interval: number): IntervalId {
|
public static setInterval(callback: Function, interval: number): IntervalId {
|
||||||
if (interval <= this.maxNativeTimerDuration_) return setInterval(callback, interval);
|
if (interval <= this.maxNativeTimerDuration_) return setInterval(callback, interval);
|
||||||
|
|
||||||
@ -46,6 +48,7 @@ export default class PoorManIntervals {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static setTimeout(callback: Function, interval: number): IntervalId {
|
public static setTimeout(callback: Function, interval: number): IntervalId {
|
||||||
if (interval <= this.maxNativeTimerDuration_) return setTimeout(callback, interval);
|
if (interval <= this.maxNativeTimerDuration_) return setTimeout(callback, interval);
|
||||||
|
|
||||||
|
@ -72,9 +72,11 @@ export default class Synchronizer {
|
|||||||
// such as cancelling in the middle of a loop.
|
// such as cancelling in the middle of a loop.
|
||||||
public testingHooks_: string[] = [];
|
public testingHooks_: string[] = [];
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
private onProgress_: Function;
|
private onProgress_: Function;
|
||||||
private progressReport_: any = {};
|
private progressReport_: any = {};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public dispatch: Function;
|
public dispatch: Function;
|
||||||
|
|
||||||
public constructor(db: JoplinDatabase, api: FileApi, appType: AppType) {
|
public constructor(db: JoplinDatabase, api: FileApi, appType: AppType) {
|
||||||
|
@ -4,6 +4,7 @@ import Logger from './Logger';
|
|||||||
|
|
||||||
interface Task {
|
interface Task {
|
||||||
id: string;
|
id: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
callback: Function;
|
callback: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ export default class TaskQueue {
|
|||||||
return Setting.value('sync.maxConcurrentConnections');
|
return Setting.value('sync.maxConcurrentConnections');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public push(id: string, callback: Function) {
|
public push(id: string, callback: Function) {
|
||||||
if (this.stopping_) throw new Error('Cannot push task when queue is stopping');
|
if (this.stopping_) throw new Error('Cannot push task when queue is stopping');
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ class WelcomeUtils {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public static async install(locale: string, dispatch: Function) {
|
public static async install(locale: string, dispatch: Function) {
|
||||||
if (!Setting.value('welcome.enabled')) {
|
if (!Setting.value('welcome.enabled')) {
|
||||||
Setting.setValue('welcome.wasBuilt', true);
|
Setting.setValue('welcome.wasBuilt', true);
|
||||||
|
@ -21,6 +21,7 @@ export class EventManager {
|
|||||||
this.appStateListeners_ = {};
|
this.appStateListeners_ = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public on(eventName: string, callback: Function) {
|
public on(eventName: string, callback: Function) {
|
||||||
return this.emitter_.on(eventName, callback);
|
return this.emitter_.on(eventName, callback);
|
||||||
}
|
}
|
||||||
@ -29,18 +30,22 @@ export class EventManager {
|
|||||||
return this.emitter_.emit(eventName, object);
|
return this.emitter_.emit(eventName, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public removeListener(eventName: string, callback: Function) {
|
public removeListener(eventName: string, callback: Function) {
|
||||||
return this.emitter_.removeListener(eventName, callback);
|
return this.emitter_.removeListener(eventName, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public off(eventName: string, callback: Function) {
|
public off(eventName: string, callback: Function) {
|
||||||
return this.removeListener(eventName, callback);
|
return this.removeListener(eventName, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public filterOn(filterName: string, callback: Function) {
|
public filterOn(filterName: string, callback: Function) {
|
||||||
return this.emitter_.on(`filter:${filterName}`, callback);
|
return this.emitter_.on(`filter:${filterName}`, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public filterOff(filterName: string, callback: Function) {
|
public filterOff(filterName: string, callback: Function) {
|
||||||
return this.removeListener(`filter:${filterName}`, callback);
|
return this.removeListener(`filter:${filterName}`, callback);
|
||||||
}
|
}
|
||||||
@ -67,6 +72,7 @@ export class EventManager {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public appStateOn(propName: string, callback: Function) {
|
public appStateOn(propName: string, callback: Function) {
|
||||||
if (!this.appStateListeners_[propName]) {
|
if (!this.appStateListeners_[propName]) {
|
||||||
this.appStateListeners_[propName] = [];
|
this.appStateListeners_[propName] = [];
|
||||||
@ -76,6 +82,7 @@ export class EventManager {
|
|||||||
this.appStateListeners_[propName].push(callback);
|
this.appStateListeners_[propName].push(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public appStateOff(propName: string, callback: Function) {
|
public appStateOff(propName: string, callback: Function) {
|
||||||
if (!this.appStateListeners_[propName]) {
|
if (!this.appStateListeners_[propName]) {
|
||||||
throw new Error('EventManager: Trying to unregister a state prop watch for a non-watched prop (1)');
|
throw new Error('EventManager: Trying to unregister a state prop watch for a non-watched prop (1)');
|
||||||
|
@ -60,6 +60,7 @@ function requestCanBeRepeated(error: any) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
async function tryAndRepeat(fn: Function, count: number) {
|
async function tryAndRepeat(fn: Function, count: number) {
|
||||||
let retryCount = 0;
|
let retryCount = 0;
|
||||||
|
|
||||||
@ -99,6 +100,7 @@ class FileApi {
|
|||||||
private remoteDateMutex_ = new Mutex();
|
private remoteDateMutex_ = new Mutex();
|
||||||
private initialized_ = false;
|
private initialized_ = false;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public constructor(baseDir: string | Function, driver: any) {
|
public constructor(baseDir: string | Function, driver: any) {
|
||||||
this.baseDir_ = baseDir;
|
this.baseDir_ = baseDir;
|
||||||
this.driver_ = driver;
|
this.driver_ = driver;
|
||||||
@ -397,6 +399,7 @@ function basicDeltaContextFromOptions_(options: any) {
|
|||||||
// This is the basic delta algorithm, which can be used in case the cloud service does not have
|
// This is the basic delta algorithm, which can be used in case the cloud service does not have
|
||||||
// a built-in delta API. OneDrive and Dropbox have one for example, but Nextcloud and obviously
|
// a built-in delta API. OneDrive and Dropbox have one for example, but Nextcloud and obviously
|
||||||
// the file system do not.
|
// the file system do not.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
async function basicDelta(path: string, getDirStatFn: Function, options: any) {
|
async function basicDelta(path: string, getDirStatFn: Function, options: any) {
|
||||||
const outputLimit = 50;
|
const outputLimit = 50;
|
||||||
const itemIds = await options.allItemIdsHandler();
|
const itemIds = await options.allItemIdsHandler();
|
||||||
|
@ -85,6 +85,7 @@ class HtmlUtils {
|
|||||||
return html.replace(htmlReg, `:/${id}`);
|
return html.replace(htmlReg, `:/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public replaceImageUrls(html: string, callback: Function) {
|
public replaceImageUrls(html: string, callback: Function) {
|
||||||
return this.processImageTags(html, (data: any) => {
|
return this.processImageTags(html, (data: any) => {
|
||||||
const newSrc = callback(data.src);
|
const newSrc = callback(data.src);
|
||||||
@ -95,6 +96,7 @@ class HtmlUtils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public replaceEmbedUrls(html: string, callback: Function) {
|
public replaceEmbedUrls(html: string, callback: Function) {
|
||||||
if (!html) return '';
|
if (!html) return '';
|
||||||
// We are adding the link as <a> since joplin disabled <embed>, <object> tags due to security reasons.
|
// We are adding the link as <a> since joplin disabled <embed>, <object> tags due to security reasons.
|
||||||
@ -110,6 +112,7 @@ class HtmlUtils {
|
|||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public replaceMediaUrls(html: string, callback: Function) {
|
public replaceMediaUrls(html: string, callback: Function) {
|
||||||
html = this.replaceImageUrls(html, callback);
|
html = this.replaceImageUrls(html, callback);
|
||||||
html = this.replaceEmbedUrls(html, callback);
|
html = this.replaceEmbedUrls(html, callback);
|
||||||
@ -121,6 +124,7 @@ class HtmlUtils {
|
|||||||
// file path is going to be used, it will need to be unescaped first. The
|
// file path is going to be used, it will need to be unescaped first. The
|
||||||
// transformed SRC, must also be escaped before being sent back to this
|
// transformed SRC, must also be escaped before being sent back to this
|
||||||
// function.
|
// function.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public processImageTags(html: string, callback: Function) {
|
public processImageTags(html: string, callback: Function) {
|
||||||
if (!html) return '';
|
if (!html) return '';
|
||||||
|
|
||||||
|
@ -224,7 +224,9 @@ async function saveNoteTags(note: ExtractedNote) {
|
|||||||
|
|
||||||
interface ImportOptions {
|
interface ImportOptions {
|
||||||
fuzzyMatching?: boolean;
|
fuzzyMatching?: boolean;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onProgress?: Function;
|
onProgress?: Function;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
onError?: Function;
|
onError?: Function;
|
||||||
outputFormat?: string;
|
outputFormat?: string;
|
||||||
}
|
}
|
||||||
@ -326,6 +328,7 @@ export default async function importEnex(parentFolderId: string, filePath: strin
|
|||||||
if (!('onProgress' in importOptions)) importOptions.onProgress = function() {};
|
if (!('onProgress' in importOptions)) importOptions.onProgress = function() {};
|
||||||
if (!('onError' in importOptions)) importOptions.onError = function() {};
|
if (!('onError' in importOptions)) importOptions.onError = function() {};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
function handleSaxStreamEvent(fn: Function) {
|
function handleSaxStreamEvent(fn: Function) {
|
||||||
return function(...args: any[]) {
|
return function(...args: any[]) {
|
||||||
// Pass the parser to the wrapped function for debugging purposes
|
// Pass the parser to the wrapped function for debugging purposes
|
||||||
|
@ -16,6 +16,7 @@ export enum MarkdownTableJustify {
|
|||||||
export interface MarkdownTableHeader {
|
export interface MarkdownTableHeader {
|
||||||
name: string;
|
name: string;
|
||||||
label: string;
|
label: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
filter?: Function;
|
filter?: Function;
|
||||||
disableEscape?: boolean;
|
disableEscape?: boolean;
|
||||||
justify?: MarkdownTableJustify;
|
justify?: MarkdownTableJustify;
|
||||||
|
@ -57,6 +57,7 @@ export interface SettingItem {
|
|||||||
isEnum?: boolean;
|
isEnum?: boolean;
|
||||||
section?: string;
|
section?: string;
|
||||||
label?(): string;
|
label?(): string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
description?: Function;
|
description?: Function;
|
||||||
options?(): any;
|
options?(): any;
|
||||||
optionsOrder?(): string[];
|
optionsOrder?(): string[];
|
||||||
@ -69,6 +70,7 @@ export interface SettingItem {
|
|||||||
maximum?: number;
|
maximum?: number;
|
||||||
step?: number;
|
step?: number;
|
||||||
onClick?(): void;
|
onClick?(): void;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
unitLabel?: Function;
|
unitLabel?: Function;
|
||||||
needRestart?: boolean;
|
needRestart?: boolean;
|
||||||
autoSave?: boolean;
|
autoSave?: boolean;
|
||||||
@ -207,6 +209,7 @@ const defaultMigrations: DefaultMigration[] = [
|
|||||||
interface UserSettingMigration {
|
interface UserSettingMigration {
|
||||||
oldName: string;
|
oldName: string;
|
||||||
newName: string;
|
newName: string;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
transformValue: Function;
|
transformValue: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ const parseNtpServer = (ntpServer: string): NtpServer => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function getNetworkTime(ntpServer: string): Promise<Date> {
|
export async function getNetworkTime(ntpServer: string): Promise<Date> {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
return new Promise((resolve: Function, reject: Function) => {
|
return new Promise((resolve: Function, reject: Function) => {
|
||||||
const s = parseNtpServer(ntpServer);
|
const s = parseNtpServer(ntpServer);
|
||||||
ntpClient().getNetworkTime(s.domain, s.port, (error: any, date: Date) => {
|
ntpClient().getNetworkTime(s.domain, s.port, (error: any, date: Date) => {
|
||||||
|
@ -44,6 +44,7 @@ export default class OneDriveApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
public on(eventName: string, callback: Function) {
|
public on(eventName: string, callback: Function) {
|
||||||
this.listeners_[eventName].push(callback);
|
this.listeners_[eventName].push(callback);
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,7 @@ class Registry {
|
|||||||
if (delay === null) delay = 1000 * 10;
|
if (delay === null) delay = 1000 * 10;
|
||||||
if (syncOptions === null) syncOptions = {};
|
if (syncOptions === null) syncOptions = {};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
|
||||||
let promiseResolve: Function = null;
|
let promiseResolve: Function = null;
|
||||||
const promise = new Promise((resolve) => {
|
const promise = new Promise((resolve) => {
|
||||||
promiseResolve = resolve;
|
promiseResolve = resolve;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user