UNPKG

842 BTypeScriptView Raw
1import {
2 IStoreOptions
3} from './store-options'
4
5/**
6 * In-memory implementation of the message store
7 * This can actually be saved into files.
8 *
9 */
10declare class Store {
11 /**
12 * Store constructor
13 *
14 * @param {Object} [options] - store options
15 */
16 constructor (options: IStoreOptions)
17
18 /**
19 * Adds a packet to the store, a packet is
20 * anything that has a messageId property.
21 *
22 */
23 public put (packet: any, cb?: Function): this
24
25 /**
26 * Creates a stream with all the packets in the store
27 *
28 */
29 public createStream (): any
30
31 /**
32 * deletes a packet from the store.
33 */
34 public del (packet: any, cb: Function): this
35
36 /**
37 * get a packet from the store.
38 */
39 public get (packet: any, cb: Function): this
40
41 /**
42 * Close the store
43 */
44 public close (cb: Function): void
45}
46export { Store }