-
Notifications
You must be signed in to change notification settings - Fork 16
/
MemoryStorage.yml
106 lines (96 loc) · 3.27 KB
/
MemoryStorage.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
### YamlMime:TSType
name: MemoryStorage
uid: botbuilder-core.MemoryStorage
package: botbuilder-core
summary: Memory based storage provider for a bot.
fullName: MemoryStorage
remarks: >-
This provider is most useful for simulating production storage when running
locally against the
emulator or as part of a unit test. It has the following characteristics:
- Starts off completely empty when the bot is run.
- Anything written to the store will be forgotten when the process exits.
- Objects that are read and written to the store are cloned to properly
simulate network based
storage providers.
- Cloned objects are serialized using `JSON.stringify()` to catch any possible
serialization
related issues that might occur when using a network based storage provider.
```JavaScript
const { MemoryStorage } = require('botbuilder');
const storage = new MemoryStorage();
```
isPreview: false
isDeprecated: false
type: class
constructors:
- name: 'MemoryStorage([key: string]: string)'
uid: botbuilder-core.MemoryStorage.constructor
package: botbuilder-core
summary: Creates a new MemoryStorage instance.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'new MemoryStorage(memory?: [key: string]: string)'
parameters:
- id: memory
type: '[key: string]\: string'
description: >
(Optional) memory to use for storing items. By default it will
create an empty JSON object `{}`.
methods:
- name: 'delete(string[])'
uid: botbuilder-core.MemoryStorage.delete
package: botbuilder-core
summary: Deletes storage items from storage.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'function delete(keys: string[]): Promise<void>'
parameters:
- id: keys
type: 'string[]'
description: >-
Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to
delete.
return:
description: A promise representing the async operation.
type: Promise<void>
- name: 'read(string[])'
uid: botbuilder-core.MemoryStorage.read
package: botbuilder-core
summary: Reads storage items from storage.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'function read(keys: string[]): Promise<StoreItems>'
parameters:
- id: keys
type: 'string[]'
description: >-
Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to
read.
return:
description: The read items.
type: Promise<<xref uid="botbuilder-core.StoreItems" />>
- name: write(StoreItems)
uid: botbuilder-core.MemoryStorage.write
package: botbuilder-core
summary: Writes storage items to storage.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'function write(changes: StoreItems): Promise<void>'
parameters:
- id: changes
type: <xref uid="botbuilder-core.StoreItems" />
description: >-
The [StoreItems](xref:botbuilder-core.StoreItems) to write, indexed
by key.
return:
description: A promise representing the async operation.
type: Promise<void>