import { type UniffiByteArray, type UniffiGcObject, type UniffiHandle, FfiConverterObject, RustBuffer, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from "@ubjs/core"; /** * Create a new Service with builder pattern (native only) */ export declare function createService(name: string): ServiceLike; /** * Create a new Service with configuration (native only) */ export declare function createServiceWithConfig(name: string, config: ServiceConfig): ServiceLike; /** * Get detailed build information */ export declare function getBuildInfo(): BuildInfo; /** * Get the global service instance (creates it if it doesn't exist) * * This returns a reference to the shared global service that can be used * across the application. All calls to this function return the same service instance. */ export declare function getGlobalService(): ServiceLike; /** * Returns references to all global services. * If not initialized, initializes with defaults first. */ export declare function getServices(): Array; /** * Get the version of the SLIM bindings (simple string) */ export declare function getVersion(): string; /** * Initialize SLIM bindings from a configuration file * * This function: * 1. Loads the configuration file * 2. Initializes the crypto provider * 3. Sets up tracing/logging exactly as the main SLIM application does * 4. Initializes the global runtime with configuration from the file * 5. Initializes and starts the global service with servers/clients from config * * This must be called before using any SLIM bindings functionality. * It's safe to call multiple times - subsequent calls will be ignored. * * # Arguments * * `config_path` - Path to the YAML configuration file * * # Returns * * `Ok(())` - Successfully initialized * * `Err(SlimError)` - If initialization fails * * # Example * ```ignore * initialize_from_config("/path/to/config.yaml")?; * ``` */ export declare function initializeFromConfig(configPath: string): void; /** * Initialize SLIM bindings from a configuration file and return errors * instead of panicking. */ export declare function initializeFromConfigWithError(configPath: string): void; /** * Initialize SLIM bindings with custom configuration structs * * This function allows you to programmatically configure SLIM bindings by passing * configuration structs directly, without needing a config file. * * # Arguments * * `runtime_config` - Runtime configuration (thread count, naming, etc.) * * `tracing_config` - Tracing/logging configuration * * `service_config` - Service configuration (node ID, group name, etc.) * * # Returns * * `Ok(())` - Successfully initialized * * `Err(SlimError)` - If initialization fails * * # Example * ```ignore * let runtime_config = new_runtime_config(); * let tracing_config = new_tracing_config(); * let mut service_config = new_service_config(); * service_config.node_id = Some("my-node".to_string()); * * initialize_with_configs(runtime_config, tracing_config, service_config)?; * ``` */ export declare function initializeWithConfigs(runtimeConfig: RuntimeConfig, tracingConfig: TracingConfig, serviceConfig: Array): void; /** * Initialize SLIM bindings with default configuration * * This is a convenience function that initializes the bindings with: * - Default runtime configuration * - Default tracing/logging configuration * - Initialized crypto provider * - Default global service (no servers/clients) * * Use `initialize_from_config` for file-based configuration or * `initialize_with_configs` for programmatic configuration. */ export declare function initializeWithDefaults(): void; /** * Check if SLIM bindings have been initialized */ export declare function isInitialized(): boolean; /** * Parse and validate a SLIM gRPC client configuration from JSON. * * The JSON must match [`CoreClientConfig`] (same as * `data-plane/core/config/src/grpc/schema/client-config.schema.json`). */ export declare function newConfigFromJson(json: string): ClientConfig; /** * Create a new DataplaneConfig (native only) */ export declare function newDataplaneConfig(): DataplaneConfig; /** * Create a new insecure client config (no TLS) */ export declare function newInsecureClientConfig(endpoint: string): ClientConfig; /** * Create a new insecure server config (no TLS) */ export declare function newInsecureServerConfig(endpoint: string): ServerConfig; /** * Create a new BindingsRuntimeConfig with default values */ export declare function newRuntimeConfig(): RuntimeConfig; /** * Create a new BindingsRuntimeConfig with custom values */ export declare function newRuntimeConfigWith(nCores: bigint, threadName: string, drainTimeout: number): RuntimeConfig; /** * Create a new secure client config (TLS enabled with default settings) */ export declare function newSecureClientConfig(endpoint: string): ClientConfig; /** * Create a new secure server config (TLS enabled with the given certificate source) */ export declare function newSecureServerConfig(endpoint: string, tlsSource: TlsSource): ServerConfig; /** * Create a new server config with the given endpoint and default values */ export declare function newServerConfig(endpoint: string): ServerConfig; /** * Create a new BindingsServiceConfig with default values */ export declare function newServiceConfig(): ServiceConfig; /** * Create a new BindingsServiceConfig with custom values */ export declare function newServiceConfigWith(nodeId: string | undefined, domainName: string | undefined, dataplane: DataplaneConfig): ServiceConfig; /** * Create a new ServiceConfiguration (native only) */ export declare function newServiceConfiguration(): ServiceConfig; /** * Create a new BindingsTracingConfig with default values */ export declare function newTracingConfig(): TracingConfig; /** * Create a new BindingsTracingConfig with custom values */ export declare function newTracingConfigWith(logLevel: string, displayThreadNames: boolean, displayThreadIds: boolean, filters: Array): TracingConfig; /** * Perform graceful shutdown operations (blocking version) * * This is a blocking wrapper around the async `shutdown()` function for use from * synchronous contexts or language bindings that don't support async. * * # Returns * * `Ok(())` - Successfully shut down * * `Err(SlimError)` - If shutdown fails */ export declare function shutdownBlocking(): void; /** * Basic authentication configuration */ export type BasicAuth = { username: string; password: string; }; /** * Generated factory for {@link BasicAuth} record objects. */ export declare const BasicAuth: Readonly<{ create: (partial: Partial & Required>) => BasicAuth; new: (partial: Partial & Required>) => BasicAuth; defaults: () => Partial; }>; /** * Build information for the SLIM bindings */ export type BuildInfo = { /** * Semantic version (e.g., "0.7.0") */ version: string; /** * Git commit hash (short) */ gitSha: string; /** * Build date in ISO 8601 UTC format */ buildDate: string; /** * Build profile (debug/release) */ profile: string; }; /** * Generated factory for {@link BuildInfo} record objects. */ export declare const BuildInfo: Readonly<{ create: (partial: Partial & Required>) => BuildInfo; new: (partial: Partial & Required>) => BuildInfo; defaults: () => Partial; }>; /** * SPIRE configuration for SPIFFE Workload API integration */ export type SpireConfig = { /** * Path to the SPIFFE Workload API socket (None => use SPIFFE_ENDPOINT_SOCKET env var) */ socketPath?: string; /** * Optional target SPIFFE ID when requesting JWT SVIDs */ targetSpiffeId?: string; /** * Audiences to request/verify for JWT SVIDs */ jwtAudiences: Array; /** * Optional trust domains override for X.509 bundle retrieval */ trustDomains: Array; }; /** * Generated factory for {@link SpireConfig} record objects. */ export declare const SpireConfig: Readonly<{ create: (partial: Partial & Required>) => SpireConfig; new: (partial: Partial & Required>) => SpireConfig; defaults: () => Partial; }>; export declare enum TlsSource_Tags { Pem = "Pem", File = "File", Spire = "Spire", None = "None" } /** * TLS certificate and key source configuration */ export declare const TlsSource: Readonly<{ instanceOf: (obj: any) => obj is TlsSource; Pem: { new (inner: { cert: string; key: string; }): { readonly tag: TlsSource_Tags.Pem; readonly inner: Readonly<{ cert: string; key: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; "new"(inner: { cert: string; key: string; }): { readonly tag: TlsSource_Tags.Pem; readonly inner: Readonly<{ cert: string; key: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; instanceOf(obj: any): obj is { readonly tag: TlsSource_Tags.Pem; readonly inner: Readonly<{ cert: string; key: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; }; File: { new (inner: { cert: string; key: string; }): { readonly tag: TlsSource_Tags.File; readonly inner: Readonly<{ cert: string; key: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; "new"(inner: { cert: string; key: string; }): { readonly tag: TlsSource_Tags.File; readonly inner: Readonly<{ cert: string; key: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; instanceOf(obj: any): obj is { readonly tag: TlsSource_Tags.File; readonly inner: Readonly<{ cert: string; key: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; }; Spire: { new (inner: { config: SpireConfig; }): { readonly tag: TlsSource_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; "new"(inner: { config: SpireConfig; }): { readonly tag: TlsSource_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; instanceOf(obj: any): obj is { readonly tag: TlsSource_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; }; None: { new (): { readonly tag: TlsSource_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; "new"(): { readonly tag: TlsSource_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; instanceOf(obj: any): obj is { readonly tag: TlsSource_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "TlsSource"; }; }; }>; /** * TLS certificate and key source configuration */ export type TlsSource = InstanceType; export declare enum CaSource_Tags { File = "File", Pem = "Pem", Spire = "Spire", None = "None" } /** * CA certificate source configuration */ export declare const CaSource: Readonly<{ instanceOf: (obj: any) => obj is CaSource; File: { new (inner: { path: string; }): { readonly tag: CaSource_Tags.File; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; "new"(inner: { path: string; }): { readonly tag: CaSource_Tags.File; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; instanceOf(obj: any): obj is { readonly tag: CaSource_Tags.File; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; }; Pem: { new (inner: { data: string; }): { readonly tag: CaSource_Tags.Pem; readonly inner: Readonly<{ data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; "new"(inner: { data: string; }): { readonly tag: CaSource_Tags.Pem; readonly inner: Readonly<{ data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; instanceOf(obj: any): obj is { readonly tag: CaSource_Tags.Pem; readonly inner: Readonly<{ data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; }; Spire: { new (inner: { config: SpireConfig; }): { readonly tag: CaSource_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; "new"(inner: { config: SpireConfig; }): { readonly tag: CaSource_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; instanceOf(obj: any): obj is { readonly tag: CaSource_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; }; None: { new (): { readonly tag: CaSource_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; "new"(): { readonly tag: CaSource_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; instanceOf(obj: any): obj is { readonly tag: CaSource_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "CaSource"; }; }; }>; /** * CA certificate source configuration */ export type CaSource = InstanceType; /** * TLS configuration for client connections */ export type TlsClientConfig = { /** * Disable TLS entirely (plain text connection) */ insecure: boolean; /** * Skip server certificate verification (enables TLS but doesn't verify certs) * WARNING: Only use for testing - insecure in production! */ insecureSkipVerify: boolean; /** * Certificate and key source for client authentication */ source: TlsSource; /** * CA certificate source for verifying server certificates */ caSource: CaSource; /** * Include system CA certificates pool (default: true) */ includeSystemCaCertsPool: boolean; /** * TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3") */ tlsVersion: string; }; /** * Generated factory for {@link TlsClientConfig} record objects. */ export declare const TlsClientConfig: Readonly<{ create: (partial: Partial & Required>) => TlsClientConfig; new: (partial: Partial & Required>) => TlsClientConfig; defaults: () => Partial; }>; /** * Compression type for gRPC messages */ export declare enum CompressionType { Gzip = 0, Zlib = 1, Deflate = 2, Snappy = 3, Zstd = 4, Lz4 = 5, None = 6, Empty = 7 } /** * Keepalive configuration for the client */ export type KeepaliveConfig = { /** * TCP keepalive duration */ tcpKeepalive: number; /** * HTTP2 keepalive duration */ http2Keepalive: number; /** * Keepalive timeout */ timeout: number; /** * Whether to permit keepalive without an active stream */ keepAliveWhileIdle: boolean; }; /** * Generated factory for {@link KeepaliveConfig} record objects. */ export declare const KeepaliveConfig: Readonly<{ create: (partial: Partial & Required>) => KeepaliveConfig; new: (partial: Partial & Required>) => KeepaliveConfig; defaults: () => Partial; }>; /** * HTTP Proxy configuration */ export type ProxyConfig = { /** * The HTTP proxy URL (e.g., "http://proxy.example.com:8080") */ url?: string; /** * TLS configuration for proxy connection */ tls: TlsClientConfig; /** * Optional username for proxy authentication */ username?: string; /** * Optional password for proxy authentication */ password?: string; /** * Headers to send with proxy requests */ headers: Map; }; /** * Generated factory for {@link ProxyConfig} record objects. */ export declare const ProxyConfig: Readonly<{ create: (partial: Partial & Required>) => ProxyConfig; new: (partial: Partial & Required>) => ProxyConfig; defaults: () => Partial; }>; /** * Static JWT (Bearer token) authentication configuration * The token is loaded from a file and automatically reloaded when changed */ export type StaticJwtAuth = { /** * Path to file containing the JWT token */ tokenFile: string; /** * Duration for caching the token before re-reading from file (default: 3600 seconds) */ duration: number; }; /** * Generated factory for {@link StaticJwtAuth} record objects. */ export declare const StaticJwtAuth: Readonly<{ create: (partial: Partial & Required>) => StaticJwtAuth; new: (partial: Partial & Required>) => StaticJwtAuth; defaults: () => Partial; }>; /** * JWT signing/verification algorithm */ export declare enum JwtAlgorithm { Hs256 = 0, Hs384 = 1, Hs512 = 2, Es256 = 3, Es384 = 4, Rs256 = 5, Rs384 = 6, Rs512 = 7, Ps256 = 8, Ps384 = 9, Ps512 = 10, EdDsa = 11 } /** * JWT key format */ export declare enum JwtKeyFormat { Pem = 0, Jwk = 1, Jwks = 2 } export declare enum JwtKeyData_Tags { Data = "Data", File = "File" } /** * JWT key data source */ export declare const JwtKeyData: Readonly<{ instanceOf: (obj: any) => obj is JwtKeyData; Data: { new (inner: { value: string; }): { readonly tag: JwtKeyData_Tags.Data; readonly inner: Readonly<{ value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyData"; }; "new"(inner: { value: string; }): { readonly tag: JwtKeyData_Tags.Data; readonly inner: Readonly<{ value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyData"; }; instanceOf(obj: any): obj is { readonly tag: JwtKeyData_Tags.Data; readonly inner: Readonly<{ value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyData"; }; }; File: { new (inner: { path: string; }): { readonly tag: JwtKeyData_Tags.File; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyData"; }; "new"(inner: { path: string; }): { readonly tag: JwtKeyData_Tags.File; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyData"; }; instanceOf(obj: any): obj is { readonly tag: JwtKeyData_Tags.File; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyData"; }; }; }>; /** * JWT key data source */ export type JwtKeyData = InstanceType; /** * JWT key configuration */ export type JwtKeyConfig = { /** * Algorithm used for signing/verifying the JWT */ algorithm: JwtAlgorithm; /** * Key format - PEM, JWK or JWKS */ format: JwtKeyFormat; /** * Encoded key or file path */ key: JwtKeyData; }; /** * Generated factory for {@link JwtKeyConfig} record objects. */ export declare const JwtKeyConfig: Readonly<{ create: (partial: Partial & Required>) => JwtKeyConfig; new: (partial: Partial & Required>) => JwtKeyConfig; defaults: () => Partial; }>; export declare enum JwtKeyType_Tags { Encoding = "Encoding", Decoding = "Decoding", Autoresolve = "Autoresolve" } /** * JWT key type (encoding, decoding, or autoresolve) */ export declare const JwtKeyType: Readonly<{ instanceOf: (obj: any) => obj is JwtKeyType; Encoding: { new (inner: { key: JwtKeyConfig; }): { readonly tag: JwtKeyType_Tags.Encoding; readonly inner: Readonly<{ key: JwtKeyConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; "new"(inner: { key: JwtKeyConfig; }): { readonly tag: JwtKeyType_Tags.Encoding; readonly inner: Readonly<{ key: JwtKeyConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; instanceOf(obj: any): obj is { readonly tag: JwtKeyType_Tags.Encoding; readonly inner: Readonly<{ key: JwtKeyConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; }; Decoding: { new (inner: { key: JwtKeyConfig; }): { readonly tag: JwtKeyType_Tags.Decoding; readonly inner: Readonly<{ key: JwtKeyConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; "new"(inner: { key: JwtKeyConfig; }): { readonly tag: JwtKeyType_Tags.Decoding; readonly inner: Readonly<{ key: JwtKeyConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; instanceOf(obj: any): obj is { readonly tag: JwtKeyType_Tags.Decoding; readonly inner: Readonly<{ key: JwtKeyConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; }; Autoresolve: { new (): { readonly tag: JwtKeyType_Tags.Autoresolve; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; "new"(): { readonly tag: JwtKeyType_Tags.Autoresolve; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; instanceOf(obj: any): obj is { readonly tag: JwtKeyType_Tags.Autoresolve; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "JwtKeyType"; }; }; }>; /** * JWT key type (encoding, decoding, or autoresolve) */ export type JwtKeyType = InstanceType; /** * JWT authentication configuration for client-side signing */ export type ClientJwtAuth = { /** * JWT key configuration (encoding key for signing) */ key: JwtKeyType; /** * JWT audience claims to include */ audience?: Array; /** * JWT issuer to include */ issuer?: string; /** * JWT subject to include */ subject?: string; /** * Token validity duration (default: 3600 seconds) */ duration: number; }; /** * Generated factory for {@link ClientJwtAuth} record objects. */ export declare const ClientJwtAuth: Readonly<{ create: (partial: Partial & Required>) => ClientJwtAuth; new: (partial: Partial & Required>) => ClientJwtAuth; defaults: () => Partial; }>; export declare enum OidcPolicyConfig_Tags { Rego = "Rego", RegoFile = "RegoFile", Cel = "Cel" } /** * Policy evaluated against JWT claims on every authenticated request (server-side OIDC only) */ export declare const OidcPolicyConfig: Readonly<{ instanceOf: (obj: any) => obj is OidcPolicyConfig; Rego: { new (inner: { text: string; }): { readonly tag: OidcPolicyConfig_Tags.Rego; readonly inner: Readonly<{ text: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; "new"(inner: { text: string; }): { readonly tag: OidcPolicyConfig_Tags.Rego; readonly inner: Readonly<{ text: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; instanceOf(obj: any): obj is { readonly tag: OidcPolicyConfig_Tags.Rego; readonly inner: Readonly<{ text: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; }; RegoFile: { new (inner: { path: string; }): { readonly tag: OidcPolicyConfig_Tags.RegoFile; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; "new"(inner: { path: string; }): { readonly tag: OidcPolicyConfig_Tags.RegoFile; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; instanceOf(obj: any): obj is { readonly tag: OidcPolicyConfig_Tags.RegoFile; readonly inner: Readonly<{ path: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; }; Cel: { new (inner: { expression: string; }): { readonly tag: OidcPolicyConfig_Tags.Cel; readonly inner: Readonly<{ expression: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; "new"(inner: { expression: string; }): { readonly tag: OidcPolicyConfig_Tags.Cel; readonly inner: Readonly<{ expression: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; instanceOf(obj: any): obj is { readonly tag: OidcPolicyConfig_Tags.Cel; readonly inner: Readonly<{ expression: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "OidcPolicyConfig"; }; }; }>; /** * Policy evaluated against JWT claims on every authenticated request (server-side OIDC only) */ export type OidcPolicyConfig = InstanceType; /** * OIDC authentication configuration (client-credentials, refresh-token, or JWKS verification) */ export type OidcConfig = { /** * OIDC issuer URL (e.g., https://auth.example.com) */ issuerUrl: string; /** * OAuth2 client ID (required for client-credentials and refresh-token flows) */ clientId?: string; /** * OAuth2 client secret (for client-credentials flow) */ clientSecret?: string; /** * Expected audience for JWT tokens (required for server-side verification) */ audience?: string; /** * Inline refresh token (for authorization-code flow) */ refreshToken?: string; /** * Path to file holding the refresh token (rotated tokens are written back automatically) */ refreshTokenFile?: string; /** * Path to a file caching the current access token (optional companion to refresh_token_file) */ accessTokenFile?: string; /** * OAuth2 scope parameter (client-side only) */ scope?: string; /** * HTTP timeout for token requests in seconds (default: 30, client-side only) */ timeout?: number; /** * JWKS cache TTL in seconds (default: 3600, server-side only) */ jwksTtl?: number; /** * Cache TTL for merged JWT+userinfo claims in seconds (server-side only, absent = no cache) */ claimCacheTtl?: number; /** * Policy evaluated against JWT claims on every authenticated request (server-side only) */ policy?: OidcPolicyConfig; }; /** * Generated factory for {@link OidcConfig} record objects. */ export declare const OidcConfig: Readonly<{ create: (partial: Partial & Required>) => OidcConfig; new: (partial: Partial & Required>) => OidcConfig; defaults: () => Partial; }>; export declare enum ClientAuthenticationConfig_Tags { Basic = "Basic", StaticJwt = "StaticJwt", Jwt = "Jwt", Spire = "Spire", Oidc = "Oidc", None = "None" } /** * Authentication configuration enum for client */ export declare const ClientAuthenticationConfig: Readonly<{ instanceOf: (obj: any) => obj is ClientAuthenticationConfig; Basic: { new (inner: { config: BasicAuth; }): { readonly tag: ClientAuthenticationConfig_Tags.Basic; readonly inner: Readonly<{ config: BasicAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; "new"(inner: { config: BasicAuth; }): { readonly tag: ClientAuthenticationConfig_Tags.Basic; readonly inner: Readonly<{ config: BasicAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ClientAuthenticationConfig_Tags.Basic; readonly inner: Readonly<{ config: BasicAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; }; StaticJwt: { new (inner: { config: StaticJwtAuth; }): { readonly tag: ClientAuthenticationConfig_Tags.StaticJwt; readonly inner: Readonly<{ config: StaticJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; "new"(inner: { config: StaticJwtAuth; }): { readonly tag: ClientAuthenticationConfig_Tags.StaticJwt; readonly inner: Readonly<{ config: StaticJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ClientAuthenticationConfig_Tags.StaticJwt; readonly inner: Readonly<{ config: StaticJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; }; Jwt: { new (inner: { config: ClientJwtAuth; }): { readonly tag: ClientAuthenticationConfig_Tags.Jwt; readonly inner: Readonly<{ config: ClientJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; "new"(inner: { config: ClientJwtAuth; }): { readonly tag: ClientAuthenticationConfig_Tags.Jwt; readonly inner: Readonly<{ config: ClientJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ClientAuthenticationConfig_Tags.Jwt; readonly inner: Readonly<{ config: ClientJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; }; Spire: { new (inner: { config: SpireConfig; }): { readonly tag: ClientAuthenticationConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; "new"(inner: { config: SpireConfig; }): { readonly tag: ClientAuthenticationConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ClientAuthenticationConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; }; Oidc: { new (inner: { config: OidcConfig; }): { readonly tag: ClientAuthenticationConfig_Tags.Oidc; readonly inner: Readonly<{ config: OidcConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; "new"(inner: { config: OidcConfig; }): { readonly tag: ClientAuthenticationConfig_Tags.Oidc; readonly inner: Readonly<{ config: OidcConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ClientAuthenticationConfig_Tags.Oidc; readonly inner: Readonly<{ config: OidcConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; }; None: { new (): { readonly tag: ClientAuthenticationConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; "new"(): { readonly tag: ClientAuthenticationConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ClientAuthenticationConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ClientAuthenticationConfig"; }; }; }>; /** * Authentication configuration enum for client */ export type ClientAuthenticationConfig = InstanceType; /** * Exponential backoff configuration */ export type ExponentialBackoff = { /** * Base delay */ base: number; /** * Multiplication factor for each retry */ factor: bigint; /** * Maximum delay */ maxDelay: number; /** * Maximum number of retry attempts */ maxAttempts: bigint; /** * Whether to add random jitter to delays */ jitter: boolean; }; /** * Generated factory for {@link ExponentialBackoff} record objects. */ export declare const ExponentialBackoff: Readonly<{ create: (partial: Partial & Required>) => ExponentialBackoff; new: (partial: Partial & Required>) => ExponentialBackoff; defaults: () => Partial; }>; /** * Fixed interval backoff configuration */ export type FixedIntervalBackoff = { /** * Fixed interval between retries */ interval: number; /** * Maximum number of retry attempts */ maxAttempts: bigint; }; /** * Generated factory for {@link FixedIntervalBackoff} record objects. */ export declare const FixedIntervalBackoff: Readonly<{ create: (partial: Partial & Required>) => FixedIntervalBackoff; new: (partial: Partial & Required>) => FixedIntervalBackoff; defaults: () => Partial; }>; export declare enum BackoffConfig_Tags { Exponential = "Exponential", FixedInterval = "FixedInterval" } /** * Backoff retry configuration */ export declare const BackoffConfig: Readonly<{ instanceOf: (obj: any) => obj is BackoffConfig; Exponential: { new (inner: { config: ExponentialBackoff; }): { readonly tag: BackoffConfig_Tags.Exponential; readonly inner: Readonly<{ config: ExponentialBackoff; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "BackoffConfig"; }; "new"(inner: { config: ExponentialBackoff; }): { readonly tag: BackoffConfig_Tags.Exponential; readonly inner: Readonly<{ config: ExponentialBackoff; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "BackoffConfig"; }; instanceOf(obj: any): obj is { readonly tag: BackoffConfig_Tags.Exponential; readonly inner: Readonly<{ config: ExponentialBackoff; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "BackoffConfig"; }; }; FixedInterval: { new (inner: { config: FixedIntervalBackoff; }): { readonly tag: BackoffConfig_Tags.FixedInterval; readonly inner: Readonly<{ config: FixedIntervalBackoff; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "BackoffConfig"; }; "new"(inner: { config: FixedIntervalBackoff; }): { readonly tag: BackoffConfig_Tags.FixedInterval; readonly inner: Readonly<{ config: FixedIntervalBackoff; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "BackoffConfig"; }; instanceOf(obj: any): obj is { readonly tag: BackoffConfig_Tags.FixedInterval; readonly inner: Readonly<{ config: FixedIntervalBackoff; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "BackoffConfig"; }; }; }>; /** * Backoff retry configuration */ export type BackoffConfig = InstanceType; /** * Client configuration for connecting to a SLIM server */ export type ClientConfig = { /** * The target endpoint the client will connect to. * * The transport protocol is inferred from the endpoint scheme: * `ws://`/`wss://` → WebSocket, otherwise gRPC. */ endpoint: string; /** * TLS client configuration */ tls: TlsClientConfig; /** * Origin (HTTP Host authority override) for the client */ origin?: string; /** * Optional TLS SNI server name override */ serverName?: string; /** * Compression type */ compression?: CompressionType; /** * Rate limit string (e.g., "100/s" for 100 requests per second) */ rateLimit?: string; /** * Keepalive parameters */ keepalive?: KeepaliveConfig; /** * HTTP Proxy configuration */ proxy?: ProxyConfig; /** * Connection timeout */ connectTimeout?: number; /** * Request timeout */ requestTimeout?: number; /** * Read buffer size in bytes */ bufferSize?: bigint; /** * Headers associated with gRPC requests */ headers?: Map; /** * Authentication configuration for outgoing RPCs */ auth?: ClientAuthenticationConfig; /** * Backoff retry configuration */ backoff?: BackoffConfig; /** * Arbitrary user-provided metadata as JSON string */ metadata?: string; /** * When true, reject inter-node messages without a valid header MAC (strict mode). */ requireHeaderMac?: boolean; }; /** * Generated factory for {@link ClientConfig} record objects. */ export declare const ClientConfig: Readonly<{ create: (partial: Partial & Required>) => ClientConfig; new: (partial: Partial & Required>) => ClientConfig; defaults: () => Partial; }>; /** * TLS configuration for server connections */ export type TlsServerConfig = { /** * Disable TLS entirely (plain text connection) */ insecure: boolean; /** * Certificate and key source for server authentication */ source: TlsSource; /** * CA certificate source for verifying client certificates */ clientCa: CaSource; /** * Include system CA certificates pool (default: true) */ includeSystemCaCertsPool?: boolean; /** * TLS version to use: "tls1.2" or "tls1.3" (default: "tls1.3") */ tlsVersion?: string; /** * Reload client CA file when modified */ reloadClientCaFile?: boolean; }; /** * Generated factory for {@link TlsServerConfig} record objects. */ export declare const TlsServerConfig: Readonly<{ create: (partial: Partial & Required>) => TlsServerConfig; new: (partial: Partial & Required>) => TlsServerConfig; defaults: () => Partial; }>; /** * Keepalive configuration for the server */ export type KeepaliveServerParameters = { /** * Max connection idle time (time after which an idle connection is closed) */ maxConnectionIdle: number; /** * Max connection age (maximum time a connection may exist before being closed) */ maxConnectionAge: number; /** * Max connection age grace (additional time after max_connection_age before closing) */ maxConnectionAgeGrace: number; /** * Keepalive ping frequency */ time: number; /** * Keepalive ping timeout (time to wait for ack) */ timeout: number; }; /** * Generated factory for {@link KeepaliveServerParameters} record objects. */ export declare const KeepaliveServerParameters: Readonly<{ create: (partial: Partial & Required>) => KeepaliveServerParameters; new: (partial: Partial & Required>) => KeepaliveServerParameters; defaults: () => Partial; }>; /** * JWT authentication configuration for server-side verification */ export type JwtAuth = { /** * JWT key configuration (decoding key for verification) */ key: JwtKeyType; /** * JWT audience claims to verify */ audience?: Array; /** * JWT issuer to verify */ issuer?: string; /** * JWT subject to verify */ subject?: string; /** * Token validity duration (default: 3600 seconds) */ duration: number; }; /** * Generated factory for {@link JwtAuth} record objects. */ export declare const JwtAuth: Readonly<{ create: (partial: Partial & Required>) => JwtAuth; new: (partial: Partial & Required>) => JwtAuth; defaults: () => Partial; }>; export declare enum ServerAuthenticationConfig_Tags { Basic = "Basic", Jwt = "Jwt", Spire = "Spire", Oidc = "Oidc", None = "None" } /** * Authentication configuration enum for server */ export declare const ServerAuthenticationConfig: Readonly<{ instanceOf: (obj: any) => obj is ServerAuthenticationConfig; Basic: { new (inner: { config: BasicAuth; }): { readonly tag: ServerAuthenticationConfig_Tags.Basic; readonly inner: Readonly<{ config: BasicAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; "new"(inner: { config: BasicAuth; }): { readonly tag: ServerAuthenticationConfig_Tags.Basic; readonly inner: Readonly<{ config: BasicAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ServerAuthenticationConfig_Tags.Basic; readonly inner: Readonly<{ config: BasicAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; }; Jwt: { new (inner: { config: JwtAuth; }): { readonly tag: ServerAuthenticationConfig_Tags.Jwt; readonly inner: Readonly<{ config: JwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; "new"(inner: { config: JwtAuth; }): { readonly tag: ServerAuthenticationConfig_Tags.Jwt; readonly inner: Readonly<{ config: JwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ServerAuthenticationConfig_Tags.Jwt; readonly inner: Readonly<{ config: JwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; }; Spire: { new (inner: { config: SpireConfig; }): { readonly tag: ServerAuthenticationConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; "new"(inner: { config: SpireConfig; }): { readonly tag: ServerAuthenticationConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ServerAuthenticationConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; }; Oidc: { new (inner: { config: OidcConfig; }): { readonly tag: ServerAuthenticationConfig_Tags.Oidc; readonly inner: Readonly<{ config: OidcConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; "new"(inner: { config: OidcConfig; }): { readonly tag: ServerAuthenticationConfig_Tags.Oidc; readonly inner: Readonly<{ config: OidcConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ServerAuthenticationConfig_Tags.Oidc; readonly inner: Readonly<{ config: OidcConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; }; None: { new (): { readonly tag: ServerAuthenticationConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; "new"(): { readonly tag: ServerAuthenticationConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; instanceOf(obj: any): obj is { readonly tag: ServerAuthenticationConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "ServerAuthenticationConfig"; }; }; }>; /** * Authentication configuration enum for server */ export type ServerAuthenticationConfig = InstanceType; /** * Server configuration for running a SLIM server */ export type ServerConfig = { /** * Endpoint address to listen on (e.g., "0.0.0.0:50051" or "[::]:50051"). * * The transport protocol is inferred from the endpoint scheme: * `ws://`/`wss://` → WebSocket, otherwise gRPC. */ endpoint: string; /** * TLS server configuration */ tls: TlsServerConfig; /** * Use HTTP/2 only (default: true) */ http2Only?: boolean; /** * Maximum size (in MiB) of messages accepted by the server */ maxFrameSize?: number; /** * Maximum number of concurrent streams per connection */ maxConcurrentStreams?: number; /** * Maximum header list size in bytes */ maxHeaderListSize?: number; /** * Read buffer size in bytes */ readBufferSize?: bigint; /** * Write buffer size in bytes */ writeBufferSize?: bigint; /** * Keepalive parameters */ keepalive?: KeepaliveServerParameters; /** * Authentication configuration for incoming requests */ auth?: ServerAuthenticationConfig; /** * Arbitrary user-provided metadata as JSON string */ metadata?: string; /** * When true, reject inter-node messages without a valid header MAC (strict mode). */ requireHeaderMac?: boolean; /** * Timeout (in seconds) for link negotiation to complete. */ negotiationTimeoutSecs?: bigint; /** * Polling interval (in milliseconds) to wait between HMAC existence checks. */ linkHmacPollIntervalMs?: bigint; }; /** * Generated factory for {@link ServerConfig} record objects. */ export declare const ServerConfig: Readonly<{ create: (partial: Partial & Required>) => ServerConfig; new: (partial: Partial & Required>) => ServerConfig; defaults: () => Partial; }>; /** * DataPlane configuration wrapper for uniffi bindings (native only — wraps gRPC config) */ export type DataplaneConfig = { /** * DataPlane GRPC server settings */ servers: Array; /** * DataPlane client configs */ clients: Array; }; /** * Generated factory for {@link DataplaneConfig} record objects. */ export declare const DataplaneConfig: Readonly<{ create: (partial: Partial & Required>) => DataplaneConfig; new: (partial: Partial & Required>) => DataplaneConfig; defaults: () => Partial; }>; /** * Name type for SLIM (Secure Low-Latency Interactive Messaging) */ export interface NameLike { /** * Get the name components as a vector of strings */ components(): Array; /** * Get the name ID formatted as UUID string */ id(): string; } /** * @deprecated Use `NameLike` instead. */ export type NameInterface = NameLike; /** * Name type for SLIM (Secure Low-Latency Interactive Messaging) */ export declare class Name extends UniffiAbstractObject implements NameLike { readonly [uniffiTypeNameSymbol] = "Name"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new Name from components without an ID */ constructor(component0: string, component1: string, component2: string); /** * Parse a Name from a `"org/namespace/agent"` string * * The string must contain exactly three `/`-separated components. * Returns an error if the format is invalid. */ static fromString(s: string): NameLike; /** * Create a new Name from components with an ID expressed in UUID format */ static newWithId(component0: string, component1: string, component2: string, id: string): NameLike; /** * Get the name components as a vector of strings */ components(): Array; /** * Get the name ID formatted as UUID string */ id(): string; toString(): string; toDebugString(): string; equals(other: Name): boolean; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Name; } /** * Generic message context for language bindings (UniFFI-compatible) * * Provides routing and descriptive metadata needed for replying, * auditing, and instrumentation across different language bindings. * This type is exported to foreign languages via UniFFI. */ export type MessageContext = { /** * Fully-qualified sender identity */ sourceName: NameLike; /** * Fully-qualified destination identity (may be empty for broadcast/group scenarios) */ destinationName?: NameLike; /** * Logical/semantic type (defaults to "msg" if unspecified) */ payloadType: string; /** * Arbitrary key/value pairs supplied by the sender (e.g. tracing IDs) */ metadata: Map; /** * Numeric identifier of the inbound connection carrying the message */ inputConnection: bigint; /** * Identity contained in the message */ identity: string; }; /** * Generated factory for {@link MessageContext} record objects. */ export declare const MessageContext: Readonly<{ create: (partial: Partial & Required>) => MessageContext; new: (partial: Partial & Required>) => MessageContext; defaults: () => Partial; }>; export type MlsSettings = { /** * 0 = disable header-integrity checks; 1–100 = percent of messages to verify after decrypt. */ headerIntegrityValidationPercent: number; /** * Maximum remembered control-message IDs used for replay protection. * `None` uses the SLIM core default. */ maxSeenControlMessageIdsSize?: bigint; }; /** * Generated factory for {@link MlsSettings} record objects. */ export declare const MlsSettings: Readonly<{ create: (partial: Partial & Required>) => MlsSettings; new: (partial: Partial & Required>) => MlsSettings; defaults: () => Partial; }>; /** * Online/offline status of a session participant */ export declare enum ParticipantStatus { Online = 0, Offline = 1 } /** * A participant in a session together with their current status */ export type ParticipantInfo = { name: NameLike; status: ParticipantStatus; }; /** * Generated factory for {@link ParticipantInfo} record objects. */ export declare const ParticipantInfo: Readonly<{ create: (partial: Partial & Required>) => ParticipantInfo; new: (partial: Partial & Required>) => ParticipantInfo; defaults: () => Partial; }>; /** * Where and how a session's MLS/state is persisted at rest. * * Persistence is opt-in and app-level: pass this to * [`Service::create_app_with_persistence`] to get a restorable app. */ export type PersistenceConfig = { /** * Directory holding the encrypted store (one file per identity). */ path: string; /** * Passphrase protecting the store. **Set this.** * * When `Some`, a 256-bit AES key is derived from it and the store is * genuinely confidential. When `None`, the key is instead derived from the * app's **public** name: the store still detects tampering and is stable * across restarts, but it offers **no confidentiality** — anyone who can * read the database file and knows the app name can decrypt it. Only rely * on the `None` fallback when the filesystem itself is your trust boundary. */ passphrase?: string; }; /** * Generated factory for {@link PersistenceConfig} record objects. */ export declare const PersistenceConfig: Readonly<{ create: (partial: Partial & Required>) => PersistenceConfig; new: (partial: Partial & Required>) => PersistenceConfig; defaults: () => Partial; }>; /** * Received message containing context and payload */ export type ReceivedMessage = { context: MessageContext; payload: ArrayBuffer; }; /** * Generated factory for {@link ReceivedMessage} record objects. */ export declare const ReceivedMessage: Readonly<{ create: (partial: Partial & Required>) => ReceivedMessage; new: (partial: Partial & Required>) => ReceivedMessage; defaults: () => Partial; }>; /** * Runtime configuration for the SLIM bindings * * Controls the Tokio runtime behavior including thread count, naming, and shutdown timeout. */ export type RuntimeConfig = { /** * Number of cores to use for the runtime (0 = use all available cores) */ nCores: bigint; /** * Thread name prefix for the runtime */ threadName: string; /** * Timeout duration for draining services during shutdown */ drainTimeout: number; }; /** * Generated factory for {@link RuntimeConfig} record objects. */ export declare const RuntimeConfig: Readonly<{ create: (partial: Partial & Required>) => RuntimeConfig; new: (partial: Partial & Required>) => RuntimeConfig; defaults: () => Partial; }>; /** * Service configuration wrapper for uniffi bindings (native only — includes gRPC dataplane config) */ export type ServiceConfig = { /** * Optional node ID for the service */ nodeId?: string; /** * Optional group name for the service */ domainName?: string; /** * DataPlane configuration (servers and clients) */ dataplane: DataplaneConfig; }; /** * Generated factory for {@link ServiceConfig} record objects. */ export declare const ServiceConfig: Readonly<{ create: (partial: Partial & Required>) => ServiceConfig; new: (partial: Partial & Required>) => ServiceConfig; defaults: () => Partial; }>; /** * Session type enum */ export declare enum SessionType { PointToPoint = 0, Group = 1 } /** * Session configuration */ export type SessionConfig = { /** * Session type (PointToPoint or Group) */ sessionType: SessionType; /** * Maximum number of retries for message transmission (None = use default) */ maxRetries?: number; /** * Interval between retries in milliseconds (None = use default) */ interval?: number; /** * Custom metadata key-value pairs for the session */ metadata: Map; /** * MLS options (None disables MLS). */ mlsSettings?: MlsSettings; }; /** * Generated factory for {@link SessionConfig} record objects. */ export declare const SessionConfig: Readonly<{ create: (partial: Partial & Required>) => SessionConfig; new: (partial: Partial & Required>) => SessionConfig; defaults: () => Partial; }>; export declare enum SlimError_Tags { ServiceError = "ServiceError", SessionError = "SessionError", ReceiveError = "ReceiveError", SendError = "SendError", AuthError = "AuthError", ConfigError = "ConfigError", RpcError = "RpcError", Timeout = "Timeout", InvalidArgument = "InvalidArgument", InternalError = "InternalError" } /** * Error types for SLIM operations */ export declare const SlimError: Readonly<{ instanceOf: (obj: any) => obj is SlimError; ServiceError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.ServiceError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.ServiceError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.ServiceError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.ServiceError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.ServiceError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; SessionError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.SessionError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.SessionError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.SessionError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.SessionError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.SessionError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; ReceiveError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.ReceiveError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.ReceiveError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.ReceiveError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.ReceiveError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.ReceiveError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; SendError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.SendError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.SendError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.SendError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.SendError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.SendError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; AuthError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.AuthError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.AuthError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.AuthError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.AuthError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.AuthError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; ConfigError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.ConfigError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.ConfigError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.ConfigError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.ConfigError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.ConfigError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; RpcError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.RpcError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.RpcError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.RpcError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.RpcError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.RpcError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; Timeout: { new (): { readonly tag: SlimError_Tags.Timeout; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(): { readonly tag: SlimError_Tags.Timeout; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.Timeout; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.Timeout; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; InvalidArgument: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.InvalidArgument; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.InvalidArgument; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.InvalidArgument; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.InvalidArgument; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.InvalidArgument; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; InternalError: { new (inner: { message: string; }): { readonly tag: SlimError_Tags.InternalError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; "new"(inner: { message: string; }): { readonly tag: SlimError_Tags.InternalError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; instanceOf(obj: any): obj is { readonly tag: SlimError_Tags.InternalError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; hasInner(obj: any): obj is { readonly tag: SlimError_Tags.InternalError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }; getInner(obj: { readonly tag: SlimError_Tags.InternalError; readonly inner: Readonly<{ message: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "SlimError"; name: string; message: string; stack?: string; }): Readonly<{ message: string; }>; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; }>; /** * Error types for SLIM operations */ export type SlimError = InstanceType; /** * FFI-compatible completion handle for async operations * * Represents a pending operation that can be awaited to ensure completion. * Used for operations that need delivery confirmation or handshake acknowledgment. * * # Examples * * Basic usage: * ```ignore * let completion = session.publish(data, None, None)?; * completion.wait()?; // Wait for delivery confirmation * ``` */ export interface CompletionHandleLike { /** * Wait for the operation to complete indefinitely (blocking version) * * This blocks the calling thread until the operation completes. * Use this from Go or other languages when you need to ensure * an operation has finished before proceeding. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError)` - Operation failed or handle already consumed */ wait(): void; /** * Wait for the operation to complete indefinitely (async version) * * This is the async version that integrates with UniFFI's polling mechanism. * The operation will yield control while waiting. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError)` - Operation failed or handle already consumed */ waitAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Wait for the operation to complete with a timeout (blocking version) * * This blocks the calling thread until the operation completes or the timeout expires. * Use this from Go or other languages when you need to ensure * an operation has finished before proceeding with a time limit. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Arguments * * `timeout` - Maximum time to wait for completion * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError::Timeout)` - If the operation timed out * * `Err(SlimError)` - Operation failed or handle already consumed */ waitFor(timeout: number): void; /** * Wait for the operation to complete with a timeout (async version) * * This is the async version that integrates with UniFFI's polling mechanism. * The operation will yield control while waiting until completion or timeout. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Arguments * * `timeout` - Maximum time to wait for completion * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError::Timeout)` - If the operation timed out * * `Err(SlimError)` - Operation failed or handle already consumed */ waitForAsync(timeout: number, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `CompletionHandleLike` instead. */ export type CompletionHandleInterface = CompletionHandleLike; /** * FFI-compatible completion handle for async operations * * Represents a pending operation that can be awaited to ensure completion. * Used for operations that need delivery confirmation or handshake acknowledgment. * * # Examples * * Basic usage: * ```ignore * let completion = session.publish(data, None, None)?; * completion.wait()?; // Wait for delivery confirmation * ``` */ export declare class CompletionHandle extends UniffiAbstractObject implements CompletionHandleLike { readonly [uniffiTypeNameSymbol] = "CompletionHandle"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Wait for the operation to complete indefinitely (blocking version) * * This blocks the calling thread until the operation completes. * Use this from Go or other languages when you need to ensure * an operation has finished before proceeding. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError)` - Operation failed or handle already consumed */ wait(): void; /** * Wait for the operation to complete indefinitely (async version) * * This is the async version that integrates with UniFFI's polling mechanism. * The operation will yield control while waiting. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError)` - Operation failed or handle already consumed */ waitAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Wait for the operation to complete with a timeout (blocking version) * * This blocks the calling thread until the operation completes or the timeout expires. * Use this from Go or other languages when you need to ensure * an operation has finished before proceeding with a time limit. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Arguments * * `timeout` - Maximum time to wait for completion * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError::Timeout)` - If the operation timed out * * `Err(SlimError)` - Operation failed or handle already consumed */ waitFor(timeout: number): void; /** * Wait for the operation to complete with a timeout (async version) * * This is the async version that integrates with UniFFI's polling mechanism. * The operation will yield control while waiting until completion or timeout. * * **Note:** This can only be called once per handle. Subsequent calls * will return an error. * * # Arguments * * `timeout` - Maximum time to wait for completion * * # Returns * * `Ok(())` - Operation completed successfully * * `Err(SlimError::Timeout)` - If the operation timed out * * `Err(SlimError)` - Operation failed or handle already consumed */ waitForAsync(timeout: number, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is CompletionHandle; } /** * How a session should be closed. */ export declare enum CloseMode { /** * Soft close: go offline so the session can be brought back later with * `rejoin()`. This is an in-memory group operation and does not require * persistence (though a persisted session also survives a process restart). * Not valid for point-to-point sessions. */ Soft = 0, /** * Hard close: terminate the session permanently. */ Hard = 1 } /** * Session context for language bindings (UniFFI-compatible) * * Wraps the session context with proper async access patterns for message reception. * Provides both synchronous (blocking) and asynchronous methods for FFI compatibility. */ export interface SessionLike { /** * Hard-close the session (blocking version): terminate it permanently. * For a soft, restorable close use [`Self::close_with_mode`]. */ close(): CompletionHandleLike; /** * Hard-close the session and wait for completion (blocking version). See [`Self::close`]. */ closeAndWait(): void; /** * Hard-close the session and wait for completion (async version). See [`Self::close`]. */ closeAndWaitAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Hard-close the session (async version). See [`Self::close`]. */ closeAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Close the session with an explicit [`CloseMode`] (blocking version). * * [`CloseMode::Soft`] notifies the group that this participant is going * offline so it can be brought back with `rejoin()` (an in-memory group * operation; persistence is not required). Only valid for Group sessions; * returns an error for PointToPoint sessions. [`CloseMode::Hard`] terminates * the session permanently. Returns a completion handle that resolves when * ACKs are collected or on timeout. */ closeWithMode(mode: CloseMode): CompletionHandleLike; /** * Close the session with an explicit [`CloseMode`] and wait for completion (blocking version). */ closeWithModeAndWait(mode: CloseMode): void; /** * Close the session with an explicit [`CloseMode`] and wait for completion (async version). */ closeWithModeAndWaitAsync(mode: CloseMode, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Close the session with an explicit [`CloseMode`] (async version). See [`Self::close_with_mode`]. */ closeWithModeAsync(mode: CloseMode, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the session configuration */ config(): SessionConfig; /** * Get the destination name for this session */ destination(): NameLike; /** * Receive a message from the session (blocking version for FFI) * * # Arguments * * `timeout` - Optional timeout duration * * # Returns * * `Ok(ReceivedMessage)` - Message with context and payload bytes * * `Err(SlimError)` - If the receive fails or times out */ getMessage(timeout: number | undefined): ReceivedMessage; /** * Receive a message from the session (async version) */ getMessageAsync(timeout: number | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Invite a participant to the session (blocking version) * * Returns a completion handle that can be awaited to ensure the invitation completes. */ invite(participant: NameLike): CompletionHandleLike; /** * Invite a participant and wait for completion (blocking version) * * This method invites a participant and blocks until the invitation completes. */ inviteAndWait(participant: NameLike): void; /** * Invite a participant and wait for completion (async version) * * This method invites a participant and waits until the invitation completes. */ inviteAndWaitAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Invite a participant to the session (async version) * * Returns a completion handle that can be awaited to ensure the invitation completes. */ inviteAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Check if this session is the initiator */ isInitiator(): boolean; /** * Get the session metadata */ metadata(): Map; /** * Get list of participants in the session with their online/offline status (blocking version for FFI) */ participantsList(): Array; /** * Get list of participants in the session with their online/offline status (async version) */ participantsListAsync(asyncOpts_?: { signal: AbortSignal; }): Promise>; /** * Publish a message to the session's destination (blocking version) * * Returns a completion handle that can be awaited to ensure the message was delivered. * * # Arguments * * `data` - The message payload bytes * * `payload_type` - Optional content type identifier * * `metadata` - Optional key-value metadata pairs * * # Returns * * `Ok(CompletionHandle)` - Handle to await delivery confirmation * * `Err(SlimError)` - If publishing fails * * # Example * ```ignore * let completion = session.publish(data, None, None)?; * completion.wait()?; // Blocks until message is delivered * ``` */ publish(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): CompletionHandleLike; /** * Publish a message and wait for completion (blocking version) * * This method publishes a message and blocks until the delivery completes. */ publishAndWait(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): void; /** * Publish a message and wait for completion (async version) * * This method publishes a message and waits until the delivery completes. */ publishAndWaitAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Publish a message to the session's destination (async version) * * Returns a completion handle that can be awaited to ensure the message was delivered. */ publishAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Publish a reply message to the originator of a received message (blocking version for FFI) * * This method uses the routing information from a previously received message * to send a reply back to the sender. This is the preferred way to implement * request/reply patterns. * * Returns a completion handle that can be awaited to ensure the message was delivered. * * # Arguments * * `message_context` - Context from a message received via `get_message()` * * `data` - The reply payload bytes * * `payload_type` - Optional content type identifier * * `metadata` - Optional key-value metadata pairs * * # Returns * * `Ok(CompletionHandle)` - Handle to await delivery confirmation * * `Err(SlimError)` - If publishing fails */ publishTo(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): CompletionHandleLike; /** * Publish a reply message and wait for completion (blocking version) * * This method publishes a reply to a received message and blocks until the delivery completes. */ publishToAndWait(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): void; /** * Publish a reply message and wait for completion (async version) * * This method publishes a reply to a received message and waits until the delivery completes. */ publishToAndWaitAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Publish a reply message (async version) * * Returns a completion handle that can be awaited to ensure the message was delivered. */ publishToAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Low-level publish with full control over all parameters (blocking version for FFI) * * This is an advanced method that provides complete control over routing and delivery. * Most users should use `publish()` or `publish_to()` instead. * * # Arguments * * `destination` - Target name to send to * * `fanout` - Number of copies to send (for multicast) * * `data` - The message payload bytes * * `connection_out` - Optional specific connection ID to use * * `payload_type` - Optional content type identifier * * `metadata` - Optional key-value metadata pairs */ publishWithParams(destination: NameLike, fanout: number, data: ArrayBuffer, connectionOut: bigint | undefined, payloadType: string | undefined, metadata: Map | undefined): void; /** * Low-level publish with full control (async version) */ publishWithParamsAsync(destination: NameLike, fanout: number, data: ArrayBuffer, connectionOut: bigint | undefined, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Notify the group that this participant is back online (blocking version). * * Only valid for Group sessions; returns an error for PointToPoint sessions. * Returns a completion handle that resolves when ACKs/NACKs are collected. * If any participant NACKs due to an MLS epoch mismatch, the rejoin fails. */ rejoin(): CompletionHandleLike; /** * Notify the group that this participant is back online and wait for completion (blocking version). */ rejoinAndWait(): void; /** * Notify the group that this participant is back online and wait for completion (async version). */ rejoinAndWaitAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Notify the group that this participant is back online (async version). */ rejoinAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Remove a participant from the session (blocking version) * * Returns a completion handle that can be awaited to ensure the removal completes. */ remove(participant: NameLike): CompletionHandleLike; /** * Remove a participant and wait for completion (blocking version) * * This method removes a participant and blocks until the removal completes. */ removeAndWait(participant: NameLike): void; /** * Remove a participant and wait for completion (async version) * * This method removes a participant and waits until the removal completes. */ removeAndWaitAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Remove a participant from the session (async version) * * Returns a completion handle that can be awaited to ensure the removal completes. */ removeAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the session ID */ sessionId(): number; /** * Get the session type (PointToPoint or Group) */ sessionType(): SessionType; /** * Get the source name for this session */ source(): NameLike; } /** * @deprecated Use `SessionLike` instead. */ export type SessionInterface = SessionLike; /** * Session context for language bindings (UniFFI-compatible) * * Wraps the session context with proper async access patterns for message reception. * Provides both synchronous (blocking) and asynchronous methods for FFI compatibility. */ export declare class Session extends UniffiAbstractObject implements SessionLike { readonly [uniffiTypeNameSymbol] = "Session"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; private constructor(); /** * Hard-close the session (blocking version): terminate it permanently. * For a soft, restorable close use [`Self::close_with_mode`]. */ close(): CompletionHandleLike; /** * Hard-close the session and wait for completion (blocking version). See [`Self::close`]. */ closeAndWait(): void; /** * Hard-close the session and wait for completion (async version). See [`Self::close`]. */ closeAndWaitAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Hard-close the session (async version). See [`Self::close`]. */ closeAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Close the session with an explicit [`CloseMode`] (blocking version). * * [`CloseMode::Soft`] notifies the group that this participant is going * offline so it can be brought back with `rejoin()` (an in-memory group * operation; persistence is not required). Only valid for Group sessions; * returns an error for PointToPoint sessions. [`CloseMode::Hard`] terminates * the session permanently. Returns a completion handle that resolves when * ACKs are collected or on timeout. */ closeWithMode(mode: CloseMode): CompletionHandleLike; /** * Close the session with an explicit [`CloseMode`] and wait for completion (blocking version). */ closeWithModeAndWait(mode: CloseMode): void; /** * Close the session with an explicit [`CloseMode`] and wait for completion (async version). */ closeWithModeAndWaitAsync(mode: CloseMode, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Close the session with an explicit [`CloseMode`] (async version). See [`Self::close_with_mode`]. */ closeWithModeAsync(mode: CloseMode, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the session configuration */ config(): SessionConfig; /** * Get the destination name for this session */ destination(): NameLike; /** * Receive a message from the session (blocking version for FFI) * * # Arguments * * `timeout` - Optional timeout duration * * # Returns * * `Ok(ReceivedMessage)` - Message with context and payload bytes * * `Err(SlimError)` - If the receive fails or times out */ getMessage(timeout: number | undefined): ReceivedMessage; /** * Receive a message from the session (async version) */ getMessageAsync(timeout: number | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Invite a participant to the session (blocking version) * * Returns a completion handle that can be awaited to ensure the invitation completes. */ invite(participant: NameLike): CompletionHandleLike; /** * Invite a participant and wait for completion (blocking version) * * This method invites a participant and blocks until the invitation completes. */ inviteAndWait(participant: NameLike): void; /** * Invite a participant and wait for completion (async version) * * This method invites a participant and waits until the invitation completes. */ inviteAndWaitAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Invite a participant to the session (async version) * * Returns a completion handle that can be awaited to ensure the invitation completes. */ inviteAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Check if this session is the initiator */ isInitiator(): boolean; /** * Get the session metadata */ metadata(): Map; /** * Get list of participants in the session with their online/offline status (blocking version for FFI) */ participantsList(): Array; /** * Get list of participants in the session with their online/offline status (async version) */ participantsListAsync(asyncOpts_?: { signal: AbortSignal; }): Promise>; /** * Publish a message to the session's destination (blocking version) * * Returns a completion handle that can be awaited to ensure the message was delivered. * * # Arguments * * `data` - The message payload bytes * * `payload_type` - Optional content type identifier * * `metadata` - Optional key-value metadata pairs * * # Returns * * `Ok(CompletionHandle)` - Handle to await delivery confirmation * * `Err(SlimError)` - If publishing fails * * # Example * ```ignore * let completion = session.publish(data, None, None)?; * completion.wait()?; // Blocks until message is delivered * ``` */ publish(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): CompletionHandleLike; /** * Publish a message and wait for completion (blocking version) * * This method publishes a message and blocks until the delivery completes. */ publishAndWait(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): void; /** * Publish a message and wait for completion (async version) * * This method publishes a message and waits until the delivery completes. */ publishAndWaitAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Publish a message to the session's destination (async version) * * Returns a completion handle that can be awaited to ensure the message was delivered. */ publishAsync(data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Publish a reply message to the originator of a received message (blocking version for FFI) * * This method uses the routing information from a previously received message * to send a reply back to the sender. This is the preferred way to implement * request/reply patterns. * * Returns a completion handle that can be awaited to ensure the message was delivered. * * # Arguments * * `message_context` - Context from a message received via `get_message()` * * `data` - The reply payload bytes * * `payload_type` - Optional content type identifier * * `metadata` - Optional key-value metadata pairs * * # Returns * * `Ok(CompletionHandle)` - Handle to await delivery confirmation * * `Err(SlimError)` - If publishing fails */ publishTo(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): CompletionHandleLike; /** * Publish a reply message and wait for completion (blocking version) * * This method publishes a reply to a received message and blocks until the delivery completes. */ publishToAndWait(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined): void; /** * Publish a reply message and wait for completion (async version) * * This method publishes a reply to a received message and waits until the delivery completes. */ publishToAndWaitAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Publish a reply message (async version) * * Returns a completion handle that can be awaited to ensure the message was delivered. */ publishToAsync(messageContext: MessageContext, data: ArrayBuffer, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Low-level publish with full control over all parameters (blocking version for FFI) * * This is an advanced method that provides complete control over routing and delivery. * Most users should use `publish()` or `publish_to()` instead. * * # Arguments * * `destination` - Target name to send to * * `fanout` - Number of copies to send (for multicast) * * `data` - The message payload bytes * * `connection_out` - Optional specific connection ID to use * * `payload_type` - Optional content type identifier * * `metadata` - Optional key-value metadata pairs */ publishWithParams(destination: NameLike, fanout: number, data: ArrayBuffer, connectionOut: bigint | undefined, payloadType: string | undefined, metadata: Map | undefined): void; /** * Low-level publish with full control (async version) */ publishWithParamsAsync(destination: NameLike, fanout: number, data: ArrayBuffer, connectionOut: bigint | undefined, payloadType: string | undefined, metadata: Map | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Notify the group that this participant is back online (blocking version). * * Only valid for Group sessions; returns an error for PointToPoint sessions. * Returns a completion handle that resolves when ACKs/NACKs are collected. * If any participant NACKs due to an MLS epoch mismatch, the rejoin fails. */ rejoin(): CompletionHandleLike; /** * Notify the group that this participant is back online and wait for completion (blocking version). */ rejoinAndWait(): void; /** * Notify the group that this participant is back online and wait for completion (async version). */ rejoinAndWaitAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Notify the group that this participant is back online (async version). */ rejoinAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Remove a participant from the session (blocking version) * * Returns a completion handle that can be awaited to ensure the removal completes. */ remove(participant: NameLike): CompletionHandleLike; /** * Remove a participant and wait for completion (blocking version) * * This method removes a participant and blocks until the removal completes. */ removeAndWait(participant: NameLike): void; /** * Remove a participant and wait for completion (async version) * * This method removes a participant and waits until the removal completes. */ removeAndWaitAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Remove a participant from the session (async version) * * Returns a completion handle that can be awaited to ensure the removal completes. */ removeAsync(participant: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the session ID */ sessionId(): number; /** * Get the session type (PointToPoint or Group) */ sessionType(): SessionType; /** * Get the source name for this session */ source(): NameLike; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Session; } /** * Result of creating a session, containing the session context and a completion handle * * The completion handle should be awaited to ensure the session is fully established. */ export type SessionWithCompletion = { /** * The session context for performing operations */ session: SessionLike; /** * Completion handle to wait for session establishment */ completion: CompletionHandleLike; }; /** * Generated factory for {@link SessionWithCompletion} record objects. */ export declare const SessionWithCompletion: Readonly<{ create: (partial: Partial & Required>) => SessionWithCompletion; new: (partial: Partial & Required>) => SessionWithCompletion; defaults: () => Partial; }>; /** * Tracing/logging configuration for the SLIM bindings * * Controls logging behavior including log level, thread name/ID display, and filters. */ export type TracingConfig = { /** * Log level (e.g., "debug", "info", "warn", "error") */ logLevel: string; /** * Whether to display thread names in logs */ displayThreadNames: boolean; /** * Whether to display thread IDs in logs */ displayThreadIds: boolean; /** * List of tracing filter directives (e.g., ["slim=debug", "tokio=info"]) */ filters: Array; }; /** * Generated factory for {@link TracingConfig} record objects. */ export declare const TracingConfig: Readonly<{ create: (partial: Partial & Required>) => TracingConfig; new: (partial: Partial & Required>) => TracingConfig; defaults: () => Partial; }>; /** * Direction enum * Indicates whether the App can send, receive, both, or neither. */ export declare enum Direction { Send = 0, Recv = 1, Bidirectional = 2, None = 3 } export declare enum IdentityProviderConfig_Tags { SharedSecret = "SharedSecret", StaticJwt = "StaticJwt", Jwt = "Jwt", Spire = "Spire", None = "None" } /** * Identity provider configuration - used to prove identity to others */ export declare const IdentityProviderConfig: Readonly<{ instanceOf: (obj: any) => obj is IdentityProviderConfig; SharedSecret: { new (inner: { id: string; data: string; }): { readonly tag: IdentityProviderConfig_Tags.SharedSecret; readonly inner: Readonly<{ id: string; data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; "new"(inner: { id: string; data: string; }): { readonly tag: IdentityProviderConfig_Tags.SharedSecret; readonly inner: Readonly<{ id: string; data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityProviderConfig_Tags.SharedSecret; readonly inner: Readonly<{ id: string; data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; }; StaticJwt: { new (inner: { config: StaticJwtAuth; }): { readonly tag: IdentityProviderConfig_Tags.StaticJwt; readonly inner: Readonly<{ config: StaticJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; "new"(inner: { config: StaticJwtAuth; }): { readonly tag: IdentityProviderConfig_Tags.StaticJwt; readonly inner: Readonly<{ config: StaticJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityProviderConfig_Tags.StaticJwt; readonly inner: Readonly<{ config: StaticJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; }; Jwt: { new (inner: { config: ClientJwtAuth; }): { readonly tag: IdentityProviderConfig_Tags.Jwt; readonly inner: Readonly<{ config: ClientJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; "new"(inner: { config: ClientJwtAuth; }): { readonly tag: IdentityProviderConfig_Tags.Jwt; readonly inner: Readonly<{ config: ClientJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityProviderConfig_Tags.Jwt; readonly inner: Readonly<{ config: ClientJwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; }; Spire: { new (inner: { config: SpireConfig; }): { readonly tag: IdentityProviderConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; "new"(inner: { config: SpireConfig; }): { readonly tag: IdentityProviderConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityProviderConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; }; None: { new (): { readonly tag: IdentityProviderConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; "new"(): { readonly tag: IdentityProviderConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityProviderConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityProviderConfig"; }; }; }>; /** * Identity provider configuration - used to prove identity to others */ export type IdentityProviderConfig = InstanceType; export declare enum IdentityVerifierConfig_Tags { SharedSecret = "SharedSecret", Jwt = "Jwt", Spire = "Spire", None = "None" } /** * Identity verifier configuration - used to verify identity of others */ export declare const IdentityVerifierConfig: Readonly<{ instanceOf: (obj: any) => obj is IdentityVerifierConfig; SharedSecret: { new (inner: { id: string; data: string; }): { readonly tag: IdentityVerifierConfig_Tags.SharedSecret; readonly inner: Readonly<{ id: string; data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; "new"(inner: { id: string; data: string; }): { readonly tag: IdentityVerifierConfig_Tags.SharedSecret; readonly inner: Readonly<{ id: string; data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityVerifierConfig_Tags.SharedSecret; readonly inner: Readonly<{ id: string; data: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; }; Jwt: { new (inner: { config: JwtAuth; }): { readonly tag: IdentityVerifierConfig_Tags.Jwt; readonly inner: Readonly<{ config: JwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; "new"(inner: { config: JwtAuth; }): { readonly tag: IdentityVerifierConfig_Tags.Jwt; readonly inner: Readonly<{ config: JwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityVerifierConfig_Tags.Jwt; readonly inner: Readonly<{ config: JwtAuth; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; }; Spire: { new (inner: { config: SpireConfig; }): { readonly tag: IdentityVerifierConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; "new"(inner: { config: SpireConfig; }): { readonly tag: IdentityVerifierConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityVerifierConfig_Tags.Spire; readonly inner: Readonly<{ config: SpireConfig; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; }; None: { new (): { readonly tag: IdentityVerifierConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; "new"(): { readonly tag: IdentityVerifierConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; instanceOf(obj: any): obj is { readonly tag: IdentityVerifierConfig_Tags.None; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "IdentityVerifierConfig"; }; }; }>; /** * Identity verifier configuration - used to verify identity of others */ export type IdentityVerifierConfig = InstanceType; /** * Transport protocol for dataplane communication. */ export declare enum TransportProtocol { Grpc = 0, Websocket = 1 } /** * Adapter that bridges the App API with the language-bindings interface. * * Both native and browser builds wrap the same [`slim_service::app::App`] with * the same `AuthProvider`/`AuthVerifier` type parameters; the only structural * difference is the lifecycle owner: * * - Native keeps the owning [`slim_service::Service`] alive. * - Browser (wasm32) uses `AuthProvider::SharedSecret` identity and keeps the * WebSocket [`slim_datapath::message_processing::MessageProcessor`] alive * together with the upstream connection id. */ export interface AppLike { /** * Remove the explicit default gateway pin. */ clearDefaultGateway(): void; /** * Remove the explicit default gateway pin. */ clearDefaultGatewayAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new session (blocking version for FFI) * * Returns a SessionWithCompletion containing the session context and a completion handle. * Call `.wait()` on the completion handle to wait for session establishment. */ createSession(config: SessionConfig, destination: NameLike): SessionWithCompletion; /** * Create a new session and wait for completion (blocking version) * * This method creates a session and blocks until the session establishment completes. * Returns only the session context, as the completion has already been awaited. */ createSessionAndWait(config: SessionConfig, destination: NameLike): SessionLike; /** * Create a new session and wait for completion (async version) * * This method creates a session and waits until the session establishment completes. * Returns only the session context, as the completion has already been awaited. */ createSessionAndWaitAsync(config: SessionConfig, destination: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new session (async version) * * Returns a SessionWithCompletion containing the session context and a completion handle. * Await the completion handle to wait for session establishment. * For point-to-point sessions, this ensures the remote peer has acknowledged the session. * For multicast sessions, this ensures the initial setup is complete. */ createSessionAsync(config: SessionConfig, destination: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Delete a session (blocking version for FFI) * * Returns a completion handle that can be awaited to ensure the deletion completes. */ deleteSession(session: SessionLike): CompletionHandleLike; /** * Delete a session and wait for completion (blocking version) * * This method deletes a session and blocks until the deletion completes. */ deleteSessionAndWait(session: SessionLike): void; /** * Delete a session and wait for completion (async version) * * This method deletes a session and waits until the deletion completes. */ deleteSessionAndWaitAsync(session: SessionLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Delete a session (async version) * * Returns a completion handle that can be awaited to ensure the deletion completes. */ deleteSessionAsync(session: SessionLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the app ID in UUID format */ id(): string; /** * Listen for incoming sessions (blocking version for FFI) */ listenForSession(timeout: number | undefined): SessionLike; /** * Listen for incoming sessions (async version) */ listenForSessionAsync(timeout: number | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the app name */ name(): NameLike; /** * Remove a route (blocking version for FFI) */ removeRoute(name: NameLike, connectionId: bigint): void; /** * Remove a route (async version) */ removeRouteAsync(name: NameLike, connectionId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Blocking wrapper around [`App::restore_sessions_async`]. */ restoreSessions(connId: bigint): Array; /** * Restore the app's persisted sessions after a restart (async). * * Only meaningful for an app created with * [`crate::service::Service::create_app_with_persistence`]; returns an * empty list when persistence is disabled. `conn_id` must be the live * upstream connection to the node (the one the app subscribes over). * Each restored session rejoins its MLS group without repeating the * invite/welcome handshake. */ restoreSessionsAsync(connId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise>; /** * Pin an Edge connection as the default gateway for unrouted publishes. */ setDefaultGateway(connectionId: bigint): void; /** * Pin an Edge connection as the default gateway for unrouted publishes. */ setDefaultGatewayAsync(connectionId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Set a route to a name for a specific connection (blocking version for FFI) */ setRoute(name: NameLike, connectionId: bigint): void; /** * Set a route to a name for a specific connection (async version) */ setRouteAsync(name: NameLike, connectionId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Subscribe to a session name (blocking version for FFI) */ subscribe(name: NameLike, connectionId: bigint | undefined): void; /** * Subscribe to a name (async version) */ subscribeAsync(name: NameLike, connectionId: bigint | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Unsubscribe from a name (blocking version for FFI) */ unsubscribe(name: NameLike, connectionId: bigint | undefined): void; /** * Unsubscribe from a name (async version) */ unsubscribeAsync(name: NameLike, connectionId: bigint | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; } /** * @deprecated Use `AppLike` instead. */ export type AppInterface = AppLike; /** * Adapter that bridges the App API with the language-bindings interface. * * Both native and browser builds wrap the same [`slim_service::app::App`] with * the same `AuthProvider`/`AuthVerifier` type parameters; the only structural * difference is the lifecycle owner: * * - Native keeps the owning [`slim_service::Service`] alive. * - Browser (wasm32) uses `AuthProvider::SharedSecret` identity and keeps the * WebSocket [`slim_datapath::message_processing::MessageProcessor`] alive * together with the upstream connection id. */ export declare class App extends UniffiAbstractObject implements AppLike { readonly [uniffiTypeNameSymbol] = "App"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new App with identity provider and verifier configurations * * This is the main entry point for creating a SLIM application from language bindings. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails * * # Supported Identity Types * - SharedSecret: Symmetric key authentication * - JWT: Dynamic JWT generation/verification with signing/decoding keys * - StaticJWT: Static JWT loaded from file with auto-reload */ constructor(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig); /** * Create a new App with traffic direction (blocking version) * * This is a convenience function for creating a SLIM application with configurable * traffic direction (send-only, receive-only, bidirectional, or none). * * # Arguments * * `name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * `direction` - Traffic direction for sessions (Send, Recv, Bidirectional, or None) * * # Returns * * `Ok(Arc)` - Successfully created app * * `Err(SlimError)` - If app creation fails */ static newWithDirection(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): AppLike; /** * Create a new App with SharedSecret authentication (blocking version) * * This is a convenience function for creating a SLIM application using SharedSecret authentication. * * # Arguments * * `name` - The base name for the app (without ID) * * `secret` - The shared secret string for authentication * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ static newWithSecret(name: NameLike, secret: string): AppLike; /** * Remove the explicit default gateway pin. */ clearDefaultGateway(): void; /** * Remove the explicit default gateway pin. */ clearDefaultGatewayAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new session (blocking version for FFI) * * Returns a SessionWithCompletion containing the session context and a completion handle. * Call `.wait()` on the completion handle to wait for session establishment. */ createSession(config: SessionConfig, destination: NameLike): SessionWithCompletion; /** * Create a new session and wait for completion (blocking version) * * This method creates a session and blocks until the session establishment completes. * Returns only the session context, as the completion has already been awaited. */ createSessionAndWait(config: SessionConfig, destination: NameLike): SessionLike; /** * Create a new session and wait for completion (async version) * * This method creates a session and waits until the session establishment completes. * Returns only the session context, as the completion has already been awaited. */ createSessionAndWaitAsync(config: SessionConfig, destination: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new session (async version) * * Returns a SessionWithCompletion containing the session context and a completion handle. * Await the completion handle to wait for session establishment. * For point-to-point sessions, this ensures the remote peer has acknowledged the session. * For multicast sessions, this ensures the initial setup is complete. */ createSessionAsync(config: SessionConfig, destination: NameLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Delete a session (blocking version for FFI) * * Returns a completion handle that can be awaited to ensure the deletion completes. */ deleteSession(session: SessionLike): CompletionHandleLike; /** * Delete a session and wait for completion (blocking version) * * This method deletes a session and blocks until the deletion completes. */ deleteSessionAndWait(session: SessionLike): void; /** * Delete a session and wait for completion (async version) * * This method deletes a session and waits until the deletion completes. */ deleteSessionAndWaitAsync(session: SessionLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Delete a session (async version) * * Returns a completion handle that can be awaited to ensure the deletion completes. */ deleteSessionAsync(session: SessionLike, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the app ID in UUID format */ id(): string; /** * Listen for incoming sessions (blocking version for FFI) */ listenForSession(timeout: number | undefined): SessionLike; /** * Listen for incoming sessions (async version) */ listenForSessionAsync(timeout: number | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Get the app name */ name(): NameLike; /** * Remove a route (blocking version for FFI) */ removeRoute(name: NameLike, connectionId: bigint): void; /** * Remove a route (async version) */ removeRouteAsync(name: NameLike, connectionId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Blocking wrapper around [`App::restore_sessions_async`]. */ restoreSessions(connId: bigint): Array; /** * Restore the app's persisted sessions after a restart (async). * * Only meaningful for an app created with * [`crate::service::Service::create_app_with_persistence`]; returns an * empty list when persistence is disabled. `conn_id` must be the live * upstream connection to the node (the one the app subscribes over). * Each restored session rejoins its MLS group without repeating the * invite/welcome handshake. */ restoreSessionsAsync(connId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise>; /** * Pin an Edge connection as the default gateway for unrouted publishes. */ setDefaultGateway(connectionId: bigint): void; /** * Pin an Edge connection as the default gateway for unrouted publishes. */ setDefaultGatewayAsync(connectionId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Set a route to a name for a specific connection (blocking version for FFI) */ setRoute(name: NameLike, connectionId: bigint): void; /** * Set a route to a name for a specific connection (async version) */ setRouteAsync(name: NameLike, connectionId: bigint, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Subscribe to a session name (blocking version for FFI) */ subscribe(name: NameLike, connectionId: bigint | undefined): void; /** * Subscribe to a name (async version) */ subscribeAsync(name: NameLike, connectionId: bigint | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Unsubscribe from a name (blocking version for FFI) */ unsubscribe(name: NameLike, connectionId: bigint | undefined): void; /** * Unsubscribe from a name (async version) */ unsubscribeAsync(name: NameLike, connectionId: bigint | undefined, asyncOpts_?: { signal: AbortSignal; }): Promise; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is App; } /** * Service wrapper for uniffi bindings */ export interface ServiceLike { /** * Get the service configuration */ config(): ServiceConfig; /** * Connect to a remote endpoint as a client - blocking version */ connect(config: ClientConfig): bigint; /** * Connect to a remote endpoint as a client */ connectAsync(config: ClientConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new App with authentication configuration (blocking version) * * This method initializes authentication providers/verifiers and creates a App * on this service instance. This is a blocking wrapper around create_app_async. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createApp(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig): AppLike; /** * Create a new App with authentication configuration (async version) * * This method initializes authentication providers/verifiers and creates a App * on this service instance. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createAppAsync(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new App with authentication configuration and traffic direction (blocking version) * * This method initializes authentication providers/verifiers and creates an App * on this service instance. The direction parameter controls whether the app * can send messages, receive messages, both, or neither. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createAppWithDirection(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): AppLike; /** * Create a new App with authentication configuration and traffic direction (async version) * * This method initializes authentication providers/verifiers and creates an App * on this service instance. The direction parameter controls whether the app * can send messages, receive messages, both, or neither. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createAppWithDirectionAsync(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Blocking wrapper around [`Service::create_app_with_persistence_async`]. */ createAppWithPersistence(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, persistence: PersistenceConfig): AppLike; /** * Create an app with restorable MLS/session state persisted under * `persistence.path` (async). * * Mirror of [`Service::create_app_with_direction_async`] with persistence * enabled. Restore the app's sessions after a restart with * [`App::restore_sessions`]. */ createAppWithPersistenceAsync(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, persistence: PersistenceConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new App with SharedSecret authentication (helper function) * * This is a convenience function for creating a SLIM application using SharedSecret authentication * on this service instance. * * # Arguments * * `name` - The base name for the app (without ID) * * `secret` - The shared secret string for authentication * * # Returns * * `Ok(Arc)` - Successfully created app * * `Err(SlimError)` - If app creation fails */ createAppWithSecret(name: NameLike, secret: string): AppLike; /** * Create a new App with SharedSecret authentication (async version) * * This is a convenience function for creating a SLIM application using SharedSecret authentication * on this service instance. This is the async version. * * # Arguments * * `name` - The base name for the app (without ID) * * `secret` - The shared secret string for authentication * * # Returns * * `Ok(Arc)` - Successfully created app * * `Err(SlimError)` - If app creation fails */ createAppWithSecretAsync(name: NameLike, secret: string, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Disconnect a client connection by connection ID - blocking version */ disconnect(connId: bigint): void; /** * Get the connection ID for a given endpoint */ getConnectionId(endpoint: string): bigint | undefined; /** * Get the service identifier/name */ getName(): string; /** * Run the service (starts all configured servers and clients) - blocking version */ run(): void; /** * Run the service (starts all configured servers and clients) */ runAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Start a server with the given configuration - blocking version */ runServer(config: ServerConfig): void; /** * Start a server with the given configuration */ runServerAsync(config: ServerConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Shutdown the service gracefully - blocking version */ shutdown(): void; /** * Shutdown the service gracefully */ shutdownAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Stop a server by endpoint - blocking version */ stopServer(endpoint: string): void; } /** * @deprecated Use `ServiceLike` instead. */ export type ServiceInterface = ServiceLike; /** * Service wrapper for uniffi bindings */ export declare class Service extends UniffiAbstractObject implements ServiceLike { readonly [uniffiTypeNameSymbol] = "Service"; readonly [destructorGuardSymbol]: UniffiGcObject; readonly [pointerLiteralSymbol]: UniffiHandle; /** * Create a new Service with the given name */ constructor(name: string); /** * Create a new Service with configuration */ static newWithConfig(name: string, config: ServiceConfig): ServiceLike; /** * Get the service configuration */ config(): ServiceConfig; /** * Connect to a remote endpoint as a client - blocking version */ connect(config: ClientConfig): bigint; /** * Connect to a remote endpoint as a client */ connectAsync(config: ClientConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new App with authentication configuration (blocking version) * * This method initializes authentication providers/verifiers and creates a App * on this service instance. This is a blocking wrapper around create_app_async. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createApp(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig): AppLike; /** * Create a new App with authentication configuration (async version) * * This method initializes authentication providers/verifiers and creates a App * on this service instance. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createAppAsync(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new App with authentication configuration and traffic direction (blocking version) * * This method initializes authentication providers/verifiers and creates an App * on this service instance. The direction parameter controls whether the app * can send messages, receive messages, both, or neither. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createAppWithDirection(baseName: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction): AppLike; /** * Create a new App with authentication configuration and traffic direction (async version) * * This method initializes authentication providers/verifiers and creates an App * on this service instance. The direction parameter controls whether the app * can send messages, receive messages, both, or neither. * * # Arguments * * `base_name` - The base name for the app (without ID) * * `identity_provider_config` - Configuration for proving identity to others * * `identity_verifier_config` - Configuration for verifying identity of others * * `direction` - Traffic direction: Send, Recv, Bidirectional, or None * * # Returns * * `Ok(Arc)` - Successfully created adapter * * `Err(SlimError)` - If adapter creation fails */ createAppWithDirectionAsync(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Blocking wrapper around [`Service::create_app_with_persistence_async`]. */ createAppWithPersistence(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, persistence: PersistenceConfig): AppLike; /** * Create an app with restorable MLS/session state persisted under * `persistence.path` (async). * * Mirror of [`Service::create_app_with_direction_async`] with persistence * enabled. Restore the app's sessions after a restart with * [`App::restore_sessions`]. */ createAppWithPersistenceAsync(name: NameLike, identityProviderConfig: IdentityProviderConfig, identityVerifierConfig: IdentityVerifierConfig, direction: Direction, persistence: PersistenceConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Create a new App with SharedSecret authentication (helper function) * * This is a convenience function for creating a SLIM application using SharedSecret authentication * on this service instance. * * # Arguments * * `name` - The base name for the app (without ID) * * `secret` - The shared secret string for authentication * * # Returns * * `Ok(Arc)` - Successfully created app * * `Err(SlimError)` - If app creation fails */ createAppWithSecret(name: NameLike, secret: string): AppLike; /** * Create a new App with SharedSecret authentication (async version) * * This is a convenience function for creating a SLIM application using SharedSecret authentication * on this service instance. This is the async version. * * # Arguments * * `name` - The base name for the app (without ID) * * `secret` - The shared secret string for authentication * * # Returns * * `Ok(Arc)` - Successfully created app * * `Err(SlimError)` - If app creation fails */ createAppWithSecretAsync(name: NameLike, secret: string, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Disconnect a client connection by connection ID - blocking version */ disconnect(connId: bigint): void; /** * Get the connection ID for a given endpoint */ getConnectionId(endpoint: string): bigint | undefined; /** * Get the service identifier/name */ getName(): string; /** * Run the service (starts all configured servers and clients) - blocking version */ run(): void; /** * Run the service (starts all configured servers and clients) */ runAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Start a server with the given configuration - blocking version */ runServer(config: ServerConfig): void; /** * Start a server with the given configuration */ runServerAsync(config: ServerConfig, asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Shutdown the service gracefully - blocking version */ shutdown(): void; /** * Shutdown the service gracefully */ shutdownAsync(asyncOpts_?: { signal: AbortSignal; }): Promise; /** * Stop a server by endpoint - blocking version */ stopServer(endpoint: string): void; uniffiDestroy(): void; static instanceOf(obj_: any): obj_ is Service; } /** * This should be called before anything else. * * It is likely that this is being done for you by the library's `index.ts`. * * It checks versions of uniffi between when the Rust scaffolding was generated * and when the bindings were generated. * * It also initializes the machinery to enable Rust to talk back to Javascript. */ declare function uniffiEnsureInitialized(): void; declare const _default: Readonly<{ initialize: typeof uniffiEnsureInitialized; converters: { FfiConverterTypeApp: FfiConverterObject; FfiConverterTypeBackoffConfig: { read(from: RustBuffer): BackoffConfig; write(value: BackoffConfig, into: RustBuffer): void; allocationSize(value: BackoffConfig): number; lift(value: UniffiByteArray): BackoffConfig; lower(value: BackoffConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeBasicAuth: { read(from: RustBuffer): BasicAuth; write(value: BasicAuth, into: RustBuffer): void; allocationSize(value: BasicAuth): number; lift(value: UniffiByteArray): BasicAuth; lower(value: BasicAuth, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeBuildInfo: { read(from: RustBuffer): BuildInfo; write(value: BuildInfo, into: RustBuffer): void; allocationSize(value: BuildInfo): number; lift(value: UniffiByteArray): BuildInfo; lower(value: BuildInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeCaSource: { read(from: RustBuffer): CaSource; write(value: CaSource, into: RustBuffer): void; allocationSize(value: CaSource): number; lift(value: UniffiByteArray): CaSource; lower(value: CaSource, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeClientAuthenticationConfig: { read(from: RustBuffer): ClientAuthenticationConfig; write(value: ClientAuthenticationConfig, into: RustBuffer): void; allocationSize(value: ClientAuthenticationConfig): number; lift(value: UniffiByteArray): ClientAuthenticationConfig; lower(value: ClientAuthenticationConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeClientConfig: { read(from: RustBuffer): ClientConfig; write(value: ClientConfig, into: RustBuffer): void; allocationSize(value: ClientConfig): number; lift(value: UniffiByteArray): ClientConfig; lower(value: ClientConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeClientJwtAuth: { read(from: RustBuffer): ClientJwtAuth; write(value: ClientJwtAuth, into: RustBuffer): void; allocationSize(value: ClientJwtAuth): number; lift(value: UniffiByteArray): ClientJwtAuth; lower(value: ClientJwtAuth, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeCloseMode: { read(from: RustBuffer): CloseMode; write(value: CloseMode, into: RustBuffer): void; allocationSize(value: CloseMode): number; lift(value: UniffiByteArray): CloseMode; lower(value: CloseMode, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeCompletionHandle: FfiConverterObject; FfiConverterTypeCompressionType: { read(from: RustBuffer): CompressionType; write(value: CompressionType, into: RustBuffer): void; allocationSize(value: CompressionType): number; lift(value: UniffiByteArray): CompressionType; lower(value: CompressionType, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeDataplaneConfig: { read(from: RustBuffer): DataplaneConfig; write(value: DataplaneConfig, into: RustBuffer): void; allocationSize(value: DataplaneConfig): number; lift(value: UniffiByteArray): DataplaneConfig; lower(value: DataplaneConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeDirection: { read(from: RustBuffer): Direction; write(value: Direction, into: RustBuffer): void; allocationSize(value: Direction): number; lift(value: UniffiByteArray): Direction; lower(value: Direction, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeExponentialBackoff: { read(from: RustBuffer): ExponentialBackoff; write(value: ExponentialBackoff, into: RustBuffer): void; allocationSize(value: ExponentialBackoff): number; lift(value: UniffiByteArray): ExponentialBackoff; lower(value: ExponentialBackoff, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeFixedIntervalBackoff: { read(from: RustBuffer): FixedIntervalBackoff; write(value: FixedIntervalBackoff, into: RustBuffer): void; allocationSize(value: FixedIntervalBackoff): number; lift(value: UniffiByteArray): FixedIntervalBackoff; lower(value: FixedIntervalBackoff, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeIdentityProviderConfig: { read(from: RustBuffer): IdentityProviderConfig; write(value: IdentityProviderConfig, into: RustBuffer): void; allocationSize(value: IdentityProviderConfig): number; lift(value: UniffiByteArray): IdentityProviderConfig; lower(value: IdentityProviderConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeIdentityVerifierConfig: { read(from: RustBuffer): IdentityVerifierConfig; write(value: IdentityVerifierConfig, into: RustBuffer): void; allocationSize(value: IdentityVerifierConfig): number; lift(value: UniffiByteArray): IdentityVerifierConfig; lower(value: IdentityVerifierConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeJwtAlgorithm: { read(from: RustBuffer): JwtAlgorithm; write(value: JwtAlgorithm, into: RustBuffer): void; allocationSize(value: JwtAlgorithm): number; lift(value: UniffiByteArray): JwtAlgorithm; lower(value: JwtAlgorithm, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeJwtAuth: { read(from: RustBuffer): JwtAuth; write(value: JwtAuth, into: RustBuffer): void; allocationSize(value: JwtAuth): number; lift(value: UniffiByteArray): JwtAuth; lower(value: JwtAuth, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeJwtKeyConfig: { read(from: RustBuffer): JwtKeyConfig; write(value: JwtKeyConfig, into: RustBuffer): void; allocationSize(value: JwtKeyConfig): number; lift(value: UniffiByteArray): JwtKeyConfig; lower(value: JwtKeyConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeJwtKeyData: { read(from: RustBuffer): JwtKeyData; write(value: JwtKeyData, into: RustBuffer): void; allocationSize(value: JwtKeyData): number; lift(value: UniffiByteArray): JwtKeyData; lower(value: JwtKeyData, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeJwtKeyFormat: { read(from: RustBuffer): JwtKeyFormat; write(value: JwtKeyFormat, into: RustBuffer): void; allocationSize(value: JwtKeyFormat): number; lift(value: UniffiByteArray): JwtKeyFormat; lower(value: JwtKeyFormat, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeJwtKeyType: { read(from: RustBuffer): JwtKeyType; write(value: JwtKeyType, into: RustBuffer): void; allocationSize(value: JwtKeyType): number; lift(value: UniffiByteArray): JwtKeyType; lower(value: JwtKeyType, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeKeepaliveConfig: { read(from: RustBuffer): KeepaliveConfig; write(value: KeepaliveConfig, into: RustBuffer): void; allocationSize(value: KeepaliveConfig): number; lift(value: UniffiByteArray): KeepaliveConfig; lower(value: KeepaliveConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeKeepaliveServerParameters: { read(from: RustBuffer): KeepaliveServerParameters; write(value: KeepaliveServerParameters, into: RustBuffer): void; allocationSize(value: KeepaliveServerParameters): number; lift(value: UniffiByteArray): KeepaliveServerParameters; lower(value: KeepaliveServerParameters, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeMessageContext: { read(from: RustBuffer): MessageContext; write(value: MessageContext, into: RustBuffer): void; allocationSize(value: MessageContext): number; lift(value: UniffiByteArray): MessageContext; lower(value: MessageContext, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeMlsSettings: { read(from: RustBuffer): MlsSettings; write(value: MlsSettings, into: RustBuffer): void; allocationSize(value: MlsSettings): number; lift(value: UniffiByteArray): MlsSettings; lower(value: MlsSettings, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeName: FfiConverterObject; FfiConverterTypeOidcConfig: { read(from: RustBuffer): OidcConfig; write(value: OidcConfig, into: RustBuffer): void; allocationSize(value: OidcConfig): number; lift(value: UniffiByteArray): OidcConfig; lower(value: OidcConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeOidcPolicyConfig: { read(from: RustBuffer): OidcPolicyConfig; write(value: OidcPolicyConfig, into: RustBuffer): void; allocationSize(value: OidcPolicyConfig): number; lift(value: UniffiByteArray): OidcPolicyConfig; lower(value: OidcPolicyConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeParticipantInfo: { read(from: RustBuffer): ParticipantInfo; write(value: ParticipantInfo, into: RustBuffer): void; allocationSize(value: ParticipantInfo): number; lift(value: UniffiByteArray): ParticipantInfo; lower(value: ParticipantInfo, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeParticipantStatus: { read(from: RustBuffer): ParticipantStatus; write(value: ParticipantStatus, into: RustBuffer): void; allocationSize(value: ParticipantStatus): number; lift(value: UniffiByteArray): ParticipantStatus; lower(value: ParticipantStatus, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypePersistenceConfig: { read(from: RustBuffer): PersistenceConfig; write(value: PersistenceConfig, into: RustBuffer): void; allocationSize(value: PersistenceConfig): number; lift(value: UniffiByteArray): PersistenceConfig; lower(value: PersistenceConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeProxyConfig: { read(from: RustBuffer): ProxyConfig; write(value: ProxyConfig, into: RustBuffer): void; allocationSize(value: ProxyConfig): number; lift(value: UniffiByteArray): ProxyConfig; lower(value: ProxyConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeReceivedMessage: { read(from: RustBuffer): ReceivedMessage; write(value: ReceivedMessage, into: RustBuffer): void; allocationSize(value: ReceivedMessage): number; lift(value: UniffiByteArray): ReceivedMessage; lower(value: ReceivedMessage, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeRuntimeConfig: { read(from: RustBuffer): RuntimeConfig; write(value: RuntimeConfig, into: RustBuffer): void; allocationSize(value: RuntimeConfig): number; lift(value: UniffiByteArray): RuntimeConfig; lower(value: RuntimeConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeServerAuthenticationConfig: { read(from: RustBuffer): ServerAuthenticationConfig; write(value: ServerAuthenticationConfig, into: RustBuffer): void; allocationSize(value: ServerAuthenticationConfig): number; lift(value: UniffiByteArray): ServerAuthenticationConfig; lower(value: ServerAuthenticationConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeServerConfig: { read(from: RustBuffer): ServerConfig; write(value: ServerConfig, into: RustBuffer): void; allocationSize(value: ServerConfig): number; lift(value: UniffiByteArray): ServerConfig; lower(value: ServerConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeService: FfiConverterObject; FfiConverterTypeServiceConfig: { read(from: RustBuffer): ServiceConfig; write(value: ServiceConfig, into: RustBuffer): void; allocationSize(value: ServiceConfig): number; lift(value: UniffiByteArray): ServiceConfig; lower(value: ServiceConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSession: FfiConverterObject; FfiConverterTypeSessionConfig: { read(from: RustBuffer): SessionConfig; write(value: SessionConfig, into: RustBuffer): void; allocationSize(value: SessionConfig): number; lift(value: UniffiByteArray): SessionConfig; lower(value: SessionConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSessionType: { read(from: RustBuffer): SessionType; write(value: SessionType, into: RustBuffer): void; allocationSize(value: SessionType): number; lift(value: UniffiByteArray): SessionType; lower(value: SessionType, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSessionWithCompletion: { read(from: RustBuffer): SessionWithCompletion; write(value: SessionWithCompletion, into: RustBuffer): void; allocationSize(value: SessionWithCompletion): number; lift(value: UniffiByteArray): SessionWithCompletion; lower(value: SessionWithCompletion, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSlimError: { read(from: RustBuffer): SlimError; write(value: SlimError, into: RustBuffer): void; allocationSize(value: SlimError): number; lift(value: UniffiByteArray): SlimError; lower(value: SlimError, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeSpireConfig: { read(from: RustBuffer): SpireConfig; write(value: SpireConfig, into: RustBuffer): void; allocationSize(value: SpireConfig): number; lift(value: UniffiByteArray): SpireConfig; lower(value: SpireConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeStaticJwtAuth: { read(from: RustBuffer): StaticJwtAuth; write(value: StaticJwtAuth, into: RustBuffer): void; allocationSize(value: StaticJwtAuth): number; lift(value: UniffiByteArray): StaticJwtAuth; lower(value: StaticJwtAuth, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeTlsClientConfig: { read(from: RustBuffer): TlsClientConfig; write(value: TlsClientConfig, into: RustBuffer): void; allocationSize(value: TlsClientConfig): number; lift(value: UniffiByteArray): TlsClientConfig; lower(value: TlsClientConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeTlsServerConfig: { read(from: RustBuffer): TlsServerConfig; write(value: TlsServerConfig, into: RustBuffer): void; allocationSize(value: TlsServerConfig): number; lift(value: UniffiByteArray): TlsServerConfig; lower(value: TlsServerConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeTlsSource: { read(from: RustBuffer): TlsSource; write(value: TlsSource, into: RustBuffer): void; allocationSize(value: TlsSource): number; lift(value: UniffiByteArray): TlsSource; lower(value: TlsSource, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeTracingConfig: { read(from: RustBuffer): TracingConfig; write(value: TracingConfig, into: RustBuffer): void; allocationSize(value: TracingConfig): number; lift(value: UniffiByteArray): TracingConfig; lower(value: TracingConfig, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; FfiConverterTypeTransportProtocol: { read(from: RustBuffer): TransportProtocol; write(value: TransportProtocol, into: RustBuffer): void; allocationSize(value: TransportProtocol): number; lift(value: UniffiByteArray): TransportProtocol; lower(value: TransportProtocol, alloc: import("@ubjs/core").RustBufferAllocator): UniffiByteArray; }; }; }>; export default _default;