DefinitelyTyped/types/macrotask/macrotask-tests.ts
2018-12-24 18:33:37 +01:00

21 lines
391 B
TypeScript

import { run, clear } from 'macrotask';
const token = run(() => {});
run(arg1 => {}); // $ExpectError
run(
(arg1, arg2) => {
arg1; // $ExpectType string
arg2; // $ExpectType number
},
'foo',
1
);
// $ExpectError
run((arg1, arg2) => {}, 'foo');
// $ExpectError
run((arg1: string, arg2: number) => {}, 'foo', 'bar');
clear(token);
clear({}); // $ExpectError