1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-08 13:06:15 +02:00

Tools: Apply rule @typescript-eslint/member-delimiter-style

This commit is contained in:
Laurent Cozic 2020-11-12 19:29:22 +00:00
parent 42799b0662
commit 17d835d694
103 changed files with 964 additions and 953 deletions

View File

@ -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,
},
}],
},
},
],

View File

@ -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[] = [];

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 = {

View File

@ -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 {

View File

@ -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`

View File

@ -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`

View File

@ -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`

View File

@ -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<any, any> {

View File

@ -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);

View File

@ -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) => {

View File

@ -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] => {

View File

@ -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();

View File

@ -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) {

View File

@ -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 {

View File

@ -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',

View File

@ -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) {

View File

@ -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) {

View File

@ -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: '',

View File

@ -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 = {

View File

@ -24,7 +24,7 @@ function contextMenuElement(editor: any, x: number, y: number) {
}
interface ContextMenuActionOptions {
current: ContextMenuOptions,
current: ContextMenuOptions;
}
const contextMenuActionOptions: ContextMenuActionOptions = { current: null };

View File

@ -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) {

View File

@ -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<HTMLInputElement>): void,
themeId: number;
noteUserUpdatedTime: number;
noteTitle: string;
noteIsTodo: number;
isProvisional: boolean;
titleInputRef: any;
onTitleChange(event: ChangeEvent<HTMLInputElement>): void;
}
function styles_(props: Props) {

View File

@ -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 {

View File

@ -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 {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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`

View File

@ -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<HTMLAnchorElement, 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<HTMLAnchorElement, MouseEvent>): void;
}
function NoteListItem(props: NoteListItemProps, ref: any) {

View File

@ -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<Props, any> {

View File

@ -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) {

View File

@ -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<any, any> {

View File

@ -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 {

View File

@ -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 {

View File

@ -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) => {

View File

@ -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`

View File

@ -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) {

View File

@ -12,9 +12,9 @@ const { reg } = require('@joplin/lib/registry.js');
const { clipboard } = require('electron');
interface ShareNoteDialogProps {
themeId: number,
noteIds: Array<string>,
onClose: Function,
themeId: number;
noteIds: Array<string>;
onClose: Function;
}
interface SharesMap {

View File

@ -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 = [

View File

@ -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() {

View File

@ -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) {

View File

@ -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) {

View File

@ -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<Props, any> {

View File

@ -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) {

View File

@ -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 {

View File

@ -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 {

View File

@ -1,6 +1,6 @@
import { AppState } from '../../app';
export interface DesktopCommandContext {
state: AppState,
dispatch: Function,
state: AppState;
dispatch: Function;
}

View File

@ -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 {

View File

@ -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;

View File

@ -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`

View File

@ -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`

View File

@ -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) {

View File

@ -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) {

View File

@ -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;

View File

@ -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: '' };

View File

@ -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) ?

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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) {

View File

@ -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 = {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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;
}

View File

@ -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 = {

View File

@ -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 {

View File

@ -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<any | void>
execute(context: CommandContext, ...args: any[]): Promise<any | void>;
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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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');

View File

@ -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(

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;

View File

@ -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<void>;
@ -68,7 +68,7 @@ export interface Module {
// Export-only properties
// ---------------------------------------
target?: FileSystemItem,
target?: FileSystemItem;
// Used only if `isCustom` is true
onInit?(context: any): Promise<void>;
@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -9,7 +9,7 @@ export enum ContainerType {
}
export interface Options {
containerType: ContainerType,
containerType: ContainerType;
}
interface CloseResponse {

View File

@ -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<any | void>
execute(...args: any[]): Promise<any | void>;
/**
* 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<void>,
onStart?(event: any): Promise<void>;
}
// =================================================================
@ -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;
}
// =================================================================

View File

@ -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';

View File

@ -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[];
}

View File

@ -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<any | void>;

View File

@ -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 => {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

Some files were not shown because too many files have changed in this diff Show More