DefinitelyTyped/types/p-fifo/p-fifo-tests.ts
2019-10-15 13:58:57 -07:00

18 lines
260 B
TypeScript

import Fifo = require("p-fifo");
const fifo = new Fifo<string>();
(async () => {
// $ExpectType void
await fifo.push("a");
// $ExpectError
fifo.push(true);
// $ExpectType string
await fifo.shift();
})();
// $ExpectType boolean
fifo.isEmpty();