Skip to content

Commit 93f103e

Browse files
authored
Merge pull request #5 from RibikiH/main
Basic TypeScript support
2 parents cd6ed1b + 5cbfa0c commit 93f103e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.1.0",
44
"description": "Charset Detector - Detect the encoding and language of text files - Use it in the browser, with Node.js, or via CLI",
55
"main": "src/index-node.js",
6+
"types": "src/index-node.d.ts",
67
"scripts": {
78
"regextest": "node ./testing/regexTester.test.js",
89
"test": "node ./testing/language-encoding.test.js",

src/index-node.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export interface FileInfo {
2+
encoding: null | string,
3+
language: null | string,
4+
confidence: {
5+
encoding: null | string,
6+
language: null | string,
7+
},
8+
}
9+
10+
declare function DetectFileEncodingAndLanguage(file: File): Promise<FileInfo>
11+
export default DetectFileEncodingAndLanguage;

0 commit comments

Comments
 (0)