From 17d835d694cf8afd459443f1ba279d8a9100eae5 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 12 Nov 2020 19:29:22 +0000 Subject: [PATCH] Tools: Apply rule @typescript-eslint/member-delimiter-style --- .eslintrc.js | 11 + .../tests/services/plugins/sandboxProxy.ts | 8 +- .../app-cli/tests/services_CommandService.ts | 4 +- packages/app-desktop/ElectronAppWrapper.ts | 4 +- packages/app-desktop/InteropServiceHelper.ts | 12 +- packages/app-desktop/app.ts | 30 +- packages/app-desktop/bridge.ts | 6 +- packages/app-desktop/gui/Button/Button.tsx | 20 +- .../gui/ConfigScreen/ButtonBar.tsx | 10 +- .../app-desktop/gui/ConfigScreen/SideBar.tsx | 6 +- .../app-desktop/gui/DropboxLoginScreen.tsx | 2 +- .../gui/KeymapConfig/KeymapConfigScreen.tsx | 4 +- .../gui/KeymapConfig/ShortcutRecorder.tsx | 14 +- .../KeymapConfig/utils/useCommandStatus.ts | 2 +- packages/app-desktop/gui/MenuBar.tsx | 32 +- packages/app-desktop/gui/MultiNoteActions.tsx | 12 +- .../gui/NoteContentPropertiesDialog.tsx | 8 +- .../NoteBody/CodeMirror/CodeMirror.tsx | 2 +- .../NoteEditor/NoteBody/CodeMirror/Editor.tsx | 24 +- .../NoteBody/CodeMirror/Toolbar.tsx | 4 +- .../CodeMirror/utils/useJoplinMode.ts | 2 +- .../NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx | 8 +- .../TinyMCE/utils/setupContextMenu.ts | 2 +- .../NoteBody/TinyMCE/utils/useScroll.ts | 4 +- .../gui/NoteEditor/NoteTitle/NoteTitleBar.tsx | 14 +- .../gui/NoteEditor/utils/contextMenu.ts | 20 +- .../app-desktop/gui/NoteEditor/utils/types.ts | 84 ++--- .../gui/NoteEditor/utils/useDropHandler.ts | 2 +- .../gui/NoteEditor/utils/useFolder.ts | 2 +- .../gui/NoteEditor/utils/useFormNote.ts | 16 +- .../gui/NoteEditor/utils/useMarkupToHtml.ts | 10 +- .../gui/NoteEditor/utils/useNoteSearchBar.ts | 10 +- .../gui/NoteEditor/utils/useSearchMarkers.ts | 10 +- .../utils/useWindowCommandHandler.ts | 14 +- .../gui/NoteListControls/NoteListControls.tsx | 2 +- packages/app-desktop/gui/NoteListItem.tsx | 36 +- packages/app-desktop/gui/NoteTextViewer.tsx | 6 +- .../gui/NoteToolbar/NoteToolbar.tsx | 6 +- .../app-desktop/gui/OneDriveLoginScreen.tsx | 2 +- .../gui/ResizableLayout/ResizableLayout.tsx | 36 +- .../hooks/useLayoutItemSizes.ts | 2 +- packages/app-desktop/gui/ResourceScreen.tsx | 44 +-- packages/app-desktop/gui/Root.tsx | 10 +- .../app-desktop/gui/SearchBar/SearchBar.tsx | 8 +- packages/app-desktop/gui/ShareNoteDialog.tsx | 6 +- packages/app-desktop/gui/SideBar/SideBar.tsx | 30 +- .../gui/StatusScreen/StatusScreen.tsx | 6 +- packages/app-desktop/gui/TagList.tsx | 6 +- .../ToggleEditorsButton.tsx | 6 +- packages/app-desktop/gui/ToolbarBase.tsx | 6 +- .../gui/ToolbarButton/ToolbarButton.tsx | 14 +- .../app-desktop/gui/utils/NoteListUtils.ts | 8 +- packages/app-desktop/plugins/GotoAnything.tsx | 38 +-- .../app-desktop/services/commands/types.ts | 4 +- .../plugins/PlatformImplementation.ts | 4 +- .../services/plugins/PluginRunner.ts | 16 +- .../services/plugins/UserWebview.tsx | 26 +- .../plugins/UserWebviewDialogButtonBar.tsx | 2 +- .../services/plugins/hooks/useThemeCss.ts | 4 +- .../NoteBodyViewer/NoteBodyViewer.tsx | 24 +- .../NoteBodyViewer/hooks/useSource.ts | 8 +- packages/app-mobile/setUpQuickActions.ts | 4 +- packages/app-mobile/utils/ShareExtension.ts | 6 +- packages/app-mobile/utils/checkPermissions.ts | 12 +- packages/lib/AsyncActionQueue.ts | 6 +- packages/lib/BaseModel.ts | 2 +- packages/lib/InMemoryCache.ts | 6 +- packages/lib/JoplinServerApi.ts | 6 +- packages/lib/Logger.ts | 14 +- packages/lib/PoorManIntervals.ts | 10 +- packages/lib/Synchronizer.ts | 6 +- packages/lib/locale.ts | 6 +- packages/lib/markdownUtils.ts | 8 +- packages/lib/models/Alarm.ts | 10 +- packages/lib/models/Setting.ts | 58 ++-- packages/lib/models/utils/paginatedFeed.ts | 10 +- packages/lib/models/utils/types.ts | 12 +- packages/lib/reducer.ts | 110 +++--- .../lib/services/AlarmServiceDriverNode.ts | 2 +- packages/lib/services/CommandService.ts | 34 +- packages/lib/services/KvStore.ts | 2 +- .../lib/services/ResourceEditWatcher/index.ts | 14 +- packages/lib/services/ResourceService.ts | 4 +- packages/lib/services/commands/MenuUtils.ts | 18 +- .../services/commands/ToolbarButtonUtils.ts | 16 +- packages/lib/services/database/types.ts | 320 +++++++++--------- .../interop/InteropService_Importer_Base.ts | 2 +- packages/lib/services/interop/types.ts | 62 ++-- packages/lib/services/plugins/Plugin.ts | 6 +- .../lib/services/plugins/PluginService.ts | 2 +- .../lib/services/plugins/WebviewController.ts | 2 +- packages/lib/services/plugins/api/types.ts | 110 +++--- packages/lib/services/plugins/reducer.ts | 22 +- packages/lib/services/plugins/utils/types.ts | 12 +- packages/lib/services/rest/Api.ts | 40 +-- .../lib/services/searchengine/filterParser.ts | 10 +- .../lib/services/searchengine/queryBuilder.ts | 6 +- .../lib/services/synchronizer/LockHandler.ts | 16 +- .../services/synchronizer/MigrationHandler.ts | 2 +- .../synchronizer/gui/useSyncTargetUpgrade.ts | 4 +- packages/lib/themes/type.ts | 66 ++-- packages/renderer/InMemoryCache.ts | 6 +- packages/renderer/MdToHtml.ts | 80 ++--- 103 files changed, 964 insertions(+), 953 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1694ebbfa..71b84d8da 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -141,6 +141,17 @@ module.exports = { 'tuples': 'always-multiline', 'functions': 'never', }], + '@typescript-eslint/semi': ['error', 'always'], + '@typescript-eslint/member-delimiter-style': ['error', { + 'multiline': { + 'delimiter': 'semi', + 'requireLast': true, + }, + 'singleline': { + 'delimiter': 'semi', + 'requireLast': false, + }, + }], }, }, ], diff --git a/packages/app-cli/tests/services/plugins/sandboxProxy.ts b/packages/app-cli/tests/services/plugins/sandboxProxy.ts index 0d9fa18bb..e7ddfa1e6 100644 --- a/packages/app-cli/tests/services/plugins/sandboxProxy.ts +++ b/packages/app-cli/tests/services/plugins/sandboxProxy.ts @@ -12,8 +12,8 @@ describe('services_plugins_sandboxProxy', function() { it('should create a new sandbox proxy', asyncTest(async () => { interface Result { - path: string, - args: any[], + path: string; + args: any[]; } const results: Result[] = []; @@ -35,8 +35,8 @@ describe('services_plugins_sandboxProxy', function() { it('should allow importing a namespace', asyncTest(async () => { interface Result { - path: string, - args: any[], + path: string; + args: any[]; } const results: Result[] = []; diff --git a/packages/app-cli/tests/services_CommandService.ts b/packages/app-cli/tests/services_CommandService.ts index b11a379c9..0453fea14 100644 --- a/packages/app-cli/tests/services_CommandService.ts +++ b/packages/app-cli/tests/services_CommandService.ts @@ -6,8 +6,8 @@ import KeymapService from '@joplin/lib/services/KeymapService'; const { asyncTest, setupDatabaseAndSynchronizer, switchClient, expectThrow, expectNotThrow } = require('./test-utils.js'); interface TestCommand { - declaration: CommandDeclaration, - runtime: CommandRuntime, + declaration: CommandDeclaration; + runtime: CommandRuntime; } function newService(): CommandService { diff --git a/packages/app-desktop/ElectronAppWrapper.ts b/packages/app-desktop/ElectronAppWrapper.ts index 43833f5fe..0baebe12b 100644 --- a/packages/app-desktop/ElectronAppWrapper.ts +++ b/packages/app-desktop/ElectronAppWrapper.ts @@ -10,11 +10,11 @@ const fs = require('fs-extra'); const { ipcMain } = require('electron'); interface RendererProcessQuitReply { - canClose: boolean, + canClose: boolean; } interface PluginWindows { - [key: string]: any, + [key: string]: any; } export default class ElectronAppWrapper { diff --git a/packages/app-desktop/InteropServiceHelper.ts b/packages/app-desktop/InteropServiceHelper.ts index 5c6454e8c..10851d665 100644 --- a/packages/app-desktop/InteropServiceHelper.ts +++ b/packages/app-desktop/InteropServiceHelper.ts @@ -13,12 +13,12 @@ const md5 = require('md5'); const url = require('url'); interface ExportNoteOptions { - customCss?: string, - sourceNoteIds?: string[], - sourceFolderIds?: string[], - printBackground?: boolean, - pageSize?: string, - landscape?: boolean, + customCss?: string; + sourceNoteIds?: string[]; + sourceFolderIds?: string[]; + printBackground?: boolean; + pageSize?: string; + landscape?: boolean; } export default class InteropServiceHelper { diff --git a/packages/app-desktop/app.ts b/packages/app-desktop/app.ts index bf0636ed0..000a08014 100644 --- a/packages/app-desktop/app.ts +++ b/packages/app-desktop/app.ts @@ -96,26 +96,26 @@ const pluginClasses = [ ]; interface AppStateRoute { - type: string, - routeName: string, - props: any, + type: string; + routeName: string; + props: any; } export interface AppState extends State { - route: AppStateRoute, - navHistory: any[], - noteVisiblePanes: string[], - sidebarVisibility: boolean, - noteListVisibility: boolean, - windowContentSize: any, - watchedNoteFiles: string[], - lastEditorScrollPercents: any, - devToolsVisible: boolean, - visibleDialogs: any, // empty object if no dialog is visible. Otherwise contains the list of visible dialogs. - focusedField: string, + route: AppStateRoute; + navHistory: any[]; + noteVisiblePanes: string[]; + sidebarVisibility: boolean; + noteListVisibility: boolean; + windowContentSize: any; + watchedNoteFiles: string[]; + lastEditorScrollPercents: any; + devToolsVisible: boolean; + visibleDialogs: any; // empty object if no dialog is visible. Otherwise contains the list of visible dialogs. + focusedField: string; // Extra reducer keys go here - watchedResources: any, + watchedResources: any; } const appDefaultState: AppState = { diff --git a/packages/app-desktop/bridge.ts b/packages/app-desktop/bridge.ts index 555ca5152..2f143c413 100644 --- a/packages/app-desktop/bridge.ts +++ b/packages/app-desktop/bridge.ts @@ -6,12 +6,12 @@ const { dirname, toSystemSlashes } = require('@joplin/lib/path-utils'); const { BrowserWindow, nativeTheme } = require('electron'); interface LastSelectedPath { - file: string, - directory: string, + file: string; + directory: string; } interface LastSelectedPaths { - [key: string]: LastSelectedPath, + [key: string]: LastSelectedPath; } export class Bridge { diff --git a/packages/app-desktop/gui/Button/Button.tsx b/packages/app-desktop/gui/Button/Button.tsx index 633caf784..6f6686baf 100644 --- a/packages/app-desktop/gui/Button/Button.tsx +++ b/packages/app-desktop/gui/Button/Button.tsx @@ -10,16 +10,16 @@ export enum ButtonLevel { } interface Props { - title?: string, - iconName?: string, - level?: ButtonLevel, - className?: string, - onClick: Function, - color?: string, - iconAnimation?: string, - tooltip?: string, - disabled?: boolean, - style?: any, + title?: string; + iconName?: string; + level?: ButtonLevel; + className?: string; + onClick: Function; + color?: string; + iconAnimation?: string; + tooltip?: string; + disabled?: boolean; + style?: any; } const StyledTitle = styled.span` diff --git a/packages/app-desktop/gui/ConfigScreen/ButtonBar.tsx b/packages/app-desktop/gui/ConfigScreen/ButtonBar.tsx index 3083ac196..a838046c4 100644 --- a/packages/app-desktop/gui/ConfigScreen/ButtonBar.tsx +++ b/packages/app-desktop/gui/ConfigScreen/ButtonBar.tsx @@ -4,11 +4,11 @@ import { _ } from '@joplin/lib/locale'; const styled = require('styled-components').default; interface Props { - backButtonTitle?: string, - hasChanges?: boolean, - onCancelClick: Function, - onSaveClick?: Function, - onApplyClick?: Function, + backButtonTitle?: string; + hasChanges?: boolean; + onCancelClick: Function; + onSaveClick?: Function; + onApplyClick?: Function; } export const StyledRoot = styled.div` diff --git a/packages/app-desktop/gui/ConfigScreen/SideBar.tsx b/packages/app-desktop/gui/ConfigScreen/SideBar.tsx index b27dd3bda..19c07b25f 100644 --- a/packages/app-desktop/gui/ConfigScreen/SideBar.tsx +++ b/packages/app-desktop/gui/ConfigScreen/SideBar.tsx @@ -3,9 +3,9 @@ const styled = require('styled-components').default; const Setting = require('@joplin/lib/models/Setting').default; interface Props { - selection: string, - onSelectionChange: Function, - sections: any[], + selection: string; + onSelectionChange: Function; + sections: any[]; } export const StyledRoot = styled.div` diff --git a/packages/app-desktop/gui/DropboxLoginScreen.tsx b/packages/app-desktop/gui/DropboxLoginScreen.tsx index dd3b95c10..72563c8df 100644 --- a/packages/app-desktop/gui/DropboxLoginScreen.tsx +++ b/packages/app-desktop/gui/DropboxLoginScreen.tsx @@ -8,7 +8,7 @@ const { themeStyle } = require('@joplin/lib/theme'); const Shared = require('@joplin/lib/components/shared/dropbox-login-shared'); interface Props { - themeId: string, + themeId: string; } class DropboxLoginScreenComponent extends React.Component { diff --git a/packages/app-desktop/gui/KeymapConfig/KeymapConfigScreen.tsx b/packages/app-desktop/gui/KeymapConfig/KeymapConfigScreen.tsx index 202a33d44..83a01a17f 100644 --- a/packages/app-desktop/gui/KeymapConfig/KeymapConfigScreen.tsx +++ b/packages/app-desktop/gui/KeymapConfig/KeymapConfigScreen.tsx @@ -15,7 +15,7 @@ const shim = require('@joplin/lib/shim').default; const keymapService = KeymapService.instance(); export interface KeymapConfigScreenProps { - themeId: number + themeId: number; } export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => { @@ -27,7 +27,7 @@ export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => { const [editing, enableEditing, disableEditing] = useCommandStatus(); const [hovering, enableHovering, disableHovering] = useCommandStatus(); - const handleSave = (event: { commandName: string, accelerator: string }) => { + const handleSave = (event: { commandName: string; accelerator: string }) => { const { commandName, accelerator } = event; setAccelerator(commandName, accelerator); disableEditing(commandName); diff --git a/packages/app-desktop/gui/KeymapConfig/ShortcutRecorder.tsx b/packages/app-desktop/gui/KeymapConfig/ShortcutRecorder.tsx index a438276f1..92e18892e 100644 --- a/packages/app-desktop/gui/KeymapConfig/ShortcutRecorder.tsx +++ b/packages/app-desktop/gui/KeymapConfig/ShortcutRecorder.tsx @@ -8,13 +8,13 @@ import { _ } from '@joplin/lib/locale'; const keymapService = KeymapService.instance(); export interface ShortcutRecorderProps { - onSave: (event: { commandName: string, accelerator: string })=> void, - onReset: (event: { commandName: string })=> void, - onCancel: (event: { commandName: string })=> void, - onError: (event: { recorderError: Error })=> void, - initialAccelerator: string - commandName: string, - themeId: number + onSave: (event: { commandName: string; accelerator: string })=> void; + onReset: (event: { commandName: string })=> void; + onCancel: (event: { commandName: string })=> void; + onError: (event: { recorderError: Error })=> void; + initialAccelerator: string; + commandName: string; + themeId: number; } export const ShortcutRecorder = ({ onSave, onReset, onCancel, onError, initialAccelerator, commandName, themeId }: ShortcutRecorderProps) => { diff --git a/packages/app-desktop/gui/KeymapConfig/utils/useCommandStatus.ts b/packages/app-desktop/gui/KeymapConfig/utils/useCommandStatus.ts index 3232f3152..3bfc3537d 100644 --- a/packages/app-desktop/gui/KeymapConfig/utils/useCommandStatus.ts +++ b/packages/app-desktop/gui/KeymapConfig/utils/useCommandStatus.ts @@ -4,7 +4,7 @@ import KeymapService from '@joplin/lib/services/KeymapService'; const keymapService = KeymapService.instance(); interface CommandStatus { - [commandName: string]: boolean + [commandName: string]: boolean; } const useCommandStatus = (): [CommandStatus, (commandName: string)=> void, (commandName: string)=> void] => { diff --git a/packages/app-desktop/gui/MenuBar.tsx b/packages/app-desktop/gui/MenuBar.tsx index 058313e30..14fbae709 100644 --- a/packages/app-desktop/gui/MenuBar.tsx +++ b/packages/app-desktop/gui/MenuBar.tsx @@ -72,22 +72,22 @@ function createPluginMenuTree(label: string, menuItems: MenuItem[], onMenuItemCl } interface Props { - dispatch: Function, - menuItemProps: any, - routeName: string, - selectedFolderId: string, - layoutButtonSequence: number, - ['notes.sortOrder.field']: string, - ['folders.sortOrder.field']: string, - ['notes.sortOrder.reverse']: boolean, - ['folders.sortOrder.reverse']: boolean, - showNoteCounts: boolean, - uncompletedTodosOnTop: boolean, - showCompletedTodos: boolean, - pluginMenuItems: any[], - pluginMenus: any[], - ['spellChecker.enabled']: boolean, - ['spellChecker.language']: string, + dispatch: Function; + menuItemProps: any; + routeName: string; + selectedFolderId: string; + layoutButtonSequence: number; + ['notes.sortOrder.field']: string; + ['folders.sortOrder.field']: string; + ['notes.sortOrder.reverse']: boolean; + ['folders.sortOrder.reverse']: boolean; + showNoteCounts: boolean; + uncompletedTodosOnTop: boolean; + showCompletedTodos: boolean; + pluginMenuItems: any[]; + pluginMenus: any[]; + ['spellChecker.enabled']: boolean; + ['spellChecker.language']: string; } const commandNames: string[] = menuCommandNames(); diff --git a/packages/app-desktop/gui/MultiNoteActions.tsx b/packages/app-desktop/gui/MultiNoteActions.tsx index d501aa46e..2afb65f7a 100644 --- a/packages/app-desktop/gui/MultiNoteActions.tsx +++ b/packages/app-desktop/gui/MultiNoteActions.tsx @@ -6,12 +6,12 @@ const { buildStyle } = require('@joplin/lib/theme'); const bridge = require('electron').remote.require('./bridge').default; interface MultiNoteActionsProps { - themeId: number, - selectedNoteIds: string[], - notes: any[], - dispatch: Function, - watchedNoteFiles: string[], - plugins: PluginStates, + themeId: number; + selectedNoteIds: string[]; + notes: any[]; + dispatch: Function; + watchedNoteFiles: string[]; + plugins: PluginStates; } function styles_(props: MultiNoteActionsProps) { diff --git a/packages/app-desktop/gui/NoteContentPropertiesDialog.tsx b/packages/app-desktop/gui/NoteContentPropertiesDialog.tsx index 01ed25d34..638804994 100644 --- a/packages/app-desktop/gui/NoteContentPropertiesDialog.tsx +++ b/packages/app-desktop/gui/NoteContentPropertiesDialog.tsx @@ -7,10 +7,10 @@ const Countable = require('countable'); const markupLanguageUtils = require('@joplin/lib/markupLanguageUtils').default; interface NoteContentPropertiesDialogProps { - themeId: number, - text: string, - markupLanguage: number, - onClose: Function, + themeId: number; + text: string; + markupLanguage: number; + onClose: Function; } interface TextPropertiesMap { diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx index a9f251d3a..247e1c59a 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx @@ -324,7 +324,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) { let cancelled = false; async function loadScripts() { - const scriptsToLoad: {src: string, id: string, loaded: boolean}[] = [ + const scriptsToLoad: {src: string; id: string; loaded: boolean}[] = [ { src: 'node_modules/codemirror/addon/dialog/dialog.css', id: 'codemirrorDialogStyle', diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx index 90e10c301..92fbcf5b3 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx @@ -75,18 +75,18 @@ for (let i = 0; i < topLanguages.length; i++) { } export interface EditorProps { - value: string, - searchMarkers: any, - mode: string, - style: any, - codeMirrorTheme: any, - readOnly: boolean, - autoMatchBraces: boolean, - keyMap: string, - onChange: any, - onScroll: any, - onEditorContextMenu: any, - onEditorPaste: any, + value: string; + searchMarkers: any; + mode: string; + style: any; + codeMirrorTheme: any; + readOnly: boolean; + autoMatchBraces: boolean; + keyMap: string; + onChange: any; + onScroll: any; + onEditorContextMenu: any; + onEditorPaste: any; } function Editor(props: EditorProps, ref: any) { diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Toolbar.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Toolbar.tsx index c4eb331c7..d26becf2a 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Toolbar.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Toolbar.tsx @@ -9,8 +9,8 @@ import stateToWhenClauseContext from '@joplin/lib/services/commands/stateToWhenC const { buildStyle } = require('@joplin/lib/theme'); interface ToolbarProps { - themeId: number, - toolbarButtonInfos: ToolbarButtonInfo[], + themeId: number; + toolbarButtonInfos: ToolbarButtonInfo[]; } function styles_(props: ToolbarProps) { diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useJoplinMode.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useJoplinMode.ts index b5d503053..0a9e1b5a1 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useJoplinMode.ts +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useJoplinMode.ts @@ -34,7 +34,7 @@ export default function useJoplinMode(CodeMirror: any) { } return { - startState: function(): { outer: any, openCharacter: string, inner: any } { + startState: function(): { outer: any; openCharacter: string; inner: any } { return { outer: CodeMirror.startState(markdownMode), openCharacter: '', diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx index bcf060a88..8a940a48a 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx @@ -109,13 +109,13 @@ function enableTextAreaTab(enable: boolean) { } interface TinyMceCommand { - name: string, - value?: any, - ui?: boolean + name: string; + value?: any; + ui?: boolean; } interface JoplinCommandToTinyMceCommands { - [key: string]: TinyMceCommand, + [key: string]: TinyMceCommand; } const joplinCommandToTinyMceCommands: JoplinCommandToTinyMceCommands = { diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/setupContextMenu.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/setupContextMenu.ts index 30d02b47b..9bf0a147d 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/setupContextMenu.ts +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/setupContextMenu.ts @@ -24,7 +24,7 @@ function contextMenuElement(editor: any, x: number, y: number) { } interface ContextMenuActionOptions { - current: ContextMenuOptions, + current: ContextMenuOptions; } const contextMenuActionOptions: ContextMenuActionOptions = { current: null }; diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.ts index 010cb7baf..72f344af9 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.ts +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.ts @@ -2,8 +2,8 @@ import { useEffect, useCallback, useRef } from 'react'; import shim from '@joplin/lib/shim'; interface HookDependencies { - editor: any, - onScroll: Function, + editor: any; + onScroll: Function; } export default function useScroll(dependencies: HookDependencies) { diff --git a/packages/app-desktop/gui/NoteEditor/NoteTitle/NoteTitleBar.tsx b/packages/app-desktop/gui/NoteEditor/NoteTitle/NoteTitleBar.tsx index 0b3db9d25..1517e3a2d 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteTitle/NoteTitleBar.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteTitle/NoteTitleBar.tsx @@ -7,13 +7,13 @@ import { buildStyle } from '@joplin/lib/theme'; import time from '@joplin/lib/time'; interface Props { - themeId: number, - noteUserUpdatedTime: number, - noteTitle: string, - noteIsTodo: number, - isProvisional: boolean, - titleInputRef: any, - onTitleChange(event: ChangeEvent): void, + themeId: number; + noteUserUpdatedTime: number; + noteTitle: string; + noteIsTodo: number; + isProvisional: boolean; + titleInputRef: any; + onTitleChange(event: ChangeEvent): void; } function styles_(props: Props) { diff --git a/packages/app-desktop/gui/NoteEditor/utils/contextMenu.ts b/packages/app-desktop/gui/NoteEditor/utils/contextMenu.ts index 8374b217d..722a236bf 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/contextMenu.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/contextMenu.ts @@ -18,19 +18,19 @@ export enum ContextMenuItemType { } export interface ContextMenuOptions { - itemType: ContextMenuItemType, - resourceId: string, - linkToCopy: string, - textToCopy: string, - htmlToCopy: string, - insertContent: Function, - isReadOnly?: boolean, + itemType: ContextMenuItemType; + resourceId: string; + linkToCopy: string; + textToCopy: string; + htmlToCopy: string; + insertContent: Function; + isReadOnly?: boolean; } interface ContextMenuItem { - label: string, - onAction: Function, - isActive: Function, + label: string; + onAction: Function; + isActive: Function; } interface ContextMenuItems { diff --git a/packages/app-desktop/gui/NoteEditor/utils/types.ts b/packages/app-desktop/gui/NoteEditor/utils/types.ts index 17d1f3940..f6e231e6e 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/types.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/types.ts @@ -24,25 +24,25 @@ export interface NoteEditorProps { selectedNoteTags: any[]; lastEditorScrollPercents: any; selectedNoteHash: string; - searches: any[], - selectedSearchId: string, - customCss: string, - noteVisiblePanes: string[], - watchedResources: any, - highlightedWords: any[], - plugins: PluginStates, - toolbarButtonInfos: ToolbarButtonInfo[], - setTagsToolbarButtonInfo: ToolbarButtonInfo, + searches: any[]; + selectedSearchId: string; + customCss: string; + noteVisiblePanes: string[]; + watchedResources: any; + highlightedWords: any[]; + plugins: PluginStates; + toolbarButtonInfos: ToolbarButtonInfo[]; + setTagsToolbarButtonInfo: ToolbarButtonInfo; } export interface NoteBodyEditorProps { style: any; - ref: any, + ref: any; themeId: number; - content: string, - contentKey: string, - contentMarkupLanguage: number, - contentOriginalCss: string, + content: string; + contentKey: string; + contentMarkupLanguage: number; + contentOriginalCss: string; onChange(event: OnChangeEvent): void; onWillChange(event: any): void; onMessage(event: any): void; @@ -53,29 +53,29 @@ export interface NoteBodyEditorProps { disabled: boolean; dispatch: Function; noteToolbar: any; - setLocalSearchResultCount(count: number): void, - searchMarkers: any, - visiblePanes: string[], - keyboardMode: string, - resourceInfos: ResourceInfos, - locale: string, - onDrop: Function, - noteToolbarButtonInfos: ToolbarButtonInfo[], - plugins: PluginStates, + setLocalSearchResultCount(count: number): void; + searchMarkers: any; + visiblePanes: string[]; + keyboardMode: string; + resourceInfos: ResourceInfos; + locale: string; + onDrop: Function; + noteToolbarButtonInfos: ToolbarButtonInfo[]; + plugins: PluginStates; } export interface FormNote { - id: string, - title: string, - body: string, - parent_id: string, - is_todo: number, - bodyEditorContent?: any, - markup_language: number, - user_updated_time: number, - encryption_applied: number, + id: string; + title: string; + body: string; + parent_id: string; + is_todo: number; + bodyEditorContent?: any; + markup_language: number; + user_updated_time: number; + encryption_applied: number; - hasChanged: boolean, + hasChanged: boolean; // Getting the content from the editor can be a slow process because that content // might need to be serialized first. For that reason, the wrapped editor (eg TinyMCE) @@ -93,10 +93,10 @@ export interface FormNote { // types something then quickly switch a different note. In that case, bodyWillChangeId // is set, thus we know we should save the note, even though we won't receive the // onChange event. - bodyWillChangeId: number - bodyChangeId: number, + bodyWillChangeId: number; + bodyChangeId: number; - saveActionQueue: AsyncActionQueue, + saveActionQueue: AsyncActionQueue; // Note with markup_language = HTML have a block of CSS at the start, which is used // to preserve the style from the original (web-clipped) page. When sending the note @@ -106,7 +106,7 @@ export interface FormNote { // Since the CSS used by TinyMCE has been lost (since it's in a temp CSS file), we keep that // original CSS here. It's used in formNoteToNote to rebuild the note body. // We can keep it here because we know TinyMCE will not modify it anyway. - originalCss: string, + originalCss: string; } export function defaultFormNote(): FormNote { @@ -128,12 +128,12 @@ export function defaultFormNote(): FormNote { } export interface ResourceInfo { - localState: any, - item: any, + localState: any; + item: any; } export interface ResourceInfos { - [index: string]: ResourceInfo, + [index: string]: ResourceInfo; } export enum ScrollOptionTypes { @@ -143,8 +143,8 @@ export enum ScrollOptionTypes { } export interface ScrollOptions { - type: ScrollOptionTypes, - value: any, + type: ScrollOptionTypes; + value: any; } export interface OnChangeEvent { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useDropHandler.ts b/packages/app-desktop/gui/NoteEditor/utils/useDropHandler.ts index b5a5eff39..6d4a978e0 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useDropHandler.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useDropHandler.ts @@ -2,7 +2,7 @@ import { useCallback } from 'react'; const Note = require('@joplin/lib/models/Note.js'); interface HookDependencies { - editorRef: any, + editorRef: any; } export default function useDropHandler(dependencies: HookDependencies) { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useFolder.ts b/packages/app-desktop/gui/NoteEditor/utils/useFolder.ts index ffae1a56b..45154304b 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useFolder.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useFolder.ts @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'; const Folder = require('@joplin/lib/models/Folder'); interface HookDependencies { - folderId: string, + folderId: string; } export default function(dependencies: HookDependencies) { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useFormNote.ts b/packages/app-desktop/gui/NoteEditor/utils/useFormNote.ts index d1cf84969..c1fbf863c 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useFormNote.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useFormNote.ts @@ -14,17 +14,17 @@ const DecryptionWorker = require('@joplin/lib/services/DecryptionWorker.js'); const ResourceEditWatcher = require('@joplin/lib/services/ResourceEditWatcher/index').default; export interface OnLoadEvent { - formNote: FormNote, + formNote: FormNote; } interface HookDependencies { - syncStarted: boolean, - noteId: string, - isProvisional: boolean, - titleInputRef: any, - editorRef: any, - onBeforeLoad(event: OnLoadEvent): void, - onAfterLoad(event: OnLoadEvent): void, + syncStarted: boolean; + noteId: string; + isProvisional: boolean; + titleInputRef: any; + editorRef: any; + onBeforeLoad(event: OnLoadEvent): void; + onAfterLoad(event: OnLoadEvent): void; } function installResourceChangeHandler(onResourceChangeHandler: Function) { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useMarkupToHtml.ts b/packages/app-desktop/gui/NoteEditor/utils/useMarkupToHtml.ts index b0be79c16..5b1c736bd 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useMarkupToHtml.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useMarkupToHtml.ts @@ -9,14 +9,14 @@ const { themeStyle } = require('@joplin/lib/theme'); const Note = require('@joplin/lib/models/Note'); interface HookDependencies { - themeId: number, - customCss: string, - plugins: PluginStates, + themeId: number; + customCss: string; + plugins: PluginStates; } interface MarkupToHtmlOptions { - replaceResourceInternalToExternalLinks?: boolean, - resourceInfos?: ResourceInfos, + replaceResourceInternalToExternalLinks?: boolean; + resourceInfos?: ResourceInfos; } export default function useMarkupToHtml(deps: HookDependencies) { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.ts b/packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.ts index da26da477..3984710fa 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useNoteSearchBar.ts @@ -2,11 +2,11 @@ import { useState, useCallback } from 'react'; import { SearchMarkers } from './useSearchMarkers'; interface LocalSearch { - query: string, - selectedIndex: number, - resultCount: number, - searching: boolean, - timestamp: number, + query: string; + selectedIndex: number; + resultCount: number; + searching: boolean; + timestamp: number; } function defaultLocalSearch(): LocalSearch { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.ts b/packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.ts index be22fa1dd..e7a80a120 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useSearchMarkers.ts @@ -1,14 +1,14 @@ import { useMemo } from 'react'; interface SearchMarkersOptions { - searchTimestamp: number, - selectedIndex: number, - separateWordSearch: boolean, + searchTimestamp: number; + selectedIndex: number; + separateWordSearch: boolean; } export interface SearchMarkers { - keywords: any[], - options: SearchMarkersOptions, + keywords: any[]; + options: SearchMarkersOptions; } function defaultSearchMarkers(): SearchMarkers { diff --git a/packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.ts b/packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.ts index c25a876c5..03de52253 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/useWindowCommandHandler.ts @@ -12,13 +12,13 @@ const commandsWithDependencies = [ ]; interface HookDependencies { - formNote: FormNote, - setShowLocalSearch: Function, - dispatch: Function, - noteSearchBarRef: any, - editorRef: any, - titleInputRef: any, - saveNoteAndWait: Function, + formNote: FormNote; + setShowLocalSearch: Function; + dispatch: Function; + noteSearchBarRef: any; + editorRef: any; + titleInputRef: any; + saveNoteAndWait: Function; } function editorCommandRuntime(declaration: CommandDeclaration, editorRef: any): CommandRuntime { diff --git a/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx b/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx index d8155a618..bf47c6aeb 100644 --- a/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx +++ b/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx @@ -7,7 +7,7 @@ import { runtime as focusSearchRuntime } from './commands/focusSearch'; const styled = require('styled-components').default; interface Props { - showNewNoteButtons: boolean, + showNewNoteButtons: boolean; } const StyledRoot = styled.div` diff --git a/packages/app-desktop/gui/NoteListItem.tsx b/packages/app-desktop/gui/NoteListItem.tsx index 75008539c..d770e4237 100644 --- a/packages/app-desktop/gui/NoteListItem.tsx +++ b/packages/app-desktop/gui/NoteListItem.tsx @@ -41,24 +41,24 @@ const StyledRoot = styled.div` `; interface NoteListItemProps { - themeId: number, - width: number, - height: number, - style: any, - dragItemIndex: number, - highlightedWords: string[], - index: number, - isProvisional: boolean, - isSelected: boolean, - isWatched: boolean - item: any, - itemCount: number, - onCheckboxClick: any, - onDragStart: any, - onNoteDragOver: any, - onNoteDrop: any, - onTitleClick: any, - onContextMenu(event: React.MouseEvent): void, + themeId: number; + width: number; + height: number; + style: any; + dragItemIndex: number; + highlightedWords: string[]; + index: number; + isProvisional: boolean; + isSelected: boolean; + isWatched: boolean; + item: any; + itemCount: number; + onCheckboxClick: any; + onDragStart: any; + onNoteDragOver: any; + onNoteDrop: any; + onTitleClick: any; + onContextMenu(event: React.MouseEvent): void; } function NoteListItem(props: NoteListItemProps, ref: any) { diff --git a/packages/app-desktop/gui/NoteTextViewer.tsx b/packages/app-desktop/gui/NoteTextViewer.tsx index ffa0e54aa..8f33ea9eb 100644 --- a/packages/app-desktop/gui/NoteTextViewer.tsx +++ b/packages/app-desktop/gui/NoteTextViewer.tsx @@ -3,9 +3,9 @@ const { connect } = require('react-redux'); const { reg } = require('@joplin/lib/registry.js'); interface Props { - onDomReady: Function, - onIpcMessage: Function, - viewerStyle: any, + onDomReady: Function; + onIpcMessage: Function; + viewerStyle: any; } class NoteTextViewerComponent extends React.Component { diff --git a/packages/app-desktop/gui/NoteToolbar/NoteToolbar.tsx b/packages/app-desktop/gui/NoteToolbar/NoteToolbar.tsx index fdd5bf698..6487bfe6d 100644 --- a/packages/app-desktop/gui/NoteToolbar/NoteToolbar.tsx +++ b/packages/app-desktop/gui/NoteToolbar/NoteToolbar.tsx @@ -8,9 +8,9 @@ const { connect } = require('react-redux'); const { buildStyle } = require('@joplin/lib/theme'); interface NoteToolbarProps { - themeId: number, - style: any, - toolbarButtonInfos: ToolbarButtonInfo[], + themeId: number; + style: any; + toolbarButtonInfos: ToolbarButtonInfo[]; } function styles_(props: NoteToolbarProps) { diff --git a/packages/app-desktop/gui/OneDriveLoginScreen.tsx b/packages/app-desktop/gui/OneDriveLoginScreen.tsx index ef5edb3a2..c404f5cfa 100644 --- a/packages/app-desktop/gui/OneDriveLoginScreen.tsx +++ b/packages/app-desktop/gui/OneDriveLoginScreen.tsx @@ -10,7 +10,7 @@ const { themeStyle } = require('@joplin/lib/theme'); const { OneDriveApiNodeUtils } = require('@joplin/lib/onedrive-api-node-utils.js'); interface Props { - themeId: string, + themeId: string; } class OneDriveLoginScreenComponent extends React.Component { diff --git a/packages/app-desktop/gui/ResizableLayout/ResizableLayout.tsx b/packages/app-desktop/gui/ResizableLayout/ResizableLayout.tsx index cbed2d448..f5591d75d 100644 --- a/packages/app-desktop/gui/ResizableLayout/ResizableLayout.tsx +++ b/packages/app-desktop/gui/ResizableLayout/ResizableLayout.tsx @@ -14,34 +14,34 @@ export enum LayoutItemDirection { } export interface Size { - width: number, - height: number, + width: number; + height: number; } export interface LayoutItem { - key: string, - width?: number, - height?: number, - minWidth?: number, - minHeight?: number, - children?: LayoutItem[] - direction?: LayoutItemDirection, - resizableRight?: boolean, - resizableBottom?: boolean, - visible?: boolean, - context?: any, + key: string; + width?: number; + height?: number; + minWidth?: number; + minHeight?: number; + children?: LayoutItem[]; + direction?: LayoutItemDirection; + resizableRight?: boolean; + resizableBottom?: boolean; + visible?: boolean; + context?: any; } interface onResizeEvent { - layout: LayoutItem + layout: LayoutItem; } interface Props { - layout: LayoutItem, + layout: LayoutItem; onResize(event: onResizeEvent): void; - width?: number, - height?: number, - renderItem: Function, + width?: number; + height?: number; + renderItem: Function; } export function allDynamicSizes(layout: LayoutItem): any { diff --git a/packages/app-desktop/gui/ResizableLayout/hooks/useLayoutItemSizes.ts b/packages/app-desktop/gui/ResizableLayout/hooks/useLayoutItemSizes.ts index 8e50026e1..3bcefd71d 100644 --- a/packages/app-desktop/gui/ResizableLayout/hooks/useLayoutItemSizes.ts +++ b/packages/app-desktop/gui/ResizableLayout/hooks/useLayoutItemSizes.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react'; import { LayoutItem, Size, dragBarThickness } from '../ResizableLayout'; export interface LayoutItemSizes { - [key: string]: Size, + [key: string]: Size; } export function itemSize(item: LayoutItem, sizes: LayoutItemSizes): Size { diff --git a/packages/app-desktop/gui/ResourceScreen.tsx b/packages/app-desktop/gui/ResourceScreen.tsx index 622cbeb42..e807a722a 100644 --- a/packages/app-desktop/gui/ResourceScreen.tsx +++ b/packages/app-desktop/gui/ResourceScreen.tsx @@ -9,45 +9,45 @@ const prettyBytes = require('pretty-bytes'); const Resource = require('@joplin/lib/models/Resource.js'); interface Style { - width: number - height: number + width: number; + height: number; } interface Props { themeId: number; - style: Style, - dispatch: Function, + style: Style; + dispatch: Function; } interface InnerResource { - title: string - id: string - size: number - file_extension: string + title: string; + id: string; + size: number; + file_extension: string; } interface State { - resources: InnerResource[] | undefined - sorting: ActiveSorting - isLoading: boolean + resources: InnerResource[] | undefined; + sorting: ActiveSorting; + isLoading: boolean; } interface ResourceTable { - resources: InnerResource[] - sorting: ActiveSorting - onResourceClick: (resource: InnerResource)=> any - onResourceDelete: (resource: InnerResource)=> any - onToggleSorting: (order: SortingOrder)=> any - themeId: number - style: Style + resources: InnerResource[]; + sorting: ActiveSorting; + onResourceClick: (resource: InnerResource)=> any; + onResourceDelete: (resource: InnerResource)=> any; + onToggleSorting: (order: SortingOrder)=> any; + themeId: number; + style: Style; } -type SortingOrder = 'size' | 'name' -type SortingType = 'asc' | 'desc' +type SortingOrder = 'size' | 'name'; +type SortingType = 'asc' | 'desc'; interface ActiveSorting { - order: SortingOrder - type: SortingType + order: SortingOrder; + type: SortingType; } const ResourceTableComp = (props: ResourceTable) => { diff --git a/packages/app-desktop/gui/Root.tsx b/packages/app-desktop/gui/Root.tsx index 967456aea..72d8f0a02 100644 --- a/packages/app-desktop/gui/Root.tsx +++ b/packages/app-desktop/gui/Root.tsx @@ -24,11 +24,11 @@ const { ThemeProvider, StyleSheetManager, createGlobalStyle } = require('styled- const bridge = require('electron').remote.require('./bridge').default; interface Props { - themeId: number, - appState: string, - dispatch: Function, - size: Size, - zoomFactor: number, + themeId: number; + appState: string; + dispatch: Function; + size: Size; + zoomFactor: number; } const GlobalStyle = createGlobalStyle` diff --git a/packages/app-desktop/gui/SearchBar/SearchBar.tsx b/packages/app-desktop/gui/SearchBar/SearchBar.tsx index ed8ef061b..eafd1441f 100644 --- a/packages/app-desktop/gui/SearchBar/SearchBar.tsx +++ b/packages/app-desktop/gui/SearchBar/SearchBar.tsx @@ -13,10 +13,10 @@ const Note = require('@joplin/lib/models/Note'); const debounce = require('debounce'); interface Props { - inputRef?: any, - notesParentType: string, - dispatch?: Function, - selectedNoteId: string, + inputRef?: any; + notesParentType: string; + dispatch?: Function; + selectedNoteId: string; } function SearchBar(props: Props) { diff --git a/packages/app-desktop/gui/ShareNoteDialog.tsx b/packages/app-desktop/gui/ShareNoteDialog.tsx index 491239c4a..352430f73 100644 --- a/packages/app-desktop/gui/ShareNoteDialog.tsx +++ b/packages/app-desktop/gui/ShareNoteDialog.tsx @@ -12,9 +12,9 @@ const { reg } = require('@joplin/lib/registry.js'); const { clipboard } = require('electron'); interface ShareNoteDialogProps { - themeId: number, - noteIds: Array, - onClose: Function, + themeId: number; + noteIds: Array; + onClose: Function; } interface SharesMap { diff --git a/packages/app-desktop/gui/SideBar/SideBar.tsx b/packages/app-desktop/gui/SideBar/SideBar.tsx index 46438e6ee..e745f800f 100644 --- a/packages/app-desktop/gui/SideBar/SideBar.tsx +++ b/packages/app-desktop/gui/SideBar/SideBar.tsx @@ -23,24 +23,24 @@ const { substrWithEllipsis } = require('@joplin/lib/string-utils'); const { ALL_NOTES_FILTER_ID } = require('@joplin/lib/reserved-ids'); interface Props { - themeId: number, - dispatch: Function, - folders: any[], - collapsedFolderIds: string[], - notesParentType: string, - selectedFolderId: string, - selectedTagId: string, - selectedSmartFilterId: string, - decryptionWorker: any, - resourceFetcher: any, - syncReport: any, - tags: any[], - syncStarted: boolean, + themeId: number; + dispatch: Function; + folders: any[]; + collapsedFolderIds: string[]; + notesParentType: string; + selectedFolderId: string; + selectedTagId: string; + selectedSmartFilterId: string; + decryptionWorker: any; + resourceFetcher: any; + syncReport: any; + tags: any[]; + syncStarted: boolean; } interface State { - tagHeaderIsExpanded: boolean, - folderHeaderIsExpanded: boolean, + tagHeaderIsExpanded: boolean; + folderHeaderIsExpanded: boolean; } const commands = [ diff --git a/packages/app-desktop/gui/StatusScreen/StatusScreen.tsx b/packages/app-desktop/gui/StatusScreen/StatusScreen.tsx index 9a0af56e9..f0e75d4dc 100644 --- a/packages/app-desktop/gui/StatusScreen/StatusScreen.tsx +++ b/packages/app-desktop/gui/StatusScreen/StatusScreen.tsx @@ -11,9 +11,9 @@ const { ReportService } = require('@joplin/lib/services/report.js'); const fs = require('fs-extra'); interface Props { - themeId: string, - style: any, - dispatch: Function, + themeId: string; + style: any; + dispatch: Function; } async function exportDebugReportClick() { diff --git a/packages/app-desktop/gui/TagList.tsx b/packages/app-desktop/gui/TagList.tsx index 78d4b604c..dbba6ab7f 100644 --- a/packages/app-desktop/gui/TagList.tsx +++ b/packages/app-desktop/gui/TagList.tsx @@ -7,9 +7,9 @@ const { themeStyle } = require('@joplin/lib/theme'); const TagItem = require('./TagItem.min.js'); interface Props { - themeId: number, - style: any, - items: any[], + themeId: number; + style: any; + items: any[]; } function TagList(props: Props) { diff --git a/packages/app-desktop/gui/ToggleEditorsButton/ToggleEditorsButton.tsx b/packages/app-desktop/gui/ToggleEditorsButton/ToggleEditorsButton.tsx index ea54c0a95..fbdda5ed5 100644 --- a/packages/app-desktop/gui/ToggleEditorsButton/ToggleEditorsButton.tsx +++ b/packages/app-desktop/gui/ToggleEditorsButton/ToggleEditorsButton.tsx @@ -8,9 +8,9 @@ export enum Value { } export interface Props { - themeId: number, - value: Value, - toolbarButtonInfo: ToolbarButtonInfo, + themeId: number; + value: Value; + toolbarButtonInfo: ToolbarButtonInfo; } export default function ToggleEditorsButton(props: Props) { diff --git a/packages/app-desktop/gui/ToolbarBase.tsx b/packages/app-desktop/gui/ToolbarBase.tsx index 4d9693e9c..3324c95bf 100644 --- a/packages/app-desktop/gui/ToolbarBase.tsx +++ b/packages/app-desktop/gui/ToolbarBase.tsx @@ -6,9 +6,9 @@ const { themeStyle } = require('@joplin/lib/theme'); const ToolbarSpace = require('./ToolbarSpace.min.js'); interface Props { - themeId: number, - style: any, - items: any[], + themeId: number; + style: any; + items: any[]; } class ToolbarBaseComponent extends React.Component { diff --git a/packages/app-desktop/gui/ToolbarButton/ToolbarButton.tsx b/packages/app-desktop/gui/ToolbarButton/ToolbarButton.tsx index ab80ca95f..8c84d5ff6 100644 --- a/packages/app-desktop/gui/ToolbarButton/ToolbarButton.tsx +++ b/packages/app-desktop/gui/ToolbarButton/ToolbarButton.tsx @@ -3,13 +3,13 @@ import { ToolbarButtonInfo } from '@joplin/lib/services/commands/ToolbarButtonUt import { StyledRoot, StyledIconSpan, StyledIconI } from './styles'; interface Props { - readonly themeId: number, - readonly toolbarButtonInfo?: ToolbarButtonInfo, - readonly title?: string, - readonly tooltip?: string, - readonly iconName?: string, - readonly disabled?: boolean, - readonly backgroundHover?: boolean, + readonly themeId: number; + readonly toolbarButtonInfo?: ToolbarButtonInfo; + readonly title?: string; + readonly tooltip?: string; + readonly iconName?: string; + readonly disabled?: boolean; + readonly backgroundHover?: boolean; } function isFontAwesomeIcon(iconName: string) { diff --git a/packages/app-desktop/gui/utils/NoteListUtils.ts b/packages/app-desktop/gui/utils/NoteListUtils.ts index cd7347656..a5e946aa8 100644 --- a/packages/app-desktop/gui/utils/NoteListUtils.ts +++ b/packages/app-desktop/gui/utils/NoteListUtils.ts @@ -15,10 +15,10 @@ const Note = require('@joplin/lib/models/Note'); const { substrWithEllipsis } = require('@joplin/lib/string-utils'); interface ContextMenuProps { - notes: any[], - dispatch: Function, - watchedNoteFiles: string[], - plugins: PluginStates, + notes: any[]; + dispatch: Function; + watchedNoteFiles: string[]; + plugins: PluginStates; } export default class NoteListUtils { diff --git a/packages/app-desktop/plugins/GotoAnything.tsx b/packages/app-desktop/plugins/GotoAnything.tsx index 56c0f49b1..82dd87385 100644 --- a/packages/app-desktop/plugins/GotoAnything.tsx +++ b/packages/app-desktop/plugins/GotoAnything.tsx @@ -21,31 +21,31 @@ const markupLanguageUtils = require('@joplin/lib/markupLanguageUtils').default; const PLUGIN_NAME = 'gotoAnything'; interface SearchResult { - id: string, - title: string, - parent_id: string, - fields: string[], - fragments?: string, - path?: string, - type?: number, + id: string; + title: string; + parent_id: string; + fields: string[]; + fragments?: string; + path?: string; + type?: number; } interface Props { - themeId: number, - dispatch: Function, - folders: any[], - showCompletedTodos: boolean, - userData: any, + themeId: number; + dispatch: Function; + folders: any[]; + showCompletedTodos: boolean; + userData: any; } interface State { - query: string, - results: SearchResult[], - selectedItemId: string, - keywords: string[], - listType: number, - showHelp: boolean, - resultsInBody: boolean, + query: string; + results: SearchResult[]; + selectedItemId: string; + keywords: string[]; + listType: number; + showHelp: boolean; + resultsInBody: boolean; } class GotoAnything { diff --git a/packages/app-desktop/services/commands/types.ts b/packages/app-desktop/services/commands/types.ts index 7e670923c..55b6e49b4 100644 --- a/packages/app-desktop/services/commands/types.ts +++ b/packages/app-desktop/services/commands/types.ts @@ -1,6 +1,6 @@ import { AppState } from '../../app'; export interface DesktopCommandContext { - state: AppState, - dispatch: Function, + state: AppState; + dispatch: Function; } diff --git a/packages/app-desktop/services/plugins/PlatformImplementation.ts b/packages/app-desktop/services/plugins/PlatformImplementation.ts index ecf7d3b6d..ae64e09eb 100644 --- a/packages/app-desktop/services/plugins/PlatformImplementation.ts +++ b/packages/app-desktop/services/plugins/PlatformImplementation.ts @@ -11,7 +11,7 @@ interface JoplinViewsDialogs { } interface JoplinViews { - dialogs: JoplinViewsDialogs + dialogs: JoplinViewsDialogs; } interface Joplin { @@ -20,7 +20,7 @@ interface Joplin { } interface Components { - [key: string]: any, + [key: string]: any; } export default class PlatformImplementation { diff --git a/packages/app-desktop/services/plugins/PluginRunner.ts b/packages/app-desktop/services/plugins/PluginRunner.ts index 279f5b234..045dd4f58 100644 --- a/packages/app-desktop/services/plugins/PluginRunner.ts +++ b/packages/app-desktop/services/plugins/PluginRunner.ts @@ -14,14 +14,14 @@ enum PluginMessageTarget { } export interface PluginMessage { - target: PluginMessageTarget, - pluginId: string, - callbackId?: string, - path?: string, - args?: any[], - result?: any, - error?: any, - mainWindowCallbackId?: string, + target: PluginMessageTarget; + pluginId: string; + callbackId?: string; + path?: string; + args?: any[]; + result?: any; + error?: any; + mainWindowCallbackId?: string; } let callbackIndex = 1; diff --git a/packages/app-desktop/services/plugins/UserWebview.tsx b/packages/app-desktop/services/plugins/UserWebview.tsx index ea99a2f67..6e23c518a 100644 --- a/packages/app-desktop/services/plugins/UserWebview.tsx +++ b/packages/app-desktop/services/plugins/UserWebview.tsx @@ -5,22 +5,22 @@ import useThemeCss from './hooks/useThemeCss'; const styled = require('styled-components').default; export interface Props { - html: string, - scripts: string[], - onMessage: Function, - pluginId: string, - viewId: string, - themeId: number, - minWidth?: number, - minHeight?: number, - fitToContent?: boolean, - borderBottom?: boolean, - theme?: any, + html: string; + scripts: string[]; + onMessage: Function; + pluginId: string; + viewId: string; + themeId: number; + minWidth?: number; + minHeight?: number; + fitToContent?: boolean; + borderBottom?: boolean; + theme?: any; } interface Size { - width: number, - height: number, + width: number; + height: number; } const StyledFrame = styled.iframe` diff --git a/packages/app-desktop/services/plugins/UserWebviewDialogButtonBar.tsx b/packages/app-desktop/services/plugins/UserWebviewDialogButtonBar.tsx index 1a0bb0a37..e3a2142e0 100644 --- a/packages/app-desktop/services/plugins/UserWebviewDialogButtonBar.tsx +++ b/packages/app-desktop/services/plugins/UserWebviewDialogButtonBar.tsx @@ -6,7 +6,7 @@ const styled = require('styled-components').default; const { space } = require('styled-system'); interface Props { - buttons: ButtonSpec[], + buttons: ButtonSpec[]; } const StyledRoot = styled.div` diff --git a/packages/app-desktop/services/plugins/hooks/useThemeCss.ts b/packages/app-desktop/services/plugins/hooks/useThemeCss.ts index 1ca0584c3..7d78f0199 100644 --- a/packages/app-desktop/services/plugins/hooks/useThemeCss.ts +++ b/packages/app-desktop/services/plugins/hooks/useThemeCss.ts @@ -5,8 +5,8 @@ const Setting = require('@joplin/lib/models/Setting').default; const { camelCaseToDash, formatCssSize } = require('@joplin/lib/string-utils'); interface HookDependencies { - pluginId: string, - themeId: number, + pluginId: string; + themeId: number; } function themeToCssVariables(theme: any) { diff --git a/packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.tsx b/packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.tsx index b007e5fb3..8178bea8b 100644 --- a/packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.tsx +++ b/packages/app-mobile/components/NoteBodyViewer/NoteBodyViewer.tsx @@ -13,18 +13,18 @@ const BackButtonDialogBox = require('../BackButtonDialogBox').default; const { reg } = require('@joplin/lib/registry.js'); interface Props { - themeId: number, - style: any, - noteBody: string, - noteMarkupLanguage: number, - highlightedKeywords: string[], - noteResources: any, - paddingBottom: number, - noteHash: string, - onJoplinLinkClick: Function, - onCheckboxChange?: Function, - onMarkForDownload?: Function, - onLoadEnd?: Function, + themeId: number; + style: any; + noteBody: string; + noteMarkupLanguage: number; + highlightedKeywords: string[]; + noteResources: any; + paddingBottom: number; + noteHash: string; + onJoplinLinkClick: Function; + onCheckboxChange?: Function; + onMarkForDownload?: Function; + onLoadEnd?: Function; } export default function NoteBodyViewer(props: Props) { diff --git a/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts b/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts index f71d33260..be5e82d82 100644 --- a/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts +++ b/packages/app-mobile/components/NoteBodyViewer/hooks/useSource.ts @@ -6,13 +6,13 @@ const markupLanguageUtils = require('@joplin/lib/markupLanguageUtils').default; const { assetsToHeaders } = require('@joplin/renderer'); interface Source { - uri: string, - baseUrl: string, + uri: string; + baseUrl: string; } interface UseSourceResult { - source: Source, - injectedJs: string[], + source: Source; + injectedJs: string[]; } let markupToHtml_: any = null; diff --git a/packages/app-mobile/setUpQuickActions.ts b/packages/app-mobile/setUpQuickActions.ts index 0ad5866c9..86bd5e055 100644 --- a/packages/app-mobile/setUpQuickActions.ts +++ b/packages/app-mobile/setUpQuickActions.ts @@ -8,8 +8,8 @@ const Note = require('@joplin/lib/models/Note.js'); const { reg } = require('@joplin/lib/registry.js'); type TData = { - type: string -} + type: string; +}; export default (dispatch: Function, folderId: string) => { const userInfo = { url: '' }; diff --git a/packages/app-mobile/utils/ShareExtension.ts b/packages/app-mobile/utils/ShareExtension.ts index 84681d28e..fc4f97fb0 100644 --- a/packages/app-mobile/utils/ShareExtension.ts +++ b/packages/app-mobile/utils/ShareExtension.ts @@ -1,9 +1,9 @@ const { NativeModules, Platform } = require('react-native'); export interface SharedData { - title?: string, - text?: string, - resources?: string[] + title?: string; + text?: string; + resources?: string[]; } const ShareExtension = (Platform.OS === 'android' && NativeModules.ShareExtension) ? diff --git a/packages/app-mobile/utils/checkPermissions.ts b/packages/app-mobile/utils/checkPermissions.ts index cc4b3fbd7..cca584870 100644 --- a/packages/app-mobile/utils/checkPermissions.ts +++ b/packages/app-mobile/utils/checkPermissions.ts @@ -1,12 +1,12 @@ const { Platform, PermissionsAndroid } = require('react-native'); type rationale = { - title: string, - message: string, - buttonPositive?: string, - buttonNegative?: string - buttonNeutral?: string -} + title: string; + message: string; + buttonPositive?: string; + buttonNegative?: string; + buttonNeutral?: string; +}; export default async (permissions: string, rationale?: rationale) => { if (Platform.OS !== 'android') return true; diff --git a/packages/lib/AsyncActionQueue.ts b/packages/lib/AsyncActionQueue.ts index 6043bb762..5c62f2627 100644 --- a/packages/lib/AsyncActionQueue.ts +++ b/packages/lib/AsyncActionQueue.ts @@ -1,12 +1,12 @@ import shim from './shim'; export interface QueueItemAction { - (): void, + (): void; } export interface QueueItem { - action: QueueItemAction, - context: any, + action: QueueItemAction; + context: any; } export enum IntervalType { diff --git a/packages/lib/BaseModel.ts b/packages/lib/BaseModel.ts index 3284be875..dccf2e686 100644 --- a/packages/lib/BaseModel.ts +++ b/packages/lib/BaseModel.ts @@ -47,7 +47,7 @@ class BaseModel { ['TYPE_MIGRATION', ModelType.Migration], ['TYPE_SMART_FILTER', ModelType.SmartFilter], ['TYPE_COMMAND', ModelType.Command], - ] + ]; public static TYPE_NOTE = ModelType.Note; public static TYPE_FOLDER = ModelType.Folder; diff --git a/packages/lib/InMemoryCache.ts b/packages/lib/InMemoryCache.ts index 73f55a94c..d70874d96 100644 --- a/packages/lib/InMemoryCache.ts +++ b/packages/lib/InMemoryCache.ts @@ -10,8 +10,8 @@ // scale. interface Record { - value: any, - expiredTime: number, + value: any; + expiredTime: number; } interface Records { @@ -19,7 +19,7 @@ interface Records { } interface ExpirableKeys { - [key: string]: boolean, + [key: string]: boolean; } export default class Cache { diff --git a/packages/lib/JoplinServerApi.ts b/packages/lib/JoplinServerApi.ts index 094ff8f48..0992030f6 100644 --- a/packages/lib/JoplinServerApi.ts +++ b/packages/lib/JoplinServerApi.ts @@ -6,9 +6,9 @@ const { rtrimSlashes } = require('./path-utils'); const base64 = require('base-64'); interface JoplinServerApiOptions { - username: Function, - password: Function, - baseUrl: Function, + username: Function; + password: Function; + baseUrl: Function; } export default class JoplinServerApi { diff --git a/packages/lib/Logger.ts b/packages/lib/Logger.ts index 7d2a680ad..f9ddb5301 100644 --- a/packages/lib/Logger.ts +++ b/packages/lib/Logger.ts @@ -17,13 +17,13 @@ enum LogLevel { } interface Target { - type: TargetType, - level?: LogLevel, - database?: any, - console?: any, - prefix?: string, - path?: string, - source?: string, + type: TargetType; + level?: LogLevel; + database?: any; + console?: any; + prefix?: string; + path?: string; + source?: string; } class Logger { diff --git a/packages/lib/PoorManIntervals.ts b/packages/lib/PoorManIntervals.ts index 260a27fdd..3e9f1412b 100644 --- a/packages/lib/PoorManIntervals.ts +++ b/packages/lib/PoorManIntervals.ts @@ -11,11 +11,11 @@ const time = require('./time').default; type IntervalId = number; interface Interval { - id: IntervalId, - callback: Function, - interval: number, - lastIntervalTime: number, - isTimeout: boolean, + id: IntervalId; + callback: Function; + interval: number; + lastIntervalTime: number; + isTimeout: boolean; } interface Intervals { diff --git a/packages/lib/Synchronizer.ts b/packages/lib/Synchronizer.ts index a6d8bfb15..da3928879 100644 --- a/packages/lib/Synchronizer.ts +++ b/packages/lib/Synchronizer.ts @@ -21,9 +21,9 @@ const TaskQueue = require('./TaskQueue'); const { Dirnames } = require('./services/synchronizer/utils/types'); interface RemoteItem { - id: string, - path?: string, - type_?: number, + id: string; + path?: string; + type_?: number; } export default class Synchronizer { diff --git a/packages/lib/locale.ts b/packages/lib/locale.ts index 7ab4dc718..dbe32d1ab 100644 --- a/packages/lib/locale.ts +++ b/packages/lib/locale.ts @@ -1,11 +1,11 @@ const { sprintf } = require('sprintf-js'); interface StringToStringMap { - [key: string]: string, + [key: string]: string; } interface CodeToCountryMap { - [key: string]: string[], + [key: string]: string[]; } const codeToLanguageE_: StringToStringMap = {}; @@ -462,7 +462,7 @@ function supportedLocales(): string[] { } interface SupportedLocalesToLanguagesOptions { - includeStats?: boolean, + includeStats?: boolean; } function supportedLocalesToLanguages(options: SupportedLocalesToLanguagesOptions = null) { diff --git a/packages/lib/markdownUtils.ts b/packages/lib/markdownUtils.ts index 2a1be542f..0cad03787 100644 --- a/packages/lib/markdownUtils.ts +++ b/packages/lib/markdownUtils.ts @@ -8,13 +8,13 @@ const listRegex = /^(\s*)([*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]\s))(\s*)/; const emptyListRegex = /^(\s*)([*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/; export interface MarkdownTableHeader { - name: string, - label: string, - filter?: Function, + name: string; + label: string; + filter?: Function; } export interface MarkdownTableRow { - [key: string]: string, + [key: string]: string; } const markdownUtils = { diff --git a/packages/lib/models/Alarm.ts b/packages/lib/models/Alarm.ts index 2a7193fa5..42d41560e 100644 --- a/packages/lib/models/Alarm.ts +++ b/packages/lib/models/Alarm.ts @@ -2,11 +2,11 @@ const BaseModel = require('../BaseModel').default; const Note = require('./Note.js'); export interface Notification { - id: number, - noteId: string, - date: Date, - title: string, - body?: string, + id: number; + noteId: string; + date: Date; + title: string; + body?: string; } export default class Alarm extends BaseModel { diff --git a/packages/lib/models/Setting.ts b/packages/lib/models/Setting.ts index 3e283da36..37a5f52f3 100644 --- a/packages/lib/models/Setting.ts +++ b/packages/lib/models/Setting.ts @@ -19,54 +19,54 @@ export enum SettingItemType { } interface KeysOptions { - secureOnly?: boolean, + secureOnly?: boolean; } // This is the definition of a setting item export interface SettingItem { - value: any, - type: SettingItemType, - public: boolean, + value: any; + type: SettingItemType; + public: boolean; - subType?: string, - key?: string, - isEnum?: boolean, - section?: string, - label?(): string, - description?(appType: string): string, - options?(): any, - appTypes?: string[], - show?(settings: any): boolean, - filter?(value: any): any, - secure?: boolean, - advanced?: boolean, - minimum?: number, - maximum?: number, - step?: number, - onClick?(): void, - unitLabel?(value: any): string, + subType?: string; + key?: string; + isEnum?: boolean; + section?: string; + label?(): string; + description?(appType: string): string; + options?(): any; + appTypes?: string[]; + show?(settings: any): boolean; + filter?(value: any): any; + secure?: boolean; + advanced?: boolean; + minimum?: number; + maximum?: number; + step?: number; + onClick?(): void; + unitLabel?(value: any): string; } interface SettingItems { - [key: string]: SettingItem, + [key: string]: SettingItem; } // This is where the actual setting values are stored. // They are saved to database at regular intervals. interface CacheItem { - key: string, - value: any, + key: string; + value: any; } export interface SettingSection { - label: string, - iconName?: string, - description?: string, - name?: string, + label: string; + iconName?: string; + description?: string; + name?: string; } interface SettingSections { - [key: string]: SettingSection, + [key: string]: SettingSection; } class Setting extends BaseModel { diff --git a/packages/lib/models/utils/paginatedFeed.ts b/packages/lib/models/utils/paginatedFeed.ts index e8cdad433..1a471aa78 100755 --- a/packages/lib/models/utils/paginatedFeed.ts +++ b/packages/lib/models/utils/paginatedFeed.ts @@ -2,14 +2,14 @@ import paginationToSql from './paginationToSql'; import { Pagination, PaginationOrder } from './types'; export interface ModelFeedPage { - items: any[], - has_more?: boolean, - total?: number, + items: any[]; + has_more?: boolean; + total?: number; } export interface WhereQuery { - sql: string, - params: any[], + sql: string; + params: any[]; } // Note: this method might return more fields than was requested as it will diff --git a/packages/lib/models/utils/types.ts b/packages/lib/models/utils/types.ts index c4ee6ee08..14544344a 100644 --- a/packages/lib/models/utils/types.ts +++ b/packages/lib/models/utils/types.ts @@ -4,13 +4,13 @@ export enum PaginationOrderDir { } export interface PaginationOrder { - by: string, - dir: PaginationOrderDir, - caseInsensitive: boolean, + by: string; + dir: PaginationOrderDir; + caseInsensitive: boolean; } export interface Pagination { - limit: number, - order: PaginationOrder[], - page: number, + limit: number; + order: PaginationOrder[]; + page: number; } diff --git a/packages/lib/reducer.ts b/packages/lib/reducer.ts index abc190a07..6e105f578 100644 --- a/packages/lib/reducer.ts +++ b/packages/lib/reducer.ts @@ -17,75 +17,75 @@ additionalReducers.push({ }); interface StateLastSelectedNotesIds { - Folder: any, - Tag: any, - Search: any, + Folder: any; + Tag: any; + Search: any; } interface StateClipperServer { - startState: string, - port: number, + startState: string; + port: number; } interface StateDecryptionWorker { - state: string, - itemIndex: number, - itemCount: number, - decryptedItemCounts: any - decryptedItemCount: number, - skippedItemCount: number, + state: string; + itemIndex: number; + itemCount: number; + decryptedItemCounts: any; + decryptedItemCount: number; + skippedItemCount: number; } interface StateResourceFetcher { - toFetchCount: number, + toFetchCount: number; } export interface State { - notes: any[], - notesSource: string, - notesParentType: string, - folders: any[], - tags: any[], - masterKeys: any[], - notLoadedMasterKeys: any[], - searches: any[], - highlightedWords: string[], - selectedNoteIds: string[], - selectedNoteHash: string, - selectedFolderId: string, - selectedTagId: string, - selectedSearchId: string, - selectedItemType: string, - selectedSmartFilterId: string, - lastSelectedNotesIds: StateLastSelectedNotesIds, - showSideMenu: boolean, - screens: any - historyCanGoBack: boolean, - syncStarted: boolean, - syncReport: any - searchQuery: string, - settings: any - sharedData: any, - appState: string, - hasDisabledSyncItems: boolean, - hasDisabledEncryptionItems: boolean, - customCss: string, - templates: any[], - collapsedFolderIds: string[], - clipperServer: StateClipperServer, - decryptionWorker: StateDecryptionWorker, - selectedNoteTags: any[], - resourceFetcher: StateResourceFetcher, - backwardHistoryNotes: any[], - forwardHistoryNotes: any[], - pluginsLegacy: any - provisionalNoteIds: string[], - editorNoteStatuses: any - isInsertingNotes: boolean, - hasEncryptedItems: boolean, + notes: any[]; + notesSource: string; + notesParentType: string; + folders: any[]; + tags: any[]; + masterKeys: any[]; + notLoadedMasterKeys: any[]; + searches: any[]; + highlightedWords: string[]; + selectedNoteIds: string[]; + selectedNoteHash: string; + selectedFolderId: string; + selectedTagId: string; + selectedSearchId: string; + selectedItemType: string; + selectedSmartFilterId: string; + lastSelectedNotesIds: StateLastSelectedNotesIds; + showSideMenu: boolean; + screens: any; + historyCanGoBack: boolean; + syncStarted: boolean; + syncReport: any; + searchQuery: string; + settings: any; + sharedData: any; + appState: string; + hasDisabledSyncItems: boolean; + hasDisabledEncryptionItems: boolean; + customCss: string; + templates: any[]; + collapsedFolderIds: string[]; + clipperServer: StateClipperServer; + decryptionWorker: StateDecryptionWorker; + selectedNoteTags: any[]; + resourceFetcher: StateResourceFetcher; + backwardHistoryNotes: any[]; + forwardHistoryNotes: any[]; + pluginsLegacy: any; + provisionalNoteIds: string[]; + editorNoteStatuses: any; + isInsertingNotes: boolean; + hasEncryptedItems: boolean; // Extra reducer keys go here: - pluginService: PluginServiceState, + pluginService: PluginServiceState; } export const defaultState: State = { diff --git a/packages/lib/services/AlarmServiceDriverNode.ts b/packages/lib/services/AlarmServiceDriverNode.ts index bb813b882..597c15c19 100644 --- a/packages/lib/services/AlarmServiceDriverNode.ts +++ b/packages/lib/services/AlarmServiceDriverNode.ts @@ -6,7 +6,7 @@ const notifier = require('node-notifier'); const bridge = require('electron').remote.require('./bridge').default; interface Options { - appName: string, + appName: string; } export default class AlarmServiceDriverNode { diff --git a/packages/lib/services/CommandService.ts b/packages/lib/services/CommandService.ts index dad894f6c..e117fad6b 100644 --- a/packages/lib/services/CommandService.ts +++ b/packages/lib/services/CommandService.ts @@ -10,25 +10,25 @@ type EnabledCondition = string; export interface CommandContext { // The state may also be of type "AppState" (used by the desktop app), which inherits from "State" (used by all apps) - state: State, - dispatch: Function, + state: State; + dispatch: Function; } export interface CommandRuntime { - execute(context: CommandContext, ...args: any[]): Promise + execute(context: CommandContext, ...args: any[]): Promise; enabledCondition?: EnabledCondition; // Used for the (optional) toolbar button title - mapStateToTitle?(state: any): string, + mapStateToTitle?(state: any): string; } export interface CommandDeclaration { - name: string + name: string; // Used for the menu item label, and toolbar button tooltip - label?: LabelFunction | string, + label?: LabelFunction | string; // Command description - if none is provided, the label will be used as description - description?: string, + description?: string; // This is a bit of a hack because some labels don't make much sense in isolation. For example, // the commmand to focus the note list is called just "Note list". This makes sense within the menu @@ -38,26 +38,26 @@ export interface CommandDeclaration { // label() => _('Note list'), // parentLabel() => _('Focus'), // Which will be displayed as "Focus: Note list" in the keymap config screen. - parentLabel?: LabelFunction | string, + parentLabel?: LabelFunction | string; // All free Font Awesome icons are available: https://fontawesome.com/icons?d=gallery&m=free - iconName?: string, + iconName?: string; // Will be used by TinyMCE (which doesn't support Font Awesome icons). // Defaults to the "preferences" icon (a cog) if not specified. // https://www.tiny.cloud/docs/advanced/editor-icon-identifiers/ - tinymceIconName?: string, + tinymceIconName?: string; // Same as `role` key in Electron MenuItem: // https://www.electronjs.org/docs/api/menu-item#new-menuitemoptions // Note that due to a bug in Electron, menu items with a role cannot // be disabled. - role?: string, + role?: string; } export interface Command { - declaration: CommandDeclaration, - runtime?: CommandRuntime, + declaration: CommandDeclaration; + runtime?: CommandRuntime; } interface Commands { @@ -81,13 +81,13 @@ export const utils: Utils = { }; interface CommandByNameOptions { - mustExist?: boolean, - runtimeMustBeRegistered?: boolean, + mustExist?: boolean; + runtimeMustBeRegistered?: boolean; } export interface SearchResult { - commandName: string, - title: string, + commandName: string; + title: string; } export default class CommandService extends BaseService { diff --git a/packages/lib/services/KvStore.ts b/packages/lib/services/KvStore.ts index c3640dfc3..374b7f89b 100644 --- a/packages/lib/services/KvStore.ts +++ b/packages/lib/services/KvStore.ts @@ -8,7 +8,7 @@ enum ValueType { export default class KvStore extends BaseService { - private incMutex_: any = null + private incMutex_: any = null; private db_: any = null; private static instance_: KvStore = null; diff --git a/packages/lib/services/ResourceEditWatcher/index.ts b/packages/lib/services/ResourceEditWatcher/index.ts index 87e6b0b25..0c59817ee 100644 --- a/packages/lib/services/ResourceEditWatcher/index.ts +++ b/packages/lib/services/ResourceEditWatcher/index.ts @@ -9,16 +9,16 @@ const chokidar = require('chokidar'); const bridge = require('electron').remote.require('./bridge').default; interface WatchedItem { - resourceId: string, - lastFileUpdatedTime: number, - lastResourceUpdatedTime: number, - path: string, - asyncSaveQueue: AsyncActionQueue, - size: number, + resourceId: string; + lastFileUpdatedTime: number; + lastResourceUpdatedTime: number; + path: string; + asyncSaveQueue: AsyncActionQueue; + size: number; } interface WatchedItems { - [key: string]: WatchedItem, + [key: string]: WatchedItem; } export default class ResourceEditWatcher { diff --git a/packages/lib/services/ResourceService.ts b/packages/lib/services/ResourceService.ts index d8acfed0e..c6c182533 100644 --- a/packages/lib/services/ResourceService.ts +++ b/packages/lib/services/ResourceService.ts @@ -15,8 +15,8 @@ export default class ResourceService extends BaseService { private static isRunningInBackground_: boolean = false; private maintenanceCalls_: boolean[] = []; - private maintenanceTimer1_: any = null - private maintenanceTimer2_: any = null + private maintenanceTimer1_: any = null; + private maintenanceTimer2_: any = null; public async indexNoteResources() { this.logger().info('ResourceService::indexNoteResources: Start'); diff --git a/packages/lib/services/commands/MenuUtils.ts b/packages/lib/services/commands/MenuUtils.ts index 03aaeab10..a85540b01 100644 --- a/packages/lib/services/commands/MenuUtils.ts +++ b/packages/lib/services/commands/MenuUtils.ts @@ -5,27 +5,27 @@ const { createSelectorCreator, defaultMemoize } = require('reselect'); const { createCachedSelector } = require('re-reselect'); interface MenuItem { - id: string, - label: string, - click: Function, - role?: any, - accelerator?: string, + id: string; + label: string; + click: Function; + role?: any; + accelerator?: string; } interface MenuItems { - [key: string]: MenuItem, + [key: string]: MenuItem; } interface MenuItemProps { - [key: string]: any, + [key: string]: any; } interface MenuItemPropsCache { - [key: string]: any, + [key: string]: any; } interface MenuItemCache { - [key: string]: MenuItems, + [key: string]: MenuItems; } const createShallowObjectEqualSelector = createSelectorCreator( diff --git a/packages/lib/services/commands/ToolbarButtonUtils.ts b/packages/lib/services/commands/ToolbarButtonUtils.ts index 59907f223..b0db6810f 100644 --- a/packages/lib/services/commands/ToolbarButtonUtils.ts +++ b/packages/lib/services/commands/ToolbarButtonUtils.ts @@ -4,20 +4,20 @@ import { stateUtils } from '../../reducer'; const separatorItem = { type: 'separator' }; export interface ToolbarButtonInfo { - name: string, - tooltip: string, - iconName: string, - enabled: boolean, - onClick(): void, - title: string, + name: string; + tooltip: string; + iconName: string; + enabled: boolean; + onClick(): void; + title: string; } interface ToolbarButtonCacheItem { - info: ToolbarButtonInfo, + info: ToolbarButtonInfo; } interface ToolbarButtonCache { - [key: string]: ToolbarButtonCacheItem, + [key: string]: ToolbarButtonCacheItem; } export default class ToolbarButtonUtils { diff --git a/packages/lib/services/database/types.ts b/packages/lib/services/database/types.ts index 66df45f2c..b06d03f2e 100644 --- a/packages/lib/services/database/types.ts +++ b/packages/lib/services/database/types.ts @@ -3,204 +3,204 @@ // This file was generated by a tool. // Rerun sql-ts to regenerate this file. export interface AlarmEntity { - 'id'?: number | null - 'note_id'?: string - 'trigger_time'?: number + 'id'?: number | null; + 'note_id'?: string; + 'trigger_time'?: number; } export interface DeletedItemEntity { - 'id'?: number | null - 'item_type'?: number - 'item_id'?: string - 'deleted_time'?: number - 'sync_target'?: number + 'id'?: number | null; + 'item_type'?: number; + 'item_id'?: string; + 'deleted_time'?: number; + 'sync_target'?: number; } export interface FolderEntity { - 'id'?: string | null - 'title'?: string - 'created_time'?: number - 'updated_time'?: number - 'user_created_time'?: number - 'user_updated_time'?: number - 'encryption_cipher_text'?: string - 'encryption_applied'?: number - 'parent_id'?: string - 'is_shared'?: number + 'id'?: string | null; + 'title'?: string; + 'created_time'?: number; + 'updated_time'?: number; + 'user_created_time'?: number; + 'user_updated_time'?: number; + 'encryption_cipher_text'?: string; + 'encryption_applied'?: number; + 'parent_id'?: string; + 'is_shared'?: number; } export interface ItemChangeEntity { - 'id'?: number | null - 'item_type'?: number - 'item_id'?: string - 'type'?: number - 'created_time'?: number - 'source'?: number - 'before_change_item'?: string + 'id'?: number | null; + 'item_type'?: number; + 'item_id'?: string; + 'type'?: number; + 'created_time'?: number; + 'source'?: number; + 'before_change_item'?: string; } export interface KeyValueEntity { - 'id'?: number | null - 'key'?: string - 'value'?: string - 'type'?: number - 'updated_time'?: number + 'id'?: number | null; + 'key'?: string; + 'value'?: string; + 'type'?: number; + 'updated_time'?: number; } export interface MasterKeyEntity { - 'id'?: string | null - 'created_time'?: number - 'updated_time'?: number - 'source_application'?: string - 'encryption_method'?: number - 'checksum'?: string - 'content'?: string + 'id'?: string | null; + 'created_time'?: number; + 'updated_time'?: number; + 'source_application'?: string; + 'encryption_method'?: number; + 'checksum'?: string; + 'content'?: string; } export interface MigrationEntity { - 'id'?: number | null - 'number'?: number - 'updated_time'?: number - 'created_time'?: number + 'id'?: number | null; + 'number'?: number; + 'updated_time'?: number; + 'created_time'?: number; } export interface NoteResourceEntity { - 'id'?: number | null - 'note_id'?: string - 'resource_id'?: string - 'is_associated'?: number - 'last_seen_time'?: number + 'id'?: number | null; + 'note_id'?: string; + 'resource_id'?: string; + 'is_associated'?: number; + 'last_seen_time'?: number; } export interface NoteTagEntity { - 'id'?: string | null - 'note_id'?: string - 'tag_id'?: string - 'created_time'?: number - 'updated_time'?: number - 'user_created_time'?: number - 'user_updated_time'?: number - 'encryption_cipher_text'?: string - 'encryption_applied'?: number - 'is_shared'?: number + 'id'?: string | null; + 'note_id'?: string; + 'tag_id'?: string; + 'created_time'?: number; + 'updated_time'?: number; + 'user_created_time'?: number; + 'user_updated_time'?: number; + 'encryption_cipher_text'?: string; + 'encryption_applied'?: number; + 'is_shared'?: number; } export interface NoteEntity { - 'id'?: string | null - 'parent_id'?: string - 'title'?: string - 'body'?: string - 'created_time'?: number - 'updated_time'?: number - 'is_conflict'?: number - 'latitude'?: number - 'longitude'?: number - 'altitude'?: number - 'author'?: string - 'source_url'?: string - 'is_todo'?: number - 'todo_due'?: number - 'todo_completed'?: number - 'source'?: string - 'source_application'?: string - 'application_data'?: string - 'order'?: number - 'user_created_time'?: number - 'user_updated_time'?: number - 'encryption_cipher_text'?: string - 'encryption_applied'?: number - 'markup_language'?: number - 'is_shared'?: number + 'id'?: string | null; + 'parent_id'?: string; + 'title'?: string; + 'body'?: string; + 'created_time'?: number; + 'updated_time'?: number; + 'is_conflict'?: number; + 'latitude'?: number; + 'longitude'?: number; + 'altitude'?: number; + 'author'?: string; + 'source_url'?: string; + 'is_todo'?: number; + 'todo_due'?: number; + 'todo_completed'?: number; + 'source'?: string; + 'source_application'?: string; + 'application_data'?: string; + 'order'?: number; + 'user_created_time'?: number; + 'user_updated_time'?: number; + 'encryption_cipher_text'?: string; + 'encryption_applied'?: number; + 'markup_language'?: number; + 'is_shared'?: number; } export interface NotesNormalizedEntity { - 'id'?: string - 'title'?: string - 'body'?: string - 'user_created_time'?: number - 'user_updated_time'?: number - 'is_todo'?: number - 'todo_completed'?: number - 'parent_id'?: string - 'latitude'?: number - 'longitude'?: number - 'altitude'?: number - 'source_url'?: string + 'id'?: string; + 'title'?: string; + 'body'?: string; + 'user_created_time'?: number; + 'user_updated_time'?: number; + 'is_todo'?: number; + 'todo_completed'?: number; + 'parent_id'?: string; + 'latitude'?: number; + 'longitude'?: number; + 'altitude'?: number; + 'source_url'?: string; } export interface ResourceLocalStateEntity { - 'id'?: number | null - 'resource_id'?: string - 'fetch_status'?: number - 'fetch_error'?: string + 'id'?: number | null; + 'resource_id'?: string; + 'fetch_status'?: number; + 'fetch_error'?: string; } export interface ResourceEntity { - 'id'?: string | null - 'title'?: string - 'mime'?: string - 'filename'?: string - 'created_time'?: number - 'updated_time'?: number - 'user_created_time'?: number - 'user_updated_time'?: number - 'file_extension'?: string - 'encryption_cipher_text'?: string - 'encryption_applied'?: number - 'encryption_blob_encrypted'?: number - 'size'?: number - 'is_shared'?: number + 'id'?: string | null; + 'title'?: string; + 'mime'?: string; + 'filename'?: string; + 'created_time'?: number; + 'updated_time'?: number; + 'user_created_time'?: number; + 'user_updated_time'?: number; + 'file_extension'?: string; + 'encryption_cipher_text'?: string; + 'encryption_applied'?: number; + 'encryption_blob_encrypted'?: number; + 'size'?: number; + 'is_shared'?: number; } export interface ResourcesToDownloadEntity { - 'id'?: number | null - 'resource_id'?: string - 'updated_time'?: number - 'created_time'?: number + 'id'?: number | null; + 'resource_id'?: string; + 'updated_time'?: number; + 'created_time'?: number; } export interface RevisionEntity { - 'id'?: string | null - 'parent_id'?: string - 'item_type'?: number - 'item_id'?: string - 'item_updated_time'?: number - 'title_diff'?: string - 'body_diff'?: string - 'metadata_diff'?: string - 'encryption_cipher_text'?: string - 'encryption_applied'?: number - 'updated_time'?: number - 'created_time'?: number + 'id'?: string | null; + 'parent_id'?: string; + 'item_type'?: number; + 'item_id'?: string; + 'item_updated_time'?: number; + 'title_diff'?: string; + 'body_diff'?: string; + 'metadata_diff'?: string; + 'encryption_cipher_text'?: string; + 'encryption_applied'?: number; + 'updated_time'?: number; + 'created_time'?: number; } export interface SettingEntity { - 'key'?: string | null - 'value'?: string | null + 'key'?: string | null; + 'value'?: string | null; } export interface SyncItemEntity { - 'id'?: number | null - 'sync_target'?: number - 'sync_time'?: number - 'item_type'?: number - 'item_id'?: string - 'sync_disabled'?: number - 'sync_disabled_reason'?: string - 'force_sync'?: number - 'item_location'?: number + 'id'?: number | null; + 'sync_target'?: number; + 'sync_time'?: number; + 'item_type'?: number; + 'item_id'?: string; + 'sync_disabled'?: number; + 'sync_disabled_reason'?: string; + 'force_sync'?: number; + 'item_location'?: number; } export interface TableFieldEntity { - 'id'?: number | null - 'table_name'?: string - 'field_name'?: string - 'field_type'?: number - 'field_default'?: string | null + 'id'?: number | null; + 'table_name'?: string; + 'field_name'?: string; + 'field_type'?: number; + 'field_default'?: string | null; } export interface TagEntity { - 'id'?: string | null - 'title'?: string - 'created_time'?: number - 'updated_time'?: number - 'user_created_time'?: number - 'user_updated_time'?: number - 'encryption_cipher_text'?: string - 'encryption_applied'?: number - 'is_shared'?: number - 'parent_id'?: string + 'id'?: string | null; + 'title'?: string; + 'created_time'?: number; + 'updated_time'?: number; + 'user_created_time'?: number; + 'user_updated_time'?: number; + 'encryption_cipher_text'?: string; + 'encryption_applied'?: number; + 'is_shared'?: number; + 'parent_id'?: string; } export interface TagsWithNoteCountEntity { - 'id'?: string | null - 'title'?: string | null - 'created_time'?: number | null - 'updated_time'?: number | null - 'note_count'?: any | null + 'id'?: string | null; + 'title'?: string | null; + 'created_time'?: number | null; + 'updated_time'?: number | null; + 'note_count'?: any | null; } export interface VersionEntity { - 'version'?: number - 'table_fields_version'?: number + 'version'?: number; + 'table_fields_version'?: number; } diff --git a/packages/lib/services/interop/InteropService_Importer_Base.ts b/packages/lib/services/interop/InteropService_Importer_Base.ts index 82e5ddeda..a18334634 100644 --- a/packages/lib/services/interop/InteropService_Importer_Base.ts +++ b/packages/lib/services/interop/InteropService_Importer_Base.ts @@ -7,7 +7,7 @@ const Setting = require('../../models/Setting').default; export default class InteropService_Importer_Base { private metadata_: any = null; protected sourcePath_: string = ''; - protected options_: any = {} + protected options_: any = {}; setMetadata(md: any) { this.metadata_ = md; diff --git a/packages/lib/services/interop/types.ts b/packages/lib/services/interop/types.ts index 172759c4a..9dfa600fc 100644 --- a/packages/lib/services/interop/types.ts +++ b/packages/lib/services/interop/types.ts @@ -1,14 +1,14 @@ import { _ } from '../../locale'; export interface CustomImportContext { - sourcePath: string, - options: ImportOptions, - warnings: string[], + sourcePath: string; + options: ImportOptions; + warnings: string[]; } export interface CustomExportContext { - destPath: string, - options: ExportOptions, + destPath: string; + options: ExportOptions; } export enum ModuleType { @@ -34,32 +34,32 @@ export interface Module { // Shared properties // --------------------------------------- - type: ModuleType, - format: string, - fileExtensions: string[], - description: string, - path?: string, + type: ModuleType; + format: string; + fileExtensions: string[]; + description: string; + path?: string; // Only applies to single file exporters or importers // It tells whether the format can package multiple notes into one file. // For example JEX or ENEX can, but HTML cannot. // Default: true. - isNoteArchive?: boolean, + isNoteArchive?: boolean; // A custom module is one that was not hard-coded, that was created at runtime // by a plugin for example. If `isCustom` is `true` if it is expected that all // the event handlers below are defined (it's enforced by the plugin API). - isCustom?: boolean, + isCustom?: boolean; // --------------------------------------- // Import-only properties // --------------------------------------- - sources?: FileSystemItem[], - importerClass?: string, - outputFormat?: ImportModuleOutputFormat, - isDefault?: boolean, - fullLabel?: Function, + sources?: FileSystemItem[]; + importerClass?: string; + outputFormat?: ImportModuleOutputFormat; + isDefault?: boolean; + fullLabel?: Function; // Used only if `isCustom` is true onExec?(context: any): Promise; @@ -68,7 +68,7 @@ export interface Module { // Export-only properties // --------------------------------------- - target?: FileSystemItem, + target?: FileSystemItem; // Used only if `isCustom` is true onInit?(context: any): Promise; @@ -78,25 +78,25 @@ export interface Module { } export interface ImportOptions { - path?: string, - format?: string - modulePath?: string, - destinationFolderId?: string, - destinationFolder?: any, - outputFormat?: ImportModuleOutputFormat, + path?: string; + format?: string; + modulePath?: string; + destinationFolderId?: string; + destinationFolder?: any; + outputFormat?: ImportModuleOutputFormat; } export interface ExportOptions { - format?: string, - path?: string, - sourceFolderIds?: string[], - sourceNoteIds?: string[], - modulePath?: string, - target?: FileSystemItem, + format?: string; + path?: string; + sourceFolderIds?: string[]; + sourceNoteIds?: string[]; + modulePath?: string; + target?: FileSystemItem; } export interface ImportExportResult { - warnings: string[], + warnings: string[]; } function moduleFullLabel(moduleSource: FileSystemItem = null): string { diff --git a/packages/lib/services/plugins/Plugin.ts b/packages/lib/services/plugins/Plugin.ts index fe380486c..028e60187 100644 --- a/packages/lib/services/plugins/Plugin.ts +++ b/packages/lib/services/plugins/Plugin.ts @@ -7,12 +7,12 @@ import Logger from '../../Logger'; const EventEmitter = require('events'); interface ViewControllers { - [key: string]: ViewController + [key: string]: ViewController; } export interface ContentScript { - id: string, - path: string, + id: string; + path: string; } interface ContentScripts { diff --git a/packages/lib/services/plugins/PluginService.ts b/packages/lib/services/plugins/PluginService.ts index 8d3807c8c..96f7a38e7 100644 --- a/packages/lib/services/plugins/PluginService.ts +++ b/packages/lib/services/plugins/PluginService.ts @@ -8,7 +8,7 @@ const { filename, dirname } = require('../../path-utils'); const uslug = require('uslug'); interface Plugins { - [key: string]: Plugin + [key: string]: Plugin; } function makePluginId(source: string): string { diff --git a/packages/lib/services/plugins/WebviewController.ts b/packages/lib/services/plugins/WebviewController.ts index 66ce65563..30de94011 100644 --- a/packages/lib/services/plugins/WebviewController.ts +++ b/packages/lib/services/plugins/WebviewController.ts @@ -9,7 +9,7 @@ export enum ContainerType { } export interface Options { - containerType: ContainerType, + containerType: ContainerType; } interface CloseResponse { diff --git a/packages/lib/services/plugins/api/types.ts b/packages/lib/services/plugins/api/types.ts index d97a99af9..e4da32369 100644 --- a/packages/lib/services/plugins/api/types.ts +++ b/packages/lib/services/plugins/api/types.ts @@ -6,7 +6,7 @@ export interface Command { /** * Name of command - must be globally unique */ - name: string + name: string; /** * Label to be displayed on menu items or keyboard shortcut editor for example. @@ -14,17 +14,17 @@ export interface Command { * In that case the command will not appear in the shortcut editor or command panel, and logically * should not be used as a menu item. */ - label?: string + label?: string; /** * Icon to be used on toolbar buttons for example */ - iconName?: string, + iconName?: string; /** * Code to be ran when the command is executed. It may return a result. */ - execute(...args: any[]): Promise + execute(...args: any[]): Promise; /** * Defines whether the command should be enabled or disabled, which in turns affects @@ -44,7 +44,7 @@ export interface Command { * * Note: Commands are enabled by default unless you use this property. */ - enabledCondition?: string + enabledCondition?: string; } // ================================================================= @@ -72,29 +72,29 @@ export interface ExportModule { /** * The format to be exported, eg "enex", "jex", "json", etc. */ - format: string, + format: string; /** * The description that will appear in the UI, for example in the menu item. */ - description: string, + description: string; /** * Whether the module will export a single file or multiple files in a directory. It affects the open dialog that will be presented to the user when using your exporter. */ - target: FileSystemItem, + target: FileSystemItem; /** * Only applies to single file exporters or importers * It tells whether the format can package multiple notes into one file. * For example JEX or ENEX can, but HTML cannot. */ - isNoteArchive: boolean, + isNoteArchive: boolean; /** * The extensions of the files exported by your module. For example, it is `["htm", "html"]` for the HTML module, and just `["jex"]` for the JEX module. */ - fileExtensions?: string[], + fileExtensions?: string[]; /** * Called when the export process starts. @@ -121,34 +121,34 @@ export interface ImportModule { /** * The format to be exported, eg "enex", "jex", "json", etc. */ - format: string, + format: string; /** * The description that will appear in the UI, for example in the menu item. */ - description: string, + description: string; /** * Only applies to single file exporters or importers * It tells whether the format can package multiple notes into one file. * For example JEX or ENEX can, but HTML cannot. */ - isNoteArchive: boolean, + isNoteArchive: boolean; /** * The type of sources that are supported by the module. Tells whether the module can import files or directories or both. */ - sources: FileSystemItem[], + sources: FileSystemItem[]; /** * Tells the file extensions of the exported files. */ - fileExtensions?: string[], + fileExtensions?: string[]; /** * Tells the type of notes that will be generated, either HTML or Markdown (default). */ - outputFormat?: ImportModuleOutputFormat, + outputFormat?: ImportModuleOutputFormat; /** * Called when the import process starts. There is only one event handler within which you should import the complete data. @@ -157,28 +157,28 @@ export interface ImportModule { } export interface ExportOptions { - format?: string, - path?: string, - sourceFolderIds?: string[], - sourceNoteIds?: string[], - modulePath?: string, - target?: FileSystemItem, + format?: string; + path?: string; + sourceFolderIds?: string[]; + sourceNoteIds?: string[]; + modulePath?: string; + target?: FileSystemItem; } export interface ExportContext { - destPath: string, - options: ExportOptions, + destPath: string; + options: ExportOptions; /** * You can attach your own custom data using this propery - it will then be passed to each event handler, allowing you to keep state from one event to the next. */ - userData?: any, + userData?: any; } export interface ImportContext { - sourcePath: string, - options: any, - warnings: string[], + sourcePath: string; + options: any; + warnings: string[]; } // ================================================================= @@ -186,7 +186,7 @@ export interface ImportContext { // ================================================================= export interface Script { - onStart?(event: any): Promise, + onStart?(event: any): Promise; } // ================================================================= @@ -194,7 +194,7 @@ export interface Script { // ================================================================= export interface CreateMenuItemOptions { - accelerator: string, + accelerator: string; } export enum MenuItemLocation { @@ -212,22 +212,22 @@ export interface MenuItem { * Command that should be associated with the menu item. All menu item should * have a command associated with them unless they are a sub-menu. */ - commandName?: string, + commandName?: string; /** * Accelerator associated with the menu item */ - accelerator?: string, + accelerator?: string; /** * Menu items that should appear below this menu item. Allows creating a menu tree. */ - submenu?: MenuItem[], + submenu?: MenuItem[]; /** * Menu item label. If not specified, the command label will be used instead. */ - label?: string, + label?: string; } // ================================================================= @@ -235,9 +235,9 @@ export interface MenuItem { // ================================================================= export interface ButtonSpec { - id: ButtonId, - title?: string, - onClick?(): void, + id: ButtonId; + title?: string; + onClick?(): void; } export type ButtonId = string; @@ -277,28 +277,28 @@ export enum SettingItemType { // Redefine a simplified interface to mask internal details // and to remove function calls as they would have to be async. export interface SettingItem { - value: any, - type: SettingItemType, - public: boolean, - label: string, + value: any; + type: SettingItemType; + public: boolean; + label: string; - description?: string, - isEnum?: boolean, - section?: string, - options?: any, - appTypes?: string[], - secure?: boolean, - advanced?: boolean, - minimum?: number, - maximum?: number, - step?: number, + description?: string; + isEnum?: boolean; + section?: string; + options?: any; + appTypes?: string[]; + secure?: boolean; + advanced?: boolean; + minimum?: number; + maximum?: number; + step?: number; } export interface SettingSection { - label: string, - iconName?: string, - description?: string, - name?: string, + label: string; + iconName?: string; + description?: string; + name?: string; } // ================================================================= diff --git a/packages/lib/services/plugins/reducer.ts b/packages/lib/services/plugins/reducer.ts index c1750ec70..0eba22ea0 100644 --- a/packages/lib/services/plugins/reducer.ts +++ b/packages/lib/services/plugins/reducer.ts @@ -1,22 +1,22 @@ import { Draft } from 'immer'; export interface ViewInfo { - view: any, - plugin: any, + view: any; + plugin: any; } interface PluginViewState { - id: string, - type: string, + id: string; + type: string; } interface PluginViewStates { - [key: string]: PluginViewState, + [key: string]: PluginViewState; } interface PluginContentScriptState { - id: string, - path: string, + id: string; + path: string; } interface PluginContentScriptStates { @@ -24,9 +24,9 @@ interface PluginContentScriptStates { } interface PluginState { - id: string, - contentScripts: PluginContentScriptStates, - views: PluginViewStates, + id: string; + contentScripts: PluginContentScriptStates; + views: PluginViewStates; } export interface PluginStates { @@ -34,7 +34,7 @@ export interface PluginStates { } export interface State { - plugins: PluginStates, + plugins: PluginStates; } export const stateRootKey = 'pluginService'; diff --git a/packages/lib/services/plugins/utils/types.ts b/packages/lib/services/plugins/utils/types.ts index 4555a4550..2b0583111 100644 --- a/packages/lib/services/plugins/utils/types.ts +++ b/packages/lib/services/plugins/utils/types.ts @@ -3,10 +3,10 @@ export enum PluginPermission { } export interface PluginManifest { - manifest_version: number, - name: string, - version: string, - description?: string, - homepage_url?: string, - permissions?: PluginPermission[], + manifest_version: number; + name: string; + version: string; + description?: string; + homepage_url?: string; + permissions?: PluginPermission[]; } diff --git a/packages/lib/services/rest/Api.ts b/packages/lib/services/rest/Api.ts index 995ca954d..60d07cdc7 100644 --- a/packages/lib/services/rest/Api.ts +++ b/packages/lib/services/rest/Api.ts @@ -20,37 +20,37 @@ export enum RequestMethod { } interface RequestFile { - path: string, + path: string; } interface RequestQuery { - fields?: string[] | string, - token?: string, - nounce?: string, - page?: number, + fields?: string[] | string; + token?: string; + nounce?: string; + page?: number; // Search engine query - query?: string, - type?: string, // Model type as a string (eg. "note", "folder") + query?: string; + type?: string; // Model type as a string (eg. "note", "folder") - as_tree?: number, + as_tree?: number; // Pagination - limit?: number, - order_dir?: PaginationOrderDir, - order_by?: string, + limit?: number; + order_dir?: PaginationOrderDir; + order_by?: string; } export interface Request { - method: RequestMethod, - path: string, - query: RequestQuery, - body: any, - bodyJson_: any, - bodyJson: any, - files: RequestFile[], - params: any[], - action?: any, + method: RequestMethod; + path: string; + query: RequestQuery; + body: any; + bodyJson_: any; + bodyJson: any; + files: RequestFile[]; + params: any[]; + action?: any; } type RouteFunction = (request: Request, id: string, link: string)=> Promise; diff --git a/packages/lib/services/searchengine/filterParser.ts b/packages/lib/services/searchengine/filterParser.ts index 3cc0edad5..2e9b01ea4 100644 --- a/packages/lib/services/searchengine/filterParser.ts +++ b/packages/lib/services/searchengine/filterParser.ts @@ -1,10 +1,10 @@ interface Term { - name: string - value: string - negated: boolean - quoted?: boolean - wildcard?: boolean + name: string; + value: string; + negated: boolean; + quoted?: boolean; + wildcard?: boolean; } const makeTerm = (name: string, value: string): Term => { diff --git a/packages/lib/services/searchengine/queryBuilder.ts b/packages/lib/services/searchengine/queryBuilder.ts index 80692066c..643f8a2db 100644 --- a/packages/lib/services/searchengine/queryBuilder.ts +++ b/packages/lib/services/searchengine/queryBuilder.ts @@ -1,9 +1,9 @@ const time = require('../../time').default; interface Term { - name: string - value: string - negated: boolean + name: string; + value: string; + negated: boolean; } enum Relation { diff --git a/packages/lib/services/synchronizer/LockHandler.ts b/packages/lib/services/synchronizer/LockHandler.ts index dce52af94..bf3ba008f 100644 --- a/packages/lib/services/synchronizer/LockHandler.ts +++ b/packages/lib/services/synchronizer/LockHandler.ts @@ -12,15 +12,15 @@ export enum LockType { } export interface Lock { - type: LockType, - clientType: string, - clientId: string, - updatedTime?: number, + type: LockType; + clientType: string; + clientId: string; + updatedTime?: number; } interface RefreshTimer { - id: any, - inProgress: boolean + id: any; + inProgress: boolean; } interface RefreshTimers { @@ -28,8 +28,8 @@ interface RefreshTimers { } export interface LockHandlerOptions { - autoRefreshInterval?: number, - lockTtl?: number, + autoRefreshInterval?: number; + lockTtl?: number; } export default class LockHandler { diff --git a/packages/lib/services/synchronizer/MigrationHandler.ts b/packages/lib/services/synchronizer/MigrationHandler.ts index cb62c340c..6960532cc 100644 --- a/packages/lib/services/synchronizer/MigrationHandler.ts +++ b/packages/lib/services/synchronizer/MigrationHandler.ts @@ -18,7 +18,7 @@ const { sprintf } = require('sprintf-js'); const JoplinError = require('../../JoplinError'); interface SyncTargetInfo { - version: number, + version: number; } export default class MigrationHandler extends BaseService { diff --git a/packages/lib/services/synchronizer/gui/useSyncTargetUpgrade.ts b/packages/lib/services/synchronizer/gui/useSyncTargetUpgrade.ts index 8e21f0bd1..5404a69f7 100644 --- a/packages/lib/services/synchronizer/gui/useSyncTargetUpgrade.ts +++ b/packages/lib/services/synchronizer/gui/useSyncTargetUpgrade.ts @@ -5,8 +5,8 @@ const Setting = require('../../../models/Setting').default; const { reg } = require('../../../registry'); export interface SyncTargetUpgradeResult { - done: boolean, - error: any, + done: boolean; + error: any; } export default function useSyncTargetUpgrade(): SyncTargetUpgradeResult { diff --git a/packages/lib/themes/type.ts b/packages/lib/themes/type.ts index 14e88da8f..b85d9e777 100644 --- a/packages/lib/themes/type.ts +++ b/packages/lib/themes/type.ts @@ -4,54 +4,54 @@ export enum ThemeAppearance { } export interface Theme { - appearance: ThemeAppearance, + appearance: ThemeAppearance; // Color scheme "1" is the basic one, like used to display the note // content. It's basically dark gray text on white background - backgroundColor: string, - backgroundColorTransparent: string, - oddBackgroundColor: string, - color: string, // For regular text - colorError: string, - colorWarn: string, - colorFaded: string, // For less important text - colorBright: string, // For important text - dividerColor: string, - selectedColor: string, - urlColor: string, + backgroundColor: string; + backgroundColorTransparent: string; + oddBackgroundColor: string; + color: string; // For regular text + colorError: string; + colorWarn: string; + colorFaded: string; // For less important text + colorBright: string; // For important text + dividerColor: string; + selectedColor: string; + urlColor: string; // Color scheme "2" is used for the sidebar. It's white text over // dark blue background. - backgroundColor2: string, - color2: string, - selectedColor2: string, - colorError2: string, + backgroundColor2: string; + color2: string; + selectedColor2: string; + colorError2: string; // Color scheme "3" is used for the config screens for example/ // It's dark text over gray background. - backgroundColor3: string, - backgroundColorHover3: string, - color3: string, + backgroundColor3: string; + backgroundColorHover3: string; + color3: string; // Color scheme "4" is used for secondary-style buttons. It makes a white // button with blue text. - backgroundColor4: string, - color4: string, + backgroundColor4: string; + color4: string; - raisedBackgroundColor: string, - raisedColor: string, - searchMarkerBackgroundColor: string, - searchMarkerColor: string, + raisedBackgroundColor: string; + raisedColor: string; + searchMarkerBackgroundColor: string; + searchMarkerColor: string; - warningBackgroundColor: string, + warningBackgroundColor: string; - tableBackgroundColor: string, - codeBackgroundColor: string, - codeBorderColor: string, - codeColor: string, + tableBackgroundColor: string; + codeBackgroundColor: string; + codeBorderColor: string; + codeColor: string; - codeMirrorTheme: string, - codeThemeCss: string, + codeMirrorTheme: string; + codeThemeCss: string; - highlightedColor?: string, + highlightedColor?: string; } diff --git a/packages/renderer/InMemoryCache.ts b/packages/renderer/InMemoryCache.ts index 73f55a94c..d70874d96 100644 --- a/packages/renderer/InMemoryCache.ts +++ b/packages/renderer/InMemoryCache.ts @@ -10,8 +10,8 @@ // scale. interface Record { - value: any, - expiredTime: number, + value: any; + expiredTime: number; } interface Records { @@ -19,7 +19,7 @@ interface Records { } interface ExpirableKeys { - [key: string]: boolean, + [key: string]: boolean; } export default class Cache { diff --git a/packages/renderer/MdToHtml.ts b/packages/renderer/MdToHtml.ts index c052c4044..ca3484b7a 100644 --- a/packages/renderer/MdToHtml.ts +++ b/packages/renderer/MdToHtml.ts @@ -6,22 +6,22 @@ const MarkdownIt = require('markdown-it'); const md5 = require('md5'); interface RendererRule { - install(context: any, ruleOptions: any): any, - assets?(theme: any): any, - plugin?: any, + install(context: any, ruleOptions: any): any; + assets?(theme: any): any; + plugin?: any; } interface RendererRules { - [pluginName: string]: RendererRule, + [pluginName: string]: RendererRule; } interface RendererPlugin { - module: any, - options?: any, + module: any; + options?: any; } interface RendererPlugins { - [pluginName: string]: RendererPlugin, + [pluginName: string]: RendererPlugin; } // /!\/!\ Note: the order of rules is important!! /!\/!\ @@ -68,24 +68,24 @@ function slugify(s: string): string { const inMemoryCache = new InMemoryCache(20); export interface ExtraRendererRule { - id: string, - module: any, + id: string; + module: any; } export interface Options { - resourceBaseUrl?: string, - ResourceModel?: any, - pluginOptions?: any, - tempDir?: string, - fsDriver?: any, - extraRendererRules?: ExtraRendererRule[], + resourceBaseUrl?: string; + ResourceModel?: any; + pluginOptions?: any; + tempDir?: string; + fsDriver?: any; + extraRendererRules?: ExtraRendererRule[]; } interface PluginAsset { - mime?: string, - inline?: boolean, - name?: string, - text?: string, + mime?: string; + inline?: boolean; + name?: string; + text?: string; } // Types are a bit of a mess when it comes to plugin assets. Something @@ -96,55 +96,55 @@ interface PluginAssets { } interface PluginContext { - css: any - pluginAssets: any, - cache: any, - userData: any, + css: any; + pluginAssets: any; + cache: any; + userData: any; } interface RenderResultPluginAsset { - name: string, - path: string, - mime: string, + name: string; + path: string; + mime: string; } interface RenderResult { - html: string, + html: string; pluginAssets: RenderResultPluginAsset[]; - cssStrings: string[], + cssStrings: string[]; } export interface RuleOptions { - context: PluginContext, - theme: any, - postMessageSyntax: string, - ResourceModel: any, - resourceBaseUrl: string, - resources: any, // resourceId: Resource + context: PluginContext; + theme: any; + postMessageSyntax: string; + ResourceModel: any; + resourceBaseUrl: string; + resources: any; // resourceId: Resource // Used by checkboxes to specify how it should be rendered - checkboxRenderingType?: number, + checkboxRenderingType?: number; // Used by the keyword highlighting plugin (mobile only) - highlightedKeywords?: any[], + highlightedKeywords?: any[]; // Use by resource-rendering logic to signify that it should be rendered // as a plain HTML string without any attached JavaScript. Used for example // when exporting to HTML. - plainResourceRendering?: boolean, + plainResourceRendering?: boolean; // Use in mobile app to enable long-pressing an image or a linkg // to display a context menu. Used in `image.ts` and `link_open.ts` - enableLongPress?: boolean, + enableLongPress?: boolean; // Used in mobile app when enableLongPress = true. Tells for how long // the resource should be pressed before the menu is shown. - longPressDelay?: number, + longPressDelay?: number; // Use by `link_open` rule. // linkRenderingType = 1 is the regular rendering and clicking on it is handled via embedded JS (in onclick attribute) // linkRenderingType = 2 gives a plain link with no JS. Caller needs to handle clicking on the link. - linkRenderingType?: number, + linkRenderingType?: number; } export default class MdToHtml {