1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Chore: Desktop: Fix eslint issues and strengthen types in NoteEditor.tsx (#10449)

This commit is contained in:
Henry Heino
2024-05-20 17:28:19 -07:00
committed by GitHub
parent c632ea5c48
commit 652add9af2
13 changed files with 162 additions and 118 deletions

View File

@ -1,4 +1,4 @@
import { useState, useEffect, useCallback } from 'react';
import { useState, useEffect, useCallback, RefObject } from 'react';
import { FormNote, defaultFormNote, ResourceInfos } from './types';
import { clearResourceCache, attachedResources } from './resourceHandling';
import AsyncActionQueue from '@joplin/lib/AsyncActionQueue';
@ -25,14 +25,15 @@ export interface HookDependencies {
decryptionStarted: boolean;
noteId: string;
isProvisional: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
titleInputRef: any;
titleInputRef: RefObject<HTMLInputElement>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
editorRef: any;
onBeforeLoad(event: OnLoadEvent): void;
onAfterLoad(event: OnLoadEvent): void;
}
export type SetFormNote = ReturnType<typeof useState<FormNote>>[1];
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
function installResourceChangeHandler(onResourceChangeHandler: Function) {
ResourceFetcher.instance().on('downloadComplete', onResourceChangeHandler);