🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

interface-store

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interface-store - npm Package Compare versions

Comparing version
7.0.2
to
8.0.0
+1
-1
dist/index.min.js.map
{
"version": 3,
"sources": ["../src/index.ts", "../src/errors.ts"],
"sourcesContent": ["/**\n * @packageDocumentation\n *\n * An abstraction of the Datastore/Blockstore codebases.\n */\n\n/**\n * An iterable or async iterable of values\n */\nexport type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>\n\n/**\n * A generator or async generator of values\n */\nexport type AwaitGenerator<T, TReturn = any, TNext = any> = Generator<T, TReturn, TNext> | AsyncGenerator<T, TReturn, TNext>\n\n/**\n * A value or a promise of a value\n */\nexport type Await<T> = Promise<T> | T\n\n/**\n * Options for async operations\n *\n * @deprecated import from 'abort-error' module instead - this will be removed in a future release\n */\nexport interface AbortOptions {\n signal?: AbortSignal\n}\n\nexport interface Store<Key, Input, Output, InputPair, OutputPair,\n HasOptionsExtension = {}, PutOptionsExtension = {},\n PutManyOptionsExtension = {}, GetOptionsExtension = {},\n GetManyOptionsExtension = {}, DeleteOptionsExtension = {},\n DeleteManyOptionsExtension = {}> {\n /**\n * Check for the existence of a value for the passed key\n *\n * @example\n * ```js\n *const exists = await store.has(new Key('awesome'))\n *\n *if (exists) {\n * console.log('it is there')\n *} else {\n * console.log('it is not there')\n *}\n *```\n */\n has(key: Key, options?: AbortOptions & HasOptionsExtension): Await<boolean>\n\n /**\n * Store the passed value under the passed key\n *\n * @example\n *\n * ```js\n * await store.put([{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }])\n * ```\n */\n put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Await<Key>\n\n /**\n * Store the given key/value pairs\n *\n * @example\n * ```js\n * const source = [{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }]\n *\n * for await (const { key, value } of store.putMany(source)) {\n * console.info(`put content for key ${key}`)\n * }\n * ```\n */\n putMany(\n source: AwaitIterable<InputPair>,\n options?: AbortOptions & PutManyOptionsExtension\n ): AwaitGenerator<Key>\n\n /**\n * Retrieve the value stored under the given key\n *\n * @example\n * ```js\n * const value = await store.get(new Key('awesome'))\n * console.log('got content: %s', value.toString('utf8'))\n * // => got content: datastore\n * ```\n */\n get(key: Key, options?: AbortOptions & GetOptionsExtension): Output\n\n /**\n * Retrieve values for the passed keys\n *\n * @example\n * ```js\n * for await (const { key, value } of store.getMany([new Key('awesome')])) {\n * console.log(`got \"${key}\" = \"${new TextDecoder('utf8').decode(value)}\"`')\n * // => got \"/awesome\" = \"datastore\"\n * }\n * ```\n */\n getMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & GetManyOptionsExtension\n ): AwaitGenerator<OutputPair>\n\n /**\n * Remove the record for the passed key\n *\n * @example\n *\n * ```js\n * await store.delete(new Key('awesome'))\n * console.log('deleted awesome content :(')\n * ```\n */\n delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): Await<void>\n\n /**\n * Remove values for the passed keys\n *\n * @example\n *\n * ```js\n * const source = [new Key('awesome')]\n *\n * for await (const key of store.deleteMany(source)) {\n * console.log(`deleted content with key ${key}`)\n * }\n * ```\n */\n deleteMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & DeleteManyOptionsExtension\n ): AwaitGenerator<Key>\n}\n\nexport * from './errors.js'\n", "export class OpenFailedError extends Error {\n static name = 'OpenFailedError'\n name = OpenFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_OPEN_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = OpenFailedError.code\n\n constructor (message = 'Open failed') {\n super(message)\n }\n}\n\nexport class CloseFailedError extends Error {\n static name = 'CloseFailedError'\n name = CloseFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_CLOSE_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = CloseFailedError.code\n\n constructor (message = 'Close failed') {\n super(message)\n }\n}\n\nexport class PutFailedError extends Error {\n static name = 'PutFailedError'\n name = PutFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_PUT_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = PutFailedError.code\n\n constructor (message = 'Put failed') {\n super(message)\n }\n}\n\nexport class GetFailedError extends Error {\n static name = 'GetFailedError'\n name = GetFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_GET_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = GetFailedError.code\n\n constructor (message = 'Get failed') {\n super(message)\n }\n}\n\nexport class DeleteFailedError extends Error {\n static name = 'DeleteFailedError'\n name = DeleteFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_DELETE_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = DeleteFailedError.code\n\n constructor (message = 'Delete failed') {\n super(message)\n }\n}\n\nexport class HasFailedError extends Error {\n static name = 'HasFailedError'\n name = HasFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_HAS_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = HasFailedError.code\n\n constructor (message = 'Has failed') {\n super(message)\n }\n}\n\nexport class NotFoundError extends Error {\n static name = 'NotFoundError'\n name = NotFoundError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_NOT_FOUND'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = NotFoundError.code\n\n constructor (message = 'Not Found') {\n super(message)\n }\n}\n\n/**\n * @deprecated import from 'abort-error' module instead - this will be removed in a future release\n */\nexport class AbortError extends Error {\n static name = 'AbortError'\n name = AbortError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_ABORTED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = AbortError.code\n\n constructor (message = 'Aborted') {\n super(message)\n }\n}\n"],
"sourcesContent": ["/**\n * @packageDocumentation\n *\n * An abstraction of the Datastore/Blockstore codebases.\n */\n\nimport type { AbortOptions } from 'abort-error'\n\nexport interface Store<Key, Input, Output, InputPair, OutputPair,\n HasOptionsExtension = {}, PutOptionsExtension = {},\n PutManyOptionsExtension = {}, GetOptionsExtension = {},\n GetManyOptionsExtension = {}, DeleteOptionsExtension = {},\n DeleteManyOptionsExtension = {}> {\n /**\n * Check for the existence of a value for the passed key\n *\n * @example\n * ```js\n *const exists = await store.has(new Key('awesome'))\n *\n *if (exists) {\n * console.log('it is there')\n *} else {\n * console.log('it is not there')\n *}\n *```\n */\n has(key: Key, options?: AbortOptions & HasOptionsExtension): boolean | Promise<boolean>\n\n /**\n * Store the passed value under the passed key\n *\n * @example\n *\n * ```js\n * await store.put([{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }])\n * ```\n */\n put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Key | Promise<Key>\n\n /**\n * Store the given key/value pairs\n *\n * @example\n * ```js\n * const source = [{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }]\n *\n * for await (const { key, value } of store.putMany(source)) {\n * console.info(`put content for key ${key}`)\n * }\n * ```\n */\n putMany(\n source: Iterable<InputPair> | AsyncIterable<InputPair>,\n options?: AbortOptions & PutManyOptionsExtension\n ): Generator<Key> | AsyncGenerator<Key>\n\n /**\n * Retrieve the value stored under the given key\n *\n * @example\n * ```js\n * const value = await store.get(new Key('awesome'))\n * console.log('got content: %s', value.toString('utf8'))\n * // => got content: datastore\n * ```\n */\n get(key: Key, options?: AbortOptions & GetOptionsExtension): Output\n\n /**\n * Retrieve values for the passed keys\n *\n * @example\n * ```js\n * for await (const { key, value } of store.getMany([new Key('awesome')])) {\n * console.log(`got \"${key}\" = \"${new TextDecoder('utf8').decode(value)}\"`')\n * // => got \"/awesome\" = \"datastore\"\n * }\n * ```\n */\n getMany(\n source: Iterable<Key> | AsyncIterable<Key>,\n options?: AbortOptions & GetManyOptionsExtension\n ): Generator<OutputPair> | AsyncGenerator<OutputPair>\n\n /**\n * Remove the record for the passed key\n *\n * @example\n *\n * ```js\n * await store.delete(new Key('awesome'))\n * console.log('deleted awesome content :(')\n * ```\n */\n delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): void | Promise<void>\n\n /**\n * Remove values for the passed keys\n *\n * @example\n *\n * ```js\n * const source = [new Key('awesome')]\n *\n * for await (const key of store.deleteMany(source)) {\n * console.log(`deleted content with key ${key}`)\n * }\n * ```\n */\n deleteMany(\n source: Iterable<Key> | AsyncIterable<Key>,\n options?: AbortOptions & DeleteManyOptionsExtension\n ): Generator<Key> | AsyncGenerator<Key>\n}\n\nexport * from './errors.ts'\n", "export class OpenFailedError extends Error {\n static name = 'OpenFailedError'\n name = OpenFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_OPEN_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = OpenFailedError.code\n\n constructor (message = 'Open failed') {\n super(message)\n }\n}\n\nexport class CloseFailedError extends Error {\n static name = 'CloseFailedError'\n name = CloseFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_CLOSE_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = CloseFailedError.code\n\n constructor (message = 'Close failed') {\n super(message)\n }\n}\n\nexport class PutFailedError extends Error {\n static name = 'PutFailedError'\n name = PutFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_PUT_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = PutFailedError.code\n\n constructor (message = 'Put failed') {\n super(message)\n }\n}\n\nexport class GetFailedError extends Error {\n static name = 'GetFailedError'\n name = GetFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_GET_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = GetFailedError.code\n\n constructor (message = 'Get failed') {\n super(message)\n }\n}\n\nexport class DeleteFailedError extends Error {\n static name = 'DeleteFailedError'\n name = DeleteFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_DELETE_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = DeleteFailedError.code\n\n constructor (message = 'Delete failed') {\n super(message)\n }\n}\n\nexport class HasFailedError extends Error {\n static name = 'HasFailedError'\n name = HasFailedError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_HAS_FAILED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = HasFailedError.code\n\n constructor (message = 'Has failed') {\n super(message)\n }\n}\n\nexport class NotFoundError extends Error {\n static name = 'NotFoundError'\n name = NotFoundError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_NOT_FOUND'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = NotFoundError.code\n\n constructor (message = 'Not Found') {\n super(message)\n }\n}\n\n/**\n * @deprecated import from 'abort-error' module instead - this will be removed in a future release\n */\nexport class AbortError extends Error {\n static name = 'AbortError'\n name = AbortError.name\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n static code = 'ERR_ABORTED'\n\n /**\n * @deprecated use `.name` instead - this will be removed in a future release\n */\n code = AbortError.code\n\n constructor (message = 'Aborted') {\n super(message)\n }\n}\n"],
"mappings": ";kcAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,qBAAAC,EAAA,sBAAAC,EAAA,mBAAAC,EA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,CACnC,OAAO,KAAO,aACd,KAAOA,EAAW,KAKlB,OAAO,KAAO,cAKd,KAAOA,EAAW,KAElB,YAAad,EAAU,UAAS,CAC9B,MAAMA,CAAO,CACf",
"names": ["index_exports", "__export", "AbortError", "CloseFailedError", "DeleteFailedError", "GetFailedError", "HasFailedError", "NotFoundError", "OpenFailedError", "PutFailedError", "OpenFailedError", "_OpenFailedError", "message", "CloseFailedError", "_CloseFailedError", "PutFailedError", "_PutFailedError", "GetFailedError", "_GetFailedError", "DeleteFailedError", "_DeleteFailedError", "HasFailedError", "_HasFailedError", "NotFoundError", "_NotFoundError", "AbortError", "_AbortError"]
}

