Comparing version 2.1.0 to 2.1.1
/// <reference types="node" /> | ||
import { BencodeTypes } from './types'; | ||
export declare class BencodeDecoder { | ||
@@ -17,5 +18,3 @@ /** | ||
*/ | ||
decode(): string | number | Buffer | (string | number | object | Buffer)[] | { | ||
[key: string]: string | number | object | Buffer; | ||
}; | ||
decode(): BencodeTypes; | ||
/** | ||
@@ -46,5 +45,3 @@ * Get character by current index | ||
} | ||
export declare function decode(data: Buffer | string, stringify?: boolean): string | number | Buffer | (string | number | object | Buffer)[] | { | ||
[key: string]: string | number | object | Buffer; | ||
}; | ||
export declare function decode(data: Buffer | string, stringify?: boolean): BencodeTypes; | ||
export default decode; |
/// <reference types="node" /> | ||
import { EncodeTypes } from './types'; | ||
import { EncodeSupportedTypes } from './types'; | ||
export declare class BencodeEncoder { | ||
@@ -15,3 +15,3 @@ private _integerIdentifier; | ||
*/ | ||
encode(data: EncodeTypes): string | Buffer; | ||
encode(data: EncodeSupportedTypes): Buffer | string; | ||
/** | ||
@@ -42,3 +42,3 @@ * Encode data by type | ||
} | ||
export declare function encode(data: EncodeTypes, stringify?: boolean): string | Buffer; | ||
export declare function encode(data: EncodeSupportedTypes, stringify?: boolean): Buffer | string; | ||
export default encode; |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
export declare enum FLAG { | ||
@@ -11,4 +12,7 @@ INTEGER = 105, | ||
} | ||
declare type ItemTypes = string | number | boolean | object; | ||
export declare type EncodeTypes = ItemTypes | Array<ItemTypes>; | ||
export {}; | ||
export declare type BencodeList = Array<BencodeTypes>; | ||
export declare type BencodeDictionary = { | ||
[key: string]: BencodeTypes; | ||
}; | ||
export declare type BencodeTypes = string | number | Buffer | BencodeDictionary | BencodeList; | ||
export declare type EncodeSupportedTypes = BencodeTypes | ArrayBuffer | ArrayBufferView | Boolean; |
{ | ||
"name": "bencodec", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Fast and easy to use bencode codec.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
14547
373