sigcheck 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1081 -0
  3. package/dist/core/file-types/audio.d.ts +12 -0
  4. package/dist/core/file-types/audio.js +93 -0
  5. package/dist/core/file-types/compressed.d.ts +10 -0
  6. package/dist/core/file-types/compressed.js +155 -0
  7. package/dist/core/file-types/image.d.ts +22 -0
  8. package/dist/core/file-types/image.js +248 -0
  9. package/dist/core/file-types/index.d.ts +109 -0
  10. package/dist/core/file-types/index.js +215 -0
  11. package/dist/core/file-types/other.d.ts +21 -0
  12. package/dist/core/file-types/other.js +234 -0
  13. package/dist/core/file-types/video.d.ts +15 -0
  14. package/dist/core/file-types/video.js +153 -0
  15. package/dist/core/index.d.ts +3 -0
  16. package/dist/core/index.js +19 -0
  17. package/dist/core/interfaces/dto/detected-file-info.d.ts +10 -0
  18. package/dist/core/interfaces/dto/detected-file-info.js +2 -0
  19. package/dist/core/interfaces/dto/index.d.ts +1 -0
  20. package/dist/core/interfaces/dto/index.js +17 -0
  21. package/dist/core/interfaces/index.d.ts +2 -0
  22. package/dist/core/interfaces/index.js +18 -0
  23. package/dist/core/interfaces/options/detect-file-options.d.ts +6 -0
  24. package/dist/core/interfaces/options/detect-file-options.js +2 -0
  25. package/dist/core/interfaces/options/file-validator-options.d.ts +6 -0
  26. package/dist/core/interfaces/options/file-validator-options.js +2 -0
  27. package/dist/core/interfaces/options/index.d.ts +4 -0
  28. package/dist/core/interfaces/options/index.js +20 -0
  29. package/dist/core/interfaces/options/validate-file-type-options.d.ts +7 -0
  30. package/dist/core/interfaces/options/validate-file-type-options.js +2 -0
  31. package/dist/core/interfaces/options/zip-validator-options.d.ts +6 -0
  32. package/dist/core/interfaces/options/zip-validator-options.js +2 -0
  33. package/dist/core/types/file-info.d.ts +10 -0
  34. package/dist/core/types/file-info.js +2 -0
  35. package/dist/core/types/file-signature.d.ts +10 -0
  36. package/dist/core/types/file-signature.js +2 -0
  37. package/dist/core/types/index.d.ts +2 -0
  38. package/dist/core/types/index.js +18 -0
  39. package/dist/detection/index.d.ts +10 -0
  40. package/dist/detection/index.js +54 -0
  41. package/dist/index.d.ts +55 -0
  42. package/dist/index.js +28 -0
  43. package/dist/utils/index.d.ts +67 -0
  44. package/dist/utils/index.js +167 -0
  45. package/dist/validation/audio.d.ts +50 -0
  46. package/dist/validation/audio.js +84 -0
  47. package/dist/validation/compressed.d.ts +34 -0
  48. package/dist/validation/compressed.js +54 -0
  49. package/dist/validation/image.d.ts +128 -0
  50. package/dist/validation/image.js +225 -0
  51. package/dist/validation/index.d.ts +16 -0
  52. package/dist/validation/index.js +91 -0
  53. package/dist/validation/other.d.ts +120 -0
  54. package/dist/validation/other.js +185 -0
  55. package/dist/validation/video.d.ts +78 -0
  56. package/dist/validation/video.js +140 -0
  57. package/package.json +97 -0