@@ -6,22 +6,3 @@ /**

*/
/**
* An iterable or async iterable of values
*/
export type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>;
/**
* A generator or async generator of values
*/
export type AwaitGenerator<T, TReturn = any, TNext = any> = Generator<T, TReturn, TNext> | AsyncGenerator<T, TReturn, TNext>;
/**
* A value or a promise of a value
*/
export type Await<T> = Promise<T> | T;
/**
* Options for async operations
*
* @deprecated import from 'abort-error' module instead - this will be removed in a future release
*/
export interface AbortOptions {
signal?: AbortSignal;
}
import type { AbortOptions } from 'abort-error';
export interface Store<Key, Input, Output, InputPair, OutputPair, HasOptionsExtension = {}, PutOptionsExtension = {}, PutManyOptionsExtension = {}, GetOptionsExtension = {}, GetManyOptionsExtension = {}, DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> {

@@ -42,3 +23,3 @@ /**

*/
has(key: Key, options?: AbortOptions & HasOptionsExtension): Await<boolean>;
has(key: Key, options?: AbortOptions & HasOptionsExtension): boolean | Promise<boolean>;
/**

@@ -53,3 +34,3 @@ * Store the passed value under the passed key

*/
put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Await<Key>;
put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Key | Promise<Key>;
/**

@@ -67,3 +48,3 @@ * Store the given key/value pairs

*/
putMany(source: AwaitIterable<InputPair>, options?: AbortOptions & PutManyOptionsExtension): AwaitGenerator<Key>;
putMany(source: Iterable<InputPair> | AsyncIterable<InputPair>, options?: AbortOptions & PutManyOptionsExtension): Generator<Key> | AsyncGenerator<Key>;
/**

@@ -91,3 +72,3 @@ * Retrieve the value stored under the given key

*/
getMany(source: AwaitIterable<Key>, options?: AbortOptions & GetManyOptionsExtension): AwaitGenerator<OutputPair>;
getMany(source: Iterable<Key> | AsyncIterable<Key>, options?: AbortOptions & GetManyOptionsExtension): Generator<OutputPair> | AsyncGenerator<OutputPair>;
/**

@@ -103,3 +84,3 @@ * Remove the record for the passed key

*/
delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): Await<void>;
delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): void | Promise<void>;
/**

@@ -118,5 +99,5 @@ * Remove values for the passed keys

*/
deleteMany(source: AwaitIterable<Key>, options?: AbortOptions & DeleteManyOptionsExtension): AwaitGenerator<Key>;
deleteMany(source: Iterable<Key> | AsyncIterable<Key>, options?: AbortOptions & DeleteManyOptionsExtension): Generator<Key> | AsyncGenerator<Key>;
}
export * from './errors.js';
export * from './errors.ts';
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;AAE7D;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AAE5H;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA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G,mBAAmB,GAAG,MAAM,CAAA;IAEnE;;;;;;;;;;OAUG;IACH,OAAO,CACL,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,EAC1C,OAAO,CAAC,EAAE,YAAY,GAAG,uBAAuB,GAC/C,SAAS,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;IAErD;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,sBAAsB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEvF;;;;;;;;;;;;OAYG;IACH,UAAU,CACR,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,EAC1C,OAAO,CAAC,EAAE,YAAY,GAAG,0BAA0B,GAClD,SAAS,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAA;CACxC;AAED,cAAc,aAAa,CAAA"}

