mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
15 lines
403 B
TypeScript
15 lines
403 B
TypeScript
import { timeout, TimeoutError } from "promise-timeout";
|
|
|
|
function acceptError(e: Error) { }
|
|
|
|
acceptError(new TimeoutError());
|
|
|
|
timeout(); // $ExpectError
|
|
timeout(new Promise(() => { })); // $ExpectError
|
|
|
|
const top = (<T>(x?: T): T => x!)();
|
|
type Top = typeof top;
|
|
declare function expectPromiseTop(x: Promise<Top>): void;
|
|
|
|
expectPromiseTop(timeout(new Promise(() => { }), 1000));
|