Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/encoding-down) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Installation
npm install --save @types/encoding-down
Summary
This package contains type definitions for encoding-down (https://github.com/Level/encoding-down).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/encoding-down.
index.d.ts
// Type definitions for encoding-down 5.0
// Project: https://github.com/Level/encoding-down
// Definitions by: Meirion Hughes <https://github.com/MeirionHughes>
// Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import {
AbstractLevelDOWN,
AbstractIteratorOptions,
AbstractIterator,
AbstractOpenOptions,
AbstractGetOptions,
ErrorCallback,
ErrorValueCallback,
AbstractChainedBatch,
AbstractBatch,
AbstractOptions
} from 'abstract-leveldown';
import { CodecOptions, CodecEncoder } from 'level-codec';
interface EncodingDown<K = any, V = any> extends AbstractLevelDOWN<K, V> {
get(key: K, cb: ErrorValueCallback<V>): void;
get(key: K, options: EncodingDown.GetOptions, cb: ErrorValueCallback<V>): void;
put(key: K, value: V, cb: ErrorCallback): void;
put(key: K, value: V, options: EncodingDown.PutOptions, cb: ErrorCallback): void;
del(key: K, cb: ErrorCallback): void;
del(key: K, options: EncodingDown.DelOptions, cb: ErrorCallback): void;
batch(): EncodingDown.ChainedBatch;
batch(array: AbstractBatch[], cb: ErrorCallback): EncodingDown.ChainedBatch;
batch(array: AbstractBatch[], options: EncodingDown.BatchOptions, cb: ErrorCallback): EncodingDown.ChainedBatch;
iterator(options?: EncodingDown.IteratorOptions): AbstractIterator<any, any>;
}
declare namespace EncodingDown {
interface GetOptions extends AbstractGetOptions, CodecOptions {}
interface PutOptions extends AbstractOptions, CodecOptions {}
interface DelOptions extends AbstractOptions, CodecOptions {}
interface BatchOptions extends AbstractOptions, CodecOptions {}
interface IteratorOptions extends AbstractIteratorOptions, CodecOptions {}
interface ChainedBatch<K = any, V = any> extends AbstractChainedBatch<K, V> {
write(cb: any): any;
write(options: CodecOptions & AbstractOptions, cb: any): any;
}
interface Constructor {
// eslint-disable-next-line no-unnecessary-generics
<K = any, V = any>(db: AbstractLevelDOWN, options?: CodecOptions): EncodingDown<K, V>;
// eslint-disable-next-line no-unnecessary-generics
new <K = any, V = any>(db: AbstractLevelDOWN, options?: CodecOptions): EncodingDown<K, V>;
}
}
declare const EncodingDown: EncodingDown.Constructor;
export default EncodingDown;
Additional Details
- Last updated: Fri, 30 Dec 2022 23:03:38 GMT
- Dependencies: @types/abstract-leveldown, @types/level-codec
- Global values: none
Credits
These definitions were written by Meirion Hughes, and Daniel Byrne.