mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
[detect-indent] add typings for v5, lintint & strict null checks (#18859)
This commit is contained in:
committed by
Mohamed Hegazy
parent
e3c0aa0357
commit
e09f8c00cd
@@ -1,7 +1,9 @@
|
||||
import detectIndent = require('detect-indent');
|
||||
|
||||
import di = require('detect-indent');
|
||||
const indent = detectIndent('').indent || ' ';
|
||||
|
||||
var str: string;
|
||||
|
||||
str = di(str);
|
||||
str = di(str, str);
|
||||
const indentInfo = detectIndent('');
|
||||
indentInfo; // $ExpectType IndentInfo
|
||||
const num: number = indentInfo.amount;
|
||||
const str: string = indentInfo.indent;
|
||||
const type: 'space' | 'tab' | null = indentInfo.type;
|
||||
|
||||
Vendored
+11
-5
@@ -1,11 +1,17 @@
|
||||
// Type definitions for detect-indent 0.1.3
|
||||
// Type definitions for detect-indent 5.0
|
||||
// Project: https://github.com/sindresorhus/detect-indent
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = detectIndent;
|
||||
|
||||
interface DetectIndent {
|
||||
(dir: string, alt?: string): string;
|
||||
declare function detectIndent(str: string): detectIndent.IndentInfo;
|
||||
|
||||
declare namespace detectIndent {
|
||||
interface IndentInfo {
|
||||
amount: number;
|
||||
type: 'tab' | 'space' | null;
|
||||
indent: string;
|
||||
}
|
||||
}
|
||||
declare var _: DetectIndent;
|
||||
export = _;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -19,4 +19,4 @@
|
||||
"index.d.ts",
|
||||
"detect-indent-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,6 @@
|
||||
import di = require('detect-indent');
|
||||
|
||||
let str: string = '';
|
||||
|
||||
str = di(str);
|
||||
str = di(str, str);
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for detect-indent 0.1
|
||||
// Project: https://github.com/sindresorhus/detect-indent
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type DetectIndent = (dir: string, alt?: string) => string;
|
||||
|
||||
declare const _: DetectIndent;
|
||||
export = _;
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"detect-indent": ["detect-indent/v0"]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"detect-indent-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user