@@ -6,3 +6,3 @@ /**

*/
export * from './errors.js';
export * from "./errors.js";
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsIH,cAAc,aAAa,CAAA"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgHH,cAAc,aAAa,CAAA"}

@@ -10,12 +10,4 @@ {

"PutFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.PutFailedError.html",
"AbortOptions": "https://ipfs.github.io/js-stores/interfaces/interface-store.AbortOptions.html",
".:AbortOptions": "https://ipfs.github.io/js-stores/interfaces/interface-store.AbortOptions.html",
"Store": "https://ipfs.github.io/js-stores/interfaces/interface-store.Store.html",
".:Store": "https://ipfs.github.io/js-stores/interfaces/interface-store.Store.html",
"Await": "https://ipfs.github.io/js-stores/types/interface-store.Await.html",
".:Await": "https://ipfs.github.io/js-stores/types/interface-store.Await.html",
"AwaitGenerator": "https://ipfs.github.io/js-stores/types/interface-store.AwaitGenerator.html",
".:AwaitGenerator": "https://ipfs.github.io/js-stores/types/interface-store.AwaitGenerator.html",
"AwaitIterable": "https://ipfs.github.io/js-stores/types/interface-store.AwaitIterable.html",
".:AwaitIterable": "https://ipfs.github.io/js-stores/types/interface-store.AwaitIterable.html"
".:Store": "https://ipfs.github.io/js-stores/interfaces/interface-store.Store.html"
}
{
"name": "interface-store",
"version": "7.0.2",
"version": "8.0.0",
"description": "A generic interface for storing and retrieving data",

@@ -133,5 +133,8 @@ "license": "Apache-2.0 OR MIT",

},
"dependencies": {
"abort-error": "^1.0.2"
},
"devDependencies": {
"aegir": "^47.1.0"
"aegir": "^48.0.4"
}
}

