1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +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

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