1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Converted models and services to TypeScript

This commit is contained in:
Laurent Cozic
2021-01-22 17:41:11 +00:00
parent c895f7cd4f
commit 86610e7561
237 changed files with 1568 additions and 1443 deletions

View File

@@ -1,8 +1,8 @@
import paginationToSql from './models/utils/paginationToSql';
const { Database } = require('./database.js');
const uuid = require('./uuid').default;
const time = require('./time').default;
import uuid from './uuid';
import time from './time';
const Mutex = require('async-mutex').Mutex;
// New code should make use of this enum
@@ -344,7 +344,7 @@ class BaseModel {
return this.modelSelectOne(sql, [fieldValue]);
}
static loadByFields(fields: string[], options: any = null) {
static loadByFields(fields: any, options: any = null) {
if (!options) options = {};
if (!('caseInsensitive' in options)) options.caseInsensitive = false;
if (!options.fields) options.fields = '*';
@@ -644,9 +644,9 @@ class BaseModel {
return this.db_;
}
static isReady() {
return !!this.db_;
}
// static isReady() {
// return !!this.db_;
// }
}
for (let i = 0; i < BaseModel.typeEnum_.length; i++) {