| 260 | * @private |
| 261 | */ |
| 262 | export interface BleModuleInterface { |
| 263 | // NativeModule methods |
| 264 | |
| 265 | addListener(string): void; |
| 266 | removeListeners(number): void; |
| 267 | |
| 268 | // Lifecycle |
| 269 | |
| 270 | /** |
| 271 | * Creates new native module internally. Only one module |
| 272 | * is allowed to be instantiated. |
| 273 | * @param {?string} restoreIdentifierKey Optional unique Id used for state restoration of BLE manager. |
| 274 | * @private |
| 275 | */ |
| 276 | createClient(restoreIdentifierKey: ?string): void; |
| 277 | |
| 278 | /** |
| 279 | * Destroys previously instantiated module. This function is |
| 280 | * only safe when previously BleModule was created. |
| 281 | * @returns {Promise<void>} Promise may return an error when the function cannot be called. |
| 282 | * @private |
| 283 | */ |
| 284 | destroyClient(): Promise<void>; |
| 285 | |
| 286 | // Monitoring state |
| 287 | |
| 288 | /** |
| 289 | * Enable Bluetooth. This function blocks until BLE is in PoweredOn state. [Android only] |
| 290 | * |
| 291 | * @param {TransactionId} transactionId Transaction handle used to cancel operation |
| 292 | * @returns {Promise<void>} Promise completes when state transition was successful. |
| 293 | * @private |
| 294 | */ |
| 295 | enable(transactionId: TransactionId): Promise<void>; |
| 296 | |
| 297 | /** |
| 298 | * Disable Bluetooth. This function blocks until BLE is in PoweredOff state. [Android only] |
| 299 | * |
| 300 | * @param {TransactionId} transactionId Transaction handle used to cancel operation |
| 301 | * @returns {Promise<void>} Promise completes when state transition was successful. |
| 302 | * @private |
| 303 | */ |
| 304 | disable(transactionId: TransactionId): Promise<void>; |
| 305 | |
| 306 | /** |
| 307 | * Current state of BLE device. |
| 308 | * |
| 309 | * @returns {Promise<State>} Current state of BLE device. |
| 310 | * @private |
| 311 | */ |
| 312 | state(): Promise<$Keys<typeof State>>; |
| 313 | |
| 314 | // Scanning |
| 315 | |
| 316 | /** |
| 317 | * Starts device scan. |
| 318 | * |
| 319 | * @param {?Array<UUID>} filteredUUIDs List of UUIDs for services which needs to be present to detect device during |
no outgoing calls
no test coverage detected
searching dependent graphs…