diff --git a/src/index.ts b/src/index.ts index c9985be..36b7edc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,21 @@ -import { getBucket } from './bucket' +import { Bucket, getBucket } from './bucket' + +type Storage = { + local: Bucket>, + sync: Bucket>, + managed: Bucket>, +} + +class StorageImpl implements Storage { + get local(): Bucket> { return getBucket>('local', 'local') } + get sync(): Bucket> { return getBucket>('sync', 'sync') } + get managed(): Bucket> { return getBucket>('managed', 'managed') } +} /** * Buckets for each storage area. */ -export const storage = { - local: getBucket>('local', 'local'), - sync: getBucket>('sync', 'sync'), - managed: getBucket>('managed', 'managed'), -} +export const storage: Storage = new StorageImpl() // Workaround for @rollup/plugin-typescript export * from './types'