2
2
3
3
import { Quaternion } from "three" ;
4
4
import { Move } from "../../alg" ;
5
- import type { KPuzzle , KPatternData } from "../../kpuzzle" ;
5
+ import type { KPatternData , KPuzzle } from "../../kpuzzle" ;
6
6
import { KPattern } from "../../kpuzzle" ;
7
7
import { puzzles } from "../../puzzles" ;
8
8
import {
@@ -164,7 +164,7 @@ const commands: { [cmd: string]: BufferSource } = {
164
164
] ) ,
165
165
} ;
166
166
167
- function buf2hex ( buffer : ArrayBuffer ) : string {
167
+ function buf2hex ( buffer : ArrayBufferLike ) : string {
168
168
// buffer is an ArrayBuffer
169
169
return (
170
170
Array . prototype . map . call ( new Uint8Array ( buffer ) , ( x : number ) =>
@@ -452,7 +452,7 @@ export class GanCube extends BluetoothPuzzle {
452
452
await faceletStatus1Characteristic . writeValue ( commands . reset ) ;
453
453
}
454
454
455
- public async readFaceletStatus1Characteristic ( ) : Promise < ArrayBuffer > {
455
+ public async readFaceletStatus1Characteristic ( ) : Promise < ArrayBufferLike > {
456
456
const faceletStatus1Characteristic =
457
457
await this . faceletStatus1Characteristic ( ) ;
458
458
return ( await faceletStatus1Characteristic . readValue ( ) ) . buffer ;
@@ -464,7 +464,7 @@ export class GanCube extends BluetoothPuzzle {
464
464
return buf2hex ( ( await faceletStatus2Characteristic . readValue ( ) ) . buffer ) ;
465
465
}
466
466
467
- public async readActualAngleAndBatteryCharacteristic ( ) : Promise < ArrayBuffer > {
467
+ public async readActualAngleAndBatteryCharacteristic ( ) : Promise < ArrayBufferLike > {
468
468
const actualAngleAndBatteryCharacteristic =
469
469
await this . actualAngleAndBatteryCharacteristic ( ) ;
470
470
return ( await actualAngleAndBatteryCharacteristic . readValue ( ) ) . buffer ;
0 commit comments