mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[stdin] introduce typings (#36866)
* [stdin] introduce typings * [stdin] use `any` instead of `unknown`
This commit is contained in:
parent
613e682831
commit
8e8b569b34
8
types/stdin/index.d.ts
vendored
Normal file
8
types/stdin/index.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// Type definitions for stdin 0.0
|
||||
// Project: https://www.npmjs.com/package/stdin
|
||||
// Definitions by: Gareth Jones <https://github.com/g-rath>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = stdin;
|
||||
|
||||
declare function stdin(fn: (str: string) => any): void;
|
||||
12
types/stdin/stdin-tests.ts
Normal file
12
types/stdin/stdin-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import stdin = require('stdin');
|
||||
|
||||
stdin(); // $ExpectError
|
||||
stdin((num: number) => {}); // $ExpectError
|
||||
|
||||
stdin(() => {}); // $ExpectType void
|
||||
stdin(str => {}); // $ExpectType void
|
||||
stdin(str => undefined); // $ExpectType void
|
||||
stdin(str => 1); // $ExpectType void
|
||||
stdin(str => str); // $ExpectType void
|
||||
stdin(str => []); // $ExpectType void
|
||||
stdin(str => ({})); // $ExpectType void
|
||||
23
types/stdin/tsconfig.json
Normal file
23
types/stdin/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"stdin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/stdin/tslint.json
Normal file
1
types/stdin/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user