Other Type Aliases
The following type aliases are available globally.
-
DittoAuthenticationExpirationHandlerAsynchronousA closure type that handles authentication expiration events for Ditto.
Important
This API is in preview and provides a modern, Swift-native alternative to the phased outDittoAuthenticationDelegateprotocol in v5.This handler is called when the authentication for a Ditto instance has or is about to expire, or if authentication has not yet occurred. It provides the relevant
Dittoinstance and the time interval (in seconds) until expiration. You can use this to login or to perform other necessary actions before authentication expires.Important
When using server connections (
server(url:)), you must set an expiration handler viaexpirationHandler. Otherwisestart()will throwDittoSwiftError/authenticationError(_:)withAuthenticationErrorReason/expirationHandlerMissing(message:)reason.Declaration
Swift
public typealias DittoAuthenticationExpirationHandler = (_ ditto: Ditto, _ timeUntilExpiration: TimeInterval) async -> VoidParameters
dittoThe
Dittoinstance whose authentication is expiring.timeUntilExpirationThe time interval, in seconds, until authentication expires.
-
DittoConnectionRequestHandlerAsynchronousA handler for connection requests from other peers.
Set a
DittoConnectionRequestHandleronDittoPresence.connectionRequestHandler()to allow or deny connection requests from other peers.Declaration
Swift
public typealias DittoConnectionRequestHandler = (_ connectionRequest: DittoConnectionRequest) async -> DittoConnectionRequestAuthorizationParameters
connectionRequestContains information about the remote peer that can be used to make an authorization decision.
Return Value
.allowif the request should be authorized,.denyotherwise. -
Undocumented
Declaration
Swift
public typealias DittoSwiftError = DittoError -
Undocumented
Declaration
Swift
public typealias DittoSignalNext = () -> Void -
A store observation handler is called whenever an active store observer receives a new query result.
Declaration
Swift
public typealias DittoStoreObservationHandler = (_ result: DittoQueryResult) -> Void -
A store observation handler is called whenever an active store observer receives a new query result.
Call
signalNext()to signal that the handler is ready to receive the next callback from the store observer.Declaration
Swift
public typealias DittoStoreObservationHandlerWithSignalNext = (_ result: DittoQueryResult, _ signalNext: @escaping DittoSignalNext) -> Void
Other Type Aliases Reference