Skip to content

API documentation of Agoric SDK / Exports / @agoric/store / types / WeakMapStore

Interface: WeakMapStore<K, V>

@agoric/store.types.WeakMapStore

Type parameters

NameType
Kextends Key & object = Key
Vextends Passable = Passable

Table of contents

Properties

Properties

addAll

addAll: (entries: CopyMap<K, V> | Iterable<[K, V]>) => void

Type declaration

▸ (entries): void

Parameters
NameType
entriesCopyMap<K, V> | Iterable<[K, V]>
Returns

void

Defined in

packages/store/src/types.js:106


delete

delete: (key: K) => void

Remove the key. Throws if not found.

Type declaration

▸ (key): void

Parameters
NameType
keyK
Returns

void

Defined in

packages/store/src/types.js:105


get

get: (key: K) => V

Return a value for the key. Throws if not found.

Type declaration

▸ (key): V

Parameters
NameType
keyK
Returns

V

Defined in

packages/store/src/types.js:99


has

has: (key: K) => boolean

Check if a key exists. The key can be any JavaScript value, though the answer will always be false for keys that cannot be found in this store.

Type declaration

▸ (key): boolean

Parameters
NameType
keyK
Returns

boolean

Defined in

packages/store/src/types.js:96


init

init: (key: K, value: V) => void

Initialize the key only if it doesn't already exist. The key must be one allowed by this store. For example a scalar store only allows primitives and remotables.

Type declaration

▸ (key, value): void

Parameters
NameType
keyK
valueV
Returns

void

Defined in

packages/store/src/types.js:101


set

set: (key: K, value: V) => void

Set the key. Throws if not found.

Type declaration

▸ (key, value): void

Parameters
NameType
keyK
valueV
Returns

void

Defined in

packages/store/src/types.js:104