@types/level-codec
TypeScript icon, indicating that this package has built-in type declarations

9.0.4 • Public • Published

Installation

npm install --save @types/level-codec

Summary

This package contains type definitions for level-codec (https://github.com/Level/codec).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/level-codec.

index.d.ts

export interface CodecEncoder {
    encode: (val: any) => any;
    decode: (val: any) => any;
    buffer: boolean;
    type: string;
}
export interface CodecOptions {
    keyEncoding?: string | CodecEncoder | undefined;
    valueEncoding?: string | CodecEncoder | undefined;
}
export interface Codec {
    encodeKey(key: any, opts?: CodecOptions, batchOpts?: CodecOptions): any;
    encodeValue(value: any, opts?: CodecOptions, batchOpts?: CodecOptions): any;
    decodeKey(key: any, opts?: CodecOptions): any;
    decodeValue(value: any, opts?: CodecOptions): any;
    encodeBatch(ops: any, opts?: CodecOptions): any;
    encodeLtgt(ltgt: any): any;
    createStreamDecoder(opts: CodecOptions): any;
    keyAsBuffer(opts?: CodecOptions): any;
    valueAsBuffer(opts?: CodecOptions): any;
}
export interface CodecConstructor {
    new(options?: CodecOptions): Codec;
    (options?: CodecOptions): Codec;
}

export const Codec: CodecConstructor;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: none

Credits

These definitions were written by Daniel Byrne.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/level-codec

Weekly Downloads

2,409

Version

9.0.4

License

MIT

Unpacked Size

4.43 kB

Total Files

5

Last publish

Collaborators

  • types