type QPayload = { data: T; timestamp: Date; }; class Q { private queue: QPayload[] = []; constructor(private maxSize: number) {} enqueue(item: T) { if (this.queue.length >= this.maxSize) { throw new Error("Queue is full"); } this.queue.push({ data: item, timestamp: new Date() }); } }