constants.ts
1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// File type constants from OnlyOffice SDK
export const oAscFileType = {
UNKNOWN: 0,
PDF: 513,
PDFA: 521,
DJVU: 515,
XPS: 516,
DOCX: 65,
DOC: 66,
ODT: 67,
RTF: 68,
TXT: 69,
HTML: 70,
MHT: 71,
EPUB: 72,
FB2: 73,
MOBI: 74,
DOCM: 75,
DOTX: 76,
DOTM: 77,
FODT: 78,
OTT: 79,
DOC_FLAT: 80,
DOCX_FLAT: 81,
HTML_IN_CONTAINER: 82,
DOCX_PACKAGE: 84,
OFORM: 85,
DOCXF: 86,
DOCY: 4097,
CANVAS_WORD: 8193,
JSON: 2056,
XLSX: 257,
XLS: 258,
ODS: 259,
CSV: 260,
XLSM: 261,
XLTX: 262,
XLTM: 263,
XLSB: 264,
FODS: 265,
OTS: 266,
XLSX_FLAT: 267,
XLSX_PACKAGE: 268,
XLSY: 4098,
PPTX: 129,
PPT: 130,
ODP: 131,
PPSX: 132,
PPTM: 133,
PPSM: 134,
POTX: 135,
POTM: 136,
FODP: 137,
OTP: 138,
PPTX_PACKAGE: 139,
IMG: 1024,
JPG: 1025,
TIFF: 1026,
TGA: 1027,
GIF: 1028,
PNG: 1029,
EMF: 1030,
WMF: 1031,
BMP: 1032,
CR2: 1033,
PCX: 1034,
RAS: 1035,
PSD: 1036,
ICO: 1037,
} as const;
export const c_oAscFileType2 = Object.fromEntries(
Object.entries(oAscFileType).map(([key, value]) => [value, key]),
) as Record<number, keyof typeof oAscFileType>;
export type DocumentType = 'word' | 'cell' | 'slide';
export const DOCUMENT_TYPE_MAP: Record<string, DocumentType> = {
docx: 'word',
doc: 'word',
odt: 'word',
rtf: 'word',
txt: 'word',
xlsx: 'cell',
xls: 'cell',
ods: 'cell',
csv: 'cell',
pptx: 'slide',
ppt: 'slide',
odp: 'slide',
};
export const BASE_PATH = '/document/';