mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
add typings for slice-ansi package (#30423)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
e372825f2e
commit
f884416c05
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for slice-ansi 2.0
|
||||
// Project: https://github.com/chalk/slice-ansi#readme
|
||||
// Definitions by: Dan Imhoff <https://github.com/dwieeb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function sliceAnsi(input: string, beginSlice: number, endSlice?: number): string;
|
||||
|
||||
export = sliceAnsi;
|
||||
@@ -0,0 +1,13 @@
|
||||
import sliceAnsi = require('slice-ansi');
|
||||
|
||||
// $ExpectType string
|
||||
sliceAnsi('The quick brown \u001b[31mfox jumped over \u001b[39mthe lazy \u001b[32mdog and then ran away with the unicorn.\u001b[39m', 20, 30);
|
||||
|
||||
// $ExpectType string
|
||||
sliceAnsi('test', 1);
|
||||
|
||||
// $ExpectError
|
||||
sliceAnsi();
|
||||
|
||||
// $ExpectError
|
||||
sliceAnsi(5);
|
||||
@@ -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",
|
||||
"slice-ansi-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user