import { RawMessage } from '../types/RawMessage'; import { ContentMessage } from '../messages/outgoing'; // TODO: We should be able to import functions straight from the db here without going through the window object export class PendingMessageCache { private readonly cachedMessages: Array = []; constructor() { // TODO: We should load pending messages from db here } public addPendingMessage( device: string, message: ContentMessage ): RawMessage { // TODO: Maybe have a util for converting OutgoingContentMessage to RawMessage? // TODO: Raw message has uuid, how are we going to set that? maybe use a different identifier? // One could be device + timestamp would make a unique identifier // TODO: Return previous pending message if it exists return {} as RawMessage; } public removePendingMessage(message: RawMessage) { // TODO: implement } public getPendingDevices(): Array { // TODO: this should return all devices which have pending messages return []; } public getPendingMessages(device: string): Array { return []; } }