UNPKG

node-global-listener

Version:

A lightweight and efficient Node.js package for capturing global keyboard and mouse events, supporting key presses, mouse movements, input simulation, and background operation.

32 lines (25 loc) 454 B
class Queue<T> { private items: T[] = []; enqueue(element: T) { this.items.push(element); } dequeue() { if (this.isEmpty()) { return null; } return this.items.shift(); } isEmpty() { return this.items.length === 0; } peek() { if (this.isEmpty()) { return null; } return this.items[0]; } size() { return this.items.length; } } export default Queue;