Socket
Socket
Sign inDemoInstall

@types/encoding-down

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/encoding-down

TypeScript definitions for encoding-down


Version published
Maintainers
1
Created
Source

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

import {
    AbstractBatch,
    AbstractChainedBatch,
    AbstractGetOptions,
    AbstractIterator,
    AbstractIteratorOptions,
    AbstractLevelDOWN,
    AbstractOpenOptions,
    AbstractOptions,
    ErrorCallback,
    ErrorValueCallback,
} from "abstract-leveldown";

import { CodecEncoder, CodecOptions } 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 @definitelytyped/no-unnecessary-generics
        <K = any, V = any>(db: AbstractLevelDOWN, options?: CodecOptions): EncodingDown<K, V>;
        // eslint-disable-next-line @definitelytyped/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

Credits

These definitions were written by Meirion Hughes, and Daniel Byrne.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc