Switch to typescript 5.8.3 (#9152)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-06-04 17:57:10 +05:00
committed by GitHub
parent 07c364c776
commit fcb67d20f8
562 changed files with 5212 additions and 5273 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
import { MeasureContext } from '@hcengineering/core'
import { type MeasureContext } from '@hcengineering/core'
import docx4js from 'docx4js'
import { AnyNode } from 'domhandler'
import { type AnyNode } from 'domhandler'
import extract from './extract/extract'
import { MetadataContainer, read } from './extract/types'
import importExtractedFile from './import'
import convert from './convert/convert'
import { Config } from './config'
import { type Config } from './config'
export async function importDoc (ctx: MeasureContext, config: Config): Promise<void> {
const { specFile, doc, backend } = config
+5 -5
View File
@@ -1,9 +1,9 @@
import { Employee } from '@hcengineering/contact'
import { Ref, WorkspaceDataId, WorkspaceUuid } from '@hcengineering/core'
import { DocumentSpace } from '@hcengineering/controlled-documents'
import { StorageAdapter } from '@hcengineering/server-core'
import { type Employee } from '@hcengineering/contact'
import { type Ref, type WorkspaceDataId, type WorkspaceUuid } from '@hcengineering/core'
import { type DocumentSpace } from '@hcengineering/controlled-documents'
import { type StorageAdapter } from '@hcengineering/server-core'
import { HtmlConversionBackend } from './convert/convert'
import { type HtmlConversionBackend } from './convert/convert'
export interface Config {
doc: string
+1 -1
View File
@@ -3,7 +3,7 @@ import { parseDocument } from 'htmlparser2'
import { NodeType } from './types'
import { clean } from '../helpers'
import { Cell } from './common'
import { type Cell } from './common'
export abstract class Container {
constructor (
+3 -3
View File
@@ -1,10 +1,10 @@
import { parseDocument } from 'htmlparser2'
import { AnyNode, Document } from 'domhandler'
import { type AnyNode, type Document } from 'domhandler'
import { findAll } from 'domutils'
import { FileSpec, FileSpecType, TocFileSpec } from './types'
import { type FileSpec, FileSpecType, type TocFileSpec } from './types'
import { createMetadataExtractor } from './meta'
import { ExtractedSection, TocSectionExtractor, extractSections } from './sections'
import { type ExtractedSection, TocSectionExtractor, extractSections } from './sections'
/**
* @public
+7 -7
View File
@@ -1,18 +1,18 @@
import { AnyNode, Document, Element, Text } from 'domhandler'
import { type AnyNode, type Document, type Element, type Text } from 'domhandler'
import { find } from 'domutils'
import { ElementType } from 'htmlparser2'
import {
DocMetadataSpec,
type DocMetadataSpec,
MetadataContainer,
DocTableRowMetadata,
DocMetaTagsMetadata,
PageHeaderTableRowMetadata,
MetadataTableCell
type DocTableRowMetadata,
type DocMetaTagsMetadata,
type PageHeaderTableRowMetadata,
type MetadataTableCell
} from './types'
import { ELEMENT_LIMIT } from './common'
import { TableNodeExtractor } from './nodes'
import { TableContainer } from './container'
import { type TableContainer } from './container'
interface DocMetadataExtractor {
extractName: (doc: Document) => string
+11 -3
View File
@@ -1,4 +1,4 @@
import { Document, Element, AnyNode as AnyDomNode, AnyNode } from 'domhandler'
import { type Document, type Element, type AnyNode as AnyDomNode, type AnyNode } from 'domhandler'
import { ElementType } from 'htmlparser2'
import {
compareDocumentPosition,
@@ -10,9 +10,17 @@ import {
removeSubsets
} from 'domutils'
import { NodeType, ListParams, TableParams, GenericParams, TocParaSeqParams, TagsWithTextSpec, TagsSpec } from './types'
import {
NodeType,
type ListParams,
type TableParams,
type GenericParams,
type TocParaSeqParams,
type TagsWithTextSpec,
type TagsSpec
} from './types'
import { clean, compareStrExact } from '../helpers'
import { Container, GenericContainer, ListContainer, TableContainer } from './container'
import { type Container, GenericContainer, ListContainer, TableContainer } from './container'
// Copied from domutils ambient const enums to solve 'isolatedModules' is enabled
const enum DocumentPosition {
+4 -4
View File
@@ -1,8 +1,8 @@
import { Document } from 'domhandler'
import { Markup } from '@hcengineering/core'
import { type Document } from 'domhandler'
import { type Markup } from '@hcengineering/core'
import { GenericNodeSpec, NodeType, SectionSpec, SectionType, TocSectionSpec } from './types'
import { AnyContainer, createNodeExtractor } from './nodes'
import { type GenericNodeSpec, NodeType, type SectionSpec, SectionType, type TocSectionSpec } from './types'
import { type AnyContainer, createNodeExtractor } from './nodes'
/**
* @public
+15 -15
View File
@@ -1,24 +1,24 @@
import attachment, { Attachment } from '@hcengineering/attachment'
import attachment, { type Attachment } from '@hcengineering/attachment'
import { getClient as getCollaboratorClient } from '@hcengineering/collaborator-client'
import documents, {
ChangeControl,
ControlledDocument,
type ChangeControl,
type ControlledDocument,
DEFAULT_PERIODIC_REVIEW_INTERVAL,
Document,
DocumentCategory,
type Document,
type DocumentCategory,
DocumentState,
DocumentTemplate,
type DocumentTemplate,
createChangeControl,
createControlledDocFromTemplate,
createDocumentTemplate
} from '@hcengineering/controlled-documents'
import core, {
AttachedData,
BackupClient,
Client as CoreClient,
Data,
MeasureContext,
Ref,
type AttachedData,
type BackupClient,
type Client as CoreClient,
type Data,
type MeasureContext,
type Ref,
TxOperations,
generateId,
makeDocCollabId,
@@ -30,9 +30,9 @@ import { generateToken } from '@hcengineering/server-token'
import { findAll, getOuterHTML } from 'domutils'
import { parseDocument } from 'htmlparser2'
import { Config } from './config'
import { ExtractedFile } from './extract/extract'
import { ExtractedSection } from './extract/sections'
import { type Config } from './config'
import { type ExtractedFile } from './extract/extract'
import { type ExtractedSection } from './extract/sections'
export default async function importExtractedFile (
ctx: MeasureContext,
+10 -4
View File
@@ -12,9 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
import { Employee } from '@hcengineering/contact'
import documents, { DocumentSpace } from '@hcengineering/controlled-documents'
import { MeasureMetricsContext, Ref, systemAccountUuid, WorkspaceUuid, type WorkspaceDataId } from '@hcengineering/core'
import { type Employee } from '@hcengineering/contact'
import documents, { type DocumentSpace } from '@hcengineering/controlled-documents'
import {
MeasureMetricsContext,
type Ref,
systemAccountUuid,
type WorkspaceUuid,
type WorkspaceDataId
} from '@hcengineering/core'
import { setMetadata } from '@hcengineering/platform'
import serverClientPlugin from '@hcengineering/server-client'
import { type StorageAdapter } from '@hcengineering/server-core'
@@ -23,7 +29,7 @@ import serverToken, { generateToken } from '@hcengineering/server-token'
import { program } from 'commander'
import { importDoc } from './commands'
import { Config } from './config'
import { type Config } from './config'
import { getBackend } from './convert/convert'
/**