@types/levelup

  • Version 5.1.2
  • Published
  • 9.68 kB
  • 3 dependencies
  • MIT license

Install

npm i @types/levelup
yarn add @types/levelup
pnpm add @types/levelup

Overview

TypeScript definitions for levelup

Index

Variables

variable levelup

const levelup: levelup.LevelUpConstructor;

    Interfaces

    interface LevelUp

    interface LevelUp<DB = AbstractLevelDOWN, Iterator = AbstractIterator<any, any>>
    extends EventEmitter {}

      property clear

      clear: InferDBClear<DB>;

        property del

        del: InferDBDel<DB>;

          property get

          get: InferDBGet<DB>;

            property getMany

            getMany: InferDBGetMany<DB>;

              property put

              put: InferDBPut<DB>;

                property status

                readonly status: 'closed' | 'open' | 'opening' | 'new' | 'closing';

                  method batch

                  batch: {
                  (array: AbstractBatch[], options?: any): Promise<void>;
                  (array: AbstractBatch[], options: any, callback: (err?: any) => any): void;
                  (array: AbstractBatch[], callback: (err?: any) => any): void;
                  (): LevelUpChain<any, any>;
                  };

                    method close

                    close: { (): Promise<void>; (callback?: ErrorCallback): void };

                      method createKeyStream

                      createKeyStream: (options?: AbstractIteratorOptions) => NodeJS.ReadableStream;

                        method createReadStream

                        createReadStream: (options?: AbstractIteratorOptions) => NodeJS.ReadableStream;

                          method createValueStream

                          createValueStream: (options?: AbstractIteratorOptions) => NodeJS.ReadableStream;

                            method isClosed

                            isClosed: () => boolean;

                              method isOpen

                              isOpen: () => boolean;

                                method isOperational

                                isOperational: () => boolean;

                                  method iterator

                                  iterator: (options?: AbstractIteratorOptions) => Iterator;

                                    method on

                                    on: {
                                    (event: 'put', cb: (key: any, value: any) => void): this;
                                    (event: 'del', cb: (key: any) => void): this;
                                    (event: 'batch', cb: (ary: any[]) => void): this;
                                    (event: 'clear', cb: (opts: any) => void): this;
                                    (
                                    event: 'closed' | 'open' | 'opening' | 'closing' | 'ready',
                                    cb: () => void
                                    ): this;
                                    };

                                      method open

                                      open: { (): Promise<void>; (callback?: ErrorCallback): void };

                                        interface LevelUpChain

                                        interface LevelUpChain<K = any, V = any> {}

                                          property length

                                          readonly length: number;

                                            method clear

                                            clear: () => this;

                                              method del

                                              del: (key: K) => this;

                                                method put

                                                put: (key: K, value: V) => this;

                                                  method write

                                                  write: { (callback: ErrorCallback): this; (): Promise<this> };

                                                    interface LevelUpConstructor

                                                    interface LevelUpConstructor {}

                                                      property errors

                                                      errors: {
                                                      LevelUPError: typeof LevelUPError;
                                                      InitializationError: typeof InitializationError;
                                                      OpenError: typeof OpenError;
                                                      ReadError: typeof ReadError;
                                                      WriteError: typeof WriteError;
                                                      NotFoundError: typeof NotFoundError;
                                                      EncodingError: typeof EncodingError;
                                                      };

                                                        construct signature

                                                        new <DB extends AbstractLevelDOWN = AbstractLevelDOWN>(
                                                        db: DB,
                                                        options: any,
                                                        cb?: ErrorCallback
                                                        ): LevelUp<DB>;

                                                          construct signature

                                                          new <DB extends AbstractLevelDOWN = AbstractLevelDOWN>(
                                                          db: DB,
                                                          cb?: ErrorCallback
                                                          ): LevelUp<DB>;

                                                            call signature

                                                            <DB extends AbstractLevelDOWN = AbstractLevelDOWN>(
                                                            db: DB,
                                                            options: any,
                                                            cb?: ErrorCallback
                                                            ): LevelUp<DB>;

                                                              call signature

                                                              <DB extends AbstractLevelDOWN = AbstractLevelDOWN>(
                                                              db: DB,
                                                              cb?: ErrorCallback
                                                              ): LevelUp<DB>;

                                                                Package Files (1)

                                                                Dependencies (3)

                                                                Dev Dependencies (0)

                                                                No dev dependencies.

                                                                Peer Dependencies (0)

                                                                No peer dependencies.

                                                                Badge

                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/levelup.

                                                                • Markdown
                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/levelup)
                                                                • HTML
                                                                  <a href="https://www.jsdocs.io/package/@types/levelup"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>