@@ -7,26 +7,4 @@ /**

/**
* An iterable or async iterable of values
*/
export type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>
import type { AbortOptions } from 'abort-error'
/**
* A generator or async generator of values
*/
export type AwaitGenerator<T, TReturn = any, TNext = any> = Generator<T, TReturn, TNext> | AsyncGenerator<T, TReturn, TNext>
/**
* A value or a promise of a value
*/
export type Await<T> = Promise<T> | T
/**
* Options for async operations
*
* @deprecated import from 'abort-error' module instead - this will be removed in a future release
*/
export interface AbortOptions {
signal?: AbortSignal
}
export interface Store<Key, Input, Output, InputPair, OutputPair,

@@ -51,3 +29,3 @@ HasOptionsExtension = {}, PutOptionsExtension = {},

*/
has(key: Key, options?: AbortOptions & HasOptionsExtension): Await<boolean>
has(key: Key, options?: AbortOptions & HasOptionsExtension): boolean | Promise<boolean>

@@ -63,3 +41,3 @@ /**

*/
put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Await<Key>
put(key: Key, val: Input, options?: AbortOptions & PutOptionsExtension): Key | Promise<Key>

@@ -79,5 +57,5 @@ /**

putMany(
source: AwaitIterable<InputPair>,
source: Iterable<InputPair> | AsyncIterable<InputPair>,
options?: AbortOptions & PutManyOptionsExtension
): AwaitGenerator<Key>
): Generator<Key> | AsyncGenerator<Key>

@@ -108,5 +86,5 @@ /**

getMany(
source: AwaitIterable<Key>,
source: Iterable<Key> | AsyncIterable<Key>,
options?: AbortOptions & GetManyOptionsExtension
): AwaitGenerator<OutputPair>
): Generator<OutputPair> | AsyncGenerator<OutputPair>

@@ -123,3 +101,3 @@ /**

*/
delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): Await<void>
delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): void | Promise<void>

@@ -140,7 +118,7 @@ /**

deleteMany(
source: AwaitIterable<Key>,
source: Iterable<Key> | AsyncIterable<Key>,
options?: AbortOptions & DeleteManyOptionsExtension
): AwaitGenerator<Key>
): Generator<Key> | AsyncGenerator<Key>
}
export * from './errors.js'
export * from './errors.ts'