import { DeepstreamConfig, DeepstreamServices, SocketWrapper } from '@deepstream/types'; import { RecordMessage } from '../../constants'; export default class RecordDeletion { private metaData; private config; private services; private socketWrapper; private message; private successCallback; private recordName; private completed; private isDestroyed; private cacheTimeout; private storageTimeout; /** * This class represents the deletion of a single record. It handles it's removal * from cache and storage and handles errors and timeouts */ constructor(config: DeepstreamConfig, services: DeepstreamServices, socketWrapper: SocketWrapper, message: RecordMessage, successCallback: Function, metaData?: any); /** * Callback for completed cache and storage interactions. Will invoke * _done() once both are completed */ private onCacheDelete; private onStorageDelete; private stageComplete; /** * Callback for successful deletions. Notifies the original sender and calls * the callback to allow the recordHandler to broadcast the deletion */ private done; /** * Destroyes the class and null down its dependencies */ private destroy; /** * Handle errors that occured during deleting the record */ private handleError; }