import { RaftInfoEvents } from "../types/events/raft-info"; import type { RestMessageOptions } from "../types/communication-between-apps/wrapper-communication"; import { ConnectableRaftType, ConnectionAttemptResults, RaftConnectionMethod } from "../types/raft"; import Connector from "./connectors/Connector"; import { RaftConnEvent, RaftPublishEvent, RaftUpdateEvent } from "@robdobsn/raftjs"; import { RICLedLcdColours } from "@robotical/roboticaljs"; import { CustomBluetoothItem, UserDeviceInfo } from "../types/userDeviceInfo"; import { ColourSensorCalibrationStage } from "../types/colour-sensor-calibration"; export declare class WrapperAppManager { private connectors; private _connectPromise; private _disconnectOperations; private _pendingConnManagers; private _pageUnloadStarted; private _observers; constructor(); /** * Get connector */ getConnector(raftId: string): Connector | undefined; /** * Connect to a RAFT * * @param {string} method - can be "WebBLE" or "WebSocket" * @param {string | object} locator - either a string (WebSocket URL) or an object (WebBLE) * @returns Promise * */ connect(method: RaftConnectionMethod, uuids: string[]): Promise; connect(method: RaftConnectionMethod, locator: string, uuids: string[], expectedRaftType?: ConnectableRaftType): Promise; private _connect; /** * Gets user's device info */ getDeviceInfo(): UserDeviceInfo; /** * Get Marty Comms stats */ getCommsStatsMarty(raftId: string): { msgRxRate: number; msgRoundtripWorstMs: number; msgRoundtripLastMs: number; msgRoundtripBestMs: number; msgRetries: number; } | undefined; aveFileOnDevice(fileName: string, base64: string): boolean; deleteFiles(fileName: string, _: string): boolean; loadFile(fileName: string, _: string): string | false; /** * Re-triggers the connect event which was missed due to the connection logic */ getMissedConnEvent(raftId: any): void; /** * Publish successful QR verification without running the LED pattern checker. */ confirmVerifiedRaft(raftId: string): Promise; calibrateColourSensorMarty(raftId: string, stage: ColourSensorCalibrationStage): Promise; resetColourSensorOffsetsMarty(raftId: string): Promise; /** * Get the RAFT Name */ getRaftName(raftId: string): "" | Promise; /** * Verify RAFT */ verifyRaft(ledLcdColours: RICLedLcdColours, raftId: string): false | Promise; /** * Stop verifying RAFT */ stopVerifyingRaft(isCorrectRIC: boolean, raftId: string): Promise; /** * Disconnect from a RAFT */ disconnect(raftId: string): Promise; /** * Best-effort terminal cleanup. Page lifecycle events cannot reliably await * async transport work, so each connector forwards to RaftJS synchronously. */ disconnectAllForPageUnload(): void; private _disconnectConnManagerForPageUnload; isConnected(raftId: string): boolean; /** * Audio streaming */ streamAudio(raftId: string, streamContents: Uint8Array, clearExisting: boolean, duration: number): Promise; /** * Publish an event to all observers * Set in RICConnector as an event listener callback */ publish(eventType: string, eventEnum: RaftConnEvent | RaftUpdateEvent | RaftPublishEvent | RaftInfoEvents, eventName: string, eventData: any): void; /** * Send a REST message to the RAFT */ sendRestMessage(msg: string, params: object | undefined, raftId: string, options?: RestMessageOptions): Promise; private _removeConnectorIfCurrent; private _handleDisconnectedEvent; /** * Warranty Service bluetooth scan for device * It scans for a device and gets the device object * Then it checks if the device is already in the given devices array having CustomBluetoothItem[] type * if not, it gets its serial number and adds it to the devices array * @returns {Promise} */ scanForPotentialWarrantyDevice(existingDevices: CustomBluetoothItem[]): Promise; /** * Sends atomic read operation to Marty */ sendAtomicReadOperationToMarty(raftId: string): Promise; } declare const wrapperAppManager: WrapperAppManager; export default wrapperAppManager;