add ts declaration
This commit is contained in:
+2
-1
@@ -23,7 +23,8 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cross-env tsc && tsup",
|
||||
"clean": "rm -rf dist",
|
||||
"build": "npm run clean && tsc && tsup",
|
||||
"test": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -5,10 +5,10 @@ import path from 'path';
|
||||
import {episodePatterns, seasonAndEpisodePatterns, seasonPatterns, soloEp} from "./config/SeasonAndEpisodePatterns.js";
|
||||
import {extraEpKeyWords, keywordsArray, substringArray} from "./config/KeywordsArray.js";
|
||||
import {existsSync, readFileSync} from "fs";
|
||||
import {extensionMappings} from "./config/ExtentionsMapping";
|
||||
import {mimeTypeMappings} from "./config/MimeTypeMapping";
|
||||
import {FileNameVideoMetaExtractor, VideoFileMetadata} from "./FileNameVideoMetaExtractor";
|
||||
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable";
|
||||
import {extensionMappings} from "./config/ExtentionsMapping.js";
|
||||
import {mimeTypeMappings} from "./config/MimeTypeMapping.js";
|
||||
import {FileNameVideoMetaExtractor, VideoFileMetadata} from "./FileNameVideoMetaExtractor.js";
|
||||
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable.js";
|
||||
|
||||
/**
|
||||
* Result of file metadata extraction
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable";
|
||||
import {extensionMappings} from "./config/ExtentionsMapping";
|
||||
import {mimeTypeMappings} from "./config/MimeTypeMapping";
|
||||
import {FileTypeConfigurable} from "./tools/FileTypeConfigurable.js";
|
||||
import {extensionMappings} from "./config/ExtentionsMapping.js";
|
||||
import {mimeTypeMappings} from "./config/MimeTypeMapping.js";
|
||||
|
||||
export class FileType extends FileTypeConfigurable {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {SimpleFileType} from "../SimpleFileType";
|
||||
import {SimpleFileType} from "../SimpleFileType.js";
|
||||
|
||||
export const extensionMappings: { [key: string]: SimpleFileType } = {
|
||||
// Audio
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {SimpleFileType} from "../SimpleFileType";
|
||||
import {SimpleFileType} from "../SimpleFileType.js";
|
||||
|
||||
export const mimeTypeMappings: { [key: string]: SimpleFileType } = {
|
||||
'text/plain': 'undefined',//text could be anything document or subtitle or other
|
||||
|
||||
+17
-18
@@ -1,20 +1,19 @@
|
||||
export * from './FileNameMetaExtractor';
|
||||
export * from './FileNameVideoMetaExtractor';
|
||||
export * from './SimpleFileType';
|
||||
export * from './FileType';
|
||||
export * from './FileNameMetaExtractor.js';
|
||||
export * from './FileNameVideoMetaExtractor.js';
|
||||
export * from './SimpleFileType.js';
|
||||
export * from './FileType.js';
|
||||
|
||||
export * from './tools/folder/FolderTool';
|
||||
export * from "./tools/lang/LanguageTool";
|
||||
export * from './tools/video/SerieFilesNamaAnalysisTool';
|
||||
export * from './tools/FileNameCleaner';
|
||||
export * from './tools/FileNameStringOperation';
|
||||
export * from './tools/FileTypeConfigurable';
|
||||
export * from './tools/StringArrayOperation';
|
||||
export * from './tools/TwoStringsOperation';
|
||||
|
||||
export * from './config/AnimeKeywords';
|
||||
export * from './config/ExtentionsMapping';
|
||||
export * from './config/KeywordsArray';
|
||||
export * from './config/MimeTypeMapping';
|
||||
export * from './config/SeasonAndEpisodePatterns';
|
||||
export * from './tools/folder/FolderTool.js';
|
||||
export * from './tools/lang/LanguageTool.js';
|
||||
export * from './tools/video/SerieFilesNamaAnalysisTool.js';
|
||||
export * from './tools/FileNameCleaner.js';
|
||||
export * from './tools/FileNameStringOperation.js';
|
||||
export * from './tools/FileTypeConfigurable.js';
|
||||
export * from './tools/StringArrayOperation.js';
|
||||
export * from './tools/TwoStringsOperation.js';
|
||||
|
||||
export * from './config/AnimeKeywords.js';
|
||||
export * from './config/ExtentionsMapping.js';
|
||||
export * from './config/KeywordsArray.js';
|
||||
export * from './config/MimeTypeMapping.js';
|
||||
export * from './config/SeasonAndEpisodePatterns.js';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {fileTypeFromFile} from 'file-type';
|
||||
import {SimpleFileType} from "../SimpleFileType";
|
||||
import {SimpleFileType} from "../SimpleFileType.js";
|
||||
|
||||
export class FileTypeConfigurable {
|
||||
|
||||
|
||||
+9
-5
@@ -1,15 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": false,
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
"module": "NodeNext",
|
||||
"target": "ESNext",
|
||||
"allowJs": true,
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"moduleResolution": "node",
|
||||
"baseUrl": "./",
|
||||
"declaration": true,
|
||||
"declarationDir": "./dist",
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src/lib",
|
||||
"baseUrl": "./"
|
||||
},
|
||||
"include": [
|
||||
"src/lib"
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ export default defineConfig({
|
||||
splitting: true,
|
||||
treeshake: true,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
dts:true,
|
||||
clean: false, // Don't clean - tsc generates .d.ts files first
|
||||
dts: false, // Let tsc handle declaration files for NodeNext compatibility
|
||||
minify: false,
|
||||
format: ['cjs', 'esm'],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user