@@ -6,7 +6,11 @@ import {Note, Revision, NoteAttributes} from "../models";
66
77const dmp = new DiffMatchPatch ( )
88
9- export function checkAllNotesRevision ( callback ) {
9+ interface Callback {
10+ ( err : Error | string | null , notes ?: Note [ ] | null ) : void
11+ }
12+
13+ export function checkAllNotesRevision ( callback : Callback ) : void {
1014 saveAllNotesRevision ( function ( err , notes ) {
1115 if ( err ) return callback ( err , null )
1216 if ( ! notes || notes . length <= 0 ) {
@@ -17,7 +21,7 @@ export function checkAllNotesRevision(callback) {
1721 } )
1822}
1923
20- export function saveAllNotesRevision ( callback : any ) : void {
24+ export function saveAllNotesRevision ( callback : Callback ) : void {
2125 Note . findAll ( {
2226 // query all notes that need to save for revision
2327 where : {
@@ -43,7 +47,7 @@ export function saveAllNotesRevision(callback: any): void {
4347 }
4448 ]
4549 }
46- } ) . then ( function ( notes ) {
50+ } ) . then ( function ( notes : Note [ ] ) {
4751 if ( notes . length <= 0 ) return callback ( null , notes )
4852 const savedNotes = [ ]
4953 async . each ( notes , function ( note , _callback ) {
@@ -77,7 +81,7 @@ export function saveAllNotesRevision(callback: any): void {
7781 } )
7882}
7983
80- export async function syncNote ( noteInFS , note ) : Promise < string > {
84+ export async function syncNote ( noteInFS : Partial < Note > , note : Note ) : Promise < string > {
8185 const contentLength = noteInFS . content . length
8286
8387 let note2 = await note . update ( {
0 commit comments