DefinitelyTyped/types/stdin/stdin-tests.ts
Gareth Jones 8e8b569b34 [stdin] introduce typings (#36866)
* [stdin] introduce typings

* [stdin] use `any` instead of `unknown`
2019-07-16 15:22:09 -07:00

13 lines
378 B
TypeScript

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