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