server-ts: Fix build errors

This commit is contained in:
Elian Doran 2024-04-03 00:02:51 +03:00
parent 0daa4cc89a
commit e96b56e061
No known key found for this signature in database
4 changed files with 12 additions and 11 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -0,0 +1,7 @@
export interface TaskData {
safeImport?: boolean;
textImportedAsText?: boolean;
codeImportedAsCode?: boolean;
shrinkImages?: boolean;
replaceUnderscoresWithSpaces?: boolean;
}

View File

@ -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,