mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
[cli-cursor] Add types
This commit is contained in:
11
types/cli-cursor/cli-cursor-tests.ts
Normal file
11
types/cli-cursor/cli-cursor-tests.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { show, hide, toggle } from 'cli-cursor';
|
||||
|
||||
hide();
|
||||
hide(process.stderr);
|
||||
|
||||
show();
|
||||
show(process.stderr);
|
||||
|
||||
toggle();
|
||||
toggle(false);
|
||||
toggle(false, process.stderr);
|
||||
28
types/cli-cursor/index.d.ts
vendored
Normal file
28
types/cli-cursor/index.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// Type definitions for cli-cursor 2.1
|
||||
// Project: https://github.com/sindresorhus/cli-cursor#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* Show cursor.
|
||||
*
|
||||
* @param stream defaults to `process.stderr`
|
||||
*/
|
||||
export function show(stream?: NodeJS.WritableStream): void;
|
||||
|
||||
/**
|
||||
* Hide cursor.
|
||||
*
|
||||
* @param stream defaults to `process.stderr`
|
||||
*/
|
||||
export function hide(stream?: NodeJS.WritableStream): void;
|
||||
|
||||
/**
|
||||
* Toggle cursor visibility.
|
||||
*
|
||||
* @param force is useful to show or hide the cursor based on a boolean.
|
||||
* @param stream defaults to `process.stderr`
|
||||
*/
|
||||
export function toggle(force?: boolean, stream?: NodeJS.WritableStream): void;
|
||||
23
types/cli-cursor/tsconfig.json
Normal file
23
types/cli-cursor/tsconfig.json
Normal file
@@ -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",
|
||||
"cli-cursor-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cli-cursor/tslint.json
Normal file
1
types/cli-cursor/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user