Compare commits
359 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3089435da0 | |||
| b8c3c4a2af | |||
| b48e47bc8b | |||
| ab9e802770 | |||
| 98dbad9ac7 | |||
| 436014cfec | |||
| d50d74b78a | |||
| 80ce1c4731 | |||
| 5ddf6d9f1a | |||
| 267cf26b2e | |||
| 580a857f11 | |||
| c3817bea15 | |||
| 492f51ce9b | |||
| 45b4e3f191 | |||
| dd72c619d3 | |||
| 43af10de88 | |||
| 7ba97e4893 | |||
| 0c24cb2262 | |||
| 7b76b76b94 | |||
| 565c44677b | |||
| 30dc3679c1 | |||
| 9a18cae265 | |||
| c04654a87b | |||
| bd7f67b3b0 | |||
| 833add707f | |||
| 9118a7688a | |||
| cba1eb36a2 | |||
| d15139d00d | |||
| c1cf9b47d8 | |||
| 986367be38 | |||
| 7d207136b3 | |||
| 0fa3b72a56 | |||
| 67d2bb3f62 | |||
| f2c333f57d | |||
| eccda7a525 | |||
| ac0d9977b5 | |||
| 6c1612f2bb | |||
| ead9bb9c41 | |||
| cc20c54967 | |||
| d5c2dd48f7 | |||
| f4336f1dde | |||
| 7ab91d9440 | |||
| 7e7a168806 | |||
| 9651351ec9 | |||
| c658616e0f | |||
| c8a40de44f | |||
| b212d1631a | |||
| 8adf701444 | |||
| b2f69d4b65 | |||
| 906d451200 | |||
| 80d2cab81c | |||
| c8bc22cbb9 | |||
| e9ca0365c7 | |||
| 52b0a7fd4e | |||
| 3651fc921b | |||
| ef3425e38e | |||
| 533e961c85 | |||
| c2f7632be4 | |||
| 245d709125 | |||
| 1ad14f016a | |||
| 03561eab36 | |||
| f2c98f9d86 | |||
| bde39be109 | |||
| 5d7ac480b2 | |||
| 3579579c80 | |||
| 47865cbcee | |||
| 054f8f2d87 | |||
| d7a02da74b | |||
| 1846597f04 | |||
| f94b3b247b | |||
| a96c17a3ad | |||
| 6276a09ced | |||
| ca92016ab9 | |||
| 21bca0e0e8 | |||
| dd02e9aecc | |||
| 77cc351bd6 | |||
| 6385afb34a | |||
| b880356dde | |||
| fdd2a5aa36 | |||
| 93f8da2f69 | |||
| a165f3e57f | |||
| d7f2221d77 | |||
| 02bda676a9 | |||
| e4bd44e939 | |||
| d83fbb1d7e | |||
| c2734a66c3 | |||
| 721f8964cf | |||
| 37ca701ae0 | |||
| c1a89eedda | |||
| 8aeb88cea3 | |||
| b776ef02a7 | |||
| 0befabb620 | |||
| 0edc193314 | |||
| 806a72efec | |||
| ea02b850f5 | |||
| ec83087712 | |||
| 798397b21c | |||
| 5677a13372 | |||
| 581f1b94bd | |||
| dbd403739b | |||
| e0af108b85 | |||
| efa95e34df | |||
| 5232879f77 | |||
| 7716a304c9 | |||
| 7ca9bfbd0b | |||
| f4afca3cab | |||
| bcd33ab9e7 | |||
| 96cb9e09e3 | |||
| 9ac93890f4 | |||
| ca232f8e8f | |||
| 9b859f0c99 | |||
| 07e5b8636f | |||
| 37b7b74914 | |||
| 78c07974bf | |||
| d44e04cd07 | |||
| d8fffe738d | |||
| 239eb94093 | |||
| c2f3731a69 | |||
| 48f80cc13d | |||
| 0396d9c6d5 | |||
| 3514b637c8 | |||
| 78ce839cc1 | |||
| 831bb20ff7 | |||
| 43dda4a2f0 | |||
| 2f0978ccc4 | |||
| 71c5eda4a1 | |||
| 4b241374ea | |||
| dd07b545c7 | |||
| af4ba6623c | |||
| 435607d170 | |||
| 8094bd2c6c | |||
| d8d22f6083 | |||
| 6fcfe2fda4 | |||
| 6ccce1875b | |||
| 433fc1a8ff | |||
| 4f64c952b8 | |||
| 139b25a7f0 | |||
| 3ee4e0fd1d | |||
| f013840cae | |||
| 79457aa13d | |||
| ac2657b7e1 | |||
| 82130f2e67 | |||
| b9573c4e8b | |||
| 6481620e7a | |||
| 35e7ead8d1 | |||
| 0f896fdaee | |||
| 8a4fceaa00 | |||
| 6007f790db | |||
| 05e7f2baa3 | |||
| 39871172e9 | |||
| 491f80741b | |||
| 0eb9ea31e1 | |||
| 8865376c3c | |||
| d86d0108ff | |||
| b45b7085ce | |||
| 91193c6b2e | |||
| 9720b1c05c | |||
| 9766a5ad6c | |||
| 1e181e7580 | |||
| f6d6c779ae | |||
| 11bb50f8d2 | |||
| d721e0ba1a | |||
| ba6066875c | |||
| 0f1a1a9de5 | |||
| a81cebf5c8 | |||
| 007ec7ab69 | |||
| b93d411f63 | |||
| 741a23809d | |||
| a92fd36c17 | |||
| e122610c04 | |||
| 0539e0bac2 | |||
| 3416161818 | |||
| 32a4aa13ea | |||
| cf188ffb6a | |||
| f1a1963ac8 | |||
| 645797b72e | |||
| b9f808f70e | |||
| 74ef3979f5 | |||
| 992879f54f | |||
| ccdf9d5d3c | |||
| 0336b5a9b6 | |||
| aefbeafd28 | |||
| bc6c07f045 | |||
| db24e66d33 | |||
| ef70f935c1 | |||
| afbf8ab6fe | |||
| d39296f496 | |||
| eafceb4645 | |||
| 83cf85a27a | |||
| 06e250a954 | |||
| 5b6622a961 | |||
| a58e291d2e | |||
| a0e1f9844e | |||
| 7d524ddeac | |||
| 94c9f7fe5a | |||
| be8a5879f3 | |||
| c657919704 | |||
| abeef21d7a | |||
| 79e3b14593 | |||
| d9a4cda9b0 | |||
| 12b316da0b | |||
| 13cade5c00 | |||
| 051e8dd6c8 | |||
| 1adea1c54e | |||
| aa51cfb2fd | |||
| 6b8885bd29 | |||
| e0fbf1ab4e | |||
| 366c6e7b77 | |||
| 378c116d9b | |||
| 58bade8ec9 | |||
| 7d7f5c40d6 | |||
| c9fd54d106 | |||
| 2f1ce799ad | |||
| 7f02f4cf99 | |||
| a9066c0d0a | |||
| 29739dba74 | |||
| d60a7094a4 | |||
| 7edd4210f6 | |||
| 2abaecbd14 | |||
| 346499e03b | |||
| bc72a52bf5 | |||
| 0ebd3cb0e7 | |||
| 5d7064ee13 | |||
| d02768ddad | |||
| dbc7b361c8 | |||
| a0de46e3c7 | |||
| 2d6e19baee | |||
| 21ec3cb2a1 | |||
| cb542da068 | |||
| 788b4e4f7a | |||
| 24b2292cba | |||
| 72866262d2 | |||
| acabbb6c03 | |||
| fff0f0befc | |||
| cf0675dac2 | |||
| 1cffa0ba74 | |||
| 9ebd8182a6 | |||
| 63a8ae7f08 | |||
| 992f94e870 | |||
| 1c476c77ad | |||
| 28bd612ca0 | |||
| 45cf2a7ac0 | |||
| f7c986c65c | |||
| ca43df4475 | |||
| ef71b6abf0 | |||
| 3ff922a2c0 | |||
| 646c371bd3 | |||
| 36401009f8 | |||
| b837554dcf | |||
| 0ba0e019ae | |||
| 8771ef3f0a | |||
| 71e7238483 | |||
| b75c10fca6 | |||
| 50f85ac103 | |||
| a7cbb84b34 | |||
| ed6789c9a5 | |||
| ca444930a4 | |||
| 21051864ec | |||
| 36d1553072 | |||
| eb14758846 | |||
| bf3a5c2422 | |||
| 98fd1342e7 | |||
| 183ed91cb8 | |||
| c241dcf1df | |||
| 8007fa6f0f | |||
| 7ab973a03b | |||
| 1889ffeeee | |||
| 987be40c91 | |||
| 2e71ac6876 | |||
| df661762a9 | |||
| c428cac537 | |||
| 18c6516df9 | |||
| fe450a7db2 | |||
| bb57f59553 | |||
| e5a4a67bdb | |||
| 1e304f1f6d | |||
| 81ebf86abd | |||
| afa16e98b3 | |||
| 6596bb2861 | |||
| fd12ab0600 | |||
| 31508e44dc | |||
| b980f371f6 | |||
| 9526d739e1 | |||
| c3af5c33be | |||
| c6258c57a0 | |||
| 45e075aca2 | |||
| 5ebe40a389 | |||
| 0a5a8f83f7 | |||
| 8f4a287ad0 | |||
| deadc8855a | |||
| 98155f00b7 | |||
| a55d3be65b | |||
| 3b8f1834f0 | |||
| 34972eb8af | |||
| f21179f567 | |||
| e1bf5a160f | |||
| c66a5fe0db | |||
| f03908bcc7 | |||
| 591b0d9d55 | |||
| 6e83fb93d8 | |||
| c1d202f433 | |||
| c7db8ac578 | |||
| d2e430e5bf | |||
| ebe169bf2a | |||
| ca36653dc4 | |||
| 94895edfac | |||
| 3ea13ac6c4 | |||
| e94adfc019 | |||
| 1291323c5a | |||
| 4ceb452e6b | |||
| 457504e786 | |||
| 6d9a939575 | |||
| efc3847a20 | |||
| 3ed139b503 | |||
| a4d9083f72 | |||
| 67b2fa95b3 | |||
| e031f85447 | |||
| 0b1dc6068e | |||
| b027b5b779 | |||
| e507c85ca2 | |||
| 145dfccfae | |||
| b4ca2bcc07 | |||
| 85b2d920ad | |||
| 6415a113ed | |||
| 3a2324b279 | |||
| d647a6b0c9 | |||
| 4230d7841c | |||
| 8995a54d15 | |||
| ba43a123ea | |||
| d00419dc18 | |||
| 15f3a30ba9 | |||
| befa53e3a9 | |||
| 35dfa840e8 | |||
| edf56e1678 | |||
| 3eab323564 | |||
| 0b2ee1d10e | |||
| 5444948940 | |||
| 13335b5de1 | |||
| c8d8e18db6 | |||
| c11321c116 | |||
| 0041a118a7 | |||
| 6cb5280cf5 | |||
| 9cad043957 | |||
| fa15ed8751 | |||
| 0c9c146d58 | |||
| 109a20fac2 | |||
| a6cf1e3cb6 | |||
| d3c16bed5f | |||
| 797d95ab75 | |||
| efb7bc9458 | |||
| 79e59f23fb | |||
| 01e199659e | |||
| 851b2f5e14 | |||
| c506512800 | |||
| 20fa05605b | |||
| 30baf1f76c | |||
| 1c3f01f861 | |||
| 47dc9b3d9f | |||
| b9e828ef3d |
+8
-5
@@ -16,11 +16,12 @@ DerivedData
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.xcuserstate
|
||||
.build
|
||||
Packages/
|
||||
*.xcodeproj/
|
||||
*.DS_Store
|
||||
|
||||
# SwiftPM
|
||||
Packages/
|
||||
.build
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
@@ -28,10 +29,12 @@ Packages/
|
||||
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
|
||||
#
|
||||
Pods/
|
||||
SlackKit.xcworkspace
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Checkouts
|
||||
Carthage/Build
|
||||
|
||||
*.resolved
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3.0.2
|
||||
5.1
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
disabled_rules:
|
||||
- identifier_name
|
||||
- function_parameter_count
|
||||
line_length: 140
|
||||
excluded: # paths to ignore during linting. Takes precedence over `included`.
|
||||
- Carthage
|
||||
- Pods
|
||||
@@ -0,0 +1,2 @@
|
||||
github "daltoniam/Starscream" == 3.1.0
|
||||
github "httpswift/swifter" == 1.4.6
|
||||
@@ -0,0 +1 @@
|
||||
github "pvzig/SlackKit"
|
||||
@@ -0,0 +1,275 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
262F50452259146E00A74EB1 /* Leaderbot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262F50432259146E00A74EB1 /* Leaderbot.swift */; };
|
||||
262F50462259146E00A74EB1 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262F50442259146E00A74EB1 /* main.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
262F50312259139400A74EB1 /* Leaderboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Leaderboard.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
262F50362259139400A74EB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
262F50432259146E00A74EB1 /* Leaderbot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Leaderbot.swift; path = Sources/Leaderbot.swift; sourceTree = "<group>"; };
|
||||
262F50442259146E00A74EB1 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = Sources/main.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
262F502F2259139400A74EB1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
262F50292259139400A74EB1 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
262F50332259139400A74EB1 /* Leaderboard */,
|
||||
262F50322259139400A74EB1 /* Products */,
|
||||
665E45E1CAEDB17C0745AD28 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
262F50322259139400A74EB1 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
262F50312259139400A74EB1 /* Leaderboard.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
262F50332259139400A74EB1 /* Leaderboard */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
262F50432259146E00A74EB1 /* Leaderbot.swift */,
|
||||
262F50442259146E00A74EB1 /* main.swift */,
|
||||
262F50362259139400A74EB1 /* Info.plist */,
|
||||
);
|
||||
path = Leaderboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
665E45E1CAEDB17C0745AD28 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
262F50302259139400A74EB1 /* Leaderboard */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 262F50392259139400A74EB1 /* Build configuration list for PBXNativeTarget "Leaderboard" */;
|
||||
buildPhases = (
|
||||
262F502E2259139400A74EB1 /* Sources */,
|
||||
262F502F2259139400A74EB1 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Leaderboard;
|
||||
productName = Leaderboard;
|
||||
productReference = 262F50312259139400A74EB1 /* Leaderboard.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
262F502A2259139400A74EB1 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1020;
|
||||
LastUpgradeCheck = 1020;
|
||||
ORGANIZATIONNAME = "Peter Zignego";
|
||||
TargetAttributes = {
|
||||
262F50302259139400A74EB1 = {
|
||||
CreatedOnToolsVersion = 10.2;
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 262F502D2259139400A74EB1 /* Build configuration list for PBXProject "Leaderboard" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 262F50292259139400A74EB1;
|
||||
productRefGroup = 262F50322259139400A74EB1 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
262F50302259139400A74EB1 /* Leaderboard */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
262F502E2259139400A74EB1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
262F50462259146E00A74EB1 /* main.swift in Sources */,
|
||||
262F50452259146E00A74EB1 /* Leaderbot.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
262F50372259139400A74EB1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
262F50382259139400A74EB1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
262F503A2259139400A74EB1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
|
||||
INFOPLIST_FILE = Leaderboard/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.Leaderboard;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
262F503B2259139400A74EB1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
|
||||
INFOPLIST_FILE = Leaderboard/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.Leaderboard;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
262F502D2259139400A74EB1 /* Build configuration list for PBXProject "Leaderboard" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
262F50372259139400A74EB1 /* Debug */,
|
||||
262F50382259139400A74EB1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
262F50392259139400A74EB1 /* Build configuration list for PBXNativeTarget "Leaderboard" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
262F503A2259139400A74EB1 /* Debug */,
|
||||
262F503B2259139400A74EB1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 262F502A2259139400A74EB1 /* Project object */;
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Leaderboard.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -13,16 +13,16 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.1</string>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2016 Peter Zignego. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
<string>Copyright © 2019 Peter Zignego. All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
//
|
||||
// Leaderboard.swift
|
||||
//
|
||||
// Copyright © 2019 Peter Zignego. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
import Foundation
|
||||
import SlackKit
|
||||
|
||||
class Leaderbot {
|
||||
|
||||
struct Leaderboard {
|
||||
let teamID: String
|
||||
var scores = [String: Int]()
|
||||
|
||||
init(teamID: String) {
|
||||
self.teamID = teamID
|
||||
}
|
||||
}
|
||||
|
||||
enum Command: String {
|
||||
case leaderboard = "leaderboard"
|
||||
}
|
||||
|
||||
enum Trigger: String {
|
||||
case plusPlus = "++"
|
||||
case minusMinus = "--"
|
||||
}
|
||||
|
||||
let slackkit = SlackKit()
|
||||
|
||||
var leaderboards = [String: Leaderboard]()
|
||||
let atSet = CharacterSet(charactersIn: "@")
|
||||
|
||||
init(apiToken: String) {
|
||||
slackkit.addWebAPIAccessWithToken(apiToken)
|
||||
slackkit.addRTMBotWithAPIToken(apiToken)
|
||||
slackkit.notificationForEvent(.message) { [weak self] (event, client) in
|
||||
self?.listen(client?.client, message: event.message)
|
||||
}
|
||||
}
|
||||
|
||||
init(clientID: String, clientSecret: String) {
|
||||
let oauthConfig = OAuthConfig(clientID: clientID, clientSecret: clientSecret)
|
||||
slackkit.addServer(oauth: oauthConfig)
|
||||
slackkit.notificationForEvent(.message) { [weak self] (event, client) in
|
||||
self?.listen(client?.client, message: event.message)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Leaderboard Internal Logic
|
||||
private func listen(_ client: Client?, message: Message?) {
|
||||
guard let message = message, let text = message.text, let client = client else {
|
||||
return
|
||||
}
|
||||
switch text {
|
||||
case let text where text.lowercased().contains(Command.leaderboard.rawValue) && text.optionalContains(client.authenticatedUser?.id):
|
||||
handleCommand(.leaderboard, channel: message.channel, client: client)
|
||||
case let text where text.contains(Trigger.plusPlus.rawValue):
|
||||
handleMessageWithTrigger(.plusPlus, message: message, client: client)
|
||||
case let text where text.contains(Trigger.minusMinus.rawValue):
|
||||
handleMessageWithTrigger(.minusMinus, message: message, client: client)
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
private func handleMessageWithTrigger(_ trigger: Trigger, message: Message, client: Client) {
|
||||
guard
|
||||
let text = message.text,
|
||||
let teamID = client.team?.id
|
||||
else {
|
||||
return
|
||||
}
|
||||
if leaderboards[teamID] == nil { leaderboards[teamID] = Leaderboard(teamID: teamID) }
|
||||
//Nonusers
|
||||
searchTextWithExpression("([a-z0-9_\\-\\.]+)[\\+\\-]{2}", text: text, trigger: trigger, teamID: teamID)
|
||||
//Users
|
||||
searchTextWithExpression("<@([A-Z0-9_\\-\\.]+)>[\\+\\-]{2}", text: text, trigger: trigger, teamID: teamID)
|
||||
}
|
||||
|
||||
func searchTextWithExpression(_ expression: String, text: String, trigger: Trigger, teamID: String) {
|
||||
let thingRegex = try? NSRegularExpression(pattern: expression, options: [])
|
||||
let things = thingRegex?.matches(in: text, options: [], range: NSMakeRange(0, text.utf16.count)) ?? []
|
||||
for match in things {
|
||||
let value = String(text[text.range(from: match.range(at: 1))!])
|
||||
if leaderboards[teamID]?.scores[value] == nil { leaderboards[teamID]?.scores[value] = 0 }
|
||||
switch trigger {
|
||||
case .plusPlus:
|
||||
leaderboards[teamID]?.scores[value]?+=1
|
||||
case .minusMinus:
|
||||
leaderboards[teamID]?.scores[value]?-=1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func handleCommand(_ command: Command, channel:String?, client: Client) {
|
||||
switch command {
|
||||
case .leaderboard:
|
||||
if let id = channel {
|
||||
slackkit.webAPI?.sendMessage(channel: id,
|
||||
text: "Here's the leaderboard:",
|
||||
linkNames: true,
|
||||
attachments: [constructLeaderboardAttachment(client)],
|
||||
success: nil,
|
||||
failure: { (error) in
|
||||
print("Leaderboard failed to post due to error:\(error)")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Leaderboard Interface
|
||||
private func constructLeaderboardAttachment(_ client: Client) -> Attachment? {
|
||||
guard let teamID = client.team?.id, let leaderboard = leaderboards[teamID] else {
|
||||
return nil
|
||||
}
|
||||
let top = AttachmentField(title: ":100:", value: swapIDsForNames(client, string: topItems(leaderboard)), short: true)
|
||||
let bottom = AttachmentField(title: ":poop:", value: swapIDsForNames(client, string: bottomItems(leaderboard)), short: true)
|
||||
return Attachment(fallback: "Leaderboard", title: "Leaderboard", colorHex: AttachmentColor.good.rawValue, text: "", fields: [top, bottom])
|
||||
}
|
||||
|
||||
private func topItems(_ leaderboard: Leaderboard) -> String {
|
||||
let sortedKeys = Array(leaderboard.scores.keys).sorted(by: {leaderboard.scores[$0]! > leaderboard.scores[$1]!}).filter({leaderboard.scores[$0]! > 0})
|
||||
let sortedValues = Array(leaderboard.scores.values).sorted(by: {$0 > $1}).filter({$0 > 0})
|
||||
return leaderboardString(sortedKeys, values: sortedValues)
|
||||
}
|
||||
|
||||
private func bottomItems(_ leaderboard: Leaderboard) -> String {
|
||||
let sortedKeys = Array(leaderboard.scores.keys).sorted(by: {leaderboard.scores[$0]! < leaderboard.scores[$1]!}).filter({leaderboard.scores[$0]! < 0})
|
||||
let sortedValues = Array(leaderboard.scores.values).sorted(by: {$0 < $1}).filter({$0 < 0})
|
||||
return leaderboardString(sortedKeys, values: sortedValues)
|
||||
}
|
||||
|
||||
private func leaderboardString(_ keys: [String], values: [Int]) -> String {
|
||||
var returnValue = ""
|
||||
for i in 0..<values.count {
|
||||
returnValue += keys[i] + " (" + "\(values[i])" + ")\n"
|
||||
}
|
||||
return returnValue
|
||||
}
|
||||
|
||||
// MARK: - Utilities
|
||||
private func swapIDsForNames(_ client: Client, string: String) -> String {
|
||||
var returnString = string
|
||||
for key in client.users.keys {
|
||||
if let name = client.users[key]?.name {
|
||||
returnString = returnString.replacingOccurrences(of: key, with: "@"+name, options: NSString.CompareOptions.literal, range: returnString.startIndex..<returnString.endIndex)
|
||||
}
|
||||
}
|
||||
return returnString
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
func optionalContains(_ string: String?) -> Bool {
|
||||
guard let str = string else {
|
||||
return false
|
||||
}
|
||||
return self.contains(str)
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
func range(from nsRange: NSRange) -> Range<String.Index>? {
|
||||
guard
|
||||
let from16 = utf16.index(utf16.startIndex, offsetBy: nsRange.location, limitedBy: utf16.endIndex),
|
||||
let to16 = utf16.index(from16, offsetBy: nsRange.length, limitedBy: utf16.endIndex),
|
||||
let from = from16.samePosition(in: self),
|
||||
let to = to16.samePosition(in: self)
|
||||
else { return nil }
|
||||
return from ..< to
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import Foundation
|
||||
|
||||
//With OAuth
|
||||
//let bot = Leaderbot(clientID: "CLIENT_ID", clientSecret: "CLIENT_SECRET")
|
||||
|
||||
//With API token
|
||||
let bot = Leaderbot(apiToken: "xoxb-SLACK_BOT_TOKEN")
|
||||
RunLoop.main.run()
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
// swift-tools-version:4.2
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Leaderboard",
|
||||
products: [
|
||||
.executable(name: "Leaderboard", targets: ["Leaderboard"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.3.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "Leaderboard",
|
||||
dependencies: ["SlackKit"],
|
||||
path: "Leaderboard/Sources")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
target 'Leaderboard' do
|
||||
use_frameworks!
|
||||
pod 'SlackKit', '>= 4.3.0'
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
github "pvzig/SlackKit"
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
// swift-tools-version:4.2
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Robot or Not Bot",
|
||||
products: [
|
||||
.executable(name: "Robot or Not Bot", targets: ["Robot or Not Bot"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.3.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "Robot or Not Bot",
|
||||
dependencies: ["SlackKit"],
|
||||
path: "Robot or Not Bot/Sources")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
target 'Robot Or Not Bot' do
|
||||
use_frameworks!
|
||||
pod 'SlackKit', '>= 4.3.0'
|
||||
end
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
262F505D22591A9000A74EB1 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262F505C22591A9000A74EB1 /* main.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
262F504F225919E200A74EB1 /* Robot Or Not Bot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Robot Or Not Bot.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
262F5054225919E200A74EB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
262F505C22591A9000A74EB1 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = Sources/main.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
262F504D225919E200A74EB1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
262F5047225919E200A74EB1 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
262F5051225919E200A74EB1 /* Robot Or Not Bot */,
|
||||
262F5050225919E200A74EB1 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
262F5050225919E200A74EB1 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
262F504F225919E200A74EB1 /* Robot Or Not Bot.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
262F5051225919E200A74EB1 /* Robot Or Not Bot */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
262F505C22591A9000A74EB1 /* main.swift */,
|
||||
262F5054225919E200A74EB1 /* Info.plist */,
|
||||
);
|
||||
path = "Robot Or Not Bot";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
262F504E225919E200A74EB1 /* Robot Or Not Bot */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 262F5057225919E200A74EB1 /* Build configuration list for PBXNativeTarget "Robot Or Not Bot" */;
|
||||
buildPhases = (
|
||||
262F504C225919E200A74EB1 /* Sources */,
|
||||
262F504D225919E200A74EB1 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Robot Or Not Bot";
|
||||
productName = "Robot Or Not Bot";
|
||||
productReference = 262F504F225919E200A74EB1 /* Robot Or Not Bot.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
262F5048225919E200A74EB1 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1020;
|
||||
LastUpgradeCheck = 1020;
|
||||
ORGANIZATIONNAME = "Peter Zignego";
|
||||
TargetAttributes = {
|
||||
262F504E225919E200A74EB1 = {
|
||||
CreatedOnToolsVersion = 10.2;
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 262F504B225919E200A74EB1 /* Build configuration list for PBXProject "Robot Or Not Bot" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 262F5047225919E200A74EB1;
|
||||
productRefGroup = 262F5050225919E200A74EB1 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
262F504E225919E200A74EB1 /* Robot Or Not Bot */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
262F504C225919E200A74EB1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
262F505D22591A9000A74EB1 /* main.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
262F5055225919E200A74EB1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
262F5056225919E200A74EB1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
262F5058225919E200A74EB1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
|
||||
INFOPLIST_FILE = "Robot Or Not Bot/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.launchsoft.Robot-Or-Not-Bot";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
262F5059225919E200A74EB1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
|
||||
INFOPLIST_FILE = "Robot Or Not Bot/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.launchsoft.Robot-Or-Not-Bot";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
262F504B225919E200A74EB1 /* Build configuration list for PBXProject "Robot Or Not Bot" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
262F5055225919E200A74EB1 /* Debug */,
|
||||
262F5056225919E200A74EB1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
262F5057225919E200A74EB1 /* Build configuration list for PBXNativeTarget "Robot Or Not Bot" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
262F5058225919E200A74EB1 /* Debug */,
|
||||
262F5059225919E200A74EB1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 262F5048225919E200A74EB1 /* Project object */;
|
||||
}
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Robot Or Not Bot.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2019 Peter Zignego. All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Regular → Executable
+40
-22
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SlackKit
|
||||
|
||||
class RobotOrNotBot: MessageEventsDelegate {
|
||||
class RobotOrNotBot {
|
||||
|
||||
let verdicts: [String:Bool] = [
|
||||
"Mr. Roboto" : false,
|
||||
@@ -76,42 +76,60 @@ class RobotOrNotBot: MessageEventsDelegate {
|
||||
"Robot Or Not Bot": false
|
||||
]
|
||||
|
||||
let client: SlackClient
|
||||
let bot: SlackKit
|
||||
|
||||
init(token: String) {
|
||||
client = SlackClient(apiToken: token)
|
||||
client.messageEventsDelegate = self
|
||||
}
|
||||
|
||||
// MARK: MessageEventsDelegate
|
||||
func received(_ message: Message, client: SlackClient) {
|
||||
if let id = client.authenticatedUser?.id {
|
||||
if message.text?.contains(id) == true {
|
||||
handleMessage(message: message)
|
||||
bot = SlackKit()
|
||||
bot.addRTMBotWithAPIToken(token)
|
||||
bot.addWebAPIAccessWithToken(token)
|
||||
bot.notificationForEvent(.message) { [weak self] (event, connection) in
|
||||
guard
|
||||
let message = event.message,
|
||||
let id = connection?.client?.authenticatedUser?.id,
|
||||
message.text?.contains(id) == true
|
||||
else {
|
||||
return
|
||||
}
|
||||
self?.handleMessage(message)
|
||||
}
|
||||
}
|
||||
func changed(_ message: Message, client: SlackClient) {}
|
||||
func deleted(_ message: Message?, client: SlackClient) {}
|
||||
func sent(_ message: Message, client: SlackClient) {}
|
||||
|
||||
private func handleMessage(message: Message) {
|
||||
init(clientID: String, clientSecret: String) {
|
||||
bot = SlackKit()
|
||||
let oauthConfig = OAuthConfig(clientID: clientID, clientSecret: clientSecret)
|
||||
bot.addServer(oauth: oauthConfig)
|
||||
bot.notificationForEvent(.message) { [weak self] (event, connection) in
|
||||
guard
|
||||
let message = event.message,
|
||||
let id = connection?.client?.authenticatedUser?.id,
|
||||
message.text?.contains(id) == true
|
||||
else {
|
||||
return
|
||||
}
|
||||
self?.handleMessage(message)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Bot logic
|
||||
private func handleMessage(_ message: Message) {
|
||||
if let text = message.text?.lowercased(), let channel = message.channel {
|
||||
for (robot, verdict) in verdicts {
|
||||
let lowerbot = robot.lowercased()
|
||||
if text.contains(lowerbot) {
|
||||
if verdict == true {
|
||||
client.webAPI.addReaction(name: "robot_face", channel: channel, timestamp: message.ts, success: nil, failure: nil)
|
||||
} else {
|
||||
client.webAPI.addReaction(name: "no_entry_sign", channel: channel, timestamp: message.ts, success: nil, failure: nil)
|
||||
}
|
||||
let reaction = verdict ? "robot_face" : "no_entry_sign"
|
||||
bot.webAPI?.addReactionToMessage(name: reaction, channel: channel, timestamp: message.ts!, success: nil, failure: nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
client.webAPI.addReaction(name: "question", channel: channel, timestamp: message.ts, success: nil, failure: nil)
|
||||
// Not found
|
||||
bot.webAPI?.addReactionToMessage(name: "question", channel: channel, timestamp: message.ts!, success: nil, failure: nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// With API token
|
||||
let slackbot = RobotOrNotBot(token: "xoxb-SLACK_API_TOKEN")
|
||||
slackbot.client.connect()
|
||||
// With OAuth
|
||||
// let slackbot = RobotOrNotBot(clientID: "CLIENT_ID", clientSecret: "CLIENT_SECRET")
|
||||
RunLoop.main.run()
|
||||
@@ -1,9 +0,0 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "echobot",
|
||||
targets: [],
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/pvzig/SlackKit.git", majorVersion: 0, minor: 0),
|
||||
]
|
||||
)
|
||||
@@ -1,35 +0,0 @@
|
||||
import Foundation
|
||||
import SlackKit
|
||||
|
||||
class Echobot: MessageEventsDelegate {
|
||||
|
||||
let client: SlackClient
|
||||
|
||||
init(token: String) {
|
||||
client = SlackClient(apiToken: token)
|
||||
client.messageEventsDelegate = self
|
||||
}
|
||||
|
||||
// MARK: MessageEventsDelegate
|
||||
func sent(_ message: Message, client: SlackClient) {}
|
||||
func changed(_ message: Message, client: SlackClient) {}
|
||||
func deleted(_ message: Message?, client: SlackClient) {}
|
||||
func received(_ message: Message, client: SlackClient) {
|
||||
listen(message: message)
|
||||
}
|
||||
|
||||
// MARK: Echobot Internal Logic
|
||||
private func listen(message: Message) {
|
||||
if let channel = message.channel, let text = message.text, let id = client.authenticatedUser?.id {
|
||||
if id != message.user && message.user != nil {
|
||||
client.webAPI.sendMessage(channel:channel, text: text, linkNames: true, success: {(response) in
|
||||
}, failure: { (error) in
|
||||
print("Echobot failed to reply due to error:\(error)")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let echobot = Echobot(token: "xoxb-SLACK_API_TOKEN")
|
||||
echobot.client.connect()
|
||||
@@ -1,8 +0,0 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "leaderboard",
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/pvzig/SlackKit.git", majorVersion: 0, minor: 0),
|
||||
]
|
||||
)
|
||||
@@ -1,141 +0,0 @@
|
||||
import Foundation
|
||||
import SlackKit
|
||||
|
||||
class Leaderboard: MessageEventsDelegate {
|
||||
|
||||
var leaderboard: [String: Int] = [String: Int]()
|
||||
let atSet = CharacterSet(charactersIn: "@")
|
||||
|
||||
let client: SlackClient
|
||||
|
||||
init(token: String) {
|
||||
client = SlackClient(apiToken: token)
|
||||
client.messageEventsDelegate = self
|
||||
}
|
||||
|
||||
enum Command: String {
|
||||
case leaderboard = "leaderboard"
|
||||
}
|
||||
|
||||
enum Trigger: String {
|
||||
case plusPlus = "++"
|
||||
case minusMinus = "--"
|
||||
}
|
||||
|
||||
// MARK: MessageEventsDelegate
|
||||
func sent(_ message: Message, client: SlackClient) {}
|
||||
func changed(_ message: Message, client: SlackClient) {}
|
||||
func deleted(_ message: Message?, client: SlackClient) {}
|
||||
func received(_ message: Message, client: SlackClient) {
|
||||
listen(message: message)
|
||||
}
|
||||
|
||||
// MARK: Leaderboard Internal Logic
|
||||
private func listen(message: Message) {
|
||||
if let id = client.authenticatedUser?.id, let text = message.text {
|
||||
if text.lowercased().contains(Command.leaderboard.rawValue) && text.contains(id) {
|
||||
handleCommand(command: .leaderboard, channel: message.channel)
|
||||
}
|
||||
}
|
||||
if message.text?.contains(Trigger.plusPlus.rawValue) == true {
|
||||
handleMessageWithTrigger(message: message, trigger: .plusPlus)
|
||||
}
|
||||
if message.text?.contains(Trigger.minusMinus.rawValue) == true {
|
||||
handleMessageWithTrigger(message: message, trigger: .minusMinus)
|
||||
}
|
||||
}
|
||||
|
||||
private func handleMessageWithTrigger(message: Message, trigger: Trigger) {
|
||||
if let text = message.text, let start = text.range(of: "@")?.lowerBound, let end = text.range(of: trigger.rawValue)?.lowerBound {
|
||||
let string = String(text.characters[start...end].dropLast().dropFirst())
|
||||
let users = client.users.values.filter{$0.id == self.userID(string: string)}
|
||||
if users.count > 0 {
|
||||
let idString = userID(string: string)
|
||||
initalizationForValue(dictionary: &leaderboard, value: idString)
|
||||
scoringForValue(dictionary: &leaderboard, value: idString, trigger: trigger)
|
||||
} else {
|
||||
initalizationForValue(dictionary: &leaderboard, value: string)
|
||||
scoringForValue(dictionary: &leaderboard, value: string, trigger: trigger)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func handleCommand(command: Command, channel:String?) {
|
||||
switch command {
|
||||
case .leaderboard:
|
||||
if let id = channel {
|
||||
client.webAPI.sendMessage(channel:id, text: "Leaderboard", linkNames: true, attachments: [constructLeaderboardAttachment()], success: {(response) in
|
||||
print(response)
|
||||
}, failure: { (error) in
|
||||
print("Leaderboard failed to post due to error:\(error)")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func initalizationForValue( dictionary: inout [String: Int], value: String) {
|
||||
if dictionary[value] == nil {
|
||||
dictionary[value] = 0
|
||||
}
|
||||
}
|
||||
|
||||
private func scoringForValue( dictionary: inout [String: Int], value: String, trigger: Trigger) {
|
||||
switch trigger {
|
||||
case .plusPlus:
|
||||
dictionary[value]?+=1
|
||||
case .minusMinus:
|
||||
dictionary[value]?-=1
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Leaderboard Interface
|
||||
private func constructLeaderboardAttachment() -> Attachment? {
|
||||
let 💯 = AttachmentField(title: "💯", value: swapIDsForNames(string: topItems(dictionary: &leaderboard)), short: true)
|
||||
let 💩 = AttachmentField(title: "💩", value: swapIDsForNames(string: bottomItems(dictionary: &leaderboard)), short: true)
|
||||
return Attachment(fallback: "Leaderboard", title: "Leaderboard", colorHex: AttachmentColor.good.rawValue, text: "", fields: [💯, 💩])
|
||||
}
|
||||
|
||||
private func topItems(dictionary: inout [String: Int]) -> String {
|
||||
let sortedKeys = dictionary.keys.sorted(by: { (k1: String, k2: String) -> Bool in
|
||||
return dictionary[k1]! > dictionary[k2]!
|
||||
}).filter({ dictionary[$0]! > 0})
|
||||
let sortedValues = dictionary.values.sorted(by: {$0 > $1}).filter({$0 > 0})
|
||||
return leaderboardString(keys: sortedKeys, values: sortedValues)
|
||||
}
|
||||
|
||||
private func bottomItems( dictionary: inout [String: Int]) -> String {
|
||||
let sortedKeys = dictionary.keys.sorted(by: { (k1: String, k2: String) -> Bool in
|
||||
return dictionary[k1]! < dictionary[k2]!
|
||||
}).filter({ dictionary[$0]! < 0})
|
||||
let sortedValues = dictionary.values.sorted(by: {$0 < $1}).filter({$0 < 0})
|
||||
return leaderboardString(keys: sortedKeys, values: sortedValues)
|
||||
}
|
||||
|
||||
private func leaderboardString(keys: [String], values: [Int]) -> String {
|
||||
var returnValue = ""
|
||||
for i in 0..<values.count {
|
||||
returnValue += keys[i] + " (" + "\(values[i])" + ")\n"
|
||||
}
|
||||
return returnValue
|
||||
}
|
||||
|
||||
// MARK: - Utilities
|
||||
private func swapIDsForNames(string: String) -> String {
|
||||
var returnString = string
|
||||
for key in client.users.keys {
|
||||
if let name = client.users[key]?.name {
|
||||
if returnString.contains(key) {
|
||||
returnString = returnString.replacingOccurrences(of: key, with: "@"+name)
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnString
|
||||
}
|
||||
|
||||
private func userID(string: String) -> String {
|
||||
return string.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
|
||||
}
|
||||
}
|
||||
|
||||
let leaderboard = Leaderboard(token: "xoxb-SLACK_API_TOKEN")
|
||||
leaderboard.client.connect()
|
||||
@@ -1,9 +0,0 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "robot-or-not-bot",
|
||||
targets: [],
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/pvzig/SlackKit.git", majorVersion: 0, minor: 0),
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,908 @@
|
||||
#ifndef TARGET_OS_SIMULATOR
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
#if TARGET_OS_SIMULATOR
|
||||
#if 0
|
||||
#elif defined(__x86_64__) && __x86_64__
|
||||
// Generated by Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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("_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(__i386__) && __i386__
|
||||
// Generated by Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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("_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
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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("_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.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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("_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
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -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>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
Binary file not shown.
BIN
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target arm64-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target arm64-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
Binary file not shown.
BIN
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
Binary file not shown.
BIN
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target i386-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target i386-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
Binary file not shown.
BIN
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target x86_64-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
Binary file not shown.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target x86_64-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
Binary file not shown.
@@ -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.
@@ -0,0 +1,856 @@
|
||||
#ifndef TARGET_OS_SIMULATOR
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
#if TARGET_OS_SIMULATOR
|
||||
#if 0
|
||||
#elif defined(__x86_64__) && __x86_64__
|
||||
// Generated by Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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;
|
||||
#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="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#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.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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;
|
||||
#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="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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;
|
||||
#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="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#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.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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;
|
||||
#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="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -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.
Binary file not shown.
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
Binary file not shown.
+570
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target arm64-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
Binary file not shown.
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target arm64-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
Binary file not shown.
+570
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
Binary file not shown.
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target armv7-apple-ios8.0 -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
BIN
Binary file not shown.
+570
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target i386-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
Binary file not shown.
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target i386-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
BIN
Binary file not shown.
+570
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target x86_64-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
Binary file not shown.
@@ -0,0 +1,570 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 effective-4.2 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// swift-module-flags: -target x86_64-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 4.2 -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(Swift.AnyObject)
|
||||
case html(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data)
|
||||
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
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
}
|
||||
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 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 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 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(_ c: () -> Swift.Void)
|
||||
public func b(_ c: () -> Swift.Void)
|
||||
public func i(_ c: () -> Swift.Void)
|
||||
public func p(_ c: () -> Swift.Void)
|
||||
public func q(_ c: () -> Swift.Void)
|
||||
public func s(_ c: () -> Swift.Void)
|
||||
public func u(_ c: () -> Swift.Void)
|
||||
public func br(_ c: () -> Swift.Void)
|
||||
public func dd(_ c: () -> Swift.Void)
|
||||
public func dl(_ c: () -> Swift.Void)
|
||||
public func dt(_ c: () -> Swift.Void)
|
||||
public func em(_ c: () -> Swift.Void)
|
||||
public func hr(_ c: () -> Swift.Void)
|
||||
public func li(_ c: () -> Swift.Void)
|
||||
public func ol(_ c: () -> Swift.Void)
|
||||
public func rp(_ c: () -> Swift.Void)
|
||||
public func rt(_ c: () -> Swift.Void)
|
||||
public func td(_ c: () -> Swift.Void)
|
||||
public func th(_ c: () -> Swift.Void)
|
||||
public func tr(_ c: () -> Swift.Void)
|
||||
public func tt(_ c: () -> Swift.Void)
|
||||
public func ul(_ c: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ c: () -> Swift.Void)
|
||||
public func h2(_ c: () -> Swift.Void)
|
||||
public func h3(_ c: () -> Swift.Void)
|
||||
public func h4(_ c: () -> Swift.Void)
|
||||
public func h5(_ c: () -> Swift.Void)
|
||||
public func h6(_ c: () -> Swift.Void)
|
||||
public func bdi(_ c: () -> Swift.Void)
|
||||
public func bdo(_ c: () -> Swift.Void)
|
||||
public func big(_ c: () -> Swift.Void)
|
||||
public func col(_ c: () -> Swift.Void)
|
||||
public func del(_ c: () -> Swift.Void)
|
||||
public func dfn(_ c: () -> Swift.Void)
|
||||
public func dir(_ c: () -> Swift.Void)
|
||||
public func div(_ c: () -> Swift.Void)
|
||||
public func img(_ c: () -> Swift.Void)
|
||||
public func ins(_ c: () -> Swift.Void)
|
||||
public func kbd(_ c: () -> Swift.Void)
|
||||
public func map(_ c: () -> Swift.Void)
|
||||
public func nav(_ c: () -> Swift.Void)
|
||||
public func pre(_ c: () -> Swift.Void)
|
||||
public func rtc(_ c: () -> Swift.Void)
|
||||
public func sub(_ c: () -> Swift.Void)
|
||||
public func sup(_ c: () -> Swift.Void)
|
||||
public func varr(_ c: () -> Swift.Void)
|
||||
public func wbr(_ c: () -> Swift.Void)
|
||||
public func xmp(_ c: () -> Swift.Void)
|
||||
public func abbr(_ c: () -> Swift.Void)
|
||||
public func area(_ c: () -> Swift.Void)
|
||||
public func base(_ c: () -> Swift.Void)
|
||||
public func body(_ c: () -> Swift.Void)
|
||||
public func cite(_ c: () -> Swift.Void)
|
||||
public func code(_ c: () -> Swift.Void)
|
||||
public func data(_ c: () -> Swift.Void)
|
||||
public func font(_ c: () -> Swift.Void)
|
||||
public func form(_ c: () -> Swift.Void)
|
||||
public func head(_ c: () -> Swift.Void)
|
||||
public func html(_ c: () -> Swift.Void)
|
||||
public func link(_ c: () -> Swift.Void)
|
||||
public func main(_ c: () -> Swift.Void)
|
||||
public func mark(_ c: () -> Swift.Void)
|
||||
public func menu(_ c: () -> Swift.Void)
|
||||
public func meta(_ c: () -> Swift.Void)
|
||||
public func nobr(_ c: () -> Swift.Void)
|
||||
public func ruby(_ c: () -> Swift.Void)
|
||||
public func samp(_ c: () -> Swift.Void)
|
||||
public func span(_ c: () -> Swift.Void)
|
||||
public func time(_ c: () -> Swift.Void)
|
||||
public func aside(_ c: () -> Swift.Void)
|
||||
public func audio(_ c: () -> Swift.Void)
|
||||
public func blink(_ c: () -> Swift.Void)
|
||||
public func embed(_ c: () -> Swift.Void)
|
||||
public func frame(_ c: () -> Swift.Void)
|
||||
public func image(_ c: () -> Swift.Void)
|
||||
public func input(_ c: () -> Swift.Void)
|
||||
public func label(_ c: () -> Swift.Void)
|
||||
public func meter(_ c: () -> Swift.Void)
|
||||
public func param(_ c: () -> Swift.Void)
|
||||
public func small(_ c: () -> Swift.Void)
|
||||
public func style(_ c: () -> Swift.Void)
|
||||
public func table(_ c: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ c: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, c: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ c: () -> Swift.Void)
|
||||
public func thead(_ c: () -> Swift.Void)
|
||||
public func title(_ c: () -> Swift.Void)
|
||||
public func track(_ c: () -> Swift.Void)
|
||||
public func video(_ c: () -> Swift.Void)
|
||||
public func applet(_ c: () -> Swift.Void)
|
||||
public func button(_ c: () -> Swift.Void)
|
||||
public func canvas(_ c: () -> Swift.Void)
|
||||
public func center(_ c: () -> Swift.Void)
|
||||
public func dialog(_ c: () -> Swift.Void)
|
||||
public func figure(_ c: () -> Swift.Void)
|
||||
public func footer(_ c: () -> Swift.Void)
|
||||
public func header(_ c: () -> Swift.Void)
|
||||
public func hgroup(_ c: () -> Swift.Void)
|
||||
public func iframe(_ c: () -> Swift.Void)
|
||||
public func keygen(_ c: () -> Swift.Void)
|
||||
public func legend(_ c: () -> Swift.Void)
|
||||
public func object(_ c: () -> Swift.Void)
|
||||
public func option(_ c: () -> Swift.Void)
|
||||
public func output(_ c: () -> Swift.Void)
|
||||
public func script(_ c: () -> Swift.Void)
|
||||
public func select(_ c: () -> Swift.Void)
|
||||
public func shadow(_ c: () -> Swift.Void)
|
||||
public func source(_ c: () -> Swift.Void)
|
||||
public func spacer(_ c: () -> Swift.Void)
|
||||
public func strike(_ c: () -> Swift.Void)
|
||||
public func strong(_ c: () -> Swift.Void)
|
||||
public func acronym(_ c: () -> Swift.Void)
|
||||
public func address(_ c: () -> Swift.Void)
|
||||
public func article(_ c: () -> Swift.Void)
|
||||
public func bgsound(_ c: () -> Swift.Void)
|
||||
public func caption(_ c: () -> Swift.Void)
|
||||
public func command(_ c: () -> Swift.Void)
|
||||
public func content(_ c: () -> Swift.Void)
|
||||
public func details(_ c: () -> Swift.Void)
|
||||
public func elementt(_ c: () -> Swift.Void)
|
||||
public func isindex(_ c: () -> Swift.Void)
|
||||
public func listing(_ c: () -> Swift.Void)
|
||||
public func marquee(_ c: () -> Swift.Void)
|
||||
public func noembed(_ c: () -> Swift.Void)
|
||||
public func picture(_ c: () -> Swift.Void)
|
||||
public func section(_ c: () -> Swift.Void)
|
||||
public func summary(_ c: () -> Swift.Void)
|
||||
public func basefont(_ c: () -> Swift.Void)
|
||||
public func colgroup(_ c: () -> Swift.Void)
|
||||
public func datalist(_ c: () -> Swift.Void)
|
||||
public func fieldset(_ c: () -> Swift.Void)
|
||||
public func frameset(_ c: () -> Swift.Void)
|
||||
public func menuitem(_ c: () -> Swift.Void)
|
||||
public func multicol(_ c: () -> Swift.Void)
|
||||
public func noframes(_ c: () -> Swift.Void)
|
||||
public func noscript(_ c: () -> Swift.Void)
|
||||
public func optgroup(_ c: () -> Swift.Void)
|
||||
public func progress(_ c: () -> Swift.Void)
|
||||
public func template(_ c: () -> Swift.Void)
|
||||
public func textarea(_ c: () -> Swift.Void)
|
||||
public func plaintext(_ c: () -> Swift.Void)
|
||||
public func javascript(_ c: () -> Swift.Void)
|
||||
public func blockquote(_ c: () -> Swift.Void)
|
||||
public func figcaption(_ c: () -> Swift.Void)
|
||||
public func stylesheet(_ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ c: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ c: () -> Swift.Void)
|
||||
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)
|
||||
}
|
||||
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
|
||||
public 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 public 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)
|
||||
}
|
||||
public 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 var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.Int32)
|
||||
}
|
||||
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
|
||||
@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()
|
||||
public 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
|
||||
}
|
||||
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.
@@ -0,0 +1,4 @@
|
||||
framework module Swifter {
|
||||
header "Swifter-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
Versions/Current/Headers
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Modules
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Resources
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Starscream
|
||||
@@ -0,0 +1,222 @@
|
||||
// Generated by Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
#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(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("_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
|
||||
@@ -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.
+219
@@ -0,0 +1,219 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
|
||||
// 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 CoreFoundation
|
||||
import Foundation
|
||||
import Security
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public let WebsocketDidConnectNotification: Swift.String
|
||||
public let WebsocketDidDisconnectNotification: Swift.String
|
||||
public let WebsocketDisconnectionErrorKeyName: Swift.String
|
||||
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 init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case outputStreamWriteError
|
||||
case compressionError
|
||||
case invalidSSLError
|
||||
case writeTimeoutError
|
||||
case protocolError
|
||||
case upgradeError
|
||||
case closeError
|
||||
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.Int
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
var delegate: Starscream.WebSocketDelegate? { get set }
|
||||
var pongDelegate: Starscream.WebSocketPongDelegate? { get set }
|
||||
var disableSSLCertValidation: Swift.Bool { get set }
|
||||
var overrideTrustHostname: Swift.Bool { get set }
|
||||
var desiredTrustHostname: Swift.String? { get set }
|
||||
var sslClientCertificate: Starscream.SSLClientCertificate? { get set }
|
||||
var security: Starscream.SSLTrustValidator? { get set }
|
||||
var enabledSSLCipherSuites: [Security.SSLCipherSuite]? { get set }
|
||||
var isConnected: Swift.Bool { get }
|
||||
func connect()
|
||||
func disconnect(forceTimeout: Foundation.TimeInterval?, closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, 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 struct SSLSettings {
|
||||
public let useSSL: Swift.Bool
|
||||
public let disableCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public let sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public let cipherSuites: [Security.SSLCipherSuite]?
|
||||
}
|
||||
public protocol WSStreamDelegate : AnyObject {
|
||||
func newBytesInStream()
|
||||
func streamDidError(error: Swift.Error?)
|
||||
}
|
||||
public protocol WSStream {
|
||||
var delegate: Starscream.WSStreamDelegate? { get set }
|
||||
func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
func write(data: Foundation.Data) -> Swift.Int
|
||||
func read() -> Foundation.Data?
|
||||
func cleanup()
|
||||
func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
}
|
||||
@objc open class FoundationStream : ObjectiveC.NSObject, Starscream.WSStream, Foundation.StreamDelegate {
|
||||
weak public var delegate: Starscream.WSStreamDelegate?
|
||||
public var enableSOCKSProxy: Swift.Bool
|
||||
public func connect(url: Foundation.URL, port: Swift.Int, timeout: Foundation.TimeInterval, ssl: Starscream.SSLSettings, completion: @escaping ((Swift.Error?) -> Swift.Void))
|
||||
public func write(data: Foundation.Data) -> Swift.Int
|
||||
public func read() -> Foundation.Data?
|
||||
public func cleanup()
|
||||
public func sslTrust() -> (trust: Security.SecTrust?, domain: Swift.String?)
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocketClient)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocketClient, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocketClient, text: Swift.String)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocketClient, data: Foundation.Data)
|
||||
}
|
||||
public protocol WebSocketPongDelegate : AnyObject {
|
||||
func websocketDidReceivePong(socket: Starscream.WebSocketClient, data: Foundation.Data?)
|
||||
}
|
||||
public protocol WebSocketAdvancedDelegate : AnyObject {
|
||||
func websocketDidConnect(socket: Starscream.WebSocket)
|
||||
func websocketDidDisconnect(socket: Starscream.WebSocket, error: Swift.Error?)
|
||||
func websocketDidReceiveMessage(socket: Starscream.WebSocket, text: Swift.String, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketDidReceiveData(socket: Starscream.WebSocket, data: Foundation.Data, response: Starscream.WebSocket.WSResponse)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, request: Swift.String)
|
||||
func websocketHttpUpgrade(socket: Starscream.WebSocket, response: Swift.String)
|
||||
}
|
||||
@objc open class WebSocket : ObjectiveC.NSObject, Foundation.StreamDelegate, Starscream.WebSocketClient, Starscream.WSStreamDelegate {
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public static let ErrorDomain: Swift.String
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public class WSResponse {
|
||||
public var code: Starscream.WebSocket.OpCode
|
||||
public var frameCount: Swift.Int
|
||||
public var buffer: Foundation.NSMutableData?
|
||||
final public let firstFrame: Foundation.Date
|
||||
@objc deinit
|
||||
}
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
weak public var advancedDelegate: Starscream.WebSocketAdvancedDelegate?
|
||||
weak public var pongDelegate: Starscream.WebSocketPongDelegate?
|
||||
public var onConnect: (() -> Swift.Void)?
|
||||
public var onDisconnect: ((Swift.Error?) -> Swift.Void)?
|
||||
public var onText: ((Swift.String) -> Swift.Void)?
|
||||
public var onData: ((Foundation.Data) -> Swift.Void)?
|
||||
public var onPong: ((Foundation.Data?) -> Swift.Void)?
|
||||
public var onHttpResponseHeaders: (([Swift.String : Swift.String]) -> Swift.Void)?
|
||||
public var disableSSLCertValidation: Swift.Bool
|
||||
public var overrideTrustHostname: Swift.Bool
|
||||
public var desiredTrustHostname: Swift.String?
|
||||
public var sslClientCertificate: Starscream.SSLClientCertificate?
|
||||
public var enableCompression: Swift.Bool
|
||||
public var security: Starscream.SSLTrustValidator?
|
||||
public var enabledSSLCipherSuites: [Security.SSLCipherSuite]?
|
||||
public var isConnected: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var request: Foundation.URLRequest
|
||||
public var currentURL: Foundation.URL {
|
||||
get
|
||||
}
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(request: Foundation.URLRequest, protocols: [Swift.String]? = nil, stream: Starscream.WSStream = FoundationStream())
|
||||
convenience public init(url: Foundation.URL, protocols: [Swift.String]? = nil)
|
||||
convenience public init(url: Foundation.URL, writeQueueQOS: Foundation.QualityOfService, protocols: [Swift.String]? = nil)
|
||||
open func connect()
|
||||
open func disconnect(forceTimeout: Foundation.TimeInterval? = nil, closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
open func write(string: Swift.String, completion: (() -> ())? = nil)
|
||||
open func write(data: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(ping: Foundation.Data, completion: (() -> ())? = nil)
|
||||
open func write(pong: Foundation.Data, completion: (() -> ())? = nil)
|
||||
public func newBytesInStream()
|
||||
public func streamDidError(error: Swift.Error?)
|
||||
@objc deinit
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public protocol SSLTrustValidator {
|
||||
func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
}
|
||||
open class SSLCert {
|
||||
public init(data: Foundation.Data)
|
||||
public init(key: Security.SecKey)
|
||||
@objc deinit
|
||||
}
|
||||
open class SSLSecurity : Starscream.SSLTrustValidator {
|
||||
public var validatedDN: Swift.Bool
|
||||
public var validateEntireChain: Swift.Bool
|
||||
convenience public init(usePublicKeys: Swift.Bool = false)
|
||||
public init(certs: [Starscream.SSLCert], usePublicKeys: Swift.Bool)
|
||||
open func isValid(_ trust: Security.SecTrust, domain: Swift.String?) -> Swift.Bool
|
||||
public func extractPublicKey(_ data: Foundation.Data) -> Security.SecKey?
|
||||
public func extractPublicKey(_ cert: Security.SecCertificate, policy: Security.SecPolicy) -> Security.SecKey?
|
||||
public func certificateChain(_ trust: Security.SecTrust) -> [Foundation.Data]
|
||||
public func publicKeyChain(_ trust: Security.SecTrust) -> [Security.SecKey]
|
||||
@objc deinit
|
||||
}
|
||||
public struct SSLClientCertificateError : Foundation.LocalizedError {
|
||||
public var errorDescription: Swift.String?
|
||||
}
|
||||
public class SSLClientCertificate {
|
||||
convenience public init(pkcs12Path: Swift.String, password: Swift.String) throws
|
||||
public init(identity: Security.SecIdentity, identityCertificate: Security.SecCertificate)
|
||||
convenience public init(pkcs12Url: Foundation.URL, password: Swift.String) throws
|
||||
public init(pkcs12Url: Foundation.URL, importOptions: CoreFoundation.CFDictionary) throws
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Equatable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.Hashable {}
|
||||
extension Starscream.WebSocket.OpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
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