@agntcy/slim-bindings-node 0.1.4

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,3728 @@
1
+ import { type UniffiByteArray, RustBuffer, UniffiAbstractObject, UniffiRustArcPtr, UnsafeMutableRawPointer, uniffiTypeNameSymbol, destructorGuardSymbol, pointerLiteralSymbol } from 'uniffi-bindgen-react-native';
2
+ /**
3
+ * Basic authentication configuration
4
+ */
5
+ export type BasicAuth = {
6
+ username: string;
7
+ password: string;
8
+ };
9
+ export declare const BasicAuth: Readonly<{
10
+ /**
11
+ * Create a frozen instance of {@link BasicAuth}, with defaults specified
12
+ * in Rust, in the {@link slim_bindings} crate.
13
+ */
14
+ create: (partial: Partial<BasicAuth> & Required<Omit<BasicAuth, never>>) => BasicAuth;
15
+ /**
16
+ * Create a frozen instance of {@link BasicAuth}, with defaults specified
17
+ * in Rust, in the {@link slim_bindings} crate.
18
+ */
19
+ new: (partial: Partial<BasicAuth> & Required<Omit<BasicAuth, never>>) => BasicAuth;
20
+ /**
21
+ * Defaults specified in the {@link slim_bindings} crate.
22
+ */
23
+ defaults: () => Partial<BasicAuth>;
24
+ }>;
25
+ /**
26
+ * Build information for the SLIM bindings
27
+ */
28
+ export type BuildInfo = {
29
+ /**
30
+ * Semantic version (e.g., "0.7.0")
31
+ */ version: string;
32
+ /**
33
+ * Git commit hash (short)
34
+ */ gitSha: string;
35
+ /**
36
+ * Build date in ISO 8601 UTC format
37
+ */ buildDate: string;
38
+ /**
39
+ * Build profile (debug/release)
40
+ */ profile: string;
41
+ };
42
+ export declare const BuildInfo: Readonly<{
43
+ /**
44
+ * Create a frozen instance of {@link BuildInfo}, with defaults specified
45
+ * in Rust, in the {@link slim_bindings} crate.
46
+ */
47
+ create: (partial: Partial<BuildInfo> & Required<Omit<BuildInfo, never>>) => BuildInfo;
48
+ /**
49
+ * Create a frozen instance of {@link BuildInfo}, with defaults specified
50
+ * in Rust, in the {@link slim_bindings} crate.
51
+ */
52
+ new: (partial: Partial<BuildInfo> & Required<Omit<BuildInfo, never>>) => BuildInfo;
53
+ /**
54
+ * Defaults specified in the {@link slim_bindings} crate.
55
+ */
56
+ defaults: () => Partial<BuildInfo>;
57
+ }>;
58
+ /**
59
+ * Client configuration for connecting to a SLIM server
60
+ */
61
+ export type ClientConfig = {
62
+ /**
63
+ * The target endpoint the client will connect to
64
+ */ endpoint: string;
65
+ /**
66
+ * Origin (HTTP Host authority override) for the client
67
+ */ origin?: string;
68
+ /**
69
+ * Optional TLS SNI server name override
70
+ */ serverName?: string;
71
+ /**
72
+ * Compression type
73
+ */ compression?: CompressionType;
74
+ /**
75
+ * Rate limit string (e.g., "100/s" for 100 requests per second)
76
+ */ rateLimit?: string;
77
+ /**
78
+ * TLS client configuration
79
+ */ tls: TlsClientConfig;
80
+ /**
81
+ * Keepalive parameters
82
+ */ keepalive?: KeepaliveConfig;
83
+ /**
84
+ * HTTP Proxy configuration
85
+ */ proxy: ProxyConfig;
86
+ /**
87
+ * Connection timeout
88
+ */ connectTimeout: number;
89
+ /**
90
+ * Request timeout
91
+ */ requestTimeout: number;
92
+ /**
93
+ * Read buffer size in bytes
94
+ */ bufferSize?: bigint;
95
+ /**
96
+ * Headers associated with gRPC requests
97
+ */ headers: Map<string, string>;
98
+ /**
99
+ * Authentication configuration for outgoing RPCs
100
+ */ auth: ClientAuthenticationConfig;
101
+ /**
102
+ * Backoff retry configuration
103
+ */ backoff: BackoffConfig;
104
+ /**
105
+ * Arbitrary user-provided metadata as JSON string
106
+ */ metadata?: string;
107
+ };
108
+ export declare const ClientConfig: Readonly<{
109
+ /**
110
+ * Create a frozen instance of {@link ClientConfig}, with defaults specified
111
+ * in Rust, in the {@link slim_bindings} crate.
112
+ */
113
+ create: (partial: Partial<ClientConfig> & Required<Omit<ClientConfig, never>>) => ClientConfig;
114
+ /**
115
+ * Create a frozen instance of {@link ClientConfig}, with defaults specified
116
+ * in Rust, in the {@link slim_bindings} crate.
117
+ */
118
+ new: (partial: Partial<ClientConfig> & Required<Omit<ClientConfig, never>>) => ClientConfig;
119
+ /**
120
+ * Defaults specified in the {@link slim_bindings} crate.
121
+ */
122
+ defaults: () => Partial<ClientConfig>;
123
+ }>;
124
+ /**
125
+ * JWT authentication configuration for client-side signing
126
+ */
127
+ export type ClientJwtAuth = {
128
+ /**
129
+ * JWT key configuration (encoding key for signing)
130
+ */ key: JwtKeyType;
131
+ /**
132
+ * JWT audience claims to include
133
+ */ audience?: Array<string>;
134
+ /**
135
+ * JWT issuer to include
136
+ */ issuer?: string;
137
+ /**
138
+ * JWT subject to include
139
+ */ subject?: string;
140
+ /**
141
+ * Token validity duration (default: 3600 seconds)
142
+ */ duration: number;
143
+ };
144
+ export declare const ClientJwtAuth: Readonly<{
145
+ /**
146
+ * Create a frozen instance of {@link ClientJwtAuth}, with defaults specified
147
+ * in Rust, in the {@link slim_bindings} crate.
148
+ */
149
+ create: (partial: Partial<ClientJwtAuth> & Required<Omit<ClientJwtAuth, never>>) => ClientJwtAuth;
150
+ /**
151
+ * Create a frozen instance of {@link ClientJwtAuth}, with defaults specified
152
+ * in Rust, in the {@link slim_bindings} crate.
153
+ */
154
+ new: (partial: Partial<ClientJwtAuth> & Required<Omit<ClientJwtAuth, never>>) => ClientJwtAuth;
155
+ /**
156
+ * Defaults specified in the {@link slim_bindings} crate.
157
+ */
158
+ defaults: () => Partial<ClientJwtAuth>;
159
+ }>;
160
+ /**
161
+ * DataPlane configuration wrapper for uniffi bindings
162
+ */
163
+ export type DataplaneConfig = {
164
+ /**
165
+ * DataPlane GRPC server settings
166
+ */ servers: Array<ServerConfig>;
167
+ /**
168
+ * DataPlane client configs
169
+ */ clients: Array<ClientConfig>;
170
+ };
171
+ export declare const DataplaneConfig: Readonly<{
172
+ /**
173
+ * Create a frozen instance of {@link DataplaneConfig}, with defaults specified
174
+ * in Rust, in the {@link slim_bindings} crate.
175
+ */
176
+ create: (partial: Partial<DataplaneConfig> & Required<Omit<DataplaneConfig, never>>) => DataplaneConfig;
177
+ /**
178
+ * Create a frozen instance of {@link DataplaneConfig}, with defaults specified
179
+ * in Rust, in the {@link slim_bindings} crate.
180
+ */
181
+ new: (partial: Partial<DataplaneConfig> & Required<Omit<DataplaneConfig, never>>) => DataplaneConfig;
182
+ /**
183
+ * Defaults specified in the {@link slim_bindings} crate.
184
+ */
185
+ defaults: () => Partial<DataplaneConfig>;
186
+ }>;
187
+ /**
188
+ * Exponential backoff configuration
189
+ */
190
+ export type ExponentialBackoff = {
191
+ /**
192
+ * Base delay
193
+ */ base: number;
194
+ /**
195
+ * Multiplication factor for each retry
196
+ */ factor: bigint;
197
+ /**
198
+ * Maximum delay
199
+ */ maxDelay: number;
200
+ /**
201
+ * Maximum number of retry attempts
202
+ */ maxAttempts: bigint;
203
+ /**
204
+ * Whether to add random jitter to delays
205
+ */ jitter: boolean;
206
+ };
207
+ export declare const ExponentialBackoff: Readonly<{
208
+ /**
209
+ * Create a frozen instance of {@link ExponentialBackoff}, with defaults specified
210
+ * in Rust, in the {@link slim_bindings} crate.
211
+ */
212
+ create: (partial: Partial<ExponentialBackoff> & Required<Omit<ExponentialBackoff, never>>) => ExponentialBackoff;
213
+ /**
214
+ * Create a frozen instance of {@link ExponentialBackoff}, with defaults specified
215
+ * in Rust, in the {@link slim_bindings} crate.
216
+ */
217
+ new: (partial: Partial<ExponentialBackoff> & Required<Omit<ExponentialBackoff, never>>) => ExponentialBackoff;
218
+ /**
219
+ * Defaults specified in the {@link slim_bindings} crate.
220
+ */
221
+ defaults: () => Partial<ExponentialBackoff>;
222
+ }>;
223
+ /**
224
+ * Fixed interval backoff configuration
225
+ */
226
+ export type FixedIntervalBackoff = {
227
+ /**
228
+ * Fixed interval between retries
229
+ */ interval: number;
230
+ /**
231
+ * Maximum number of retry attempts
232
+ */ maxAttempts: bigint;
233
+ };
234
+ export declare const FixedIntervalBackoff: Readonly<{
235
+ /**
236
+ * Create a frozen instance of {@link FixedIntervalBackoff}, with defaults specified
237
+ * in Rust, in the {@link slim_bindings} crate.
238
+ */
239
+ create: (partial: Partial<FixedIntervalBackoff> & Required<Omit<FixedIntervalBackoff, never>>) => FixedIntervalBackoff;
240
+ /**
241
+ * Create a frozen instance of {@link FixedIntervalBackoff}, with defaults specified
242
+ * in Rust, in the {@link slim_bindings} crate.
243
+ */
244
+ new: (partial: Partial<FixedIntervalBackoff> & Required<Omit<FixedIntervalBackoff, never>>) => FixedIntervalBackoff;
245
+ /**
246
+ * Defaults specified in the {@link slim_bindings} crate.
247
+ */
248
+ defaults: () => Partial<FixedIntervalBackoff>;
249
+ }>;
250
+ /**
251
+ * JWT authentication configuration for server-side verification
252
+ */
253
+ export type JwtAuth = {
254
+ /**
255
+ * JWT key configuration (decoding key for verification)
256
+ */ key: JwtKeyType;
257
+ /**
258
+ * JWT audience claims to verify
259
+ */ audience?: Array<string>;
260
+ /**
261
+ * JWT issuer to verify
262
+ */ issuer?: string;
263
+ /**
264
+ * JWT subject to verify
265
+ */ subject?: string;
266
+ /**
267
+ * Token validity duration (default: 3600 seconds)
268
+ */ duration: number;
269
+ };
270
+ export declare const JwtAuth: Readonly<{
271
+ /**
272
+ * Create a frozen instance of {@link JwtAuth}, with defaults specified
273
+ * in Rust, in the {@link slim_bindings} crate.
274
+ */
275
+ create: (partial: Partial<JwtAuth> & Required<Omit<JwtAuth, never>>) => JwtAuth;
276
+ /**
277
+ * Create a frozen instance of {@link JwtAuth}, with defaults specified
278
+ * in Rust, in the {@link slim_bindings} crate.
279
+ */
280
+ new: (partial: Partial<JwtAuth> & Required<Omit<JwtAuth, never>>) => JwtAuth;
281
+ /**
282
+ * Defaults specified in the {@link slim_bindings} crate.
283
+ */
284
+ defaults: () => Partial<JwtAuth>;
285
+ }>;
286
+ /**
287
+ * JWT key configuration
288
+ */
289
+ export type JwtKeyConfig = {
290
+ /**
291
+ * Algorithm used for signing/verifying the JWT
292
+ */ algorithm: JwtAlgorithm;
293
+ /**
294
+ * Key format - PEM, JWK or JWKS
295
+ */ format: JwtKeyFormat;
296
+ /**
297
+ * Encoded key or file path
298
+ */ key: JwtKeyData;
299
+ };
300
+ export declare const JwtKeyConfig: Readonly<{
301
+ /**
302
+ * Create a frozen instance of {@link JwtKeyConfig}, with defaults specified
303
+ * in Rust, in the {@link slim_bindings} crate.
304
+ */
305
+ create: (partial: Partial<JwtKeyConfig> & Required<Omit<JwtKeyConfig, never>>) => JwtKeyConfig;
306
+ /**
307
+ * Create a frozen instance of {@link JwtKeyConfig}, with defaults specified
308
+ * in Rust, in the {@link slim_bindings} crate.
309
+ */
310
+ new: (partial: Partial<JwtKeyConfig> & Required<Omit<JwtKeyConfig, never>>) => JwtKeyConfig;
311
+ /**
312
+ * Defaults specified in the {@link slim_bindings} crate.
313
+ */
314
+ defaults: () => Partial<JwtKeyConfig>;
315
+ }>;
316
+ /**
317
+ * Keepalive configuration for the client
318
+ */
319
+ export type KeepaliveConfig = {
320
+ /**
321
+ * TCP keepalive duration
322
+ */ tcpKeepalive: number;
323
+ /**
324
+ * HTTP2 keepalive duration
325
+ */ http2Keepalive: number;
326
+ /**
327
+ * Keepalive timeout
328
+ */ timeout: number;
329
+ /**
330
+ * Whether to permit keepalive without an active stream
331
+ */ keepAliveWhileIdle: boolean;
332
+ };
333
+ export declare const KeepaliveConfig: Readonly<{
334
+ /**
335
+ * Create a frozen instance of {@link KeepaliveConfig}, with defaults specified
336
+ * in Rust, in the {@link slim_bindings} crate.
337
+ */
338
+ create: (partial: Partial<KeepaliveConfig> & Required<Omit<KeepaliveConfig, never>>) => KeepaliveConfig;
339
+ /**
340
+ * Create a frozen instance of {@link KeepaliveConfig}, with defaults specified
341
+ * in Rust, in the {@link slim_bindings} crate.
342
+ */
343
+ new: (partial: Partial<KeepaliveConfig> & Required<Omit<KeepaliveConfig, never>>) => KeepaliveConfig;
344
+ /**
345
+ * Defaults specified in the {@link slim_bindings} crate.
346
+ */
347
+ defaults: () => Partial<KeepaliveConfig>;
348
+ }>;
349
+ /**
350
+ * Keepalive configuration for the server
351
+ */
352
+ export type KeepaliveServerParameters = {
353
+ /**
354
+ * Max connection idle time (time after which an idle connection is closed)
355
+ */ maxConnectionIdle: number;
356
+ /**
357
+ * Max connection age (maximum time a connection may exist before being closed)
358
+ */ maxConnectionAge: number;
359
+ /**
360
+ * Max connection age grace (additional time after max_connection_age before closing)
361
+ */ maxConnectionAgeGrace: number;
362
+ /**
363
+ * Keepalive ping frequency
364
+ */ time: number;
365
+ /**
366
+ * Keepalive ping timeout (time to wait for ack)
367
+ */ timeout: number;
368
+ };
369
+ export declare const KeepaliveServerParameters: Readonly<{
370
+ /**
371
+ * Create a frozen instance of {@link KeepaliveServerParameters}, with defaults specified
372
+ * in Rust, in the {@link slim_bindings} crate.
373
+ */
374
+ create: (partial: Partial<KeepaliveServerParameters> & Required<Omit<KeepaliveServerParameters, never>>) => KeepaliveServerParameters;
375
+ /**
376
+ * Create a frozen instance of {@link KeepaliveServerParameters}, with defaults specified
377
+ * in Rust, in the {@link slim_bindings} crate.
378
+ */
379
+ new: (partial: Partial<KeepaliveServerParameters> & Required<Omit<KeepaliveServerParameters, never>>) => KeepaliveServerParameters;
380
+ /**
381
+ * Defaults specified in the {@link slim_bindings} crate.
382
+ */
383
+ defaults: () => Partial<KeepaliveServerParameters>;
384
+ }>;
385
+ /**
386
+ * Generic message context for language bindings (UniFFI-compatible)
387
+ *
388
+ * Provides routing and descriptive metadata needed for replying,
389
+ * auditing, and instrumentation across different language bindings.
390
+ * This type is exported to foreign languages via UniFFI.
391
+ */
392
+ export type MessageContext = {
393
+ /**
394
+ * Fully-qualified sender identity
395
+ */ sourceName: Name;
396
+ /**
397
+ * Fully-qualified destination identity (may be empty for broadcast/group scenarios)
398
+ */ destinationName?: Name;
399
+ /**
400
+ * Logical/semantic type (defaults to "msg" if unspecified)
401
+ */ payloadType: string;
402
+ /**
403
+ * Arbitrary key/value pairs supplied by the sender (e.g. tracing IDs)
404
+ */ metadata: Map<string, string>;
405
+ /**
406
+ * Numeric identifier of the inbound connection carrying the message
407
+ */ inputConnection: bigint;
408
+ /**
409
+ * Identity contained in the message
410
+ */ identity: string;
411
+ };
412
+ export declare const MessageContext: Readonly<{
413
+ /**
414
+ * Create a frozen instance of {@link MessageContext}, with defaults specified
415
+ * in Rust, in the {@link slim_bindings} crate.
416
+ */
417
+ create: (partial: Partial<MessageContext> & Required<Omit<MessageContext, never>>) => MessageContext;
418
+ /**
419
+ * Create a frozen instance of {@link MessageContext}, with defaults specified
420
+ * in Rust, in the {@link slim_bindings} crate.
421
+ */
422
+ new: (partial: Partial<MessageContext> & Required<Omit<MessageContext, never>>) => MessageContext;
423
+ /**
424
+ * Defaults specified in the {@link slim_bindings} crate.
425
+ */
426
+ defaults: () => Partial<MessageContext>;
427
+ }>;
428
+ /**
429
+ * HTTP Proxy configuration
430
+ */
431
+ export type ProxyConfig = {
432
+ /**
433
+ * The HTTP proxy URL (e.g., "http://proxy.example.com:8080")
434
+ */ url?: string;
435
+ /**
436
+ * TLS configuration for proxy connection
437
+ */ tls: TlsClientConfig;
438
+ /**
439
+ * Optional username for proxy authentication
440
+ */ username?: string;
441
+ /**
442
+ * Optional password for proxy authentication
443
+ */ password?: string;
444
+ /**
445
+ * Headers to send with proxy requests
446
+ */ headers: Map<string, string>;
447
+ };
448
+ export declare const ProxyConfig: Readonly<{
449
+ /**
450
+ * Create a frozen instance of {@link ProxyConfig}, with defaults specified
451
+ * in Rust, in the {@link slim_bindings} crate.
452
+ */
453
+ create: (partial: Partial<ProxyConfig> & Required<Omit<ProxyConfig, never>>) => ProxyConfig;
454
+ /**
455
+ * Create a frozen instance of {@link ProxyConfig}, with defaults specified
456
+ * in Rust, in the {@link slim_bindings} crate.
457
+ */
458
+ new: (partial: Partial<ProxyConfig> & Required<Omit<ProxyConfig, never>>) => ProxyConfig;
459
+ /**
460
+ * Defaults specified in the {@link slim_bindings} crate.
461
+ */
462
+ defaults: () => Partial<ProxyConfig>;
463
+ }>;
464
+ /**
465
+ * Received message containing context and payload
466
+ */
467
+ export type ReceivedMessage = {
468
+ context: MessageContext;
469
+ payload: ArrayBuffer;
470
+ };
471
+ export declare const ReceivedMessage: Readonly<{
472
+ /**
473
+ * Create a frozen instance of {@link ReceivedMessage}, with defaults specified
474
+ * in Rust, in the {@link slim_bindings} crate.
475
+ */
476
+ create: (partial: Partial<ReceivedMessage> & Required<Omit<ReceivedMessage, never>>) => ReceivedMessage;
477
+ /**
478
+ * Create a frozen instance of {@link ReceivedMessage}, with defaults specified
479
+ * in Rust, in the {@link slim_bindings} crate.
480
+ */
481
+ new: (partial: Partial<ReceivedMessage> & Required<Omit<ReceivedMessage, never>>) => ReceivedMessage;
482
+ /**
483
+ * Defaults specified in the {@link slim_bindings} crate.
484
+ */
485
+ defaults: () => Partial<ReceivedMessage>;
486
+ }>;
487
+ /**
488
+ * Runtime configuration for the SLIM bindings
489
+ *
490
+ * Controls the Tokio runtime behavior including thread count, naming, and shutdown timeout.
491
+ */
492
+ export type RuntimeConfig = {
493
+ /**
494
+ * Number of cores to use for the runtime (0 = use all available cores)
495
+ */ nCores: bigint;
496
+ /**
497
+ * Thread name prefix for the runtime
498
+ */ threadName: string;
499
+ /**
500
+ * Timeout duration for draining services during shutdown
501
+ */ drainTimeout: number;
502
+ };
503
+ export declare const RuntimeConfig: Readonly<{
504
+ /**
505
+ * Create a frozen instance of {@link RuntimeConfig}, with defaults specified
506
+ * in Rust, in the {@link slim_bindings} crate.
507
+ */
508
+ create: (partial: Partial<RuntimeConfig> & Required<Omit<RuntimeConfig, never>>) => RuntimeConfig;
509
+ /**
510
+ * Create a frozen instance of {@link RuntimeConfig}, with defaults specified
511
+ * in Rust, in the {@link slim_bindings} crate.
512
+ */
513
+ new: (partial: Partial<RuntimeConfig> & Required<Omit<RuntimeConfig, never>>) => RuntimeConfig;
514
+ /**
515
+ * Defaults specified in the {@link slim_bindings} crate.
516
+ */
517
+ defaults: () => Partial<RuntimeConfig>;
518
+ }>;
519
+ /**
520
+ * Server configuration for running a SLIM server
521
+ */
522
+ export type ServerConfig = {
523
+ /**
524
+ * Endpoint address to listen on (e.g., "0.0.0.0:50051" or "[::]:50051")
525
+ */ endpoint: string;
526
+ /**
527
+ * TLS server configuration
528
+ */ tls: TlsServerConfig;
529
+ /**
530
+ * Use HTTP/2 only (default: true)
531
+ */ http2Only: boolean;
532
+ /**
533
+ * Maximum size (in MiB) of messages accepted by the server
534
+ */ maxFrameSize?: number;
535
+ /**
536
+ * Maximum number of concurrent streams per connection
537
+ */ maxConcurrentStreams?: number;
538
+ /**
539
+ * Maximum header list size in bytes
540
+ */ maxHeaderListSize?: number;
541
+ /**
542
+ * Read buffer size in bytes
543
+ */ readBufferSize?: bigint;
544
+ /**
545
+ * Write buffer size in bytes
546
+ */ writeBufferSize?: bigint;
547
+ /**
548
+ * Keepalive parameters
549
+ */ keepalive: KeepaliveServerParameters;
550
+ /**
551
+ * Authentication configuration for incoming requests
552
+ */ auth: ServerAuthenticationConfig;
553
+ /**
554
+ * Arbitrary user-provided metadata as JSON string
555
+ */ metadata?: string;
556
+ };
557
+ export declare const ServerConfig: Readonly<{
558
+ /**
559
+ * Create a frozen instance of {@link ServerConfig}, with defaults specified
560
+ * in Rust, in the {@link slim_bindings} crate.
561
+ */
562
+ create: (partial: Partial<ServerConfig> & Required<Omit<ServerConfig, never>>) => ServerConfig;
563
+ /**
564
+ * Create a frozen instance of {@link ServerConfig}, with defaults specified
565
+ * in Rust, in the {@link slim_bindings} crate.
566
+ */
567
+ new: (partial: Partial<ServerConfig> & Required<Omit<ServerConfig, never>>) => ServerConfig;
568
+ /**
569
+ * Defaults specified in the {@link slim_bindings} crate.
570
+ */
571
+ defaults: () => Partial<ServerConfig>;
572
+ }>;
573
+ /**
574
+ * Service configuration wrapper for uniffi bindings
575
+ */
576
+ export type ServiceConfig = {
577
+ /**
578
+ * Optional node ID for the service
579
+ */ nodeId?: string;
580
+ /**
581
+ * Optional group name for the service
582
+ */ groupName?: string;
583
+ /**
584
+ * DataPlane configuration (servers and clients)
585
+ */ dataplane: DataplaneConfig;
586
+ };
587
+ export declare const ServiceConfig: Readonly<{
588
+ /**
589
+ * Create a frozen instance of {@link ServiceConfig}, with defaults specified
590
+ * in Rust, in the {@link slim_bindings} crate.
591
+ */
592
+ create: (partial: Partial<ServiceConfig> & Required<Omit<ServiceConfig, never>>) => ServiceConfig;
593
+ /**
594
+ * Create a frozen instance of {@link ServiceConfig}, with defaults specified
595
+ * in Rust, in the {@link slim_bindings} crate.
596
+ */
597
+ new: (partial: Partial<ServiceConfig> & Required<Omit<ServiceConfig, never>>) => ServiceConfig;
598
+ /**
599
+ * Defaults specified in the {@link slim_bindings} crate.
600
+ */
601
+ defaults: () => Partial<ServiceConfig>;
602
+ }>;
603
+ /**
604
+ * Session configuration
605
+ */
606
+ export type SessionConfig = {
607
+ /**
608
+ * Session type (PointToPoint or Group)
609
+ */ sessionType: SessionType;
610
+ /**
611
+ * Enable MLS encryption for this session
612
+ */ enableMls: boolean;
613
+ /**
614
+ * Maximum number of retries for message transmission (None = use default)
615
+ */ maxRetries?: number;
616
+ /**
617
+ * Interval between retries in milliseconds (None = use default)
618
+ */ interval?: number;
619
+ /**
620
+ * Custom metadata key-value pairs for the session
621
+ */ metadata: Map<string, string>;
622
+ };
623
+ export declare const SessionConfig: Readonly<{
624
+ /**
625
+ * Create a frozen instance of {@link SessionConfig}, with defaults specified
626
+ * in Rust, in the {@link slim_bindings} crate.
627
+ */
628
+ create: (partial: Partial<SessionConfig> & Required<Omit<SessionConfig, never>>) => SessionConfig;
629
+ /**
630
+ * Create a frozen instance of {@link SessionConfig}, with defaults specified
631
+ * in Rust, in the {@link slim_bindings} crate.
632
+ */
633
+ new: (partial: Partial<SessionConfig> & Required<Omit<SessionConfig, never>>) => SessionConfig;
634
+ /**
635
+ * Defaults specified in the {@link slim_bindings} crate.
636
+ */
637
+ defaults: () => Partial<SessionConfig>;
638
+ }>;
639
+ /**
640
+ * Result of creating a session, containing the session context and a completion handle
641
+ *
642
+ * The completion handle should be awaited to ensure the session is fully established.
643
+ */
644
+ export type SessionWithCompletion = {
645
+ /**
646
+ * The session context for performing operations
647
+ */ session: Session;
648
+ /**
649
+ * Completion handle to wait for session establishment
650
+ */ completion: CompletionHandle;
651
+ };
652
+ export declare const SessionWithCompletion: Readonly<{
653
+ /**
654
+ * Create a frozen instance of {@link SessionWithCompletion}, with defaults specified
655
+ * in Rust, in the {@link slim_bindings} crate.
656
+ */
657
+ create: (partial: Partial<SessionWithCompletion> & Required<Omit<SessionWithCompletion, never>>) => SessionWithCompletion;
658
+ /**
659
+ * Create a frozen instance of {@link SessionWithCompletion}, with defaults specified
660
+ * in Rust, in the {@link slim_bindings} crate.
661
+ */
662
+ new: (partial: Partial<SessionWithCompletion> & Required<Omit<SessionWithCompletion, never>>) => SessionWithCompletion;
663
+ /**
664
+ * Defaults specified in the {@link slim_bindings} crate.
665
+ */
666
+ defaults: () => Partial<SessionWithCompletion>;
667
+ }>;
668
+ /**
669
+ * SPIRE configuration for SPIFFE Workload API integration
670
+ */
671
+ export type SpireConfig = {
672
+ /**
673
+ * Path to the SPIFFE Workload API socket (None => use SPIFFE_ENDPOINT_SOCKET env var)
674
+ */ socketPath?: string;
675
+ /**
676
+ * Optional target SPIFFE ID when requesting JWT SVIDs
677
+ */ targetSpiffeId?: string;
678
+ /**
679
+ * Audiences to request/verify for JWT SVIDs
680
+ */ jwtAudiences: Array<string>;
681
+ /**
682
+ * Optional trust domains override for X.509 bundle retrieval
683
+ */ trustDomains: Array<string>;
684
+ };
685
+ export declare const SpireConfig: Readonly<{
686
+ /**
687
+ * Create a frozen instance of {@link SpireConfig}, with defaults specified
688
+ * in Rust, in the {@link slim_bindings} crate.
689
+ */
690
+ create: (partial: Partial<SpireConfig> & Required<Omit<SpireConfig, never>>) => SpireConfig;
691
+ /**
692
+ * Create a frozen instance of {@link SpireConfig}, with defaults specified
693
+ * in Rust, in the {@link slim_bindings} crate.
694
+ */
695
+ new: (partial: Partial<SpireConfig> & Required<Omit<SpireConfig, never>>) => SpireConfig;
696
+ /**
697
+ * Defaults specified in the {@link slim_bindings} crate.
698
+ */
699
+ defaults: () => Partial<SpireConfig>;
700
+ }>;
701
+ /**
702
+ * Static JWT (Bearer token) authentication configuration
703
+ * The token is loaded from a file and automatically reloaded when changed
704
+ */
705
+ export type StaticJwtAuth = {
706
+ /**
707
+ * Path to file containing the JWT token
708
+ */ tokenFile: string;
709
+ /**
710
+ * Duration for caching the token before re-reading from file (default: 3600 seconds)
711
+ */ duration: number;
712
+ };
713
+ export declare const StaticJwtAuth: Readonly<{
714
+ /**
715
+ * Create a frozen instance of {@link StaticJwtAuth}, with defaults specified
716
+ * in Rust, in the {@link slim_bindings} crate.
717
+ */
718
+ create: (partial: Partial<StaticJwtAuth> & Required<Omit<StaticJwtAuth, never>>) => StaticJwtAuth;
719
+ /**
720
+ * Create a frozen instance of {@link StaticJwtAuth}, with defaults specified
721
+ * in Rust, in the {@link slim_bindings} crate.
722
+ */
723
+ new: (partial: Partial<StaticJwtAuth> & Required<Omit<StaticJwtAuth, never>>) => StaticJwtAuth;
724
+ /**
725
+ * Defaults specified in the {@link slim_bindings} crate.
726
+ */
727
+ defaults: () => Partial<StaticJwtAuth>;
728
+ }>;
729
+ /**
730
+ * TLS configuration for client connections
731
+ */
732
+ export type TlsClientConfig = {
733
+ /**
734
+ * Disable TLS entirely (plain text connection)
735
+ */ insecure: boolean;
736
+ /**
737
+ * Skip server certificate verification (enables TLS but doesn't verify certs)
738
+ * WARNING: Only use for testing - insecure in production!
739
+ */ insecureSkipVerify: boolean;
740
+ /**
741
+ * Certificate and key source for client authentication
742
+ */ source: TlsSource;
743
+ /**
744
+ * CA certificate source for verifying server certificates
745
+ */ caSource: CaSource;
746
+ /**
747
+ * Include system CA certificates pool (default: true)
748
+ */ includeSystemCaCertsPool: boolean;
749
+ /**
750
+ * TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3")
751
+ */ tlsVersion: string;
752
+ };
753
+ export declare const TlsClientConfig: Readonly<{
754
+ /**
755
+ * Create a frozen instance of {@link TlsClientConfig}, with defaults specified
756
+ * in Rust, in the {@link slim_bindings} crate.
757
+ */
758
+ create: (partial: Partial<TlsClientConfig> & Required<Omit<TlsClientConfig, never>>) => TlsClientConfig;
759
+ /**
760
+ * Create a frozen instance of {@link TlsClientConfig}, with defaults specified
761
+ * in Rust, in the {@link slim_bindings} crate.
762
+ */
763
+ new: (partial: Partial<TlsClientConfig> & Required<Omit<TlsClientConfig, never>>) => TlsClientConfig;
764
+ /**
765
+ * Defaults specified in the {@link slim_bindings} crate.
766
+ */
767
+ defaults: () => Partial<TlsClientConfig>;
768
+ }>;
769
+ /**
770
+ * TLS configuration for server connections
771
+ */
772
+ export type TlsServerConfig = {
773
+ /**
774
+ * Disable TLS entirely (plain text connection)
775
+ */ insecure: boolean;
776
+ /**
777
+ * Certificate and key source for server authentication
778
+ */ source: TlsSource;
779
+ /**
780
+ * CA certificate source for verifying client certificates
781
+ */ clientCa: CaSource;
782
+ /**
783
+ * Include system CA certificates pool (default: true)
784
+ */ includeSystemCaCertsPool: boolean;
785
+ /**
786
+ * TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3")
787
+ */ tlsVersion: string;
788
+ /**
789
+ * Reload client CA file when modified
790
+ */ reloadClientCaFile: boolean;
791
+ };
792
+ export declare const TlsServerConfig: Readonly<{
793
+ /**
794
+ * Create a frozen instance of {@link TlsServerConfig}, with defaults specified
795
+ * in Rust, in the {@link slim_bindings} crate.
796
+ */
797
+ create: (partial: Partial<TlsServerConfig> & Required<Omit<TlsServerConfig, never>>) => TlsServerConfig;
798
+ /**
799
+ * Create a frozen instance of {@link TlsServerConfig}, with defaults specified
800
+ * in Rust, in the {@link slim_bindings} crate.
801
+ */
802
+ new: (partial: Partial<TlsServerConfig> & Required<Omit<TlsServerConfig, never>>) => TlsServerConfig;
803
+ /**
804
+ * Defaults specified in the {@link slim_bindings} crate.
805
+ */
806
+ defaults: () => Partial<TlsServerConfig>;
807
+ }>;
808
+ /**
809
+ * Tracing/logging configuration for the SLIM bindings
810
+ *
811
+ * Controls logging behavior including log level, thread name/ID display, and filters.
812
+ */
813
+ export type TracingConfig = {
814
+ /**
815
+ * Log level (e.g., "debug", "info", "warn", "error")
816
+ */ logLevel: string;
817
+ /**
818
+ * Whether to display thread names in logs
819
+ */ displayThreadNames: boolean;
820
+ /**
821
+ * Whether to display thread IDs in logs
822
+ */ displayThreadIds: boolean;
823
+ /**
824
+ * List of tracing filter directives (e.g., ["slim=debug", "tokio=info"])
825
+ */ filters: Array<string>;
826
+ };
827
+ export declare const TracingConfig: Readonly<{
828
+ /**
829
+ * Create a frozen instance of {@link TracingConfig}, with defaults specified
830
+ * in Rust, in the {@link slim_bindings} crate.
831
+ */
832
+ create: (partial: Partial<TracingConfig> & Required<Omit<TracingConfig, never>>) => TracingConfig;
833
+ /**
834
+ * Create a frozen instance of {@link TracingConfig}, with defaults specified
835
+ * in Rust, in the {@link slim_bindings} crate.
836
+ */
837
+ new: (partial: Partial<TracingConfig> & Required<Omit<TracingConfig, never>>) => TracingConfig;
838
+ /**
839
+ * Defaults specified in the {@link slim_bindings} crate.
840
+ */
841
+ defaults: () => Partial<TracingConfig>;
842
+ }>;
843
+ /**
844
+ * Backoff retry configuration
845
+ */
846
+ export type BackoffConfig = {
847
+ tag: "exponential";
848
+ inner: Readonly<{
849
+ config: ExponentialBackoff;
850
+ }>;
851
+ } | {
852
+ tag: "fixedInterval";
853
+ inner: Readonly<{
854
+ config: FixedIntervalBackoff;
855
+ }>;
856
+ };
857
+ export declare const FfiConverterTypeBackoffConfig: {
858
+ read(from: RustBuffer): BackoffConfig;
859
+ write(value: BackoffConfig, into: RustBuffer): void;
860
+ allocationSize(value: BackoffConfig): number;
861
+ lift(value: UniffiByteArray): BackoffConfig;
862
+ lower(value: BackoffConfig): UniffiByteArray;
863
+ };
864
+ /**
865
+ * CA certificate source configuration
866
+ */
867
+ export type CaSource =
868
+ /**
869
+ * Load CA from file
870
+ */
871
+ {
872
+ tag: "file";
873
+ inner: Readonly<{
874
+ path: string;
875
+ }>;
876
+ }
877
+ /**
878
+ * Load CA from PEM string
879
+ */
880
+ | {
881
+ tag: "pem";
882
+ inner: Readonly<{
883
+ data: string;
884
+ }>;
885
+ }
886
+ /**
887
+ * Load CA from SPIRE Workload API
888
+ */
889
+ | {
890
+ tag: "spire";
891
+ inner: Readonly<{
892
+ config: SpireConfig;
893
+ }>;
894
+ }
895
+ /**
896
+ * No CA configured
897
+ */
898
+ | {
899
+ tag: "none";
900
+ };
901
+ export declare const FfiConverterTypeCaSource: {
902
+ read(from: RustBuffer): CaSource;
903
+ write(value: CaSource, into: RustBuffer): void;
904
+ allocationSize(value: CaSource): number;
905
+ lift(value: UniffiByteArray): CaSource;
906
+ lower(value: CaSource): UniffiByteArray;
907
+ };
908
+ /**
909
+ * Authentication configuration enum for client
910
+ */
911
+ export type ClientAuthenticationConfig = {
912
+ tag: "basic";
913
+ inner: Readonly<{
914
+ config: BasicAuth;
915
+ }>;
916
+ } | {
917
+ tag: "staticJwt";
918
+ inner: Readonly<{
919
+ config: StaticJwtAuth;
920
+ }>;
921
+ } | {
922
+ tag: "jwt";
923
+ inner: Readonly<{
924
+ config: ClientJwtAuth;
925
+ }>;
926
+ } | {
927
+ tag: "none";
928
+ };
929
+ export declare const FfiConverterTypeClientAuthenticationConfig: {
930
+ read(from: RustBuffer): ClientAuthenticationConfig;
931
+ write(value: ClientAuthenticationConfig, into: RustBuffer): void;
932
+ allocationSize(value: ClientAuthenticationConfig): number;
933
+ lift(value: UniffiByteArray): ClientAuthenticationConfig;
934
+ lower(value: ClientAuthenticationConfig): UniffiByteArray;
935
+ };
936
+ /**
937
+ * gRPC status codes
938
+ */
939
+ export type Code =
940
+ /**
941
+ * Success
942
+ */
943
+ "ok"
944
+ /**
945
+ * The operation was cancelled
946
+ */
947
+ | "cancelled"
948
+ /**
949
+ * Unknown error
950
+ */
951
+ | "unknown"
952
+ /**
953
+ * Client specified an invalid argument
954
+ */
955
+ | "invalidArgument"
956
+ /**
957
+ * Deadline expired before operation could complete
958
+ */
959
+ | "deadlineExceeded"
960
+ /**
961
+ * Some requested entity was not found
962
+ */
963
+ | "notFound"
964
+ /**
965
+ * Some entity that we attempted to create already exists
966
+ */
967
+ | "alreadyExists"
968
+ /**
969
+ * The caller does not have permission to execute the specified operation
970
+ */
971
+ | "permissionDenied"
972
+ /**
973
+ * Some resource has been exhausted
974
+ */
975
+ | "resourceExhausted"
976
+ /**
977
+ * The system is not in a state required for the operation's execution
978
+ */
979
+ | "failedPrecondition"
980
+ /**
981
+ * The operation was aborted
982
+ */
983
+ | "aborted"
984
+ /**
985
+ * Operation was attempted past the valid range
986
+ */
987
+ | "outOfRange"
988
+ /**
989
+ * Operation is not implemented or not supported
990
+ */
991
+ | "unimplemented"
992
+ /**
993
+ * Internal errors
994
+ */
995
+ | "internal"
996
+ /**
997
+ * The service is currently unavailable
998
+ */
999
+ | "unavailable"
1000
+ /**
1001
+ * Unrecoverable data loss or corruption
1002
+ */
1003
+ | "dataLoss"
1004
+ /**
1005
+ * The request does not have valid authentication credentials
1006
+ */
1007
+ | "unauthenticated";
1008
+ export declare const FfiConverterTypeCode: {
1009
+ read(from: RustBuffer): Code;
1010
+ write(value: Code, into: RustBuffer): void;
1011
+ allocationSize(value: Code): number;
1012
+ lift(value: UniffiByteArray): Code;
1013
+ lower(value: Code): UniffiByteArray;
1014
+ };
1015
+ /**
1016
+ * Compression type for gRPC messages
1017
+ */
1018
+ export type CompressionType = "gzip" | "zlib" | "deflate" | "snappy" | "zstd" | "lz4" | "none" | "empty";
1019
+ export declare const FfiConverterTypeCompressionType: {
1020
+ read(from: RustBuffer): CompressionType;
1021
+ write(value: CompressionType, into: RustBuffer): void;
1022
+ allocationSize(value: CompressionType): number;
1023
+ lift(value: UniffiByteArray): CompressionType;
1024
+ lower(value: CompressionType): UniffiByteArray;
1025
+ };
1026
+ /**
1027
+ * Direction enum
1028
+ * Indicates whether the App can send, receive, both, or neither.
1029
+ */
1030
+ export type Direction = "send" | "recv" | "bidirectional" | "none";
1031
+ export declare const FfiConverterTypeDirection: {
1032
+ read(from: RustBuffer): Direction;
1033
+ write(value: Direction, into: RustBuffer): void;
1034
+ allocationSize(value: Direction): number;
1035
+ lift(value: UniffiByteArray): Direction;
1036
+ lower(value: Direction): UniffiByteArray;
1037
+ };
1038
+ /**
1039
+ * Identity provider configuration - used to prove identity to others
1040
+ */
1041
+ export type IdentityProviderConfig =
1042
+ /**
1043
+ * Shared secret authentication (symmetric key)
1044
+ */
1045
+ {
1046
+ tag: "sharedSecret";
1047
+ inner: Readonly<{
1048
+ id: string;
1049
+ data: string;
1050
+ }>;
1051
+ }
1052
+ /**
1053
+ * Static JWT loaded from file with auto-reload
1054
+ */
1055
+ | {
1056
+ tag: "staticJwt";
1057
+ inner: Readonly<{
1058
+ config: StaticJwtAuth;
1059
+ }>;
1060
+ }
1061
+ /**
1062
+ * Dynamic JWT generation with signing key
1063
+ */
1064
+ | {
1065
+ tag: "jwt";
1066
+ inner: Readonly<{
1067
+ config: ClientJwtAuth;
1068
+ }>;
1069
+ }
1070
+ /**
1071
+ * SPIRE-based identity provider (non-Windows only)
1072
+ */
1073
+ | {
1074
+ tag: "spire";
1075
+ inner: Readonly<{
1076
+ config: SpireConfig;
1077
+ }>;
1078
+ }
1079
+ /**
1080
+ * No identity provider configured
1081
+ */
1082
+ | {
1083
+ tag: "none";
1084
+ };
1085
+ export declare const FfiConverterTypeIdentityProviderConfig: {
1086
+ read(from: RustBuffer): IdentityProviderConfig;
1087
+ write(value: IdentityProviderConfig, into: RustBuffer): void;
1088
+ allocationSize(value: IdentityProviderConfig): number;
1089
+ lift(value: UniffiByteArray): IdentityProviderConfig;
1090
+ lower(value: IdentityProviderConfig): UniffiByteArray;
1091
+ };
1092
+ /**
1093
+ * Identity verifier configuration - used to verify identity of others
1094
+ */
1095
+ export type IdentityVerifierConfig =
1096
+ /**
1097
+ * Shared secret verification (symmetric key)
1098
+ */
1099
+ {
1100
+ tag: "sharedSecret";
1101
+ inner: Readonly<{
1102
+ id: string;
1103
+ data: string;
1104
+ }>;
1105
+ }
1106
+ /**
1107
+ * JWT verification with decoding key
1108
+ */
1109
+ | {
1110
+ tag: "jwt";
1111
+ inner: Readonly<{
1112
+ config: JwtAuth;
1113
+ }>;
1114
+ }
1115
+ /**
1116
+ * SPIRE-based identity verifier (non-Windows only)
1117
+ */
1118
+ | {
1119
+ tag: "spire";
1120
+ inner: Readonly<{
1121
+ config: SpireConfig;
1122
+ }>;
1123
+ }
1124
+ /**
1125
+ * No identity verifier configured
1126
+ */
1127
+ | {
1128
+ tag: "none";
1129
+ };
1130
+ export declare const FfiConverterTypeIdentityVerifierConfig: {
1131
+ read(from: RustBuffer): IdentityVerifierConfig;
1132
+ write(value: IdentityVerifierConfig, into: RustBuffer): void;
1133
+ allocationSize(value: IdentityVerifierConfig): number;
1134
+ lift(value: UniffiByteArray): IdentityVerifierConfig;
1135
+ lower(value: IdentityVerifierConfig): UniffiByteArray;
1136
+ };
1137
+ /**
1138
+ * JWT signing/verification algorithm
1139
+ */
1140
+ export type JwtAlgorithm = "hs256" | "hs384" | "hs512" | "es256" | "es384" | "rs256" | "rs384" | "rs512" | "ps256" | "ps384" | "ps512" | "edDsa";
1141
+ export declare const FfiConverterTypeJwtAlgorithm: {
1142
+ read(from: RustBuffer): JwtAlgorithm;
1143
+ write(value: JwtAlgorithm, into: RustBuffer): void;
1144
+ allocationSize(value: JwtAlgorithm): number;
1145
+ lift(value: UniffiByteArray): JwtAlgorithm;
1146
+ lower(value: JwtAlgorithm): UniffiByteArray;
1147
+ };
1148
+ /**
1149
+ * JWT key data source
1150
+ */
1151
+ export type JwtKeyData =
1152
+ /**
1153
+ * String with encoded key(s)
1154
+ */
1155
+ {
1156
+ tag: "data";
1157
+ inner: Readonly<{
1158
+ value: string;
1159
+ }>;
1160
+ }
1161
+ /**
1162
+ * File path to the key(s)
1163
+ */
1164
+ | {
1165
+ tag: "file";
1166
+ inner: Readonly<{
1167
+ path: string;
1168
+ }>;
1169
+ };
1170
+ export declare const FfiConverterTypeJwtKeyData: {
1171
+ read(from: RustBuffer): JwtKeyData;
1172
+ write(value: JwtKeyData, into: RustBuffer): void;
1173
+ allocationSize(value: JwtKeyData): number;
1174
+ lift(value: UniffiByteArray): JwtKeyData;
1175
+ lower(value: JwtKeyData): UniffiByteArray;
1176
+ };
1177
+ /**
1178
+ * JWT key format
1179
+ */
1180
+ export type JwtKeyFormat = "pem" | "jwk" | "jwks";
1181
+ export declare const FfiConverterTypeJwtKeyFormat: {
1182
+ read(from: RustBuffer): JwtKeyFormat;
1183
+ write(value: JwtKeyFormat, into: RustBuffer): void;
1184
+ allocationSize(value: JwtKeyFormat): number;
1185
+ lift(value: UniffiByteArray): JwtKeyFormat;
1186
+ lower(value: JwtKeyFormat): UniffiByteArray;
1187
+ };
1188
+ /**
1189
+ * JWT key type (encoding, decoding, or autoresolve)
1190
+ */
1191
+ export type JwtKeyType =
1192
+ /**
1193
+ * Encoding key for signing JWTs (client-side)
1194
+ */
1195
+ {
1196
+ tag: "encoding";
1197
+ inner: Readonly<{
1198
+ key: JwtKeyConfig;
1199
+ }>;
1200
+ }
1201
+ /**
1202
+ * Decoding key for verifying JWTs (server-side)
1203
+ */
1204
+ | {
1205
+ tag: "decoding";
1206
+ inner: Readonly<{
1207
+ key: JwtKeyConfig;
1208
+ }>;
1209
+ }
1210
+ /**
1211
+ * Automatically resolve keys based on claims
1212
+ */
1213
+ | {
1214
+ tag: "autoresolve";
1215
+ };
1216
+ export declare const FfiConverterTypeJwtKeyType: {
1217
+ read(from: RustBuffer): JwtKeyType;
1218
+ write(value: JwtKeyType, into: RustBuffer): void;
1219
+ allocationSize(value: JwtKeyType): number;
1220
+ lift(value: UniffiByteArray): JwtKeyType;
1221
+ lower(value: JwtKeyType): UniffiByteArray;
1222
+ };
1223
+ /**
1224
+ * UniFFI-compatible RPC error
1225
+ *
1226
+ * This wraps Status to make it compatible with UniFFI foreign language bindings.
1227
+ * UniFFI requires errors to be represented as enums with associated data.
1228
+ */
1229
+ export type RpcError = "rpc";
1230
+ export declare const FfiConverterTypeRpcError: {
1231
+ read(from: RustBuffer): RpcError;
1232
+ write(value: RpcError, into: RustBuffer): void;
1233
+ allocationSize(value: RpcError): number;
1234
+ lift(value: UniffiByteArray): "rpc";
1235
+ lower(value: "rpc"): UniffiByteArray;
1236
+ };
1237
+ /**
1238
+ * Authentication configuration enum for server
1239
+ */
1240
+ export type ServerAuthenticationConfig = {
1241
+ tag: "basic";
1242
+ inner: Readonly<{
1243
+ config: BasicAuth;
1244
+ }>;
1245
+ } | {
1246
+ tag: "jwt";
1247
+ inner: Readonly<{
1248
+ config: JwtAuth;
1249
+ }>;
1250
+ } | {
1251
+ tag: "none";
1252
+ };
1253
+ export declare const FfiConverterTypeServerAuthenticationConfig: {
1254
+ read(from: RustBuffer): ServerAuthenticationConfig;
1255
+ write(value: ServerAuthenticationConfig, into: RustBuffer): void;
1256
+ allocationSize(value: ServerAuthenticationConfig): number;
1257
+ lift(value: UniffiByteArray): ServerAuthenticationConfig;
1258
+ lower(value: ServerAuthenticationConfig): UniffiByteArray;
1259
+ };
1260
+ /**
1261
+ * Session type enum
1262
+ */
1263
+ export type SessionType = "pointToPoint" | "group";
1264
+ export declare const FfiConverterTypeSessionType: {
1265
+ read(from: RustBuffer): SessionType;
1266
+ write(value: SessionType, into: RustBuffer): void;
1267
+ allocationSize(value: SessionType): number;
1268
+ lift(value: UniffiByteArray): SessionType;
1269
+ lower(value: SessionType): UniffiByteArray;
1270
+ };
1271
+ /**
1272
+ * Error types for SLIM operations
1273
+ */
1274
+ export type SlimError = {
1275
+ tag: "serviceError";
1276
+ inner: Readonly<{
1277
+ message: string;
1278
+ }>;
1279
+ } | {
1280
+ tag: "sessionError";
1281
+ inner: Readonly<{
1282
+ message: string;
1283
+ }>;
1284
+ } | {
1285
+ tag: "receiveError";
1286
+ inner: Readonly<{
1287
+ message: string;
1288
+ }>;
1289
+ } | {
1290
+ tag: "sendError";
1291
+ inner: Readonly<{
1292
+ message: string;
1293
+ }>;
1294
+ } | {
1295
+ tag: "authError";
1296
+ inner: Readonly<{
1297
+ message: string;
1298
+ }>;
1299
+ } | {
1300
+ tag: "configError";
1301
+ inner: Readonly<{
1302
+ message: string;
1303
+ }>;
1304
+ } | {
1305
+ tag: "rpcError";
1306
+ inner: Readonly<{
1307
+ message: string;
1308
+ }>;
1309
+ } | {
1310
+ tag: "timeout";
1311
+ } | {
1312
+ tag: "invalidArgument";
1313
+ inner: Readonly<{
1314
+ message: string;
1315
+ }>;
1316
+ } | {
1317
+ tag: "internalError";
1318
+ inner: Readonly<{
1319
+ message: string;
1320
+ }>;
1321
+ };
1322
+ export declare const FfiConverterTypeSlimError: {
1323
+ read(from: RustBuffer): SlimError;
1324
+ write(value: SlimError, into: RustBuffer): void;
1325
+ allocationSize(value: SlimError): number;
1326
+ lift(value: UniffiByteArray): SlimError;
1327
+ lower(value: SlimError): UniffiByteArray;
1328
+ };
1329
+ /**
1330
+ * Message from a stream
1331
+ */
1332
+ export type StreamMessage =
1333
+ /**
1334
+ * Successfully received data
1335
+ */
1336
+ {
1337
+ tag: "data";
1338
+ inner: Readonly<[ArrayBuffer]>;
1339
+ }
1340
+ /**
1341
+ * Stream error occurred
1342
+ */
1343
+ | {
1344
+ tag: "error";
1345
+ inner: Readonly<[RpcError]>;
1346
+ }
1347
+ /**
1348
+ * Stream has ended
1349
+ */
1350
+ | {
1351
+ tag: "end";
1352
+ };
1353
+ export declare const FfiConverterTypeStreamMessage: {
1354
+ read(from: RustBuffer): StreamMessage;
1355
+ write(value: StreamMessage, into: RustBuffer): void;
1356
+ allocationSize(value: StreamMessage): number;
1357
+ lift(value: UniffiByteArray): StreamMessage;
1358
+ lower(value: StreamMessage): UniffiByteArray;
1359
+ };
1360
+ /**
1361
+ * TLS certificate and key source configuration
1362
+ */
1363
+ export type TlsSource =
1364
+ /**
1365
+ * Load certificate and key from PEM strings
1366
+ */
1367
+ {
1368
+ tag: "pem";
1369
+ inner: Readonly<{
1370
+ cert: string;
1371
+ key: string;
1372
+ }>;
1373
+ }
1374
+ /**
1375
+ * Load certificate and key from files (with auto-reload support)
1376
+ */
1377
+ | {
1378
+ tag: "file";
1379
+ inner: Readonly<{
1380
+ cert: string;
1381
+ key: string;
1382
+ }>;
1383
+ }
1384
+ /**
1385
+ * Load certificate and key from SPIRE Workload API
1386
+ */
1387
+ | {
1388
+ tag: "spire";
1389
+ inner: Readonly<{
1390
+ config: SpireConfig;
1391
+ }>;
1392
+ }
1393
+ /**
1394
+ * No certificate/key configured
1395
+ */
1396
+ | {
1397
+ tag: "none";
1398
+ };
1399
+ export declare const FfiConverterTypeTlsSource: {
1400
+ read(from: RustBuffer): TlsSource;
1401
+ write(value: TlsSource, into: RustBuffer): void;
1402
+ allocationSize(value: TlsSource): number;
1403
+ lift(value: UniffiByteArray): TlsSource;
1404
+ lower(value: TlsSource): UniffiByteArray;
1405
+ };
1406
+ export type AppInterface = {
1407
+ /**
1408
+ * Create a new session (blocking version for FFI)
1409
+ *
1410
+ * Returns a SessionWithCompletion containing the session context and a completion handle.
1411
+ * Call `.wait()` on the completion handle to wait for session establishment.
1412
+ */ createSession(config: SessionConfig, destination: Name): SessionWithCompletion;
1413
+ /**
1414
+ * Create a new session and wait for completion (blocking version)
1415
+ *
1416
+ * This method creates a session and blocks until the session establishment completes.
1417
+ * Returns only the session context, as the completion has already been awaited.
1418
+ */ createSessionAndWait(config: SessionConfig, destination: Name): Session;
1419
+ /**
1420
+ * Create a new session and wait for completion (async version)
1421
+ *
1422
+ * This method creates a session and waits until the session establishment completes.
1423
+ * Returns only the session context, as the completion has already been awaited.
1424
+ */ createSessionAndWaitAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
1425
+ signal: AbortSignal;
1426
+ }): Promise<Session>;
1427
+ /**
1428
+ * Create a new session (async version)
1429
+ *
1430
+ * Returns a SessionWithCompletion containing the session context and a completion handle.
1431
+ * Await the completion handle to wait for session establishment.
1432
+ * For point-to-point sessions, this ensures the remote peer has acknowledged the session.
1433
+ * For multicast sessions, this ensures the initial setup is complete.
1434
+ */ createSessionAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
1435
+ signal: AbortSignal;
1436
+ }): Promise<SessionWithCompletion>;
1437
+ /**
1438
+ * Delete a session (blocking version for FFI)
1439
+ *
1440
+ * Returns a completion handle that can be awaited to ensure the deletion completes.
1441
+ */ deleteSession(session: Session): CompletionHandle;
1442
+ /**
1443
+ * Delete a session and wait for completion (blocking version)
1444
+ *
1445
+ * This method deletes a session and blocks until the deletion completes.
1446
+ */ deleteSessionAndWait(session: Session): void;
1447
+ /**
1448
+ * Delete a session and wait for completion (async version)
1449
+ *
1450
+ * This method deletes a session and waits until the deletion completes.
1451
+ */ deleteSessionAndWaitAsync(session: Session, asyncOpts_?: {
1452
+ signal: AbortSignal;
1453
+ }): void;
1454
+ /**
1455
+ * Delete a session (async version)
1456
+ *
1457
+ * Returns a completion handle that can be awaited to ensure the deletion completes.
1458
+ */ deleteSessionAsync(session: Session, asyncOpts_?: {
1459
+ signal: AbortSignal;
1460
+ }): Promise<CompletionHandle>;
1461
+ /**
1462
+ * Get the app ID (derived from name)
1463
+ */ id(): bigint;
1464
+ /**
1465
+ * Listen for incoming sessions (blocking version for FFI)
1466
+ */ listenForSession(timeout: number | undefined): Session;
1467
+ /**
1468
+ * Listen for incoming sessions (async version)
1469
+ */ listenForSessionAsync(timeout: number | undefined, asyncOpts_?: {
1470
+ signal: AbortSignal;
1471
+ }): Promise<Session>;
1472
+ /**
1473
+ * Get the app name
1474
+ */ name(): Name;
1475
+ /**
1476
+ * Remove a route (blocking version for FFI)
1477
+ */ removeRoute(name: Name, connectionId: bigint): void;
1478
+ /**
1479
+ * Remove a route (async version)
1480
+ */ removeRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
1481
+ signal: AbortSignal;
1482
+ }): void;
1483
+ /**
1484
+ * Set a route to a name for a specific connection (blocking version for FFI)
1485
+ */ setRoute(name: Name, connectionId: bigint): void;
1486
+ /**
1487
+ * Set a route to a name for a specific connection (async version)
1488
+ */ setRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
1489
+ signal: AbortSignal;
1490
+ }): void;
1491
+ /**
1492
+ * Subscribe to a session name (blocking version for FFI)
1493
+ */ subscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
1494
+ /**
1495
+ * Subscribe to a name (async version)
1496
+ */ subscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
1497
+ signal: AbortSignal;
1498
+ }): void;
1499
+ /**
1500
+ * Unsubscribe from a name (blocking version for FFI)
1501
+ */ unsubscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
1502
+ /**
1503
+ * Unsubscribe from a name (async version)
1504
+ */ unsubscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
1505
+ signal: AbortSignal;
1506
+ }): void;
1507
+ };
1508
+ /**
1509
+ * Adapter that bridges the App API with language-bindings interface
1510
+ *
1511
+ * This adapter uses enum-based auth types (`AuthProvider`/`AuthVerifier`) instead of generics
1512
+ * to be compatible with UniFFI, supporting multiple authentication mechanisms (SharedSecret,
1513
+ * JWT, SPIRE, StaticToken). It provides both synchronous (blocking) and asynchronous methods
1514
+ * for flexibility.
1515
+ */
1516
+ export declare class App extends UniffiAbstractObject implements AppInterface {
1517
+ readonly [uniffiTypeNameSymbol] = "App";
1518
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
1519
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
1520
+ /**
1521
+ * Create a new App with identity provider and verifier configurations
1522
+ *
1523
+ * This is the main entry point for creating a SLIM application from language bindings.
1524
+ *
1525
+ * # Arguments
1526
+ * * `base_name` - The base name for the app (without ID)
1527
+ * * `identity_provider_config` - Configuration for proving identity to others
1528
+ * * `identity_verifier_config` - Configuration for verifying identity of others
1529
+ *
1530
+ * # Returns
1531
+ * * `Ok(Arc<App>)` - Successfully created adapter
1532
+ * * `Err(SlimError)` - If adapter creation fails
1533
+ *
1534
+ * # Supported Identity Types
1535
+ * - SharedSecret: Symmetric key authentication
1536
+ * - JWT: Dynamic JWT generation/verification with signing/decoding keys
1537
+ * - StaticJWT: Static JWT loaded from file with auto-reload
1538
+ */
1539
+ constructor(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig);
1540
+ /**
1541
+ * Create a new App with traffic direction (blocking version)
1542
+ *
1543
+ * This is a convenience function for creating a SLIM application with configurable
1544
+ * traffic direction (send-only, receive-only, bidirectional, or none).
1545
+ *
1546
+ * # Arguments
1547
+ * * `name` - The base name for the app (without ID)
1548
+ * * `identity_provider_config` - Configuration for proving identity to others
1549
+ * * `identity_verifier_config` - Configuration for verifying identity of others
1550
+ * * `direction` - Traffic direction for sessions (Send, Recv, Bidirectional, or None)
1551
+ *
1552
+ * # Returns
1553
+ * * `Ok(Arc<App>)` - Successfully created app
1554
+ * * `Err(SlimError)` - If app creation fails
1555
+ */
1556
+ static newWithDirection(name: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): App;
1557
+ /**
1558
+ * Create a new App with SharedSecret authentication (blocking version)
1559
+ *
1560
+ * This is a convenience function for creating a SLIM application using SharedSecret authentication.
1561
+ *
1562
+ * # Arguments
1563
+ * * `name` - The base name for the app (without ID)
1564
+ * * `secret` - The shared secret string for authentication
1565
+ *
1566
+ * # Returns
1567
+ * * `Ok(Arc<App>)` - Successfully created adapter
1568
+ * * `Err(SlimError)` - If adapter creation fails
1569
+ */
1570
+ static newWithSecret(name: Name, secret: string): App;
1571
+ /**
1572
+ * Create a new session (blocking version for FFI)
1573
+ *
1574
+ * Returns a SessionWithCompletion containing the session context and a completion handle.
1575
+ * Call `.wait()` on the completion handle to wait for session establishment.
1576
+ */ createSession(config: SessionConfig, destination: Name): SessionWithCompletion;
1577
+ /**
1578
+ * Create a new session and wait for completion (blocking version)
1579
+ *
1580
+ * This method creates a session and blocks until the session establishment completes.
1581
+ * Returns only the session context, as the completion has already been awaited.
1582
+ */ createSessionAndWait(config: SessionConfig, destination: Name): Session;
1583
+ /**
1584
+ * Create a new session and wait for completion (async version)
1585
+ *
1586
+ * This method creates a session and waits until the session establishment completes.
1587
+ * Returns only the session context, as the completion has already been awaited.
1588
+ */ createSessionAndWaitAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
1589
+ signal: AbortSignal;
1590
+ }): Promise<Session>;
1591
+ /**
1592
+ * Create a new session (async version)
1593
+ *
1594
+ * Returns a SessionWithCompletion containing the session context and a completion handle.
1595
+ * Await the completion handle to wait for session establishment.
1596
+ * For point-to-point sessions, this ensures the remote peer has acknowledged the session.
1597
+ * For multicast sessions, this ensures the initial setup is complete.
1598
+ */ createSessionAsync(config: SessionConfig, destination: Name, asyncOpts_?: {
1599
+ signal: AbortSignal;
1600
+ }): Promise<SessionWithCompletion>;
1601
+ /**
1602
+ * Delete a session (blocking version for FFI)
1603
+ *
1604
+ * Returns a completion handle that can be awaited to ensure the deletion completes.
1605
+ */ deleteSession(session: Session): CompletionHandle;
1606
+ /**
1607
+ * Delete a session and wait for completion (blocking version)
1608
+ *
1609
+ * This method deletes a session and blocks until the deletion completes.
1610
+ */ deleteSessionAndWait(session: Session): void;
1611
+ /**
1612
+ * Delete a session and wait for completion (async version)
1613
+ *
1614
+ * This method deletes a session and waits until the deletion completes.
1615
+ */ deleteSessionAndWaitAsync(session: Session, asyncOpts_?: {
1616
+ signal: AbortSignal;
1617
+ }): void;
1618
+ /**
1619
+ * Delete a session (async version)
1620
+ *
1621
+ * Returns a completion handle that can be awaited to ensure the deletion completes.
1622
+ */ deleteSessionAsync(session: Session, asyncOpts_?: {
1623
+ signal: AbortSignal;
1624
+ }): Promise<CompletionHandle>;
1625
+ /**
1626
+ * Get the app ID (derived from name)
1627
+ */ id(): bigint;
1628
+ /**
1629
+ * Listen for incoming sessions (blocking version for FFI)
1630
+ */ listenForSession(timeout: number | undefined): Session;
1631
+ /**
1632
+ * Listen for incoming sessions (async version)
1633
+ */ listenForSessionAsync(timeout: number | undefined, asyncOpts_?: {
1634
+ signal: AbortSignal;
1635
+ }): Promise<Session>;
1636
+ /**
1637
+ * Get the app name
1638
+ */ name(): Name;
1639
+ /**
1640
+ * Remove a route (blocking version for FFI)
1641
+ */ removeRoute(name: Name, connectionId: bigint): void;
1642
+ /**
1643
+ * Remove a route (async version)
1644
+ */ removeRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
1645
+ signal: AbortSignal;
1646
+ }): void;
1647
+ /**
1648
+ * Set a route to a name for a specific connection (blocking version for FFI)
1649
+ */ setRoute(name: Name, connectionId: bigint): void;
1650
+ /**
1651
+ * Set a route to a name for a specific connection (async version)
1652
+ */ setRouteAsync(name: Name, connectionId: bigint, asyncOpts_?: {
1653
+ signal: AbortSignal;
1654
+ }): void;
1655
+ /**
1656
+ * Subscribe to a session name (blocking version for FFI)
1657
+ */ subscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
1658
+ /**
1659
+ * Subscribe to a name (async version)
1660
+ */ subscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
1661
+ signal: AbortSignal;
1662
+ }): void;
1663
+ /**
1664
+ * Unsubscribe from a name (blocking version for FFI)
1665
+ */ unsubscribe(name: Name, connectionId: /*u64*/ bigint | undefined): void;
1666
+ /**
1667
+ * Unsubscribe from a name (async version)
1668
+ */ unsubscribeAsync(name: Name, connectionId: /*u64*/ bigint | undefined, asyncOpts_?: {
1669
+ signal: AbortSignal;
1670
+ }): void;
1671
+ /**
1672
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1673
+ */
1674
+ uniffiDestroy(): void;
1675
+ [Symbol.dispose]: () => void;
1676
+ static instanceOf(obj: any): obj is App;
1677
+ }
1678
+ export type BidiStreamHandlerInterface = {
1679
+ /**
1680
+ * Close the request stream (no more messages will be sent)
1681
+ */ closeSend(): void;
1682
+ /**
1683
+ * Close the request stream (async version)
1684
+ */ closeSendAsync(asyncOpts_?: {
1685
+ signal: AbortSignal;
1686
+ }): void;
1687
+ /**
1688
+ * Receive the next response message (blocking version)
1689
+ */ recv(): StreamMessage;
1690
+ /**
1691
+ * Receive the next response message (async version)
1692
+ */ recvAsync(asyncOpts_?: {
1693
+ signal: AbortSignal;
1694
+ }): Promise<StreamMessage>;
1695
+ /**
1696
+ * Send a request message to the stream (blocking version)
1697
+ */ send(data: ArrayBuffer): void;
1698
+ /**
1699
+ * Send a request message to the stream (async version)
1700
+ */ sendAsync(data: ArrayBuffer, asyncOpts_?: {
1701
+ signal: AbortSignal;
1702
+ }): void;
1703
+ };
1704
+ /**
1705
+ * Bidirectional stream handler for stream-to-stream RPC calls
1706
+ *
1707
+ * Allows sending and receiving messages concurrently.
1708
+ */
1709
+ export declare class BidiStreamHandler extends UniffiAbstractObject implements BidiStreamHandlerInterface {
1710
+ readonly [uniffiTypeNameSymbol] = "BidiStreamHandler";
1711
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
1712
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
1713
+ /**
1714
+ * Close the request stream (no more messages will be sent)
1715
+ */ closeSend(): void;
1716
+ /**
1717
+ * Close the request stream (async version)
1718
+ */ closeSendAsync(asyncOpts_?: {
1719
+ signal: AbortSignal;
1720
+ }): void;
1721
+ /**
1722
+ * Receive the next response message (blocking version)
1723
+ */ recv(): StreamMessage;
1724
+ /**
1725
+ * Receive the next response message (async version)
1726
+ */ recvAsync(asyncOpts_?: {
1727
+ signal: AbortSignal;
1728
+ }): Promise<StreamMessage>;
1729
+ /**
1730
+ * Send a request message to the stream (blocking version)
1731
+ */ send(data: ArrayBuffer): void;
1732
+ /**
1733
+ * Send a request message to the stream (async version)
1734
+ */ sendAsync(data: ArrayBuffer, asyncOpts_?: {
1735
+ signal: AbortSignal;
1736
+ }): void;
1737
+ /**
1738
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1739
+ */
1740
+ uniffiDestroy(): void;
1741
+ [Symbol.dispose]: () => void;
1742
+ static instanceOf(obj: any): obj is BidiStreamHandler;
1743
+ }
1744
+ export type ChannelInterface = {
1745
+ /**
1746
+ * Make a stream-to-stream RPC call (blocking version)
1747
+ *
1748
+ * # Arguments
1749
+ * * `service_name` - The service name
1750
+ * * `method_name` - The method name
1751
+ * * `timeout` - Optional timeout duration
1752
+ *
1753
+ * # Returns
1754
+ * A BidiStreamHandler for sending and receiving messages
1755
+ *
1756
+ * # Note
1757
+ * This returns a BidiStreamHandler that can be used to send request messages
1758
+ * and read response messages concurrently.
1759
+ */ callStreamStream(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): BidiStreamHandler;
1760
+ /**
1761
+ * Make a stream-to-unary RPC call (blocking version)
1762
+ *
1763
+ * # Arguments
1764
+ * * `service_name` - The service name
1765
+ * * `method_name` - The method name
1766
+ * * `timeout` - Optional timeout duration
1767
+ *
1768
+ * # Returns
1769
+ * A RequestStreamWriter for sending request messages and getting the final response
1770
+ *
1771
+ * # Note
1772
+ * This returns a RequestStreamWriter that can be used to send multiple request
1773
+ * messages and then finalize to get the single response.
1774
+ */ callStreamUnary(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): RequestStreamWriter;
1775
+ /**
1776
+ * Make a unary-to-unary RPC call (blocking version)
1777
+ *
1778
+ * # Arguments
1779
+ * * `service_name` - The service name (e.g., "MyService")
1780
+ * * `method_name` - The method name (e.g., "GetUser")
1781
+ * * `request` - The request message bytes
1782
+ * * `timeout` - Optional timeout duration
1783
+ *
1784
+ * # Returns
1785
+ * The response message bytes or an error
1786
+ */ callUnary(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ArrayBuffer;
1787
+ /**
1788
+ * Make a unary-to-unary RPC call (async version)
1789
+ *
1790
+ * # Arguments
1791
+ * * `service_name` - The service name (e.g., "MyService")
1792
+ * * `method_name` - The method name (e.g., "GetUser")
1793
+ * * `request` - The request message bytes
1794
+ * * `timeout` - Optional timeout duration
1795
+ *
1796
+ * # Returns
1797
+ * The response message bytes or an error
1798
+ */ callUnaryAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
1799
+ signal: AbortSignal;
1800
+ }): Promise<ArrayBuffer>;
1801
+ /**
1802
+ * Make a unary-to-stream RPC call (blocking version)
1803
+ *
1804
+ * # Arguments
1805
+ * * `service_name` - The service name
1806
+ * * `method_name` - The method name
1807
+ * * `request` - The request message bytes
1808
+ * * `timeout` - Optional timeout duration
1809
+ *
1810
+ * # Returns
1811
+ * A stream reader for pulling response messages
1812
+ *
1813
+ * # Note
1814
+ * This returns a ResponseStreamReader that can be used to pull messages
1815
+ * one at a time from the response stream.
1816
+ */ callUnaryStream(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ResponseStreamReader;
1817
+ /**
1818
+ * Make a unary-to-stream RPC call (async version)
1819
+ *
1820
+ * # Arguments
1821
+ * * `service_name` - The service name
1822
+ * * `method_name` - The method name
1823
+ * * `request` - The request message bytes
1824
+ * * `timeout` - Optional timeout duration
1825
+ *
1826
+ * # Returns
1827
+ * A stream reader for pulling response messages
1828
+ *
1829
+ * # Note
1830
+ * This returns a ResponseStreamReader that can be used to pull messages
1831
+ * one at a time from the response stream.
1832
+ */ callUnaryStreamAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
1833
+ signal: AbortSignal;
1834
+ }): Promise<ResponseStreamReader>;
1835
+ };
1836
+ /**
1837
+ * Client-side channel for making RPC calls
1838
+ *
1839
+ * A Channel manages the connection to a remote service and provides methods
1840
+ * for making RPC calls with different streaming patterns.
1841
+ *
1842
+ * Each RPC call creates a new session which is closed after the RPC completes.
1843
+ */
1844
+ export declare class Channel extends UniffiAbstractObject implements ChannelInterface {
1845
+ readonly [uniffiTypeNameSymbol] = "Channel";
1846
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
1847
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
1848
+ /**
1849
+ * Create a new RPC channel
1850
+ *
1851
+ * # Arguments
1852
+ * * `app` - The SLIM application instance
1853
+ * * `remote` - The remote service name to connect to
1854
+ *
1855
+ * # Returns
1856
+ * A new channel instance
1857
+ */
1858
+ constructor(app: App, remote: Name);
1859
+ /**
1860
+ * Create a new RPC channel with optional connection ID
1861
+ *
1862
+ * The connection ID is used to set up routing before making RPC calls,
1863
+ * enabling multi-hop RPC calls through specific connections.
1864
+ *
1865
+ * # Arguments
1866
+ * * `app` - The SLIM application instance
1867
+ * * `remote` - The remote service name to connect to
1868
+ * * `connection_id` - Optional connection ID for routing setup
1869
+ *
1870
+ * # Returns
1871
+ * A new channel instance
1872
+ */
1873
+ static newWithConnection(app: App, remote: Name, connectionId: /*u64*/ bigint | undefined): Channel;
1874
+ /**
1875
+ * Make a stream-to-stream RPC call (blocking version)
1876
+ *
1877
+ * # Arguments
1878
+ * * `service_name` - The service name
1879
+ * * `method_name` - The method name
1880
+ * * `timeout` - Optional timeout duration
1881
+ *
1882
+ * # Returns
1883
+ * A BidiStreamHandler for sending and receiving messages
1884
+ *
1885
+ * # Note
1886
+ * This returns a BidiStreamHandler that can be used to send request messages
1887
+ * and read response messages concurrently.
1888
+ */ callStreamStream(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): BidiStreamHandler;
1889
+ /**
1890
+ * Make a stream-to-unary RPC call (blocking version)
1891
+ *
1892
+ * # Arguments
1893
+ * * `service_name` - The service name
1894
+ * * `method_name` - The method name
1895
+ * * `timeout` - Optional timeout duration
1896
+ *
1897
+ * # Returns
1898
+ * A RequestStreamWriter for sending request messages and getting the final response
1899
+ *
1900
+ * # Note
1901
+ * This returns a RequestStreamWriter that can be used to send multiple request
1902
+ * messages and then finalize to get the single response.
1903
+ */ callStreamUnary(serviceName: string, methodName: string, timeout: number | undefined, metadata: Map<string, string> | undefined): RequestStreamWriter;
1904
+ /**
1905
+ * Make a unary-to-unary RPC call (blocking version)
1906
+ *
1907
+ * # Arguments
1908
+ * * `service_name` - The service name (e.g., "MyService")
1909
+ * * `method_name` - The method name (e.g., "GetUser")
1910
+ * * `request` - The request message bytes
1911
+ * * `timeout` - Optional timeout duration
1912
+ *
1913
+ * # Returns
1914
+ * The response message bytes or an error
1915
+ */ callUnary(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ArrayBuffer;
1916
+ /**
1917
+ * Make a unary-to-unary RPC call (async version)
1918
+ *
1919
+ * # Arguments
1920
+ * * `service_name` - The service name (e.g., "MyService")
1921
+ * * `method_name` - The method name (e.g., "GetUser")
1922
+ * * `request` - The request message bytes
1923
+ * * `timeout` - Optional timeout duration
1924
+ *
1925
+ * # Returns
1926
+ * The response message bytes or an error
1927
+ */ callUnaryAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
1928
+ signal: AbortSignal;
1929
+ }): Promise<ArrayBuffer>;
1930
+ /**
1931
+ * Make a unary-to-stream RPC call (blocking version)
1932
+ *
1933
+ * # Arguments
1934
+ * * `service_name` - The service name
1935
+ * * `method_name` - The method name
1936
+ * * `request` - The request message bytes
1937
+ * * `timeout` - Optional timeout duration
1938
+ *
1939
+ * # Returns
1940
+ * A stream reader for pulling response messages
1941
+ *
1942
+ * # Note
1943
+ * This returns a ResponseStreamReader that can be used to pull messages
1944
+ * one at a time from the response stream.
1945
+ */ callUnaryStream(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined): ResponseStreamReader;
1946
+ /**
1947
+ * Make a unary-to-stream RPC call (async version)
1948
+ *
1949
+ * # Arguments
1950
+ * * `service_name` - The service name
1951
+ * * `method_name` - The method name
1952
+ * * `request` - The request message bytes
1953
+ * * `timeout` - Optional timeout duration
1954
+ *
1955
+ * # Returns
1956
+ * A stream reader for pulling response messages
1957
+ *
1958
+ * # Note
1959
+ * This returns a ResponseStreamReader that can be used to pull messages
1960
+ * one at a time from the response stream.
1961
+ */ callUnaryStreamAsync(serviceName: string, methodName: string, request: ArrayBuffer, timeout: number | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
1962
+ signal: AbortSignal;
1963
+ }): Promise<ResponseStreamReader>;
1964
+ /**
1965
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1966
+ */
1967
+ uniffiDestroy(): void;
1968
+ [Symbol.dispose]: () => void;
1969
+ static instanceOf(obj: any): obj is Channel;
1970
+ }
1971
+ export type CompletionHandleInterface = {
1972
+ /**
1973
+ * Wait for the operation to complete indefinitely (blocking version)
1974
+ *
1975
+ * This blocks the calling thread until the operation completes.
1976
+ * Use this from Go or other languages when you need to ensure
1977
+ * an operation has finished before proceeding.
1978
+ *
1979
+ * **Note:** This can only be called once per handle. Subsequent calls
1980
+ * will return an error.
1981
+ *
1982
+ * # Returns
1983
+ * * `Ok(())` - Operation completed successfully
1984
+ * * `Err(SlimError)` - Operation failed or handle already consumed
1985
+ */ wait(): void;
1986
+ /**
1987
+ * Wait for the operation to complete indefinitely (async version)
1988
+ *
1989
+ * This is the async version that integrates with UniFFI's polling mechanism.
1990
+ * The operation will yield control while waiting.
1991
+ *
1992
+ * **Note:** This can only be called once per handle. Subsequent calls
1993
+ * will return an error.
1994
+ *
1995
+ * # Returns
1996
+ * * `Ok(())` - Operation completed successfully
1997
+ * * `Err(SlimError)` - Operation failed or handle already consumed
1998
+ */ waitAsync(asyncOpts_?: {
1999
+ signal: AbortSignal;
2000
+ }): void;
2001
+ /**
2002
+ * Wait for the operation to complete with a timeout (blocking version)
2003
+ *
2004
+ * This blocks the calling thread until the operation completes or the timeout expires.
2005
+ * Use this from Go or other languages when you need to ensure
2006
+ * an operation has finished before proceeding with a time limit.
2007
+ *
2008
+ * **Note:** This can only be called once per handle. Subsequent calls
2009
+ * will return an error.
2010
+ *
2011
+ * # Arguments
2012
+ * * `timeout` - Maximum time to wait for completion
2013
+ *
2014
+ * # Returns
2015
+ * * `Ok(())` - Operation completed successfully
2016
+ * * `Err(SlimError::Timeout)` - If the operation timed out
2017
+ * * `Err(SlimError)` - Operation failed or handle already consumed
2018
+ */ waitFor(timeout: number): void;
2019
+ /**
2020
+ * Wait for the operation to complete with a timeout (async version)
2021
+ *
2022
+ * This is the async version that integrates with UniFFI's polling mechanism.
2023
+ * The operation will yield control while waiting until completion or timeout.
2024
+ *
2025
+ * **Note:** This can only be called once per handle. Subsequent calls
2026
+ * will return an error.
2027
+ *
2028
+ * # Arguments
2029
+ * * `timeout` - Maximum time to wait for completion
2030
+ *
2031
+ * # Returns
2032
+ * * `Ok(())` - Operation completed successfully
2033
+ * * `Err(SlimError::Timeout)` - If the operation timed out
2034
+ * * `Err(SlimError)` - Operation failed or handle already consumed
2035
+ */ waitForAsync(timeout: number, asyncOpts_?: {
2036
+ signal: AbortSignal;
2037
+ }): void;
2038
+ };
2039
+ /**
2040
+ * FFI-compatible completion handle for async operations
2041
+ *
2042
+ * Represents a pending operation that can be awaited to ensure completion.
2043
+ * Used for operations that need delivery confirmation or handshake acknowledgment.
2044
+ *
2045
+ * # Examples
2046
+ *
2047
+ * Basic usage:
2048
+ * ```ignore
2049
+ * let completion = session.publish(data, None, None)?;
2050
+ * completion.wait()?; // Wait for delivery confirmation
2051
+ * ```
2052
+ */
2053
+ export declare class CompletionHandle extends UniffiAbstractObject implements CompletionHandleInterface {
2054
+ readonly [uniffiTypeNameSymbol] = "CompletionHandle";
2055
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2056
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2057
+ /**
2058
+ * Wait for the operation to complete indefinitely (blocking version)
2059
+ *
2060
+ * This blocks the calling thread until the operation completes.
2061
+ * Use this from Go or other languages when you need to ensure
2062
+ * an operation has finished before proceeding.
2063
+ *
2064
+ * **Note:** This can only be called once per handle. Subsequent calls
2065
+ * will return an error.
2066
+ *
2067
+ * # Returns
2068
+ * * `Ok(())` - Operation completed successfully
2069
+ * * `Err(SlimError)` - Operation failed or handle already consumed
2070
+ */ wait(): void;
2071
+ /**
2072
+ * Wait for the operation to complete indefinitely (async version)
2073
+ *
2074
+ * This is the async version that integrates with UniFFI's polling mechanism.
2075
+ * The operation will yield control while waiting.
2076
+ *
2077
+ * **Note:** This can only be called once per handle. Subsequent calls
2078
+ * will return an error.
2079
+ *
2080
+ * # Returns
2081
+ * * `Ok(())` - Operation completed successfully
2082
+ * * `Err(SlimError)` - Operation failed or handle already consumed
2083
+ */ waitAsync(asyncOpts_?: {
2084
+ signal: AbortSignal;
2085
+ }): void;
2086
+ /**
2087
+ * Wait for the operation to complete with a timeout (blocking version)
2088
+ *
2089
+ * This blocks the calling thread until the operation completes or the timeout expires.
2090
+ * Use this from Go or other languages when you need to ensure
2091
+ * an operation has finished before proceeding with a time limit.
2092
+ *
2093
+ * **Note:** This can only be called once per handle. Subsequent calls
2094
+ * will return an error.
2095
+ *
2096
+ * # Arguments
2097
+ * * `timeout` - Maximum time to wait for completion
2098
+ *
2099
+ * # Returns
2100
+ * * `Ok(())` - Operation completed successfully
2101
+ * * `Err(SlimError::Timeout)` - If the operation timed out
2102
+ * * `Err(SlimError)` - Operation failed or handle already consumed
2103
+ */ waitFor(timeout: number): void;
2104
+ /**
2105
+ * Wait for the operation to complete with a timeout (async version)
2106
+ *
2107
+ * This is the async version that integrates with UniFFI's polling mechanism.
2108
+ * The operation will yield control while waiting until completion or timeout.
2109
+ *
2110
+ * **Note:** This can only be called once per handle. Subsequent calls
2111
+ * will return an error.
2112
+ *
2113
+ * # Arguments
2114
+ * * `timeout` - Maximum time to wait for completion
2115
+ *
2116
+ * # Returns
2117
+ * * `Ok(())` - Operation completed successfully
2118
+ * * `Err(SlimError::Timeout)` - If the operation timed out
2119
+ * * `Err(SlimError)` - Operation failed or handle already consumed
2120
+ */ waitForAsync(timeout: number, asyncOpts_?: {
2121
+ signal: AbortSignal;
2122
+ }): void;
2123
+ /**
2124
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2125
+ */
2126
+ uniffiDestroy(): void;
2127
+ [Symbol.dispose]: () => void;
2128
+ static instanceOf(obj: any): obj is CompletionHandle;
2129
+ }
2130
+ export type ContextInterface = {
2131
+ /**
2132
+ * Get the deadline for this RPC call
2133
+ */ deadline(): Date;
2134
+ /**
2135
+ * Check if the deadline has been exceeded
2136
+ */ isDeadlineExceeded(): boolean;
2137
+ /**
2138
+ * Get the rpc session metadata
2139
+ */ metadata(): Map<string, string>;
2140
+ /**
2141
+ * Get the remaining time until deadline
2142
+ *
2143
+ * Returns Duration::ZERO if the deadline has already passed
2144
+ */ remainingTime(): number;
2145
+ /**
2146
+ * Get the session ID
2147
+ */ sessionId(): string;
2148
+ };
2149
+ /**
2150
+ * Context passed to RPC handlers
2151
+ *
2152
+ * Contains all contextual information about an RPC call including:
2153
+ * - Session information (source, destination, session ID)
2154
+ * - Metadata (key-value pairs)
2155
+ * - Deadline/timeout information
2156
+ * - Message routing details
2157
+ */
2158
+ export declare class Context extends UniffiAbstractObject implements ContextInterface {
2159
+ readonly [uniffiTypeNameSymbol] = "Context";
2160
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2161
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2162
+ /**
2163
+ * Get the deadline for this RPC call
2164
+ */ deadline(): Date;
2165
+ /**
2166
+ * Check if the deadline has been exceeded
2167
+ */ isDeadlineExceeded(): boolean;
2168
+ /**
2169
+ * Get the rpc session metadata
2170
+ */ metadata(): Map<string, string>;
2171
+ /**
2172
+ * Get the remaining time until deadline
2173
+ *
2174
+ * Returns Duration::ZERO if the deadline has already passed
2175
+ */ remainingTime(): number;
2176
+ /**
2177
+ * Get the session ID
2178
+ */ sessionId(): string;
2179
+ /**
2180
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2181
+ */
2182
+ uniffiDestroy(): void;
2183
+ [Symbol.dispose]: () => void;
2184
+ static instanceOf(obj: any): obj is Context;
2185
+ }
2186
+ export type NameInterface = {
2187
+ /**
2188
+ * Get the name components as a vector of strings
2189
+ */ components(): Array<string>;
2190
+ /**
2191
+ * Get the name ID
2192
+ */ id(): bigint;
2193
+ };
2194
+ /**
2195
+ * Name type for SLIM (Secure Low-Latency Interactive Messaging)
2196
+ */
2197
+ export declare class Name extends UniffiAbstractObject implements NameInterface {
2198
+ readonly [uniffiTypeNameSymbol] = "Name";
2199
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2200
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2201
+ /**
2202
+ * Create a new Name from components without an ID
2203
+ */
2204
+ constructor(component0: string, component1: string, component2: string);
2205
+ /**
2206
+ * Create a new Name from components with an ID
2207
+ */
2208
+ static newWithId(component0: string, component1: string, component2: string, id: bigint): Name;
2209
+ /**
2210
+ * Get the name components as a vector of strings
2211
+ */ components(): Array<string>;
2212
+ /**
2213
+ * Get the name ID
2214
+ */ id(): bigint;
2215
+ /**
2216
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2217
+ */
2218
+ uniffiDestroy(): void;
2219
+ [Symbol.dispose]: () => void;
2220
+ static instanceOf(obj: any): obj is Name;
2221
+ }
2222
+ export type RequestStreamInterface = {
2223
+ /**
2224
+ * Pull the next message from the stream (blocking version)
2225
+ *
2226
+ * Returns a StreamMessage indicating the result
2227
+ */ next(): StreamMessage;
2228
+ /**
2229
+ * Pull the next message from the stream (async version)
2230
+ *
2231
+ * Returns a StreamMessage indicating the result
2232
+ */ nextAsync(asyncOpts_?: {
2233
+ signal: AbortSignal;
2234
+ }): Promise<StreamMessage>;
2235
+ };
2236
+ /**
2237
+ * Request stream reader
2238
+ *
2239
+ * Allows pulling messages from a client request stream.
2240
+ * This wraps the underlying async stream and provides a blocking interface
2241
+ * suitable for UniFFI callback traits.
2242
+ */
2243
+ export declare class RequestStream extends UniffiAbstractObject implements RequestStreamInterface {
2244
+ readonly [uniffiTypeNameSymbol] = "RequestStream";
2245
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2246
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2247
+ /**
2248
+ * Pull the next message from the stream (blocking version)
2249
+ *
2250
+ * Returns a StreamMessage indicating the result
2251
+ */ next(): StreamMessage;
2252
+ /**
2253
+ * Pull the next message from the stream (async version)
2254
+ *
2255
+ * Returns a StreamMessage indicating the result
2256
+ */ nextAsync(asyncOpts_?: {
2257
+ signal: AbortSignal;
2258
+ }): Promise<StreamMessage>;
2259
+ /**
2260
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2261
+ */
2262
+ uniffiDestroy(): void;
2263
+ [Symbol.dispose]: () => void;
2264
+ static instanceOf(obj: any): obj is RequestStream;
2265
+ }
2266
+ export type RequestStreamWriterInterface = {
2267
+ /**
2268
+ * Finalize the stream and get the response (blocking version)
2269
+ */ finalize(): ArrayBuffer;
2270
+ /**
2271
+ * Finalize the stream and get the response (async version)
2272
+ */ finalizeAsync(asyncOpts_?: {
2273
+ signal: AbortSignal;
2274
+ }): Promise<ArrayBuffer>;
2275
+ /**
2276
+ * Send a request message to the stream (blocking version)
2277
+ */ send(data: ArrayBuffer): void;
2278
+ /**
2279
+ * Send a request message to the stream (async version)
2280
+ */ sendAsync(data: ArrayBuffer, asyncOpts_?: {
2281
+ signal: AbortSignal;
2282
+ }): void;
2283
+ };
2284
+ /**
2285
+ * Request stream writer for stream-to-unary RPC calls
2286
+ *
2287
+ * Allows sending multiple request messages and getting a final response.
2288
+ */
2289
+ export declare class RequestStreamWriter extends UniffiAbstractObject implements RequestStreamWriterInterface {
2290
+ readonly [uniffiTypeNameSymbol] = "RequestStreamWriter";
2291
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2292
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2293
+ /**
2294
+ * Finalize the stream and get the response (blocking version)
2295
+ */ finalize(): ArrayBuffer;
2296
+ /**
2297
+ * Finalize the stream and get the response (async version)
2298
+ */ finalizeAsync(asyncOpts_?: {
2299
+ signal: AbortSignal;
2300
+ }): Promise<ArrayBuffer>;
2301
+ /**
2302
+ * Send a request message to the stream (blocking version)
2303
+ */ send(data: ArrayBuffer): void;
2304
+ /**
2305
+ * Send a request message to the stream (async version)
2306
+ */ sendAsync(data: ArrayBuffer, asyncOpts_?: {
2307
+ signal: AbortSignal;
2308
+ }): void;
2309
+ /**
2310
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2311
+ */
2312
+ uniffiDestroy(): void;
2313
+ [Symbol.dispose]: () => void;
2314
+ static instanceOf(obj: any): obj is RequestStreamWriter;
2315
+ }
2316
+ export type ResponseSinkInterface = {
2317
+ /**
2318
+ * Close the response stream (blocking version)
2319
+ *
2320
+ * Signals that no more messages will be sent.
2321
+ * The stream will end gracefully.
2322
+ */ close(): void;
2323
+ /**
2324
+ * Close the response stream (async version)
2325
+ *
2326
+ * Signals that no more messages will be sent.
2327
+ * The stream will end gracefully.
2328
+ */ closeAsync(asyncOpts_?: {
2329
+ signal: AbortSignal;
2330
+ }): void;
2331
+ /**
2332
+ * Check if the sink has been closed (blocking version)
2333
+ */ isClosed(): boolean;
2334
+ /**
2335
+ * Check if the sink has been closed (async version)
2336
+ */ isClosedAsync(asyncOpts_?: {
2337
+ signal: AbortSignal;
2338
+ }): Promise<boolean>;
2339
+ /**
2340
+ * Send a message to the response stream (blocking version)
2341
+ *
2342
+ * Returns an error if the stream has been closed or if sending fails.
2343
+ */ send(data: ArrayBuffer): void;
2344
+ /**
2345
+ * Send a message to the response stream (async version)
2346
+ *
2347
+ * Returns an error if the stream has been closed or if sending fails.
2348
+ */ sendAsync(data: ArrayBuffer, asyncOpts_?: {
2349
+ signal: AbortSignal;
2350
+ }): void;
2351
+ /**
2352
+ * Send an error to the response stream and close it (blocking version)
2353
+ *
2354
+ * This terminates the stream with an error status.
2355
+ */ sendError(error: RpcError): void;
2356
+ /**
2357
+ * Send an error to the response stream and close it (async version)
2358
+ *
2359
+ * This terminates the stream with an error status.
2360
+ */ sendErrorAsync(error: RpcError, asyncOpts_?: {
2361
+ signal: AbortSignal;
2362
+ }): void;
2363
+ };
2364
+ /**
2365
+ * Response stream writer
2366
+ *
2367
+ * Allows pushing messages to a client response stream.
2368
+ * This wraps an async channel sender and provides a blocking interface
2369
+ * suitable for UniFFI callback traits.
2370
+ */
2371
+ export declare class ResponseSink extends UniffiAbstractObject implements ResponseSinkInterface {
2372
+ readonly [uniffiTypeNameSymbol] = "ResponseSink";
2373
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2374
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2375
+ /**
2376
+ * Close the response stream (blocking version)
2377
+ *
2378
+ * Signals that no more messages will be sent.
2379
+ * The stream will end gracefully.
2380
+ */ close(): void;
2381
+ /**
2382
+ * Close the response stream (async version)
2383
+ *
2384
+ * Signals that no more messages will be sent.
2385
+ * The stream will end gracefully.
2386
+ */ closeAsync(asyncOpts_?: {
2387
+ signal: AbortSignal;
2388
+ }): void;
2389
+ /**
2390
+ * Check if the sink has been closed (blocking version)
2391
+ */ isClosed(): boolean;
2392
+ /**
2393
+ * Check if the sink has been closed (async version)
2394
+ */ isClosedAsync(asyncOpts_?: {
2395
+ signal: AbortSignal;
2396
+ }): Promise<boolean>;
2397
+ /**
2398
+ * Send a message to the response stream (blocking version)
2399
+ *
2400
+ * Returns an error if the stream has been closed or if sending fails.
2401
+ */ send(data: ArrayBuffer): void;
2402
+ /**
2403
+ * Send a message to the response stream (async version)
2404
+ *
2405
+ * Returns an error if the stream has been closed or if sending fails.
2406
+ */ sendAsync(data: ArrayBuffer, asyncOpts_?: {
2407
+ signal: AbortSignal;
2408
+ }): void;
2409
+ /**
2410
+ * Send an error to the response stream and close it (blocking version)
2411
+ *
2412
+ * This terminates the stream with an error status.
2413
+ */ sendError(error: RpcError): void;
2414
+ /**
2415
+ * Send an error to the response stream and close it (async version)
2416
+ *
2417
+ * This terminates the stream with an error status.
2418
+ */ sendErrorAsync(error: RpcError, asyncOpts_?: {
2419
+ signal: AbortSignal;
2420
+ }): void;
2421
+ /**
2422
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2423
+ */
2424
+ uniffiDestroy(): void;
2425
+ [Symbol.dispose]: () => void;
2426
+ static instanceOf(obj: any): obj is ResponseSink;
2427
+ }
2428
+ export type ResponseStreamReaderInterface = {
2429
+ /**
2430
+ * Pull the next message from the response stream (blocking version)
2431
+ *
2432
+ * Returns a StreamMessage indicating the result
2433
+ */ next(): StreamMessage;
2434
+ /**
2435
+ * Pull the next message from the response stream (async version)
2436
+ *
2437
+ * Returns a StreamMessage indicating the result
2438
+ */ nextAsync(asyncOpts_?: {
2439
+ signal: AbortSignal;
2440
+ }): Promise<StreamMessage>;
2441
+ };
2442
+ /**
2443
+ * Response stream reader for unary-to-stream RPC calls
2444
+ *
2445
+ * Allows pulling messages from a server response stream one at a time.
2446
+ */
2447
+ export declare class ResponseStreamReader extends UniffiAbstractObject implements ResponseStreamReaderInterface {
2448
+ readonly [uniffiTypeNameSymbol] = "ResponseStreamReader";
2449
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2450
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2451
+ /**
2452
+ * Pull the next message from the response stream (blocking version)
2453
+ *
2454
+ * Returns a StreamMessage indicating the result
2455
+ */ next(): StreamMessage;
2456
+ /**
2457
+ * Pull the next message from the response stream (async version)
2458
+ *
2459
+ * Returns a StreamMessage indicating the result
2460
+ */ nextAsync(asyncOpts_?: {
2461
+ signal: AbortSignal;
2462
+ }): Promise<StreamMessage>;
2463
+ /**
2464
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2465
+ */
2466
+ uniffiDestroy(): void;
2467
+ [Symbol.dispose]: () => void;
2468
+ static instanceOf(obj: any): obj is ResponseStreamReader;
2469
+ }
2470
+ export type ServerInterface = {
2471
+ /**
2472
+ * Register a stream-to-stream RPC handler
2473
+ *
2474
+ * # Arguments
2475
+ * * `service_name` - The service name
2476
+ * * `method_name` - The method name
2477
+ * * `handler` - Implementation of the StreamStreamHandler trait
2478
+ */ registerStreamStream(serviceName: string, methodName: string, handler: StreamStreamHandler): void;
2479
+ /**
2480
+ * Register a stream-to-unary RPC handler
2481
+ *
2482
+ * # Arguments
2483
+ * * `service_name` - The service name
2484
+ * * `method_name` - The method name
2485
+ * * `handler` - Implementation of the StreamUnaryHandler trait
2486
+ */ registerStreamUnary(serviceName: string, methodName: string, handler: StreamUnaryHandler): void;
2487
+ /**
2488
+ * Register a unary-to-stream RPC handler
2489
+ *
2490
+ * # Arguments
2491
+ * * `service_name` - The service name
2492
+ * * `method_name` - The method name
2493
+ * * `handler` - Implementation of the UnaryStreamHandler trait
2494
+ */ registerUnaryStream(serviceName: string, methodName: string, handler: UnaryStreamHandler): void;
2495
+ /**
2496
+ * Register a unary-to-unary RPC handler
2497
+ *
2498
+ * # Arguments
2499
+ * * `service_name` - The service name (e.g., "MyService")
2500
+ * * `method_name` - The method name (e.g., "GetUser")
2501
+ * * `handler` - Implementation of the UnaryUnaryHandler trait
2502
+ */ registerUnaryUnary(serviceName: string, methodName: string, handler: UnaryUnaryHandler): void;
2503
+ /**
2504
+ * Start serving RPC requests (blocking version)
2505
+ *
2506
+ * This is a blocking method that runs until the server is shut down.
2507
+ * It listens for incoming RPC calls and dispatches them to registered handlers.
2508
+ */ serve(): void;
2509
+ /**
2510
+ * Start serving RPC requests (async version)
2511
+ *
2512
+ * This is an async method that runs until the server is shut down.
2513
+ * It listens for incoming RPC calls and dispatches them to registered handlers.
2514
+ */ serveAsync(asyncOpts_?: {
2515
+ signal: AbortSignal;
2516
+ }): void;
2517
+ /**
2518
+ * Shutdown the server gracefully (blocking version)
2519
+ *
2520
+ * This signals the server to stop accepting new requests and wait for
2521
+ * in-flight requests to complete.
2522
+ */ shutdown(): void;
2523
+ /**
2524
+ * Shutdown the server gracefully (async version)
2525
+ *
2526
+ * This signals the server to stop accepting new requests and wait for
2527
+ * in-flight requests to complete.
2528
+ */ shutdownAsync(asyncOpts_?: {
2529
+ signal: AbortSignal;
2530
+ }): void;
2531
+ };
2532
+ /**
2533
+ * RPC Server
2534
+ *
2535
+ * Handles incoming RPC requests by creating sessions and dispatching
2536
+ * to registered service handlers.
2537
+ *
2538
+ * # Example
2539
+ *
2540
+ * ```no_run
2541
+ * # use slim_bindings::{Server, Context, Status, Decoder, Encoder, App, Name};
2542
+ * # use std::sync::Arc;
2543
+ * # fn main() -> Result<(), Box<dyn std::error::Error>> {
2544
+ * # use slim_bindings::{IdentityProviderConfig, IdentityVerifierConfig};
2545
+ * # let app_name = Arc::new(Name::new("test".to_string(), "app".to_string(), "v1".to_string()));
2546
+ * # let provider = IdentityProviderConfig::SharedSecret { id: "test".to_string(), data: "secret".to_string() };
2547
+ * # let verifier = IdentityVerifierConfig::SharedSecret { id: "test".to_string(), data: "secret".to_string() };
2548
+ * # let app = App::new(app_name, provider, verifier)?;
2549
+ * # let core_app = app.inner();
2550
+ * # let notification_rx = app.notification_receiver();
2551
+ * # #[derive(Default)]
2552
+ * # struct Request {}
2553
+ * # impl Decoder for Request {
2554
+ * # fn decode(_buf: impl Into<Vec<u8>>) -> Result<Self, Status> { Ok(Request::default()) }
2555
+ * # }
2556
+ * # #[derive(Default)]
2557
+ * # struct Response {}
2558
+ * # impl Encoder for Response {
2559
+ * # fn encode(self) -> Result<Vec<u8>, Status> { Ok(vec![]) }
2560
+ * # }
2561
+ * let base_name = Name::new("org".to_string(), "namespace".to_string(), "service".to_string());
2562
+ * let server = Server::new_with_shared_rx_and_connection(core_app, base_name.as_slim_name(), None, notification_rx, None);
2563
+ *
2564
+ * // Register handlers
2565
+ * server.register_unary_unary_internal(
2566
+ * "MyService",
2567
+ * "MyMethod",
2568
+ * |request: Request, _ctx: Context| async move {
2569
+ * Ok(Response::default())
2570
+ * }
2571
+ * );
2572
+ * # Ok(())
2573
+ * # }
2574
+ * ```
2575
+ */
2576
+ export declare class Server extends UniffiAbstractObject implements ServerInterface {
2577
+ readonly [uniffiTypeNameSymbol] = "Server";
2578
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2579
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2580
+ /**
2581
+ * Create a new RPC server
2582
+ *
2583
+ * This is the primary constructor for creating an RPC server instance
2584
+ * that can handle incoming RPC requests over SLIM.
2585
+ *
2586
+ * # Arguments
2587
+ * * `app` - The SLIM application instance that provides the underlying
2588
+ * network transport and session management
2589
+ * * `base_name` - The base name for this service (e.g., org.namespace.service).
2590
+ * This name is used to construct subscription names for RPC methods.
2591
+ *
2592
+ * # Returns
2593
+ * A new RPC server instance wrapped in an Arc for shared ownership
2594
+ */
2595
+ constructor(app: App, baseName: Name);
2596
+ /**
2597
+ * Create a new RPC server with optional connection ID
2598
+ *
2599
+ * The connection ID is used to set up routing before serving RPC requests,
2600
+ * enabling multi-hop RPC calls through specific connections.
2601
+ *
2602
+ * # Arguments
2603
+ * * `app` - The SLIM application instance that provides the underlying
2604
+ * network transport and session management
2605
+ * * `base_name` - The base name for this service (e.g., org.namespace.service).
2606
+ * This name is used to construct subscription names for RPC methods.
2607
+ * * `connection_id` - Optional connection ID for routing setup
2608
+ *
2609
+ * # Returns
2610
+ * A new RPC server instance wrapped in an Arc for shared ownership
2611
+ */
2612
+ static newWithConnection(app: App, baseName: Name, connectionId: /*u64*/ bigint | undefined): Server;
2613
+ /**
2614
+ * Register a stream-to-stream RPC handler
2615
+ *
2616
+ * # Arguments
2617
+ * * `service_name` - The service name
2618
+ * * `method_name` - The method name
2619
+ * * `handler` - Implementation of the StreamStreamHandler trait
2620
+ */ registerStreamStream(serviceName: string, methodName: string, handler: StreamStreamHandler): void;
2621
+ /**
2622
+ * Register a stream-to-unary RPC handler
2623
+ *
2624
+ * # Arguments
2625
+ * * `service_name` - The service name
2626
+ * * `method_name` - The method name
2627
+ * * `handler` - Implementation of the StreamUnaryHandler trait
2628
+ */ registerStreamUnary(serviceName: string, methodName: string, handler: StreamUnaryHandler): void;
2629
+ /**
2630
+ * Register a unary-to-stream RPC handler
2631
+ *
2632
+ * # Arguments
2633
+ * * `service_name` - The service name
2634
+ * * `method_name` - The method name
2635
+ * * `handler` - Implementation of the UnaryStreamHandler trait
2636
+ */ registerUnaryStream(serviceName: string, methodName: string, handler: UnaryStreamHandler): void;
2637
+ /**
2638
+ * Register a unary-to-unary RPC handler
2639
+ *
2640
+ * # Arguments
2641
+ * * `service_name` - The service name (e.g., "MyService")
2642
+ * * `method_name` - The method name (e.g., "GetUser")
2643
+ * * `handler` - Implementation of the UnaryUnaryHandler trait
2644
+ */ registerUnaryUnary(serviceName: string, methodName: string, handler: UnaryUnaryHandler): void;
2645
+ /**
2646
+ * Start serving RPC requests (blocking version)
2647
+ *
2648
+ * This is a blocking method that runs until the server is shut down.
2649
+ * It listens for incoming RPC calls and dispatches them to registered handlers.
2650
+ */ serve(): void;
2651
+ /**
2652
+ * Start serving RPC requests (async version)
2653
+ *
2654
+ * This is an async method that runs until the server is shut down.
2655
+ * It listens for incoming RPC calls and dispatches them to registered handlers.
2656
+ */ serveAsync(asyncOpts_?: {
2657
+ signal: AbortSignal;
2658
+ }): void;
2659
+ /**
2660
+ * Shutdown the server gracefully (blocking version)
2661
+ *
2662
+ * This signals the server to stop accepting new requests and wait for
2663
+ * in-flight requests to complete.
2664
+ */ shutdown(): void;
2665
+ /**
2666
+ * Shutdown the server gracefully (async version)
2667
+ *
2668
+ * This signals the server to stop accepting new requests and wait for
2669
+ * in-flight requests to complete.
2670
+ */ shutdownAsync(asyncOpts_?: {
2671
+ signal: AbortSignal;
2672
+ }): void;
2673
+ /**
2674
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2675
+ */
2676
+ uniffiDestroy(): void;
2677
+ [Symbol.dispose]: () => void;
2678
+ static instanceOf(obj: any): obj is Server;
2679
+ }
2680
+ export type ServiceInterface = {
2681
+ /**
2682
+ * Get the service configuration
2683
+ */ config(): ServiceConfig;
2684
+ /**
2685
+ * Connect to a remote endpoint as a client - blocking version
2686
+ */ connect(config: ClientConfig): bigint;
2687
+ /**
2688
+ * Connect to a remote endpoint as a client
2689
+ */ connectAsync(config: ClientConfig, asyncOpts_?: {
2690
+ signal: AbortSignal;
2691
+ }): Promise</*u64*/ bigint>;
2692
+ /**
2693
+ * Create a new App with authentication configuration (blocking version)
2694
+ *
2695
+ * This method initializes authentication providers/verifiers and creates a App
2696
+ * on this service instance. This is a blocking wrapper around create_app_async.
2697
+ *
2698
+ * # Arguments
2699
+ * * `base_name` - The base name for the app (without ID)
2700
+ * * `identity_provider_config` - Configuration for proving identity to others
2701
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2702
+ *
2703
+ * # Returns
2704
+ * * `Ok(Arc<App>)` - Successfully created adapter
2705
+ * * `Err(SlimError)` - If adapter creation fails
2706
+ */ createApp(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig): App;
2707
+ /**
2708
+ * Create a new App with authentication configuration (async version)
2709
+ *
2710
+ * This method initializes authentication providers/verifiers and creates a App
2711
+ * on this service instance.
2712
+ *
2713
+ * # Arguments
2714
+ * * `base_name` - The base name for the app (without ID)
2715
+ * * `identity_provider_config` - Configuration for proving identity to others
2716
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2717
+ *
2718
+ * # Returns
2719
+ * * `Ok(Arc<App>)` - Successfully created adapter
2720
+ * * `Err(SlimError)` - If adapter creation fails
2721
+ */ createAppAsync(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, asyncOpts_?: {
2722
+ signal: AbortSignal;
2723
+ }): Promise<App>;
2724
+ /**
2725
+ * Create a new App with authentication configuration and traffic direction (blocking version)
2726
+ *
2727
+ * This method initializes authentication providers/verifiers and creates an App
2728
+ * on this service instance. The direction parameter controls whether the app
2729
+ * can send messages, receive messages, both, or neither.
2730
+ *
2731
+ * # Arguments
2732
+ * * `base_name` - The base name for the app (without ID)
2733
+ * * `identity_provider_config` - Configuration for proving identity to others
2734
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2735
+ * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
2736
+ *
2737
+ * # Returns
2738
+ * * `Ok(Arc<App>)` - Successfully created adapter
2739
+ * * `Err(SlimError)` - If adapter creation fails
2740
+ */ createAppWithDirection(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): App;
2741
+ /**
2742
+ * Create a new App with authentication configuration and traffic direction (async version)
2743
+ *
2744
+ * This method initializes authentication providers/verifiers and creates an App
2745
+ * on this service instance. The direction parameter controls whether the app
2746
+ * can send messages, receive messages, both, or neither.
2747
+ *
2748
+ * # Arguments
2749
+ * * `base_name` - The base name for the app (without ID)
2750
+ * * `identity_provider_config` - Configuration for proving identity to others
2751
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2752
+ * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
2753
+ *
2754
+ * # Returns
2755
+ * * `Ok(Arc<App>)` - Successfully created adapter
2756
+ * * `Err(SlimError)` - If adapter creation fails
2757
+ */ createAppWithDirectionAsync(name: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, asyncOpts_?: {
2758
+ signal: AbortSignal;
2759
+ }): Promise<App>;
2760
+ /**
2761
+ * Create a new App with SharedSecret authentication (helper function)
2762
+ *
2763
+ * This is a convenience function for creating a SLIM application using SharedSecret authentication
2764
+ * on this service instance.
2765
+ *
2766
+ * # Arguments
2767
+ * * `name` - The base name for the app (without ID)
2768
+ * * `secret` - The shared secret string for authentication
2769
+ *
2770
+ * # Returns
2771
+ * * `Ok(Arc<App>)` - Successfully created app
2772
+ * * `Err(SlimError)` - If app creation fails
2773
+ */ createAppWithSecret(name: Name, secret: string): App;
2774
+ /**
2775
+ * Create a new App with SharedSecret authentication (async version)
2776
+ *
2777
+ * This is a convenience function for creating a SLIM application using SharedSecret authentication
2778
+ * on this service instance. This is the async version.
2779
+ *
2780
+ * # Arguments
2781
+ * * `name` - The base name for the app (without ID)
2782
+ * * `secret` - The shared secret string for authentication
2783
+ *
2784
+ * # Returns
2785
+ * * `Ok(Arc<App>)` - Successfully created app
2786
+ * * `Err(SlimError)` - If app creation fails
2787
+ */ createAppWithSecretAsync(name: Name, secret: string, asyncOpts_?: {
2788
+ signal: AbortSignal;
2789
+ }): Promise<App>;
2790
+ /**
2791
+ * Disconnect a client connection by connection ID - blocking version
2792
+ */ disconnect(connId: bigint): void;
2793
+ /**
2794
+ * Get the connection ID for a given endpoint
2795
+ */ getConnectionId(endpoint: string): /*u64*/ bigint | undefined;
2796
+ /**
2797
+ * Get the service identifier/name
2798
+ */ getName(): string;
2799
+ /**
2800
+ * Run the service (starts all configured servers and clients) - blocking version
2801
+ */ run(): void;
2802
+ /**
2803
+ * Run the service (starts all configured servers and clients)
2804
+ */ runAsync(asyncOpts_?: {
2805
+ signal: AbortSignal;
2806
+ }): void;
2807
+ /**
2808
+ * Start a server with the given configuration - blocking version
2809
+ */ runServer(config: ServerConfig): void;
2810
+ /**
2811
+ * Start a server with the given configuration
2812
+ */ runServerAsync(config: ServerConfig, asyncOpts_?: {
2813
+ signal: AbortSignal;
2814
+ }): void;
2815
+ /**
2816
+ * Shutdown the service gracefully - blocking version
2817
+ */ shutdown(): void;
2818
+ /**
2819
+ * Shutdown the service gracefully
2820
+ */ shutdownAsync(asyncOpts_?: {
2821
+ signal: AbortSignal;
2822
+ }): void;
2823
+ /**
2824
+ * Stop a server by endpoint - blocking version
2825
+ */ stopServer(endpoint: string): void;
2826
+ };
2827
+ /**
2828
+ * Service wrapper for uniffi bindings
2829
+ */
2830
+ export declare class Service extends UniffiAbstractObject implements ServiceInterface {
2831
+ readonly [uniffiTypeNameSymbol] = "Service";
2832
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
2833
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
2834
+ /**
2835
+ * Create a new Service with the given name
2836
+ */
2837
+ constructor(name: string);
2838
+ /**
2839
+ * Create a new Service with configuration
2840
+ */
2841
+ static newWithConfig(name: string, config: ServiceConfig): Service;
2842
+ /**
2843
+ * Get the service configuration
2844
+ */ config(): ServiceConfig;
2845
+ /**
2846
+ * Connect to a remote endpoint as a client - blocking version
2847
+ */ connect(config: ClientConfig): bigint;
2848
+ /**
2849
+ * Connect to a remote endpoint as a client
2850
+ */ connectAsync(config: ClientConfig, asyncOpts_?: {
2851
+ signal: AbortSignal;
2852
+ }): Promise</*u64*/ bigint>;
2853
+ /**
2854
+ * Create a new App with authentication configuration (blocking version)
2855
+ *
2856
+ * This method initializes authentication providers/verifiers and creates a App
2857
+ * on this service instance. This is a blocking wrapper around create_app_async.
2858
+ *
2859
+ * # Arguments
2860
+ * * `base_name` - The base name for the app (without ID)
2861
+ * * `identity_provider_config` - Configuration for proving identity to others
2862
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2863
+ *
2864
+ * # Returns
2865
+ * * `Ok(Arc<App>)` - Successfully created adapter
2866
+ * * `Err(SlimError)` - If adapter creation fails
2867
+ */ createApp(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig): App;
2868
+ /**
2869
+ * Create a new App with authentication configuration (async version)
2870
+ *
2871
+ * This method initializes authentication providers/verifiers and creates a App
2872
+ * on this service instance.
2873
+ *
2874
+ * # Arguments
2875
+ * * `base_name` - The base name for the app (without ID)
2876
+ * * `identity_provider_config` - Configuration for proving identity to others
2877
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2878
+ *
2879
+ * # Returns
2880
+ * * `Ok(Arc<App>)` - Successfully created adapter
2881
+ * * `Err(SlimError)` - If adapter creation fails
2882
+ */ createAppAsync(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, asyncOpts_?: {
2883
+ signal: AbortSignal;
2884
+ }): Promise<App>;
2885
+ /**
2886
+ * Create a new App with authentication configuration and traffic direction (blocking version)
2887
+ *
2888
+ * This method initializes authentication providers/verifiers and creates an App
2889
+ * on this service instance. The direction parameter controls whether the app
2890
+ * can send messages, receive messages, both, or neither.
2891
+ *
2892
+ * # Arguments
2893
+ * * `base_name` - The base name for the app (without ID)
2894
+ * * `identity_provider_config` - Configuration for proving identity to others
2895
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2896
+ * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
2897
+ *
2898
+ * # Returns
2899
+ * * `Ok(Arc<App>)` - Successfully created adapter
2900
+ * * `Err(SlimError)` - If adapter creation fails
2901
+ */ createAppWithDirection(baseName: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): App;
2902
+ /**
2903
+ * Create a new App with authentication configuration and traffic direction (async version)
2904
+ *
2905
+ * This method initializes authentication providers/verifiers and creates an App
2906
+ * on this service instance. The direction parameter controls whether the app
2907
+ * can send messages, receive messages, both, or neither.
2908
+ *
2909
+ * # Arguments
2910
+ * * `base_name` - The base name for the app (without ID)
2911
+ * * `identity_provider_config` - Configuration for proving identity to others
2912
+ * * `identity_verifier_config` - Configuration for verifying identity of others
2913
+ * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None
2914
+ *
2915
+ * # Returns
2916
+ * * `Ok(Arc<App>)` - Successfully created adapter
2917
+ * * `Err(SlimError)` - If adapter creation fails
2918
+ */ createAppWithDirectionAsync(name: Name, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, asyncOpts_?: {
2919
+ signal: AbortSignal;
2920
+ }): Promise<App>;
2921
+ /**
2922
+ * Create a new App with SharedSecret authentication (helper function)
2923
+ *
2924
+ * This is a convenience function for creating a SLIM application using SharedSecret authentication
2925
+ * on this service instance.
2926
+ *
2927
+ * # Arguments
2928
+ * * `name` - The base name for the app (without ID)
2929
+ * * `secret` - The shared secret string for authentication
2930
+ *
2931
+ * # Returns
2932
+ * * `Ok(Arc<App>)` - Successfully created app
2933
+ * * `Err(SlimError)` - If app creation fails
2934
+ */ createAppWithSecret(name: Name, secret: string): App;
2935
+ /**
2936
+ * Create a new App with SharedSecret authentication (async version)
2937
+ *
2938
+ * This is a convenience function for creating a SLIM application using SharedSecret authentication
2939
+ * on this service instance. This is the async version.
2940
+ *
2941
+ * # Arguments
2942
+ * * `name` - The base name for the app (without ID)
2943
+ * * `secret` - The shared secret string for authentication
2944
+ *
2945
+ * # Returns
2946
+ * * `Ok(Arc<App>)` - Successfully created app
2947
+ * * `Err(SlimError)` - If app creation fails
2948
+ */ createAppWithSecretAsync(name: Name, secret: string, asyncOpts_?: {
2949
+ signal: AbortSignal;
2950
+ }): Promise<App>;
2951
+ /**
2952
+ * Disconnect a client connection by connection ID - blocking version
2953
+ */ disconnect(connId: bigint): void;
2954
+ /**
2955
+ * Get the connection ID for a given endpoint
2956
+ */ getConnectionId(endpoint: string): /*u64*/ bigint | undefined;
2957
+ /**
2958
+ * Get the service identifier/name
2959
+ */ getName(): string;
2960
+ /**
2961
+ * Run the service (starts all configured servers and clients) - blocking version
2962
+ */ run(): void;
2963
+ /**
2964
+ * Run the service (starts all configured servers and clients)
2965
+ */ runAsync(asyncOpts_?: {
2966
+ signal: AbortSignal;
2967
+ }): void;
2968
+ /**
2969
+ * Start a server with the given configuration - blocking version
2970
+ */ runServer(config: ServerConfig): void;
2971
+ /**
2972
+ * Start a server with the given configuration
2973
+ */ runServerAsync(config: ServerConfig, asyncOpts_?: {
2974
+ signal: AbortSignal;
2975
+ }): void;
2976
+ /**
2977
+ * Shutdown the service gracefully - blocking version
2978
+ */ shutdown(): void;
2979
+ /**
2980
+ * Shutdown the service gracefully
2981
+ */ shutdownAsync(asyncOpts_?: {
2982
+ signal: AbortSignal;
2983
+ }): void;
2984
+ /**
2985
+ * Stop a server by endpoint - blocking version
2986
+ */ stopServer(endpoint: string): void;
2987
+ /**
2988
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
2989
+ */
2990
+ uniffiDestroy(): void;
2991
+ [Symbol.dispose]: () => void;
2992
+ static instanceOf(obj: any): obj is Service;
2993
+ }
2994
+ export type SessionInterface = {
2995
+ /**
2996
+ * Get the session configuration
2997
+ */ config(): SessionConfig;
2998
+ /**
2999
+ * Get the destination name for this session
3000
+ */ destination(): Name;
3001
+ /**
3002
+ * Receive a message from the session (blocking version for FFI)
3003
+ *
3004
+ * # Arguments
3005
+ * * `timeout` - Optional timeout duration
3006
+ *
3007
+ * # Returns
3008
+ * * `Ok(ReceivedMessage)` - Message with context and payload bytes
3009
+ * * `Err(SlimError)` - If the receive fails or times out
3010
+ */ getMessage(timeout: number | undefined): ReceivedMessage;
3011
+ /**
3012
+ * Receive a message from the session (async version)
3013
+ */ getMessageAsync(timeout: number | undefined, asyncOpts_?: {
3014
+ signal: AbortSignal;
3015
+ }): Promise<ReceivedMessage>;
3016
+ /**
3017
+ * Invite a participant to the session (blocking version)
3018
+ *
3019
+ * Returns a completion handle that can be awaited to ensure the invitation completes.
3020
+ */ invite(participant: Name): CompletionHandle;
3021
+ /**
3022
+ * Invite a participant and wait for completion (blocking version)
3023
+ *
3024
+ * This method invites a participant and blocks until the invitation completes.
3025
+ */ inviteAndWait(participant: Name): void;
3026
+ /**
3027
+ * Invite a participant and wait for completion (async version)
3028
+ *
3029
+ * This method invites a participant and waits until the invitation completes.
3030
+ */ inviteAndWaitAsync(participant: Name, asyncOpts_?: {
3031
+ signal: AbortSignal;
3032
+ }): void;
3033
+ /**
3034
+ * Invite a participant to the session (async version)
3035
+ *
3036
+ * Returns a completion handle that can be awaited to ensure the invitation completes.
3037
+ */ inviteAsync(participant: Name, asyncOpts_?: {
3038
+ signal: AbortSignal;
3039
+ }): Promise<CompletionHandle>;
3040
+ /**
3041
+ * Check if this session is the initiator
3042
+ */ isInitiator(): boolean;
3043
+ /**
3044
+ * Get the session metadata
3045
+ */ metadata(): Map<string, string>;
3046
+ /**
3047
+ * Get list of participants in the session (blocking version for FFI)
3048
+ */ participantsList(): Array<Name>;
3049
+ /**
3050
+ * Get list of participants in the session
3051
+ */ participantsListAsync(asyncOpts_?: {
3052
+ signal: AbortSignal;
3053
+ }): Promise<Array<Name>>;
3054
+ /**
3055
+ * Publish a message to the session's destination (blocking version)
3056
+ *
3057
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3058
+ *
3059
+ * # Arguments
3060
+ * * `data` - The message payload bytes
3061
+ * * `payload_type` - Optional content type identifier
3062
+ * * `metadata` - Optional key-value metadata pairs
3063
+ *
3064
+ * # Returns
3065
+ * * `Ok(CompletionHandle)` - Handle to await delivery confirmation
3066
+ * * `Err(SlimError)` - If publishing fails
3067
+ *
3068
+ * # Example
3069
+ * ```ignore
3070
+ * let completion = session.publish(data, None, None)?;
3071
+ * completion.wait()?; // Blocks until message is delivered
3072
+ * ```
3073
+ */ publish(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
3074
+ /**
3075
+ * Publish a message and wait for completion (blocking version)
3076
+ *
3077
+ * This method publishes a message and blocks until the delivery completes.
3078
+ */ publishAndWait(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
3079
+ /**
3080
+ * Publish a message and wait for completion (async version)
3081
+ *
3082
+ * This method publishes a message and waits until the delivery completes.
3083
+ */ publishAndWaitAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3084
+ signal: AbortSignal;
3085
+ }): void;
3086
+ /**
3087
+ * Publish a message to the session's destination (async version)
3088
+ *
3089
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3090
+ */ publishAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3091
+ signal: AbortSignal;
3092
+ }): Promise<CompletionHandle>;
3093
+ /**
3094
+ * Publish a reply message to the originator of a received message (blocking version for FFI)
3095
+ *
3096
+ * This method uses the routing information from a previously received message
3097
+ * to send a reply back to the sender. This is the preferred way to implement
3098
+ * request/reply patterns.
3099
+ *
3100
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3101
+ *
3102
+ * # Arguments
3103
+ * * `message_context` - Context from a message received via `get_message()`
3104
+ * * `data` - The reply payload bytes
3105
+ * * `payload_type` - Optional content type identifier
3106
+ * * `metadata` - Optional key-value metadata pairs
3107
+ *
3108
+ * # Returns
3109
+ * * `Ok(CompletionHandle)` - Handle to await delivery confirmation
3110
+ * * `Err(SlimError)` - If publishing fails
3111
+ */ publishTo(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
3112
+ /**
3113
+ * Publish a reply message and wait for completion (blocking version)
3114
+ *
3115
+ * This method publishes a reply to a received message and blocks until the delivery completes.
3116
+ */ publishToAndWait(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
3117
+ /**
3118
+ * Publish a reply message and wait for completion (async version)
3119
+ *
3120
+ * This method publishes a reply to a received message and waits until the delivery completes.
3121
+ */ publishToAndWaitAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3122
+ signal: AbortSignal;
3123
+ }): void;
3124
+ /**
3125
+ * Publish a reply message (async version)
3126
+ *
3127
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3128
+ */ publishToAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3129
+ signal: AbortSignal;
3130
+ }): Promise<CompletionHandle>;
3131
+ /**
3132
+ * Low-level publish with full control over all parameters (blocking version for FFI)
3133
+ *
3134
+ * This is an advanced method that provides complete control over routing and delivery.
3135
+ * Most users should use `publish()` or `publish_to()` instead.
3136
+ *
3137
+ * # Arguments
3138
+ * * `destination` - Target name to send to
3139
+ * * `fanout` - Number of copies to send (for multicast)
3140
+ * * `data` - The message payload bytes
3141
+ * * `connection_out` - Optional specific connection ID to use
3142
+ * * `payload_type` - Optional content type identifier
3143
+ * * `metadata` - Optional key-value metadata pairs
3144
+ */ publishWithParams(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
3145
+ /**
3146
+ * Low-level publish with full control (async version)
3147
+ */ publishWithParamsAsync(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3148
+ signal: AbortSignal;
3149
+ }): void;
3150
+ /**
3151
+ * Remove a participant from the session (blocking version)
3152
+ *
3153
+ * Returns a completion handle that can be awaited to ensure the removal completes.
3154
+ */ remove(participant: Name): CompletionHandle;
3155
+ /**
3156
+ * Remove a participant and wait for completion (blocking version)
3157
+ *
3158
+ * This method removes a participant and blocks until the removal completes.
3159
+ */ removeAndWait(participant: Name): void;
3160
+ /**
3161
+ * Remove a participant and wait for completion (async version)
3162
+ *
3163
+ * This method removes a participant and waits until the removal completes.
3164
+ */ removeAndWaitAsync(participant: Name, asyncOpts_?: {
3165
+ signal: AbortSignal;
3166
+ }): void;
3167
+ /**
3168
+ * Remove a participant from the session (async version)
3169
+ *
3170
+ * Returns a completion handle that can be awaited to ensure the removal completes.
3171
+ */ removeAsync(participant: Name, asyncOpts_?: {
3172
+ signal: AbortSignal;
3173
+ }): Promise<CompletionHandle>;
3174
+ /**
3175
+ * Get the session ID
3176
+ */ sessionId(): number;
3177
+ /**
3178
+ * Get the session type (PointToPoint or Group)
3179
+ */ sessionType(): SessionType;
3180
+ /**
3181
+ * Get the source name for this session
3182
+ */ source(): Name;
3183
+ };
3184
+ /**
3185
+ * Session context for language bindings (UniFFI-compatible)
3186
+ *
3187
+ * Wraps the session context with proper async access patterns for message reception.
3188
+ * Provides both synchronous (blocking) and asynchronous methods for FFI compatibility.
3189
+ */
3190
+ export declare class Session extends UniffiAbstractObject implements SessionInterface {
3191
+ readonly [uniffiTypeNameSymbol] = "Session";
3192
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
3193
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
3194
+ /**
3195
+ * Get the session configuration
3196
+ */ config(): SessionConfig;
3197
+ /**
3198
+ * Get the destination name for this session
3199
+ */ destination(): Name;
3200
+ /**
3201
+ * Receive a message from the session (blocking version for FFI)
3202
+ *
3203
+ * # Arguments
3204
+ * * `timeout` - Optional timeout duration
3205
+ *
3206
+ * # Returns
3207
+ * * `Ok(ReceivedMessage)` - Message with context and payload bytes
3208
+ * * `Err(SlimError)` - If the receive fails or times out
3209
+ */ getMessage(timeout: number | undefined): ReceivedMessage;
3210
+ /**
3211
+ * Receive a message from the session (async version)
3212
+ */ getMessageAsync(timeout: number | undefined, asyncOpts_?: {
3213
+ signal: AbortSignal;
3214
+ }): Promise<ReceivedMessage>;
3215
+ /**
3216
+ * Invite a participant to the session (blocking version)
3217
+ *
3218
+ * Returns a completion handle that can be awaited to ensure the invitation completes.
3219
+ */ invite(participant: Name): CompletionHandle;
3220
+ /**
3221
+ * Invite a participant and wait for completion (blocking version)
3222
+ *
3223
+ * This method invites a participant and blocks until the invitation completes.
3224
+ */ inviteAndWait(participant: Name): void;
3225
+ /**
3226
+ * Invite a participant and wait for completion (async version)
3227
+ *
3228
+ * This method invites a participant and waits until the invitation completes.
3229
+ */ inviteAndWaitAsync(participant: Name, asyncOpts_?: {
3230
+ signal: AbortSignal;
3231
+ }): void;
3232
+ /**
3233
+ * Invite a participant to the session (async version)
3234
+ *
3235
+ * Returns a completion handle that can be awaited to ensure the invitation completes.
3236
+ */ inviteAsync(participant: Name, asyncOpts_?: {
3237
+ signal: AbortSignal;
3238
+ }): Promise<CompletionHandle>;
3239
+ /**
3240
+ * Check if this session is the initiator
3241
+ */ isInitiator(): boolean;
3242
+ /**
3243
+ * Get the session metadata
3244
+ */ metadata(): Map<string, string>;
3245
+ /**
3246
+ * Get list of participants in the session (blocking version for FFI)
3247
+ */ participantsList(): Array<Name>;
3248
+ /**
3249
+ * Get list of participants in the session
3250
+ */ participantsListAsync(asyncOpts_?: {
3251
+ signal: AbortSignal;
3252
+ }): Promise<Array<Name>>;
3253
+ /**
3254
+ * Publish a message to the session's destination (blocking version)
3255
+ *
3256
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3257
+ *
3258
+ * # Arguments
3259
+ * * `data` - The message payload bytes
3260
+ * * `payload_type` - Optional content type identifier
3261
+ * * `metadata` - Optional key-value metadata pairs
3262
+ *
3263
+ * # Returns
3264
+ * * `Ok(CompletionHandle)` - Handle to await delivery confirmation
3265
+ * * `Err(SlimError)` - If publishing fails
3266
+ *
3267
+ * # Example
3268
+ * ```ignore
3269
+ * let completion = session.publish(data, None, None)?;
3270
+ * completion.wait()?; // Blocks until message is delivered
3271
+ * ```
3272
+ */ publish(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
3273
+ /**
3274
+ * Publish a message and wait for completion (blocking version)
3275
+ *
3276
+ * This method publishes a message and blocks until the delivery completes.
3277
+ */ publishAndWait(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
3278
+ /**
3279
+ * Publish a message and wait for completion (async version)
3280
+ *
3281
+ * This method publishes a message and waits until the delivery completes.
3282
+ */ publishAndWaitAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3283
+ signal: AbortSignal;
3284
+ }): void;
3285
+ /**
3286
+ * Publish a message to the session's destination (async version)
3287
+ *
3288
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3289
+ */ publishAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3290
+ signal: AbortSignal;
3291
+ }): Promise<CompletionHandle>;
3292
+ /**
3293
+ * Publish a reply message to the originator of a received message (blocking version for FFI)
3294
+ *
3295
+ * This method uses the routing information from a previously received message
3296
+ * to send a reply back to the sender. This is the preferred way to implement
3297
+ * request/reply patterns.
3298
+ *
3299
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3300
+ *
3301
+ * # Arguments
3302
+ * * `message_context` - Context from a message received via `get_message()`
3303
+ * * `data` - The reply payload bytes
3304
+ * * `payload_type` - Optional content type identifier
3305
+ * * `metadata` - Optional key-value metadata pairs
3306
+ *
3307
+ * # Returns
3308
+ * * `Ok(CompletionHandle)` - Handle to await delivery confirmation
3309
+ * * `Err(SlimError)` - If publishing fails
3310
+ */ publishTo(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): CompletionHandle;
3311
+ /**
3312
+ * Publish a reply message and wait for completion (blocking version)
3313
+ *
3314
+ * This method publishes a reply to a received message and blocks until the delivery completes.
3315
+ */ publishToAndWait(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
3316
+ /**
3317
+ * Publish a reply message and wait for completion (async version)
3318
+ *
3319
+ * This method publishes a reply to a received message and waits until the delivery completes.
3320
+ */ publishToAndWaitAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3321
+ signal: AbortSignal;
3322
+ }): void;
3323
+ /**
3324
+ * Publish a reply message (async version)
3325
+ *
3326
+ * Returns a completion handle that can be awaited to ensure the message was delivered.
3327
+ */ publishToAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3328
+ signal: AbortSignal;
3329
+ }): Promise<CompletionHandle>;
3330
+ /**
3331
+ * Low-level publish with full control over all parameters (blocking version for FFI)
3332
+ *
3333
+ * This is an advanced method that provides complete control over routing and delivery.
3334
+ * Most users should use `publish()` or `publish_to()` instead.
3335
+ *
3336
+ * # Arguments
3337
+ * * `destination` - Target name to send to
3338
+ * * `fanout` - Number of copies to send (for multicast)
3339
+ * * `data` - The message payload bytes
3340
+ * * `connection_out` - Optional specific connection ID to use
3341
+ * * `payload_type` - Optional content type identifier
3342
+ * * `metadata` - Optional key-value metadata pairs
3343
+ */ publishWithParams(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined): void;
3344
+ /**
3345
+ * Low-level publish with full control (async version)
3346
+ */ publishWithParamsAsync(destination: Name, fanout: number, data: ArrayBuffer, connectionOut: /*u64*/ bigint | undefined, payloadType: string | undefined, metadata: Map<string, string> | undefined, asyncOpts_?: {
3347
+ signal: AbortSignal;
3348
+ }): void;
3349
+ /**
3350
+ * Remove a participant from the session (blocking version)
3351
+ *
3352
+ * Returns a completion handle that can be awaited to ensure the removal completes.
3353
+ */ remove(participant: Name): CompletionHandle;
3354
+ /**
3355
+ * Remove a participant and wait for completion (blocking version)
3356
+ *
3357
+ * This method removes a participant and blocks until the removal completes.
3358
+ */ removeAndWait(participant: Name): void;
3359
+ /**
3360
+ * Remove a participant and wait for completion (async version)
3361
+ *
3362
+ * This method removes a participant and waits until the removal completes.
3363
+ */ removeAndWaitAsync(participant: Name, asyncOpts_?: {
3364
+ signal: AbortSignal;
3365
+ }): void;
3366
+ /**
3367
+ * Remove a participant from the session (async version)
3368
+ *
3369
+ * Returns a completion handle that can be awaited to ensure the removal completes.
3370
+ */ removeAsync(participant: Name, asyncOpts_?: {
3371
+ signal: AbortSignal;
3372
+ }): Promise<CompletionHandle>;
3373
+ /**
3374
+ * Get the session ID
3375
+ */ sessionId(): number;
3376
+ /**
3377
+ * Get the session type (PointToPoint or Group)
3378
+ */ sessionType(): SessionType;
3379
+ /**
3380
+ * Get the source name for this session
3381
+ */ source(): Name;
3382
+ /**
3383
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3384
+ */
3385
+ uniffiDestroy(): void;
3386
+ [Symbol.dispose]: () => void;
3387
+ static instanceOf(obj: any): obj is Session;
3388
+ }
3389
+ export type StreamStreamHandlerInterface = {
3390
+ /**
3391
+ * Handle a stream-to-stream RPC call
3392
+ *
3393
+ * # Arguments
3394
+ * * `stream` - Request stream to pull messages from
3395
+ * * `context` - RPC context with metadata and session information
3396
+ * * `sink` - Response sink to send streaming responses
3397
+ *
3398
+ * # Returns
3399
+ * Ok(()) if handling succeeded, or an error
3400
+ *
3401
+ * # Note
3402
+ * You must call `sink.close()` or `sink.send_error()` when done.
3403
+ */ handle(stream: RequestStream, context: Context, sink: ResponseSink, asyncOpts_?: {
3404
+ signal: AbortSignal;
3405
+ }): void;
3406
+ };
3407
+ /**
3408
+ * Stream-to-Stream RPC handler trait
3409
+ *
3410
+ * Implement this trait to handle stream-to-stream RPC calls.
3411
+ * The handler receives multiple requests via the stream and sends multiple responses via the sink.
3412
+ */
3413
+ export declare class StreamStreamHandler extends UniffiAbstractObject implements StreamStreamHandlerInterface {
3414
+ readonly [uniffiTypeNameSymbol] = "StreamStreamHandler";
3415
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
3416
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
3417
+ /**
3418
+ * Handle a stream-to-stream RPC call
3419
+ *
3420
+ * # Arguments
3421
+ * * `stream` - Request stream to pull messages from
3422
+ * * `context` - RPC context with metadata and session information
3423
+ * * `sink` - Response sink to send streaming responses
3424
+ *
3425
+ * # Returns
3426
+ * Ok(()) if handling succeeded, or an error
3427
+ *
3428
+ * # Note
3429
+ * You must call `sink.close()` or `sink.send_error()` when done.
3430
+ */ handle(stream: RequestStream, context: Context, sink: ResponseSink, asyncOpts_?: {
3431
+ signal: AbortSignal;
3432
+ }): void;
3433
+ /**
3434
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3435
+ */
3436
+ uniffiDestroy(): void;
3437
+ [Symbol.dispose]: () => void;
3438
+ static instanceOf(obj: any): obj is StreamStreamHandler;
3439
+ }
3440
+ export type StreamUnaryHandlerInterface = {
3441
+ /**
3442
+ * Handle a stream-to-unary RPC call
3443
+ *
3444
+ * # Arguments
3445
+ * * `stream` - Request stream to pull messages from
3446
+ * * `context` - RPC context with metadata and session information
3447
+ *
3448
+ * # Returns
3449
+ * The response message bytes or an error
3450
+ */ handle(stream: RequestStream, context: Context, asyncOpts_?: {
3451
+ signal: AbortSignal;
3452
+ }): Promise<ArrayBuffer>;
3453
+ };
3454
+ /**
3455
+ * Stream-to-Unary RPC handler trait
3456
+ *
3457
+ * Implement this trait to handle stream-to-unary RPC calls.
3458
+ * The handler receives multiple requests via the stream and returns a single response.
3459
+ */
3460
+ export declare class StreamUnaryHandler extends UniffiAbstractObject implements StreamUnaryHandlerInterface {
3461
+ readonly [uniffiTypeNameSymbol] = "StreamUnaryHandler";
3462
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
3463
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
3464
+ /**
3465
+ * Handle a stream-to-unary RPC call
3466
+ *
3467
+ * # Arguments
3468
+ * * `stream` - Request stream to pull messages from
3469
+ * * `context` - RPC context with metadata and session information
3470
+ *
3471
+ * # Returns
3472
+ * The response message bytes or an error
3473
+ */ handle(stream: RequestStream, context: Context, asyncOpts_?: {
3474
+ signal: AbortSignal;
3475
+ }): Promise<ArrayBuffer>;
3476
+ /**
3477
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3478
+ */
3479
+ uniffiDestroy(): void;
3480
+ [Symbol.dispose]: () => void;
3481
+ static instanceOf(obj: any): obj is StreamUnaryHandler;
3482
+ }
3483
+ export type UnaryStreamHandlerInterface = {
3484
+ /**
3485
+ * Handle a unary-to-stream RPC call
3486
+ *
3487
+ * # Arguments
3488
+ * * `request` - The request message bytes
3489
+ * * `context` - RPC context with metadata and session information
3490
+ * * `sink` - Response sink to send streaming responses
3491
+ *
3492
+ * # Returns
3493
+ * Ok(()) if handling succeeded, or an error
3494
+ *
3495
+ * # Note
3496
+ * You must call `sink.close()` or `sink.send_error()` when done.
3497
+ */ handle(request: ArrayBuffer, context: Context, sink: ResponseSink, asyncOpts_?: {
3498
+ signal: AbortSignal;
3499
+ }): void;
3500
+ };
3501
+ /**
3502
+ * Unary-to-Stream RPC handler trait
3503
+ *
3504
+ * Implement this trait to handle unary-to-stream RPC calls.
3505
+ * The handler receives a single request and sends multiple responses via the sink.
3506
+ */
3507
+ export declare class UnaryStreamHandler extends UniffiAbstractObject implements UnaryStreamHandlerInterface {
3508
+ readonly [uniffiTypeNameSymbol] = "UnaryStreamHandler";
3509
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
3510
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
3511
+ /**
3512
+ * Handle a unary-to-stream RPC call
3513
+ *
3514
+ * # Arguments
3515
+ * * `request` - The request message bytes
3516
+ * * `context` - RPC context with metadata and session information
3517
+ * * `sink` - Response sink to send streaming responses
3518
+ *
3519
+ * # Returns
3520
+ * Ok(()) if handling succeeded, or an error
3521
+ *
3522
+ * # Note
3523
+ * You must call `sink.close()` or `sink.send_error()` when done.
3524
+ */ handle(request: ArrayBuffer, context: Context, sink: ResponseSink, asyncOpts_?: {
3525
+ signal: AbortSignal;
3526
+ }): void;
3527
+ /**
3528
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3529
+ */
3530
+ uniffiDestroy(): void;
3531
+ [Symbol.dispose]: () => void;
3532
+ static instanceOf(obj: any): obj is UnaryStreamHandler;
3533
+ }
3534
+ export type UnaryUnaryHandlerInterface = {
3535
+ /**
3536
+ * Handle a unary-to-unary RPC call
3537
+ *
3538
+ * # Arguments
3539
+ * * `request` - The request message bytes
3540
+ * * `context` - RPC context with metadata and session information
3541
+ *
3542
+ * # Returns
3543
+ * The response message bytes or an error
3544
+ */ handle(request: ArrayBuffer, context: Context, asyncOpts_?: {
3545
+ signal: AbortSignal;
3546
+ }): Promise<ArrayBuffer>;
3547
+ };
3548
+ /**
3549
+ * Unary-to-Unary RPC handler trait
3550
+ *
3551
+ * Implement this trait to handle unary-to-unary RPC calls.
3552
+ * The handler receives a single request and returns a single response.
3553
+ */
3554
+ export declare class UnaryUnaryHandler extends UniffiAbstractObject implements UnaryUnaryHandlerInterface {
3555
+ readonly [uniffiTypeNameSymbol] = "UnaryUnaryHandler";
3556
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
3557
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
3558
+ /**
3559
+ * Handle a unary-to-unary RPC call
3560
+ *
3561
+ * # Arguments
3562
+ * * `request` - The request message bytes
3563
+ * * `context` - RPC context with metadata and session information
3564
+ *
3565
+ * # Returns
3566
+ * The response message bytes or an error
3567
+ */ handle(request: ArrayBuffer, context: Context, asyncOpts_?: {
3568
+ signal: AbortSignal;
3569
+ }): Promise<ArrayBuffer>;
3570
+ /**
3571
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3572
+ */
3573
+ uniffiDestroy(): void;
3574
+ [Symbol.dispose]: () => void;
3575
+ static instanceOf(obj: any): obj is UnaryUnaryHandler;
3576
+ }
3577
+ /**
3578
+ * Create a new Service with builder pattern
3579
+ */
3580
+ export declare function createService(name: string): Service;
3581
+ /**
3582
+ * Create a new Service with configuration
3583
+ */
3584
+ export declare function createServiceWithConfig(name: string, config: ServiceConfig): Service;
3585
+ /**
3586
+ * Get detailed build information
3587
+ */
3588
+ export declare function getBuildInfo(): BuildInfo;
3589
+ /**
3590
+ * Get the global service instance (creates it if it doesn't exist)
3591
+ *
3592
+ * This returns a reference to the shared global service that can be used
3593
+ * across the application. All calls to this function return the same service instance.
3594
+ */
3595
+ export declare function getGlobalService(): Service;
3596
+ /**
3597
+ * Returns references to all global services.
3598
+ * If not initialized, initializes with defaults first.
3599
+ */
3600
+ export declare function getServices(): Array<Service>;
3601
+ /**
3602
+ * Get the version of the SLIM bindings (simple string)
3603
+ */
3604
+ export declare function getVersion(): string;
3605
+ /**
3606
+ * Initialize SLIM bindings from a configuration file
3607
+ *
3608
+ * This function:
3609
+ * 1. Loads the configuration file
3610
+ * 2. Initializes the crypto provider
3611
+ * 3. Sets up tracing/logging exactly as the main SLIM application does
3612
+ * 4. Initializes the global runtime with configuration from the file
3613
+ * 5. Initializes and starts the global service with servers/clients from config
3614
+ *
3615
+ * This must be called before using any SLIM bindings functionality.
3616
+ * It's safe to call multiple times - subsequent calls will be ignored.
3617
+ *
3618
+ * # Arguments
3619
+ * * `config_path` - Path to the YAML configuration file
3620
+ *
3621
+ * # Returns
3622
+ * * `Ok(())` - Successfully initialized
3623
+ * * `Err(SlimError)` - If initialization fails
3624
+ *
3625
+ * # Example
3626
+ * ```ignore
3627
+ * initialize_from_config("/path/to/config.yaml")?;
3628
+ * ```
3629
+ */
3630
+ export declare function initializeFromConfig(configPath: string): void;
3631
+ /**
3632
+ * Initialize SLIM bindings with custom configuration structs
3633
+ *
3634
+ * This function allows you to programmatically configure SLIM bindings by passing
3635
+ * configuration structs directly, without needing a config file.
3636
+ *
3637
+ * # Arguments
3638
+ * * `runtime_config` - Runtime configuration (thread count, naming, etc.)
3639
+ * * `tracing_config` - Tracing/logging configuration
3640
+ * * `service_config` - Service configuration (node ID, group name, etc.)
3641
+ *
3642
+ * # Returns
3643
+ * * `Ok(())` - Successfully initialized
3644
+ * * `Err(SlimError)` - If initialization fails
3645
+ *
3646
+ * # Example
3647
+ * ```ignore
3648
+ * let runtime_config = new_runtime_config();
3649
+ * let tracing_config = new_tracing_config();
3650
+ * let mut service_config = new_service_config();
3651
+ * service_config.node_id = Some("my-node".to_string());
3652
+ *
3653
+ * initialize_with_configs(runtime_config, tracing_config, service_config)?;
3654
+ * ```
3655
+ */
3656
+ export declare function initializeWithConfigs(runtimeConfig: RuntimeConfig, tracingConfig: TracingConfig, serviceConfig: Array<ServiceConfig>): void;
3657
+ /**
3658
+ * Initialize SLIM bindings with default configuration
3659
+ *
3660
+ * This is a convenience function that initializes the bindings with:
3661
+ * - Default runtime configuration
3662
+ * - Default tracing/logging configuration
3663
+ * - Initialized crypto provider
3664
+ * - Default global service (no servers/clients)
3665
+ *
3666
+ * Use `initialize_from_config` for file-based configuration or
3667
+ * `initialize_with_configs` for programmatic configuration.
3668
+ */
3669
+ export declare function initializeWithDefaults(): void;
3670
+ /**
3671
+ * Check if SLIM bindings have been initialized
3672
+ */
3673
+ export declare function isInitialized(): boolean;
3674
+ /**
3675
+ * Create a new DataplaneConfig
3676
+ */
3677
+ export declare function newDataplaneConfig(): DataplaneConfig;
3678
+ /**
3679
+ * Create a new insecure client config (no TLS)
3680
+ */
3681
+ export declare function newInsecureClientConfig(endpoint: string): ClientConfig;
3682
+ /**
3683
+ * Create a new insecure server config (no TLS)
3684
+ */
3685
+ export declare function newInsecureServerConfig(endpoint: string): ServerConfig;
3686
+ /**
3687
+ * Create a new BindingsRuntimeConfig with default values
3688
+ */
3689
+ export declare function newRuntimeConfig(): RuntimeConfig;
3690
+ /**
3691
+ * Create a new BindingsRuntimeConfig with custom values
3692
+ */
3693
+ export declare function newRuntimeConfigWith(nCores: bigint, threadName: string, drainTimeout: number): RuntimeConfig;
3694
+ /**
3695
+ * Create a new server config with the given endpoint and default values
3696
+ */
3697
+ export declare function newServerConfig(endpoint: string): ServerConfig;
3698
+ /**
3699
+ * Create a new BindingsServiceConfig with default values
3700
+ */
3701
+ export declare function newServiceConfig(): ServiceConfig;
3702
+ /**
3703
+ * Create a new BindingsServiceConfig with custom values
3704
+ */
3705
+ export declare function newServiceConfigWith(nodeId: string | undefined, groupName: string | undefined, dataplane: DataplaneConfig): ServiceConfig;
3706
+ /**
3707
+ * Create a new ServiceConfiguration
3708
+ */
3709
+ export declare function newServiceConfiguration(): ServiceConfig;
3710
+ /**
3711
+ * Create a new BindingsTracingConfig with default values
3712
+ */
3713
+ export declare function newTracingConfig(): TracingConfig;
3714
+ /**
3715
+ * Create a new BindingsTracingConfig with custom values
3716
+ */
3717
+ export declare function newTracingConfigWith(logLevel: string, displayThreadNames: boolean, displayThreadIds: boolean, filters: Array<string>): TracingConfig;
3718
+ /**
3719
+ * Perform graceful shutdown operations (blocking version)
3720
+ *
3721
+ * This is a blocking wrapper around the async `shutdown()` function for use from
3722
+ * synchronous contexts or language bindings that don't support async.
3723
+ *
3724
+ * # Returns
3725
+ * * `Ok(())` - Successfully shut down
3726
+ * * `Err(SlimError)` - If shutdown fails
3727
+ */
3728
+ export declare function shutdownBlocking(): void;