yolkbot 0.1.4-alpha.15 → 0.1.4-alpha.16
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.
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare class CommIn {
|
|
2
|
+
static buffer: Uint8Array;
|
|
3
|
+
static idx: number;
|
|
4
|
+
static init(buf: ArrayBuffer): void;
|
|
5
|
+
static isMoreDataAvailable(): number;
|
|
6
|
+
static peekInt8U(): number;
|
|
7
|
+
static unPackInt8U(): number;
|
|
8
|
+
static unPackInt8(): number;
|
|
9
|
+
static unPackInt16U(): number;
|
|
10
|
+
static unPackInt24U(): number;
|
|
11
|
+
static unPackInt32U(): number;
|
|
12
|
+
static unPackInt16(): number;
|
|
13
|
+
static unPackInt32(): number;
|
|
14
|
+
static unPackRadU(): number;
|
|
15
|
+
static unPackRad(): number;
|
|
16
|
+
static unPackFloat(): number;
|
|
17
|
+
static unPackDouble(): number;
|
|
18
|
+
static unPackString(maxLen?: number): string | number;
|
|
19
|
+
static unPackLongString(maxLen?: number): string | number;
|
|
20
|
+
private static unPackStringHelper(len: number): string | number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default CommIn;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare class OutBuffer {
|
|
2
|
+
private idx: number;
|
|
3
|
+
private arrayBuffer: ArrayBuffer;
|
|
4
|
+
private buffer: Uint8Array;
|
|
5
|
+
|
|
6
|
+
constructor(size: number);
|
|
7
|
+
|
|
8
|
+
send(ws2: { send(data: Uint8Array): void }): void;
|
|
9
|
+
|
|
10
|
+
packInt8(val: number): void;
|
|
11
|
+
packInt16(val: number): void;
|
|
12
|
+
packInt24(val: number): void;
|
|
13
|
+
packInt32(val: number): void;
|
|
14
|
+
|
|
15
|
+
packRadU(val: number): void;
|
|
16
|
+
packRad(val: number): void;
|
|
17
|
+
packFloat(val: number): void;
|
|
18
|
+
packDouble(val: number): void;
|
|
19
|
+
|
|
20
|
+
packString(str: string, doMalicious?: boolean): void;
|
|
21
|
+
packLongString(str: string): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default OutBuffer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare class Pool<T> {
|
|
2
|
+
size: number;
|
|
3
|
+
originalSize: number;
|
|
4
|
+
constructorFn: () => T;
|
|
5
|
+
objects: Array<T & { id: number; active: boolean }>;
|
|
6
|
+
idx: number;
|
|
7
|
+
numActive: number;
|
|
8
|
+
|
|
9
|
+
constructor(constructorFn: () => T, size: number);
|
|
10
|
+
|
|
11
|
+
expand(num: number): void;
|
|
12
|
+
|
|
13
|
+
retrieve(id?: number): T & { id: number; active: boolean };
|
|
14
|
+
|
|
15
|
+
recycle(obj: T & { id: number; active: boolean }): void;
|
|
16
|
+
|
|
17
|
+
forEachActive(fn: (obj: T & { id: number; active: boolean }, index: number) => void): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default Pool;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import CommIn from './CommIn';
|
|
2
|
+
import CommOut from './CommOut';
|
|
3
|
+
import OutBuffer from './OutBuffer';
|
|
4
|
+
import Pool from './Pool';
|
|
5
|
+
|
|
6
|
+
import { CommCode } from '../constants/codes';
|
|
7
|
+
import { CloseCode } from './Codes';
|
|
3
8
|
|
|
4
9
|
export {
|
|
10
|
+
CommIn,
|
|
11
|
+
CommOut,
|
|
12
|
+
OutBuffer,
|
|
13
|
+
Pool,
|
|
5
14
|
CommCode,
|
|
6
15
|
CloseCode
|
|
7
|
-
}
|
|
16
|
+
};
|