Skip to content

InMemoryStore

Defined in: src/backends/memory.ts:12

A simple in-memory store

  • Map<number, Uint8Array>

new InMemoryStore(maxSize?, label?): InMemoryStore

Defined in: src/backends/memory.ts:17

number = size_max

string

InMemoryStore

Map<number, Uint8Array>.constructor

readonly [toStringTag]: string

Defined in: ../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:135

Map.[toStringTag]


readonly flags: readonly []

Defined in: src/backends/memory.ts:13

Use for optimizations

SyncMapStore.flags


readonly optional label?: string

Defined in: src/backends/memory.ts:19

A name for this instance of the store. For example, you might use a share name for a network-based store

SyncMapStore.label


readonly maxSize: number = size_max

Defined in: src/backends/memory.ts:18


readonly name: string = 'tmpfs'

Defined in: src/backends/memory.ts:15

What the file system using this store should be called. For example, tmpfs for an in memory store

SyncMapStore.name


readonly size: number

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:46

the number of elements in the Map.

Map.size


readonly static [species]: MapConstructor

Defined in: ../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:317

Map.[species]

get bytes(): number

Defined in: src/backends/memory.ts:30

number

[iterator](): MapIterator<[number, Uint8Array<ArrayBufferLike>]>

Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:141

Returns an iterable of entries in the map.

MapIterator<[number, Uint8Array<ArrayBufferLike>]>

Map.[iterator]


clear(): void

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:21

Removes all elements from the Map.

void

Map.clear


delete(key): boolean

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:25

number

boolean

true if an element in the Map existed and has been removed, or false if the element does not exist.

SyncMapStore.delete

Map.delete


entries(): MapIterator<[number, Uint8Array<ArrayBufferLike>]>

Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:146

Returns an iterable of key, value pairs for every entry in the map.

MapIterator<[number, Uint8Array<ArrayBufferLike>]>

Map.entries


forEach(callbackfn, thisArg?): void

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:29

Executes a provided function once per each key/value pair in the Map, in insertion order.

(value, key, map) => void

any

void

Map.forEach


get(key): Uint8Array<ArrayBufferLike> | undefined

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:34

Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

number

Uint8Array<ArrayBufferLike> | undefined

Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

SyncMapStore.get

Map.get


getOrInsert(key, defaultValue): Uint8Array

Defined in: ../../node_modules/typescript/lib/lib.esnext.collection.d.ts:25

Returns a specified element from the Map object. If no element is associated with the specified key, a new element with the value defaultValue will be inserted into the Map and returned.

number

Uint8Array

Uint8Array

The element associated with the specified key, which will be defaultValue if no element previously existed.

Map.getOrInsert


getOrInsertComputed(key, callback): Uint8Array

Defined in: ../../node_modules/typescript/lib/lib.esnext.collection.d.ts:31

Returns a specified element from the Map object. If no element is associated with the specified key, the result of passing the specified key to the callback function will be inserted into the Map and returned.

number

(key) => Uint8Array

Uint8Array

The element associated with the specific key, which will be the newly computed value if no element previously existed.

Map.getOrInsertComputed


has(key): boolean

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:38

number

boolean

boolean indicating whether an element with the specified key exists or not.

Map.has


keys(): MapIterator<number>

Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:151

Returns an iterable of keys in the map

MapIterator<number>

SyncMapStore.keys

Map.keys


set(key, value): this

Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:42

Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

number

Uint8Array

this

SyncMapStore.set

Map.set


sync(): Promise<void>

Defined in: src/backends/memory.ts:24

Syncs the store

Promise<void>

SyncMapStore.sync


transaction(): SyncMapTransaction

Defined in: src/backends/memory.ts:26

Begins a new transaction.

SyncMapTransaction

SyncMapStore.transaction


usage(): UsageInfo

Defined in: src/backends/memory.ts:36

Usage information for the store

UsageInfo

SyncMapStore.usage


values(): MapIterator<Uint8Array<ArrayBufferLike>>

Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:156

Returns an iterable of values in the map

MapIterator<Uint8Array<ArrayBufferLike>>

Map.values


static groupBy<K, T>(items, keySelector): Map<K, T[]>

Defined in: ../../node_modules/typescript/lib/lib.es2024.collection.d.ts:23

Groups members of an iterable according to the return value of the passed callback.

K

T

Iterable<T>

An iterable.

(item, index) => K

A callback which will be invoked for each item in items.

Map<K, T[]>

Map.groupBy