server-esm: Solve some more imports

This commit is contained in:
Elian Doran
2024-07-18 22:58:12 +03:00
parent 4ed88d28e9
commit f4d19e2bc1
11 changed files with 66 additions and 55 deletions

View File

@@ -7,7 +7,7 @@ import BBranch from '../becca/entities/bbranch';
import becca from '../becca/becca';
import log from './log';
interface CloneResponse {
export interface CloneResponse {
success: boolean;
message?: string;
branchId?: string;
@@ -53,7 +53,7 @@ function cloneNoteToParentNote(noteId: string, parentNoteId: string, prefix: str
};
}
function cloneNoteToBranch(noteId: string, parentBranchId: string, prefix: string) {
function cloneNoteToBranch(noteId: string, parentBranchId: string, prefix?: string) {
const parentBranch = becca.getBranch(parentBranchId);
if (!parentBranch) {

View File

@@ -12,6 +12,7 @@ import sanitizeAttributeName from "../sanitize_attribute_name.js";
import TaskContext from "../task_context.js";
import BNote from "../../becca/entities/bnote.js";
import { File } from "./common";
import { AttributeType } from "../../becca/entities/rows.js";
/**
* date format is e.g. 20181121T193703Z or 2013-04-14T16:19:00.000Z (Mac evernote, see #3496)
@@ -29,7 +30,7 @@ function parseDate(text: string) {
}
interface Attribute {
type: string;
type: AttributeType;
name: string;
value: string;
}

View File

@@ -50,7 +50,7 @@ function checkDate(millisSinceMidnight: number) {
return millisSinceMidnight;
}
function log(str: string) {
function log(str: string | Error) {
const bundleNoteId = cls.get("bundleNoteId");
if (bundleNoteId) {
@@ -66,11 +66,11 @@ function log(str: string) {
console.log(str);
}
function info(message: string) {
function info(message: string | Error) {
log(message);
}
function error(message: string) {
function error(message: string | Error) {
log(`ERROR: ${message}`);
}

View File

@@ -18,7 +18,19 @@ import Expression from "../expressions/expression.js";
import sql from "../../sql.js";
import scriptService from "../../script.js";
function searchFromNote(note: BNote) {
export interface SearchNoteResult {
searchResultNoteIds: string[];
highlightedTokens: string[];
error: string | null;
}
export const EMPTY_RESULT: SearchNoteResult = {
searchResultNoteIds: [],
highlightedTokens: [],
error: null
};
function searchFromNote(note: BNote): SearchNoteResult {
let searchResultNoteIds;
let highlightedTokens: string[];