Type Aliases
The following type aliases are available globally.
-
Type for mock delay randomizer.
Declaration
Swift
public typealias MockDelayRange = (min: TimeInterval, max: TimeInterval)Parameters
minThe lower bound of interval.
maxThe upper bound of interval.
-
Hook type for beforeAllRequestsCallback queue property
Declaration
Swift
public typealias BeforeQueueStartCallbackType = () -> Void -
Hook type for afterAllRequestsCallback queue property
Declaration
Swift
public typealias AfterAllRequestsCallbackType = (_ hasError: Bool) -> VoidParameters
hasErrorPasses a Boolean value which indicates if any of the request in queue has completed with error.
-
Hook type for beforeEachRequestCallback queue property
Declaration
Swift
public typealias BeforeEachRequestCallbackType = (_ request: Request) -> VoidParameters
requestThe actual Request instance.
-
Hook type for afterEachRequestCallback queue property
Declaration
Swift
public typealias AfterEachRequestCallbackType = ( _ request: Request, _ data: Data?, _ response: URLResponse?, _ error: Error?) -> VoidParameters
requestThe actual Request instance.
dataThe response data
responseThe URLResponse
errorThe network error (if any)
-
Type for reachability monitoring updates
Declaration
Swift
public typealias ReachabilityUpdateClosureType = (_ status: ReachabilityState) -> VoidParameters
statusThe new network state.
-
The Image type depending on platform: UIImage for iOS or NSImage for macOS.
Declaration
Swift
public typealias ImageType = NSImage -
The Image type depending on platform: UIImage for iOS or NSImage for macOS.
-
Progress callback type
Declaration
Swift
public typealias ProgressCallbackType = (_ bytesProcessed: Int, _ totalBytes: Int, _ progress: Float) -> VoidParameters
bytesProcessedThe total size of bytes sent/downloaded to/from server.
totalBytesThe total size of upload/download data.
progressDownload/Upload progress
-
Custom type for success data task.
Declaration
Swift
public typealias SuccessCallback<T> = (_ object: T) -> VoidParameters
objectThe object to be returned as T type.
-
Custom type for success data task without type.
Declaration
Swift
public typealias SuccessCallbackWithoutType = () -> Void -
Custom type for download success data task.
Declaration
Swift
public typealias DownloadSuccessCallback = () -> Void -
Custom type for failure data task. Failure callback (Obsolete).
Declaration
Swift
public typealias FailureCallback = (_ error: TNError, _ data: Data?) -> VoidParameters
errorThe the error that caused the request to fail.
dataThe response data if any.
-
Custom type for failure data task without type.
Declaration
Swift
public typealias FailureCallbackWithoutType = (TNError) -> VoidParameters
errorThe the error that caused the request to fail.
-
Custom type for failure data task with custom type.
Declaration
Swift
public typealias FailureCallbackWithType<T> = (_ object: T?, _ error: TNError) -> VoidParameters
objectThe object to be returned as T type.
errorThe the error that caused the request to fail.
View on GitHub
Install in Dash
Type Aliases Reference