Skip to main content
Version: 0.17

Class: IndexedDBBucket

Bucket for persisting transient data in IndexedDB.

Hierarchy​

  • Bucket

    ↳ IndexedDBBucket

Constructors​

constructor​

• new IndexedDBBucket(settings?)

Create a new IndexedDBBucket.

Parameters​

NameType
settingsIndexedDBBucketSettings

Overrides​

Bucket.constructor

Defined in​

indexeddb-bucket/src/bucket.ts:25

Accessors​

dbName​

• get dbName(): string

IndexedDB database name.

Defaults to 'orbit-bucket', which can be overridden in the constructor.

Returns​

string

Defined in​

indexeddb-bucket/src/bucket.ts:61


dbStoreName​

• get dbStoreName(): string

IndexedDB ObjectStore name.

Defaults to 'settings', which can be overridden in the constructor.

Returns​

string

Defined in​

indexeddb-bucket/src/bucket.ts:70


dbVersion​

• get dbVersion(): number

The version to specify when opening the IndexedDB database.

IndexedDB's default verions is 1.

Returns​

number

Defined in​

indexeddb-bucket/src/bucket.ts:52


isDBOpen​

• get isDBOpen(): boolean

Returns​

boolean

Defined in​

indexeddb-bucket/src/bucket.ts:74


name​

• get name(): undefined | string

Name used for tracking and debugging a bucket instance.

Returns​

undefined | string

Inherited from​

Bucket.name

Defined in​

core/dist/modules/bucket.d.ts:63


namespace​

• get namespace(): string

The namespace used by the bucket when accessing any items.

This is used to distinguish one bucket's contents from another.

Returns​

string

Inherited from​

Bucket.namespace

Defined in​

core/dist/modules/bucket.d.ts:69


version​

• get version(): number

The current version of the bucket.

This is read-only. To change versions, upgrade should be invoked.

Returns​

number

Inherited from​

Bucket.version

Defined in​

core/dist/modules/bucket.d.ts:75

Methods​

_applySettings​

â–¸ _applySettings(settings): Promise<void>

Parameters​

NameType
settingsIndexedDBBucketSettings

Returns​

Promise<void>

Overrides​

Bucket._applySettings

Defined in​

indexeddb-bucket/src/bucket.ts:40


clear​

â–¸ clear(): Promise<void>

Returns​

Promise<void>

Overrides​

Bucket.clear

Defined in​

indexeddb-bucket/src/bucket.ts:216


closeDB​

â–¸ closeDB(): void

Returns​

void

Defined in​

indexeddb-bucket/src/bucket.ts:109


createDB​

â–¸ createDB(db): void

Parameters​

NameType
dbIDBDatabase

Returns​

void

Defined in​

indexeddb-bucket/src/bucket.ts:121


deleteDB​

â–¸ deleteDB(): Promise<void>

Returns​

Promise<void>

Defined in​

indexeddb-bucket/src/bucket.ts:137


emit​

â–¸ emit(event, ...args): void

Parameters​

NameType
eventEvent
...argsunknown[]

Returns​

void

Inherited from​

Bucket.emit

Defined in​

core/dist/modules/evented.d.ts:23


getItem​

â–¸ getItem(key): Promise<any>

Parameters​

NameType
keystring

Returns​

Promise<any>

Overrides​

Bucket.getItem

Defined in​

indexeddb-bucket/src/bucket.ts:156


listeners​

â–¸ listeners(event): Listener[]

Parameters​

NameType
eventEvent

Returns​

Listener[]

Inherited from​

Bucket.listeners

Defined in​

core/dist/modules/evented.d.ts:24


migrateDB​

â–¸ migrateDB(db, event): void

Migrate database.

Parameters​

NameType
dbIDBDatabase
eventIDBVersionChangeEvent

Returns​

void

Defined in​

indexeddb-bucket/src/bucket.ts:128


off​

â–¸ off(event, listener?): void

Parameters​

NameType
eventEvent
listener?Listener

Returns​

void

Inherited from​

Bucket.off

Defined in​

core/dist/modules/evented.d.ts:21


on​

â–¸ on(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Bucket.on

Defined in​

core/dist/modules/evented.d.ts:20


one​

â–¸ one(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Bucket.one

Defined in​

core/dist/modules/evented.d.ts:22


openDB​

â–¸ openDB(): Promise<IDBDatabase>

Returns​

Promise<IDBDatabase>

Defined in​

indexeddb-bucket/src/bucket.ts:78


removeItem​

â–¸ removeItem(key): Promise<void>

Parameters​

NameType
keystring

Returns​

Promise<void>

Overrides​

Bucket.removeItem

Defined in​

indexeddb-bucket/src/bucket.ts:197


reopenDB​

â–¸ reopenDB(): Promise<IDBDatabase>

Returns​

Promise<IDBDatabase>

Defined in​

indexeddb-bucket/src/bucket.ts:116


setItem​

â–¸ setItem(key, value): Promise<void>

Parameters​

NameType
keystring
valueunknown

Returns​

Promise<void>

Overrides​

Bucket.setItem

Defined in​

indexeddb-bucket/src/bucket.ts:176


upgrade​

â–¸ upgrade(settings): Promise<void>

Parameters​

NameType
settingsIndexedDBBucketSettings

Returns​

Promise<void>

Overrides​

Bucket.upgrade

Defined in​

indexeddb-bucket/src/bucket.ts:34