1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Chore: Strengthen eventManager types (#10505)

This commit is contained in:
Henry Heino
2024-05-28 03:24:20 -07:00
committed by GitHub
parent 300d0e3ca5
commit 97274c95a5
7 changed files with 76 additions and 27 deletions

View File

@ -35,12 +35,6 @@ interface ItemChangeEvent {
event: ItemChangeEventType;
}
interface SyncStartEvent {
// Tells whether there were errors during sync or not. The log will
// have the complete information about any error.
withErrors: boolean;
}
interface ResourceChangeEvent {
id: string;
}
@ -59,13 +53,15 @@ interface NoteAlarmTriggerEvent {
}
interface SyncCompleteEvent {
// Tells whether there were errors during sync or not. The log will
// have the complete information about any error.
withErrors: boolean;
}
type WorkspaceEventHandler<EventType> = (event: EventType)=> void;
type ItemChangeHandler = WorkspaceEventHandler<ItemChangeEvent>;
type SyncStartHandler = WorkspaceEventHandler<SyncStartEvent>;
type SyncStartHandler = ()=> void;
type ResourceChangeHandler = WorkspaceEventHandler<ResourceChangeEvent>;
/**