toi cam thay minh la sieu nhan

This commit is contained in:
2024-11-15 18:18:37 +07:00
parent ff45e69efd
commit 7e4a4283e6
12 changed files with 499 additions and 12 deletions

View File

@@ -0,0 +1,42 @@
import { forwardRef, Inject, Injectable } from '@nestjs/common'
import Delta, { Op } from 'quill-delta'
import { MinioService } from '../Minio/minio.service'
import { DocumentDelta } from './document.type'
import { JSDOM } from 'jsdom'
@Injectable()
export class DocumentService {
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
private quill: any
constructor(
private readonly minio: MinioService,
public document: JSDOM,
) {
;(async () => {
await this.loadQuill()
})()
}
private async loadQuill() {
if (typeof window === 'undefined' || typeof document === 'undefined') {
const { window } = new JSDOM('<!doctype html><html><body></body></html>')
const { navigator } = window
const { Node } = window
global.window = window
global.document = window.document
global.navigator = navigator
global.Node = Node
}
const { default: Quill } = await import('quill')
this.quill = Quill
}
async handleOnChange(delta: DocumentDelta) {}
async handleOnSave() {}
async handleOnSync() {}
async requestSync() {}
}