9.0.4 • Published 7 months ago

@types/level-codec v9.0.4

Weekly downloads
2,326
License
MIT
Repository
github
Last release
7 months ago

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

// Type definitions for level-codec 9.0
// Project: https://github.com/Level/codec
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Thu, 08 Jul 2021 16:23:41 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Daniel Byrne.