librats 0.5.1 → 0.5.3

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.
package/README.md CHANGED
@@ -205,7 +205,7 @@ client.publishJsonToTopic('general-chat', JSON.stringify(message));
205
205
  - `startDhtDiscovery(dhtPort: number): boolean` - Start DHT discovery
206
206
  - `stopDhtDiscovery(): void` - Stop DHT discovery
207
207
  - `isDhtRunning(): boolean` - Check if DHT is running
208
- - `announceForHash(contentHash: string, port: number): boolean` - Announce for hash
208
+ - `announceForHash(contentHash: string, port: number, callback?: (peers: string[]) => void): boolean` - Announce for hash with optional peer discovery callback
209
209
 
210
210
  #### Encryption
211
211
 
package/lib/index.d.ts CHANGED
@@ -370,9 +370,10 @@ export class RatsClient {
370
370
  * Announce availability for a content hash
371
371
  * @param contentHash - Hash to announce for
372
372
  * @param port - Port to announce
373
+ * @param callback - Optional callback to receive discovered peers during DHT traversal
373
374
  * @returns true if announced successfully
374
375
  */
375
- announceForHash(contentHash: string, port: number): boolean;
376
+ announceForHash(contentHash: string, port: number, callback?: (peers: string[]) => void): boolean;
376
377
 
377
378
  // ============ mDNS ============
378
379
 
@@ -64,6 +64,15 @@ project(librats VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
64
64
  set(CMAKE_CXX_STANDARD 17)
65
65
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
66
 
67
+ # Flags
68
+ # Compiler warnings configuration
69
+ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
70
+ # additional checks by compiler to found errors ealy on
71
+ add_compile_options(-Wall -Wextra -Wpedantic)
72
+ # not show unused stuff, useful for development
73
+ add_compile_options(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable)
74
+ endif()
75
+
67
76
  # Options
68
77
  option(RATS_BUILD_EXAMPLES "Build examples" ON)
69
78
  option(RATS_BUILD_TESTS "Build unit tests" ON)