|
| 1 | +// swift-interface-format-version: 1.0 |
| 2 | +// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15) |
| 3 | +// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream |
| 4 | +import CommonCrypto |
| 5 | +import CoreFoundation |
| 6 | +import Foundation |
| 7 | +import Security |
| 8 | +@_exported import Starscream |
| 9 | +import Swift |
| 10 | +import zlib |
| 11 | +public let WebsocketDidConnectNotification: Swift.String |
| 12 | +public let WebsocketDidDisconnectNotification: Swift.String |
| 13 | +public let WebsocketDisconnectionErrorKeyName: Swift.String |
| 14 | +public enum CloseCode : Swift.UInt16 { |
| 15 | + case normal |
| 16 | + case goingAway |
| 17 | + case protocolError |
| 18 | + case protocolUnhandledType |
| 19 | + case noStatusReceived |
| 20 | + case encoding |
| 21 | + case policyViolated |
| 22 | + case messageTooBig |
| 23 | + public typealias RawValue = Swift.UInt16 |
| 24 | + public init?(rawValue: Swift.UInt16) |
| 25 | + public var rawValue: Swift.UInt16 { |
| 26 | + get |
| 27 | + } |
| 28 | +} |
| 29 | +public enum ErrorType : Swift.Error { |
| 30 | + case outputStreamWriteError |
| 31 | + case compressionError |
| 32 | + case invalidSSLError |
| 33 | + case writeTimeoutError |
| 34 | + case protocolError |
| 35 | + case upgradeError |
| 36 | + case closeError |
| 37 | + public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool |
| 38 | + public var hashValue: Swift.Int { |
| 39 | + get |
| 40 | + } |
| 41 | + public func hash(into hasher: inout Swift.Hasher) |
| 42 | +} |
| 43 | +public struct WSError : Swift.Error { |
| 44 | + public let type: Starscream.ErrorType |
| 45 | + public let message: Swift.String |
| 46 | + public let code: Swift.Int |
| 47 | +} |
| 48 | +public protocol WebSocketClient : AnyObject { |
| 49 | + var delegate: Starscream.WebSocketDelegate? { get set } |
| 50 | + var pongDelegate: Starscream.WebSocketPongDelegate? { get set } |
| 51 | + var disableSSLCertValidation: Swift.Bool { get set } |
| 52 | + var overrideTrustHostname: Swift.Bool { get set } |
| 53 | + var desiredTrustHostname: Swift.String? { get set } |
| 54 | + var sslClientCertificate: Starscream.SSLClientCertificate? { get set } |
| 55 | + var security: Starscream.SSLTrustValidator? { get set } |
| 56 | + var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set } |
| 57 | + var isConnected: Swift.Bool { get } |
| 58 | + func connect() |
| 59 | + func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16) |
| 60 | + func write(string: Swift.String, completion: (() -> ())?) |
| 61 | + func write(data: Foundation.Data, completion: (() -> ())?) |
| 62 | + func write(ping: Foundation.Data, completion: (() -> ())?) |
| 63 | + func write(pong: Foundation.Data, completion: (() -> ())?) |
| 64 | +} |
| 65 | +extension WebSocketClient { |
| 66 | + public func write(string: Swift.String) |
| 67 | + public func write(data: Foundation.Data) |
| 68 | + public func write(ping: Foundation.Data) |
| 69 | + public func write(pong: Foundation.Data) |
| 70 | + public func disconnect() |
| 71 | +} |
| 72 | +public struct SSLSettings { |
| 73 | + public let useSSL: Swift.Bool |
| 74 | + public let disableCertValidation: Swift.Bool |
| 75 | + public var overrideTrustHostname: Swift.Bool |
| 76 | + public var desiredTrustHostname: Swift.String? |
| 77 | + public let sslClientCertificate: Starscream.SSLClientCertificate? |
| 78 | + public let cipherSuites: [Security.SSLCipherSuite]? |
| 79 | +} |
| 80 | +public protocol WSStreamDelegate : AnyObject { |
| 81 | + func newBytesInStream() |
| 82 | + func streamDidError(error: Swift.Error?) |
| 83 | +} |
| 84 | +public protocol WSStream { |
| 85 | + var delegate: Starscream.WSStreamDelegate? { get set } |
| 86 | + func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void)) |
| 87 | + func write(data: Foundation.Data) -> Swift.Int |
| 88 | + func read() -> Foundation.Data? |
| 89 | + func cleanup() |
| 90 | + func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?) |
| 91 | +} |
| 92 | +@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate { |
| 93 | + weak public var delegate: Starscream.WSStreamDelegate? |
| 94 | + public var enableSOCKSProxy: Swift.Bool |
| 95 | + public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void)) |
| 96 | + public func write(data: Foundation.Data) -> Swift.Int |
| 97 | + public func read() -> Foundation.Data? |
| 98 | + public func cleanup() |
| 99 | + public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?) |
| 100 | + @objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event) |
| 101 | + @objc override dynamic public init() |
| 102 | + @objc deinit |
| 103 | +} |
| 104 | +public protocol WebSocketDelegate : AnyObject { |
| 105 | + func websocketDidConnect(socket: Starscream.WebSocketClient) |
| 106 | + func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?) |
| 107 | + func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String) |
| 108 | + func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data) |
| 109 | +} |
| 110 | +public protocol WebSocketPongDelegate : AnyObject { |
| 111 | + func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?) |
| 112 | +} |
| 113 | +public protocol WebSocketAdvancedDelegate : AnyObject { |
| 114 | + func websocketDidConnect(socket: Starscream.WebSocket) |
| 115 | + func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?) |
| 116 | + func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse) |
| 117 | + func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse) |
| 118 | + func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String) |
| 119 | + func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String) |
| 120 | +} |
| 121 | +@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate { |
| 122 | + public enum OpCode : Swift.UInt8 { |
| 123 | + case continueFrame |
| 124 | + case textFrame |
| 125 | + case binaryFrame |
| 126 | + case connectionClose |
| 127 | + case ping |
| 128 | + case pong |
| 129 | + public typealias RawValue = Swift.UInt8 |
| 130 | + public init?(rawValue: Swift.UInt8) |
| 131 | + public var rawValue: Swift.UInt8 { |
| 132 | + get |
| 133 | + } |
| 134 | + } |
| 135 | + public static let ErrorDomain: Swift.String |
| 136 | + public var callbackQueue: Dispatch.DispatchQueue |
| 137 | + public class WSResponse { |
| 138 | + public var code: Starscream.WebSocket.OpCode |
| 139 | + public var frameCount: Swift.Int |
| 140 | + public var buffer: Foundation.NSMutableData? |
| 141 | + final public let firstFrame: Foundation.Date |
| 142 | + @objc deinit |
| 143 | + } |
| 144 | + weak public var delegate: Starscream.WebSocketDelegate? |
| 145 | + weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate? |
| 146 | + weak public var pongDelegate: Starscream.WebSocketPongDelegate? |
| 147 | + public var onConnect: (() -> Swift.Void)? |
| 148 | + public var onDisconnect: ((Swift.Error?) -> Swift.Void)? |
| 149 | + public var onText: ((Swift.String) -> Swift.Void)? |
| 150 | + public var onData: ((Foundation.Data) -> Swift.Void)? |
| 151 | + public var onPong: ((Foundation.Data?) -> Swift.Void)? |
| 152 | + public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)? |
| 153 | + public var disableSSLCertValidation: Swift.Bool |
| 154 | + public var overrideTrustHostname: Swift.Bool |
| 155 | + public var desiredTrustHostname: Swift.String? |
| 156 | + public var sslClientCertificate: Starscream.SSLClientCertificate? |
| 157 | + public var enableCompression: Swift.Bool |
| 158 | + public var security: Starscream.SSLTrustValidator? |
| 159 | + public var enabledSSLCipherSuites: [Security.SSLCipherSuite]? |
| 160 | + public var isConnected: Swift.Bool { |
| 161 | + get |
| 162 | + } |
| 163 | + public var request: Foundation.URLRequest |
| 164 | + public var currentURL: Foundation.URL { |
| 165 | + get |
| 166 | + } |
| 167 | + public var respondToPingWithPong: Swift.Bool |
| 168 | + public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream()) |
| 169 | + convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil) |
| 170 | + convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil) |
| 171 | + open func connect() |
| 172 | + open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue) |
| 173 | + open func write(string: Swift.String, completion: (() -> ())? = nil) |
| 174 | + open func write(data: Foundation.Data, completion: (() -> ())? = nil) |
| 175 | + open func write(ping: Foundation.Data, completion: (() -> ())? = nil) |
| 176 | + open func write(pong: Foundation.Data, completion: (() -> ())? = nil) |
| 177 | + public func newBytesInStream() |
| 178 | + public func streamDidError(error: Swift.Error?) |
| 179 | + @objc deinit |
| 180 | + @objc override dynamic public init() |
| 181 | +} |
| 182 | +public protocol SSLTrustValidator { |
| 183 | + func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool |
| 184 | +} |
| 185 | +open class SSLCert { |
| 186 | + public init(data: Foundation.Data) |
| 187 | + public init(key: Security.SecKey) |
| 188 | + @objc deinit |
| 189 | +} |
| 190 | +open class SSLSecurity : Starscream.SSLTrustValidator { |
| 191 | + public var validatedDN: Swift.Bool |
| 192 | + public var validateEntireChain: Swift.Bool |
| 193 | + convenience public init(usePublicKeys: Swift.Bool = false) |
| 194 | + public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool) |
| 195 | + open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool |
| 196 | + public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey? |
| 197 | + public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey? |
| 198 | + public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data] |
| 199 | + public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey] |
| 200 | + @objc deinit |
| 201 | +} |
| 202 | +public struct SSLClientCertificateError : Foundation.LocalizedError { |
| 203 | + public var errorDescription: Swift.String? |
| 204 | +} |
| 205 | +public class SSLClientCertificate { |
| 206 | + convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws |
| 207 | + public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate) |
| 208 | + convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws |
| 209 | + public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws |
| 210 | + @objc deinit |
| 211 | +} |
| 212 | +extension Starscream.CloseCode : Swift.Equatable {} |
| 213 | +extension Starscream.CloseCode : Swift.Hashable {} |
| 214 | +extension Starscream.CloseCode : Swift.RawRepresentable {} |
| 215 | +extension Starscream.ErrorType : Swift.Equatable {} |
| 216 | +extension Starscream.ErrorType : Swift.Hashable {} |
| 217 | +extension Starscream.WebSocket.OpCode : Swift.Equatable {} |
| 218 | +extension Starscream.WebSocket.OpCode : Swift.Hashable {} |
| 219 | +extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {} |
0 commit comments