@@ -0,0 +1,12 @@
1
+ import { FileInfo } from "../types/file-info";
2
+ /**
3
+ * Audio files information with their unique signatures
4
+ */
5
+ export declare class AudioTypes {
6
+ static AAC: FileInfo;
7
+ static AMR: FileInfo;
8
+ static FLAC: FileInfo;
9
+ static M4A: FileInfo;
10
+ static MP3: FileInfo;
11
+ static WAV: FileInfo;
12
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AudioTypes = void 0;
4
+ /**
5
+ * Audio files information with their unique signatures
6
+ */
7
+ class AudioTypes {
8
+ }
9
+ exports.AudioTypes = AudioTypes;
10
+ AudioTypes.AAC = {
11
+ extension: "aac",
12
+ mimeType: "audio/aac",
13
+ description: "Advanced Audio Coding (AAC) is an audio coding standard for lossy digital audio compression",
14
+ signatures: [
15
+ {
16
+ sequence: [0xff, 0xf1],
17
+ description: "MPEG-4 Advanced Audio Coding (AAC) Low Complexity (LC) audio file",
18
+ },
19
+ {
20
+ sequence: [0xff, 0xf9],
21
+ description: "MPEG-2 Advanced Audio Coding (AAC) Low Complexity (LC) audio file",
22
+ },
23
+ ],
24
+ };
25
+ AudioTypes.AMR = {
26
+ extension: "amr",
27
+ mimeType: "audio/amr",
28
+ description: "Adaptive Multi-Rate ACELP (Algebraic Code Excited Linear Prediction) Codec, commonly audio format with GSM cell phones",
29
+ signatures: [
30
+ {
31
+ sequence: [0x23, 0x21, 0x41, 0x4d, 0x52],
32
+ },
33
+ ],
34
+ };
35
+ AudioTypes.FLAC = {
36
+ extension: "flac",
37
+ mimeType: "audio/x-flac",
38
+ description: "Free Lossless Audio Codec file",
39
+ signatures: [
40
+ {
41
+ sequence: [0x66, 0x4c, 0x61, 0x43, 0x00, 0x00, 0x00, 0x22],
42
+ },
43
+ ],
44
+ };
45
+ AudioTypes.M4A = {
46
+ extension: "m4a",
47
+ mimeType: "audio/x-m4a",
48
+ description: "Apple Lossless Audio Codec file",
49
+ signatures: [
50
+ {
51
+ sequence: [0x66, 0x74, 0x79, 0x70, 0x4d, 0x34, 0x41, 0x20],
52
+ offset: 4,
53
+ compatibleExtensions: ["aac"],
54
+ },
55
+ ],
56
+ };
57
+ AudioTypes.MP3 = {
58
+ extension: "mp3",
59
+ mimeType: "audio/mpeg",
60
+ description: "A digital audio file format that uses compression to reduce file size while maintaining high quality sound",
61
+ signatures: [
62
+ {
63
+ sequence: [0xff, 0xfb],
64
+ description: "MPEG-1 Layer 3 file without an ID3 tag or with an ID3v1 tag (which is appended at the end of the file)",
65
+ },
66
+ {
67
+ sequence: [0xff, 0xf3],
68
+ description: "MPEG-1 Layer 3 file without an ID3 tag or with an ID3v1 tag (which is appended at the end of the file)",
69
+ },
70
+ {
71
+ sequence: [0xff, 0xf2],
72
+ description: "MPEG-1 Layer 3 file without an ID3 tag or with an ID3v1 tag (which is appended at the end of the file)",
73
+ },
74
+ {
75
+ sequence: [0x49, 0x44, 0x33],
76
+ description: "MP3 file with an ID3v2 container",
77
+ },
78
+ ],
79
+ };
80
+ AudioTypes.WAV = {
81
+ extension: "wav",
82
+ mimeType: "audio/wav",
83
+ description: "Waveform Audio File Format",
84
+ signatures: [
85
+ {
86
+ sequence: [
87
+ 0x52, 0x49, 0x46, 0x46, 0x57, 0x41, 0x56, 0x45, 0x66, 0x6d, 0x74,
88
+ 0x20,
89
+ ],
90
+ skippedBytes: [4, 5, 6, 7],
91
+ },
92
+ ],
93
+ };
@@ -0,0 +1,10 @@
1
+ import { FileInfo } from "../types/file-info";
2
+ /**
3
+ * Compressed files information with their unique signatures
4
+ */
5
+ export declare class CompressedTypes {
6
+ static _7Z: FileInfo;
7
+ static LZH: FileInfo;
8
+ static RAR: FileInfo;
9
+ static ZIP: FileInfo;
10
+ }
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompressedTypes = void 0;
4
+ /**
5
+ * Compressed files information with their unique signatures
6
+ */
7
+ class CompressedTypes {
8
+ }
9
+ exports.CompressedTypes = CompressedTypes;
10
+ CompressedTypes._7Z = {
11
+ extension: "7z",
12
+ mimeType: "application/x-7z-compressed",
13
+ description: "7-Zip compressed file",
14
+ signatures: [
15
+ {
16
+ sequence: [0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c],
17
+ },
18
+ ],
19
+ };
20
+ CompressedTypes.LZH = {
21
+ extension: "lzh",
22
+ mimeType: "application/x-lzh-compressed",
23
+ description: "Compressed file using Lempel-Ziv and Haruyasu (LZH) compression algorithm",
24
+ signatures: [
25
+ {
26
+ sequence: [0x2d, 0x68, 0x6c, 0x30, 0x2d],
27
+ description: "Lempel Ziv Huffman archive file Method 0 (No compression)",
28
+ compatibleExtensions: ["lha"],
29
+ },
30
+ {
31
+ sequence: [0x2d, 0x68, 0x6c, 0x35, 0x2d],
32
+ description: "Lempel Ziv Huffman archive file Method 5 (8KiB sliding window)",
33
+ compatibleExtensions: ["lha"],
34
+ },
35
+ ],
36
+ };
37
+ CompressedTypes.RAR = {
38
+ extension: "rar",
39
+ mimeType: "application/x-rar-compressed",
40
+ description: "Roshal ARchive compressed archive file",
41
+ signatures: [
42
+ {
43
+ sequence: [0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00],
44
+ description: "Compressed archive v5.00 onwards",
45
+ },
46
+ {
47
+ sequence: [0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00],
48
+ description: "Compressed archive v1.50 onwards",
49
+ },
50
+ ],
51
+ };
52
+ CompressedTypes.ZIP = {
53
+ extension: "zip",
54
+ mimeType: "application/zip",
55
+ description: "Compressed archive file",
56
+ signatures: [
57
+ {
58
+ sequence: [0x57, 0x69, 0x6e, 0x5a, 0x69, 0x70],
59
+ offset: 29152,
60
+ description: "WinZip compressed archive",
61
+ },
62
+ {
63
+ sequence: [
64
+ 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x01, 0x00, 0x63, 0x00, 0x00,
65
+ 0x00, 0x00, 0x00,
66
+ ],
67
+ description: "ZLock Pro encrypted ZIP",
68
+ },
69
+ {
70
+ sequence: [0x50, 0x4b, 0x4c, 0x49, 0x54, 0x45],
71
+ offset: 30,
72
+ description: "PKLITE compressed ZIP archive (see also PKZIP)",
73
+ },
74
+ {
75
+ sequence: [0x50, 0x4b, 0x53, 0x70, 0x58],
76
+ offset: 526,
77
+ description: "PKSFX self-extracting executable compressed file (see also PKZIP)",
78
+ },
79
+ {
80
+ sequence: [0x50, 0x4b, 0x03, 0x04],
81
+ description: "PKZIP archive file - zip file format and multiple formats based on it",
82
+ compatibleExtensions: [
83
+ "aar",
84
+ "apk",
85
+ "docx",
86
+ "epub",
87
+ "ipa",
88
+ "jar",
89
+ "kmz",
90
+ "maff",
91
+ "msix",
92
+ "odp",
93
+ "ods",
94
+ "odt",
95
+ "pk3",
96
+ "pk4",
97
+ "pptx",
98
+ "usdz",
99
+ "vsdx",
100
+ "xlsx",
101
+ "xpi",
102
+ ],
103
+ },
104
+ {
105
+ sequence: [0x50, 0x4b, 0x05, 0x06],
106
+ description: "PKZIP empty archive file - zip file format and multiple formats based on it",
107
+ compatibleExtensions: [
108
+ "aar",
109
+ "apk",
110
+ "docx",
111
+ "epub",
112
+ "ipa",
113
+ "jar",
114
+ "kmz",
115
+ "maff",
116
+ "msix",
117
+ "odp",
118
+ "ods",
119
+ "odt",
120
+ "pk3",
121
+ "pk4",
122
+ "pptx",
123
+ "usdz",
124
+ "vsdx",
125
+ "xlsx",
126
+ "xpi",
127
+ ],
128
+ },
129
+ {
130
+ sequence: [0x50, 0x4b, 0x07, 0x08],
131
+ description: "PKZIP multivolume archive file - zip file format and multiple formats based on it",
132
+ compatibleExtensions: [
133
+ "aar",
134
+ "apk",
135
+ "docx",
136
+ "epub",
137
+ "ipa",
138
+ "jar",
139
+ "kmz",
140
+ "maff",
141
+ "msix",
142
+ "odp",
143
+ "ods",
144
+ "odt",
145
+ "pk3",
146
+ "pk4",
147
+ "pptx",
148
+ "usdz",
149
+ "vsdx",
150
+ "xlsx",
151
+ "xpi",
152
+ ],
153
+ },
154
+ ],
155
+ };
@@ -0,0 +1,22 @@
1
+ import { FileInfo } from "../types/file-info";
2
+ /**
3
+ * Image files information with their unique signatures
4
+ */
5
+ export declare class ImageTypes {
6
+ static AVIF: FileInfo;
7
+ static BMP: FileInfo;
8
+ static BPG: FileInfo;
9
+ static CR2: FileInfo;
10
+ static EXR: FileInfo;
11
+ static GIF: FileInfo;
12
+ static HEIC: FileInfo;
13
+ static ICO: FileInfo;
14
+ static JPEG: FileInfo;
15
+ static PBM: FileInfo;
16
+ static PGM: FileInfo;
17
+ static PNG: FileInfo;
18
+ static PPM: FileInfo;
19
+ static PSD: FileInfo;
20
+ static TIFF: FileInfo;
21
+ static WEBP: FileInfo;
22
+ }
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageTypes = void 0;
4
+ /**
5
+ * Image files information with their unique signatures
6
+ */
7
+ class ImageTypes {
8
+ }
9
+ exports.ImageTypes = ImageTypes;
10
+ ImageTypes.AVIF = {
11
+ extension: "avif",
12
+ mimeType: "image/avif",
13
+ description: "Alliance for Open Media (AOMedia) Video 1 (AV1) Image File",
14
+ signatures: [
15
+ {
16
+ sequence: [0x00, 0x00, 0x00],
17
+ },
18
+ ],
19
+ };
20
+ ImageTypes.BMP = {
21
+ extension: "bmp",
22
+ mimeType: "image/bmp",
23
+ description: "A bitmap format used mostly in Windows",
24
+ signatures: [
25
+ {
26
+ sequence: [0x42, 0x4d],
27
+ compatibleExtensions: ["dib"],
28
+ },
29
+ ],
30
+ };
31
+ ImageTypes.BPG = {
32
+ extension: "bpg",
33
+ mimeType: "image/bpg",
34
+ description: "Better Portable Graphics image format",
35
+ signatures: [
36
+ {
37
+ sequence: [0x42, 0x50, 0x47, 0xfb],
38
+ },
39
+ ],
40
+ };
41
+ ImageTypes.CR2 = {
42
+ extension: "cr2",
43
+ mimeType: "image/x-canon-cr2",
44
+ description: "Canon digital camera RAW file",
45
+ signatures: [
46
+ {
47
+ sequence: [0x49, 0x49, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x43, 0x52],
48
+ },
49
+ ],
50
+ };
51
+ ImageTypes.EXR = {
52
+ extension: "exr",
53
+ mimeType: "image/x-exr",
54
+ description: "OpenEXR bitmap image format",
55
+ signatures: [
56
+ {
57
+ sequence: [0x76, 0x2f, 0x31, 0x01],
58
+ },
59
+ ],
60
+ };
61
+ ImageTypes.GIF = {
62
+ extension: "gif",
63
+ mimeType: "image/gif",
64
+ description: "Image file encoded in the Graphics Interchange Format (GIF)",
65
+ signatures: [
66
+ {
67
+ sequence: [0x47, 0x49, 0x46, 0x38, 0x37, 0x61],
68
+ },
69
+ {
70
+ sequence: [0x47, 0x49, 0x46, 0x38, 0x39, 0x61],
71
+ },
72
+ ],
73
+ };
74
+ ImageTypes.HEIC = {
75
+ extension: "heic",
76
+ mimeType: "image/heic",
77
+ description: "A variant of the HEIF (High Efficiency Image Format) that store images on the latest Apple devices.",
78
+ signatures: [
79
+ {
80
+ sequence: [0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63],
81
+ offset: 4,
82
+ },
83
+ {
84
+ sequence: [0x66, 0x74, 0x79, 0x70, 0x6d],
85
+ offset: 4,
86
+ },
87
+ ],
88
+ };
89
+ ImageTypes.ICO = {
90
+ extension: "ico",
91
+ mimeType: "image/x-icon",
92
+ description: "Computer icon encoded in ICO file format",
93
+ signatures: [
94
+ {
95
+ sequence: [0x00, 0x00, 0x01, 0x00],
96
+ compatibleExtensions: ["spl"],
97
+ },
98
+ ],
99
+ };
100
+ ImageTypes.JPEG = {
101
+ extension: "jpeg",
102
+ mimeType: "image/jpeg",
103
+ description: "JPEG (Joint Photographic Experts Group) is a widely used lossy image compression format.",
104
+ signatures: [
105
+ {
106
+ sequence: [0xff, 0xd8, 0xff, 0xe1, 0x45, 0x78, 0x69, 0x66, 0x00],
107
+ skippedBytes: [4, 5],
108
+ description: "Digital camera JPG using Exchangeable Image File Format (EXIF)",
109
+ },
110
+ {
111
+ sequence: [0xff, 0xd8, 0xff, 0xe8, 0x53, 0x50, 0x49, 0x46, 0x46, 0x00],
112
+ skippedBytes: [4, 5],
113
+ description: "Still Picture Interchange File Format (SPIFF)",
114
+ },
115
+ {
116
+ sequence: [
117
+ 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00,
118
+ 0x00,
119
+ ],
120
+ description: "JPEG raw or in the JFIF or Exif file format",
121
+ },
122
+ {
123
+ sequence: [0xff, 0xd8, 0xff, 0xee],
124
+ description: "JPEG raw or in the JFIF or Exif file format",
125
+ },
126
+ {
127
+ sequence: [0xff, 0xd8, 0xff, 0xe1, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00],
128
+ skippedBytes: [4, 5],
129
+ description: "JPEG raw or in the JFIF or Exif file format",
130
+ },
131
+ {
132
+ sequence: [0xff, 0xd8, 0xff, 0xe0, 0x4a, 0x46, 0x49, 0x46, 0x00],
133
+ skippedBytes: [4, 5],
134
+ description: "JPEG/JFIF graphics file",
135
+ compatibleExtensions: ["jfif", "jpe"],
136
+ },
137
+ {
138
+ sequence: [0xff, 0xd8, 0xff, 0xe0],
139
+ description: "JPEG raw or in the JFIF or Exif file format",
140
+ },
141
+ {
142
+ sequence: [0xff, 0xd8],
143
+ description: "Generic JPEGimage file",
144
+ compatibleExtensions: ["jpe"],
145
+ },
146
+ ],
147
+ };
148
+ ImageTypes.PBM = {
149
+ extension: "pbm",
150
+ mimeType: "image/x-portable-bitmap",
151
+ description: "PBM (Portable Bitmap) is a simple monochrome bitmap image format that uses plain text ASCII characters to represent binary image data",
152
+ signatures: [
153
+ {
154
+ sequence: [0x50, 0x31, 0x0a],
155
+ description: "Portable bitmap ASCII",
156
+ },
157
+ {
158
+ sequence: [0x50, 0x34, 0x0a],
159
+ description: "Portable bitmap binary",
160
+ },
161
+ ],
162
+ };
163
+ ImageTypes.PGM = {
164
+ extension: "pgm",
165
+ mimeType: "image/x-portable-graymap",
166
+ description: "PGM (Portable Graymap) is a simple grayscale image format that uses ASCII text characters to represent binary image data.",
167
+ signatures: [
168
+ {
169
+ sequence: [0x50, 0x32, 0x0a],
170
+ description: "Portable Gray Map ASCII",
171
+ },
172
+ {
173
+ sequence: [0x50, 0x35, 0x0a],
174
+ description: "Portable Gray Map binary",
175
+ },
176
+ ],
177
+ };
178
+ ImageTypes.PNG = {
179
+ extension: "png",
180
+ mimeType: "image/png",
181
+ description: "PNG (Portable Network Graphics) is a lossless image compression format that supports a wide range of color depths and transparency and is widely used for high-quality graphics.",
182
+ signatures: [
183
+ {
184
+ sequence: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a],
185
+ },
186
+ ],
187
+ };
188
+ ImageTypes.PPM = {
189
+ extension: "ppm",
190
+ mimeType: "image/x-portable-pixmap",
191
+ description: "PPM (Portable Pixmap) is a simple color image format in the Portable Network Graphics (PNG) suite.",
192
+ signatures: [
193
+ {
194
+ sequence: [0x50, 0x33, 0x0a],
195
+ description: "Portable Pixmap ASCII",
196
+ },
197
+ {
198
+ sequence: [0x50, 0x36, 0x0a],
199
+ description: "Portable Pixmap binary",
200
+ },
201
+ ],
202
+ };
203
+ ImageTypes.PSD = {
204
+ extension: "psd",
205
+ mimeType: "image/vnd.adobe.photoshop",
206
+ description: "PSD (Photoshop Document) is an Adobe Photoshop image file format",
207
+ signatures: [
208
+ {
209
+ sequence: [0x38, 0x42, 0x50, 0x53],
210
+ },
211
+ ],
212
+ };
213
+ ImageTypes.TIFF = {
214
+ extension: "tiff",
215
+ mimeType: "image/tiff",
216
+ description: "TIFF is a raster image format used for high-quality scanning, publishing, and photography",
217
+ signatures: [
218
+ {
219
+ sequence: [0x49, 0x49, 0x2a, 0x00],
220
+ compatibleExtensions: ["tif"],
221
+ },
222
+ {
223
+ sequence: [0x4d, 0x4d, 0x00, 0x2a],
224
+ compatibleExtensions: ["tif"],
225
+ },
226
+ {
227
+ sequence: [0x49, 0x49, 0x2b, 0x00],
228
+ compatibleExtensions: ["tif"],
229
+ description: "BigTIFF files. Tagged Image File Format files > 4 GB",
230
+ },
231
+ {
232
+ sequence: [0x4d, 0x4d, 0x00, 0x2b],
233
+ compatibleExtensions: ["tif"],
234
+ description: "BigTIFF files. Tagged Image File Format files > 4 GB",
235
+ },
236
+ ],
237
+ };
238
+ ImageTypes.WEBP = {
239
+ extension: "webp",
240
+ mimeType: "image/webp",
241
+ description: "A modern image format that provides superior lossless and lossy compression for images on the web",
242
+ signatures: [
243
+ {
244
+ sequence: [0x52, 0x49, 0x46, 0x46, 0x57, 0x45, 0x42, 0x50],
245
+ skippedBytes: [4, 5, 6, 7],
246
+ },
247
+ ],
248
+ };
@@ -0,0 +1,109 @@
1
+ import { DetectedFileInfo } from "../interfaces/dto";
2
+ import { FileInfo, FileSignature } from "../types";
3
+ export declare const FILE_TYPES_REQUIRED_ADDITIONAL_CHECK: Array<string>;
4
+ /**
5
+ * A class hold all supported file typs with their unique signatures
6
+ */
7
+ export declare class FileTypes {
8
+ static AAC: FileInfo;
9
+ static AMR: FileInfo;
10
+ static FLAC: FileInfo;
11
+ static M4A: FileInfo;
12
+ static MP3: FileInfo;
13
+ static WAV: FileInfo;
14
+ static AVIF: FileInfo;
15
+ static BMP: FileInfo;
16
+ static BPG: FileInfo;
17
+ static CR2: FileInfo;
18
+ static EXR: FileInfo;
19
+ static GIF: FileInfo;
20
+ static HEIC: FileInfo;
21
+ static ICO: FileInfo;
22
+ static JPEG: FileInfo;
23
+ static PBM: FileInfo;
24
+ static PGM: FileInfo;
25
+ static PNG: FileInfo;
26
+ static PPM: FileInfo;
27
+ static PSD: FileInfo;
28
+ static TIFF: FileInfo;
29
+ static WEBP: FileInfo;
30
+ static AVI: FileInfo;
31
+ static FLV: FileInfo;
32
+ static M4V: FileInfo;
33
+ static MKV: FileInfo;
34
+ static MOV: FileInfo;
35
+ static MP4: FileInfo;
36
+ static OGG: FileInfo;
37
+ static SWF: FileInfo;
38
+ static WEBM: FileInfo;
39
+ static _7Z: FileInfo;
40
+ static LZH: FileInfo;
41
+ static RAR: FileInfo;
42
+ static ZIP: FileInfo;
43
+ static BLEND: FileInfo;
44
+ static DOC: FileInfo;
45
+ static ELF: FileInfo;
46
+ static EXE: FileInfo;
47
+ static INDD: FileInfo;
48
+ static MACHO: FileInfo;
49
+ static ORC: FileInfo;
50
+ static PARQUET: FileInfo;
51
+ static PCAP: FileInfo;
52
+ static PDF: FileInfo;
53
+ static PS: FileInfo;
54
+ static RTF: FileInfo;
55
+ static SQLITE: FileInfo;
56
+ static STL: FileInfo;
57
+ static TTF: FileInfo;
58
+ /**
59
+ * Receive information on a file type by its property name from FileTypes class
60
+ *
61
+ * @param propertyName Property name from FileTypes class
62
+ *
63
+ * @returns {FileInfo} File type information
64
+ */
65
+ static getInfoByName(propertyName: string): FileInfo;
66
+ /**
67
+ * Receive an array of file type signatures by its property name from FileTypes class
68
+ *
69
+ * @param propertyName Property name from FileTypes class
70
+ *
71
+ * @returns {Array<FileSignature>} All unique signatures with their information
72
+ */
73
+ static getSignaturesByName(propertyName: string): Array<FileSignature>;
74
+ /**
75
+ * Determine if a valid signature exist in a file chunk
76
+ *
77
+ * @param fileChunk A chunk from the beginning of a file content, represents in array of numbers
78
+ * @param acceptedSignatures Valid signatures to search for in fileChunk
79
+ *
80
+ * @returns {boolean} True if found a valid signature inside the chunk, otherwise false
81
+ */
82
+ static detectSignature(fileChunk: Array<number>, acceptedSignatures: Array<FileSignature>): FileSignature | undefined;
83
+ /**
84
+ * Perfomrs an additional check for detected file types by their unique structure
85
+ *
86
+ * @param fileChunk A chunk from the beginning of a file content, represents in array of numbers
87
+ * @param detectedFiles A list of detected files
88
+ * @returns {string | undefined} File type extension if found, otherwise undefined
89
+ */
90
+ static detectTypeByAdditionalCheck(fileChunk: Array<number>, detectedFiles: Array<DetectedFileInfo | FileInfo>): string | undefined;
91
+ /**
92
+ * Determine if a file chunk contains a valid signature and return the file signature if exist
93
+ *
94
+ * @param fileChunk A chunk from the beginning of a file content, represents in array of numbers
95
+ * @param acceptedSignatures Valid signatures to search for in fileChunk
96
+ *
97
+ * @returns {FileSignature | undefined } FileSignature if found a valid signature, otherwise undefined
98
+ */
99
+ static detectbBySignatures(fileChunk: Array<number>, acceptedSignatures: Array<FileSignature>): FileSignature | undefined;
100
+ /**
101
+ * Determine if file content contains a valid signature of a required type
102
+ *
103
+ * @param fileChunk A chunk from the beginning of a file content, represents in array of numbers
104
+ * @param type The file type to match against
105
+ *
106
+ * @returns {boolean} True if found a signature of the type in file content, otherwise false
107
+ */
108
+ static checkByFileType(fileChunk: Array<number>, type: string): boolean;
109
+ }