mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
21 lines
391 B
TypeScript
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
|