1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Tools: Fixed TSC compile error

This commit is contained in:
Laurent Cozic
2021-10-14 16:34:53 +01:00
parent 47fc51ea8a
commit 0ccd8dee41
3 changed files with 12 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
import { ModelType } from '../BaseModel';
import { ModelType, DeleteOptions } from '../BaseModel';
import { BaseItemEntity, NoteEntity } from '../services/database/types';
import Setting from './Setting';
import BaseModel from '../BaseModel';
@@ -240,7 +240,7 @@ export default class BaseItem extends BaseModel {
return this.batchDelete([id], options);
}
static async batchDelete(ids: string[], options: any = null) {
static async batchDelete(ids: string[], options: DeleteOptions = null) {
if (!options) options = {};
let trackDeleted = true;
if (options && options.trackDeleted !== null && options.trackDeleted !== undefined) trackDeleted = options.trackDeleted;

View File

@@ -1,5 +1,5 @@
import { FolderEntity } from '../services/database/types';
import BaseModel from '../BaseModel';
import BaseModel, { DeleteOptions } from '../BaseModel';
import time from '../time';
import { _ } from '../locale';
import Note from './Note';
@@ -16,16 +16,6 @@ interface FolderEntityWithChildren extends FolderEntity {
children?: FolderEntity[];
}
export interface DeleteOptions {
deleteChildren?: boolean;
}
const defaultDeleteOptions = (): DeleteOptions => {
return {
deleteChildren: true,
};
};
export default class Folder extends BaseItem {
static tableName() {
return 'folders';
@@ -90,7 +80,7 @@ export default class Folder extends BaseItem {
public static async delete(folderId: string, options: DeleteOptions = null) {
options = {
...defaultDeleteOptions(),
deleteChildren: true,
...options,
};