Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c071f10bc8 | |||
| a9768580c1 | |||
| 37285cc86c | |||
| 7555a83c9b | |||
| 7cb2dbb5e6 | |||
| 94e6293f36 | |||
| 187a39ca14 | |||
| 6e63e74f81 | |||
| 229e4eeaa1 | |||
| e7d01c4ec1 | |||
| 3089435da0 | |||
| b8c3c4a2af | |||
| b48e47bc8b | |||
| ab9e802770 | |||
| 98dbad9ac7 | |||
| 436014cfec | |||
| d50d74b78a | |||
| 80ce1c4731 | |||
| 5ddf6d9f1a | |||
| 580a857f11 | |||
| 45b4e3f191 |
@@ -37,4 +37,7 @@ SlackKit.xcworkspace
|
||||
Carthage/Checkouts
|
||||
Carthage/Build
|
||||
|
||||
# Swift Package Manager
|
||||
.swiftpm/
|
||||
|
||||
*.resolved
|
||||
+1
-1
@@ -1 +1 @@
|
||||
5.0
|
||||
5.2.4
|
||||
@@ -1,2 +1,2 @@
|
||||
github "daltoniam/Starscream" == 3.1.0
|
||||
github "httpswift/swifter" == 1.4.6
|
||||
github "daltoniam/Starscream" == 4.0.4
|
||||
github "httpswift/swifter" == 1.5.0
|
||||
@@ -8,7 +8,7 @@ let package = Package(
|
||||
.executable(name: "Leaderboard", targets: ["Leaderboard"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.3.0"))
|
||||
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.6.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "Leaderboard",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
target 'Leaderboard' do
|
||||
use_frameworks!
|
||||
pod 'SlackKit', '>= 4.3.0'
|
||||
pod 'SlackKit', '>= 4.6.0'
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ let package = Package(
|
||||
.executable(name: "Robot or Not Bot", targets: ["Robot or Not Bot"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.3.0"))
|
||||
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.6.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "Robot or Not Bot",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
target 'Robot Or Not Bot' do
|
||||
use_frameworks!
|
||||
pod 'SlackKit', '>= 4.3.0'
|
||||
pod 'SlackKit', '>= 4.6.0'
|
||||
end
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-x86_64_i386-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
<string>i386</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>macos-x86_64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>macos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-armv7_arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+466
@@ -0,0 +1,466 @@
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+466
@@ -0,0 +1,466 @@
|
||||
#if 0
|
||||
#elif defined(__x86_64__) && __x86_64__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#elif defined(__i386__) && __i386__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target i386-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target i386-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
Executable
BIN
Binary file not shown.
+327
@@ -0,0 +1,327 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<data>
|
||||
BQJrNbsr8553nondsEMBqJfEBaw=
|
||||
</data>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>Info.plist</key>
|
||||
<data>
|
||||
oP4CFUqNJVIdoCv3XqdH8wLjvZ0=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftdoc</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftinterface</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftmodule</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftdoc</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftinterface</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftmodule</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
BQJrNbsr8553nondsEMBqJfEBaw=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
WzTAT3MIOflP3LGVWW13UJUM/PTx41Ql3QoytUeN5Gg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
uDB1F1BYBSS///5Kx3sW3b25gGjxudlItQDs2UvmKGE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
9MQkrsmF/cH+OB9/YmZMWJyxhobKXIq04SqWyHksiZY=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
SatBt0sLx/ncctmcfRqN71lYIEutDrpwHOLarbUHfK4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
NLaKTrs6WDyaeZkwMVRsgiRWVv1FENjSwWITdK43DT0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
9MQkrsmF/cH+OB9/YmZMWJyxhobKXIq04SqWyHksiZY=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
SatBt0sLx/ncctmcfRqN71lYIEutDrpwHOLarbUHfK4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
NLaKTrs6WDyaeZkwMVRsgiRWVv1FENjSwWITdK43DT0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
Qs7n/ErVjkmr34fv+qUum3mp2aymGhyDuBFl2yUVhmo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
GdOgAurAtZ+vIe3ppOXWJDqOeEC8jdFypsFZ4DJv8oM=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
A+Ly7RgI0E7wOOb3VdQiyLSlOyCAUuOcEFPEc33v6x0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
Qs7n/ErVjkmr34fv+qUum3mp2aymGhyDuBFl2yUVhmo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
GdOgAurAtZ+vIe3ppOXWJDqOeEC8jdFypsFZ4DJv8oM=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
A+Ly7RgI0E7wOOb3VdQiyLSlOyCAUuOcEFPEc33v6x0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
nYTs/q5E5rMtj3rXmqMuzZYThSlmu615k3gwB/Evs/I=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
+33
-10
@@ -1,4 +1,4 @@
|
||||
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
@@ -82,6 +82,11 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
@@ -110,6 +115,15 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
@@ -151,6 +165,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
@@ -162,6 +179,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
@@ -187,20 +207,23 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream16FoundationStream")
|
||||
@interface FoundationStream : NSObject <NSStreamDelegate>
|
||||
/// Delegate for the stream methods. Processes incoming bytes
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream9WebSocket")
|
||||
@interface WebSocket : NSObject <NSStreamDelegate>
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-macos10.10 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-macos10.10 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+9
-7
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>18E226</string>
|
||||
<string>20A5384c</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.5</string>
|
||||
<string>4.0.4</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
@@ -29,17 +29,19 @@
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>10E125</string>
|
||||
<string>11E801a</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>18E219</string>
|
||||
<string>19G68</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.14</string>
|
||||
<string>macosx10.15</string>
|
||||
<key>DTXcode</key>
|
||||
<string>1020</string>
|
||||
<string>1170</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>10E125</string>
|
||||
<string>11E801a</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.10</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
Executable
BIN
Binary file not shown.
+231
@@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<data>
|
||||
QNIQI55xFN9YMaXB+YhyRpELnUo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
71VH+DTcavxNXarECOTUSHapQao=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
rjANGFLjI1AvDGsWvmCOHzqXjiMZTDLUy9f9oCpZLt0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
uDB1F1BYBSS///5Kx3sW3b25gGjxudlItQDs2UvmKGE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-macos.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
Pkh3V0Rz4xIirn/+23gpBwv8l54=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
5gIy/0PK510PmUcOJmZhZQ5iQQP53VCprEmclaGtQvQ=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-macos.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
ZVd1T94gkWNGYDEYoaHrQvbR4BA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
0sabhn4E3rIiCpjv+NMyaXuZ6OjGUgfb4swA3f3Qyuo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-macos.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
IklqmxI3t5CabQYPBG5s90wYP0o=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
h+mXqrumf1QHDKWAwXxW63QsitubfRwaZLb3IoJbjo8=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
Pkh3V0Rz4xIirn/+23gpBwv8l54=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
5gIy/0PK510PmUcOJmZhZQ5iQQP53VCprEmclaGtQvQ=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
ZVd1T94gkWNGYDEYoaHrQvbR4BA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
0sabhn4E3rIiCpjv+NMyaXuZ6OjGUgfb4swA3f3Qyuo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
IklqmxI3t5CabQYPBG5s90wYP0o=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
h+mXqrumf1QHDKWAwXxW63QsitubfRwaZLb3IoJbjo8=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
nYTs/q5E5rMtj3rXmqMuzZYThSlmu615k3gwB/Evs/I=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
QNIQI55xFN9YMaXB+YhyRpELnUo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
qUklPdaPHW8qFlJJFtjYq6nBtKy8OCUJQPob507lP7Y=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^Resources/</key>
|
||||
<true/>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^[^/]+$</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-tvos9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-tvos9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
BIN
Binary file not shown.
+230
@@ -0,0 +1,230 @@
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-tvos9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-tvos9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
BIN
Binary file not shown.
+237
@@ -0,0 +1,237 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<data>
|
||||
71VH+DTcavxNXarECOTUSHapQao=
|
||||
</data>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>Info.plist</key>
|
||||
<data>
|
||||
tF7kiYJWx0yWvlvq8f+a7xBmbpQ=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftdoc</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
71VH+DTcavxNXarECOTUSHapQao=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
rjANGFLjI1AvDGsWvmCOHzqXjiMZTDLUy9f9oCpZLt0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
uDB1F1BYBSS///5Kx3sW3b25gGjxudlItQDs2UvmKGE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
InDr2ZcxemKns5Bo8MAM67o/AIkEsHchCShO+5qhuNg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
FzUFqqCdWHmab6BnSIJmMgtBlPegXAyZ6NzSHRtHyQw=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
PoUbW/m1nLL1GgCSn8Fy6SDjvTubqrmCwDlno8ksL3g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
InDr2ZcxemKns5Bo8MAM67o/AIkEsHchCShO+5qhuNg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
FzUFqqCdWHmab6BnSIJmMgtBlPegXAyZ6NzSHRtHyQw=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
PoUbW/m1nLL1GgCSn8Fy6SDjvTubqrmCwDlno8ksL3g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
nYTs/q5E5rMtj3rXmqMuzZYThSlmu615k3gwB/Evs/I=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-x86_64_i386-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
<string>i386</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>macos-x86_64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>macos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-armv7_arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+42
-2
@@ -1,6 +1,6 @@
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.0 effective-4.2 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
@@ -84,6 +84,11 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
@@ -112,6 +117,15 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
@@ -153,6 +167,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
@@ -164,6 +181,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
@@ -196,7 +216,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
|
||||
// Generated by Apple Swift version 5.0 effective-4.2 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
@@ -280,6 +300,11 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
@@ -308,6 +333,15 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
@@ -349,6 +383,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
@@ -360,6 +397,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
Binary file not shown.
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
Binary file not shown.
+48
-34
@@ -1,6 +1,6 @@
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
|
||||
#elif defined(__x86_64__) && __x86_64__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
@@ -84,6 +84,11 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
@@ -112,6 +117,15 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
@@ -153,6 +167,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
@@ -164,12 +181,14 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
@@ -183,33 +202,21 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream16FoundationStream")
|
||||
@interface FoundationStream : NSObject <NSStreamDelegate>
|
||||
/// Delegate for the stream methods. Processes incoming bytes
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream9WebSocket")
|
||||
@interface WebSocket : NSObject <NSStreamDelegate>
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
|
||||
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
|
||||
#elif defined(__i386__) && __i386__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
@@ -293,6 +300,11 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
@@ -321,6 +333,15 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
@@ -362,6 +383,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
@@ -373,12 +397,14 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
@@ -392,25 +418,13 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream16FoundationStream")
|
||||
@interface FoundationStream : NSObject <NSStreamDelegate>
|
||||
/// Delegate for the stream methods. Processes incoming bytes
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream9WebSocket")
|
||||
@interface WebSocket : NSObject <NSStreamDelegate>
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// SwifteriOS.h
|
||||
// SwifteriOS
|
||||
//
|
||||
// Created by Romain Pouclet on 2015-11-24.
|
||||
// Copyright © 2015 Damian Kołakowski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for SwifteriOS.
|
||||
FOUNDATION_EXPORT double SwifteriOSVersionNumber;
|
||||
|
||||
//! Project version string for SwifteriOS.
|
||||
FOUNDATION_EXPORT const unsigned char SwifteriOSVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <SwifteriOS/PublicHeader.h>
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target i386-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target i386-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user