mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add types for detect-character-encoding
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import detectCharacterEncoding = require("detect-character-encoding");
|
||||
|
||||
const buf: Buffer = null as any;
|
||||
|
||||
const result: detectCharacterEncoding.Result | null = detectCharacterEncoding(buf);
|
||||
|
||||
if (result) {
|
||||
const str: string = result.encoding;
|
||||
const num: number = result.confidence;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for detect-character-encoding 0.7
|
||||
// Project: https://github.com/sonicdoe/detect-character-encoding#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
export = detectCharacterEncoding;
|
||||
|
||||
declare function detectCharacterEncoding(buf: Buffer): detectCharacterEncoding.Result | null;
|
||||
|
||||
declare namespace detectCharacterEncoding {
|
||||
interface Result {
|
||||
encoding: string;
|
||||
confidence: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"detect-character-encoding-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user