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