mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Fix build errors
This commit is contained in:
parent
0daa4cc89a
commit
e96b56e061
@ -7,7 +7,7 @@ import importUtils = require('./utils');
|
||||
function renderToHtml(content: string, title: string) {
|
||||
const html = marked.parse(content, {
|
||||
async: false
|
||||
}); // FIXME: mangle and headerIds does not seem to exist in marked
|
||||
}) as string; // FIXME: mangle and headerIds does not seem to exist in marked
|
||||
const h1Handled = importUtils.handleH1(html, title); // h1 handling needs to come before sanitization
|
||||
return htmlSanitizer.sanitize(h1Handled);
|
||||
}
|
||||
|
@ -1,18 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
import { TaskData } from './task_context_interface';
|
||||
import ws = require('./ws');
|
||||
|
||||
// taskId => TaskContext
|
||||
const taskContexts: Record<string, TaskContext> = {};
|
||||
|
||||
interface TaskData {
|
||||
safeImport?: boolean;
|
||||
textImportedAsText?: boolean;
|
||||
codeImportedAsCode?: boolean;
|
||||
shrinkImages?: boolean;
|
||||
replaceUnderscoresWithSpaces?: boolean;
|
||||
}
|
||||
|
||||
class TaskContext {
|
||||
|
||||
private taskId: string;
|
||||
|
7
src/services/task_context_interface.ts
Normal file
7
src/services/task_context_interface.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export interface TaskData {
|
||||
safeImport?: boolean;
|
||||
textImportedAsText?: boolean;
|
||||
codeImportedAsCode?: boolean;
|
||||
shrinkImages?: boolean;
|
||||
replaceUnderscoresWithSpaces?: boolean;
|
||||
}
|
@ -12,6 +12,8 @@ import AbstractBeccaEntity = require('../becca/entities/abstract_becca_entity');
|
||||
import env = require('./env');
|
||||
import { IncomingMessage, Server } from 'http';
|
||||
import { EntityChange } from './entity_changes_interface';
|
||||
import { TaskData } from './task_context_interface';
|
||||
|
||||
if (env.isDev()) {
|
||||
const chokidar = require('chokidar');
|
||||
const debounce = require('debounce');
|
||||
@ -28,10 +30,9 @@ let lastSyncedPush: number | null = null;
|
||||
|
||||
interface Message {
|
||||
type: string;
|
||||
data?: {
|
||||
data?: TaskData | null | {
|
||||
lastSyncedPush?: number | null,
|
||||
entityChanges?: any[],
|
||||
safeImport?: boolean
|
||||
},
|
||||
lastSyncedPush?: number | null,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user