split-frames 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,57 +1,52 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- import { Transform } from "node:stream";
5
- export declare type tTagObject = {
6
- [key: string]: tTag;
7
- };
8
- export declare type tControlBits = "none" | "end+1" | "end+2";
9
- export declare type tTag = number | Buffer | Array<number> | Array<Buffer>;
10
- export interface iSearchedBits {
11
- "start": number;
12
- "end": number;
13
- }
14
- export interface iOptions {
15
- "startWith"?: tTag;
16
- "startTimeout"?: number;
17
- "endWith"?: tTag;
18
- "escapeWith"?: tTag;
19
- "escaped"?: Array<number>;
20
- "specifics"?: tTagObject;
21
- "controlBits"?: tControlBits;
22
- }
23
- export interface iConf extends iOptions {
24
- "escaped": Array<number>;
25
- "specifics": tTagObject;
26
- "controlBits": tControlBits;
27
- }
28
- export default class SplitFrames extends Transform {
29
- protected _frame: Buffer;
30
- protected _digesting: boolean;
31
- protected _timeoutDigest: NodeJS.Timeout | null;
32
- protected _startWith: iConf["startWith"];
33
- protected _startTimeout: iConf["startTimeout"];
34
- protected _endWith: iConf["endWith"];
35
- protected _escapeWith: iConf["escapeWith"];
36
- protected _escaped: iConf["escaped"];
37
- protected _specifics: iConf["specifics"];
38
- protected _controlBits: iConf["controlBits"];
39
- protected _digester: (enc?: BufferEncoding) => void;
40
- constructor(options?: iOptions);
41
- _transform(chunk: Buffer, enc: BufferEncoding, cb: (err?: Error | null, data?: any) => void): void;
42
- protected _chooseDigester(): (enc?: BufferEncoding) => void;
43
- protected _digest(enc?: BufferEncoding): void;
44
- private _digestNoStartNoEnd;
45
- private _digestStartOnly;
46
- private _digestEndOnly;
47
- private _extractSpecifics;
48
- private _digestStartAndEnd;
49
- private _searchFirstTag;
50
- private _searchFirstNumberTag;
51
- private _searchFirstBufferOrArrayTag;
52
- private _searchFirstStart;
53
- private _searchFirstEnd;
54
- private _searchTags;
55
- private _searchNumberTags;
56
- private _searchBufferOrArrayTags;
57
- }
1
+ import { Transform } from "node:stream";
2
+ export type tTagObject = Record<string, tTag>;
3
+ export type tControlBits = "none" | "end+1" | "end+2";
4
+ export type tTag = number | Buffer | number[] | Buffer[];
5
+ export interface iSearchedBits {
6
+ "start": number;
7
+ "end": number;
8
+ }
9
+ export interface iOptions {
10
+ "startWith"?: tTag;
11
+ "startTimeout"?: number;
12
+ "endWith"?: tTag;
13
+ "escapeWith"?: tTag;
14
+ "escaped"?: number[];
15
+ "specifics"?: tTagObject;
16
+ "controlBits"?: tControlBits;
17
+ }
18
+ export interface iConf extends iOptions {
19
+ "escaped": number[];
20
+ "specifics": tTagObject;
21
+ "controlBits": tControlBits;
22
+ }
23
+ export default class SplitFrames extends Transform {
24
+ protected _frame: Buffer;
25
+ protected _digesting: boolean;
26
+ protected _timeoutDigest: NodeJS.Timeout | null;
27
+ protected _startWith: iConf["startWith"];
28
+ protected _startTimeout: iConf["startTimeout"];
29
+ protected _endWith: iConf["endWith"];
30
+ protected _escapeWith: iConf["escapeWith"];
31
+ protected _escaped: iConf["escaped"];
32
+ protected _specifics: iConf["specifics"];
33
+ protected _controlBits: iConf["controlBits"];
34
+ protected _digester: (enc?: BufferEncoding) => void;
35
+ constructor(options?: iOptions);
36
+ _transform(chunk: Buffer, enc: BufferEncoding, cb: (err?: Error | null, data?: unknown) => void): void;
37
+ protected _chooseDigester(): (enc?: BufferEncoding) => void;
38
+ protected _digest(enc?: BufferEncoding): void;
39
+ private _digestNoStartNoEnd;
40
+ private _digestStartOnly;
41
+ private _digestEndOnly;
42
+ private _extractSpecifics;
43
+ private _digestStartAndEnd;
44
+ private _searchFirstTag;
45
+ private _searchFirstNumberTag;
46
+ private _searchFirstBufferOrArrayTag;
47
+ private _searchFirstStart;
48
+ private _searchFirstEnd;
49
+ private _searchTags;
50
+ private _searchNumberTags;
51
+ private _searchBufferOrArrayTags;
52
+ }