Compare commits
450 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c071f10bc8 | |||
| a9768580c1 | |||
| 37285cc86c | |||
| 7555a83c9b | |||
| 7cb2dbb5e6 | |||
| 94e6293f36 | |||
| 187a39ca14 | |||
| 6e63e74f81 | |||
| 229e4eeaa1 | |||
| e7d01c4ec1 | |||
| 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 | |||
| b2be8d0170 | |||
| 45be1b7a3f | |||
| 09aa72d43e | |||
| bf4b55bbd6 | |||
| a82279fad1 | |||
| 500e489d5d | |||
| 874f4f51e1 | |||
| 654f419f4e | |||
| a7c25fe33b | |||
| d2037f4cc5 | |||
| b87232dfb5 | |||
| 9e5678739f | |||
| 5cc8582d65 | |||
| aa078934c0 | |||
| 5c157caea3 | |||
| b567113b5f | |||
| 5b08fb6031 | |||
| b48f33fb72 | |||
| deccb727a1 | |||
| 8f1df8d138 | |||
| 0048710e24 | |||
| f6da0ddd32 | |||
| 513485e704 | |||
| fb3719c29d | |||
| 76fdc55f9e | |||
| 687b57fc1f | |||
| 319dc9a095 | |||
| 64440b5c5b | |||
| 3efe5752cb | |||
| 31f69e3afd | |||
| 72b29562e5 | |||
| 2b26eb35d7 | |||
| c4c8e99c0b | |||
| 5efe222196 | |||
| e56ff971b2 | |||
| 18b8a31d85 | |||
| d386730c75 | |||
| bc6e94d99a | |||
| 89f5e3786e | |||
| 0665ea0270 | |||
| 4ebc33b59a | |||
| 9e93806437 | |||
| 572e363717 | |||
| d8c8c3cb57 | |||
| 02eff541b1 | |||
| 92d6d833ea | |||
| 78b73c4c99 | |||
| dee376e1b9 | |||
| 5550658d83 | |||
| 82978bb963 | |||
| 0a203bbc68 | |||
| 38a762c60b | |||
| 96543932af | |||
| 39fa80904f | |||
| e4f0429ffb | |||
| ab41c148cd | |||
| a74aba3c5e | |||
| 9f266fff64 | |||
| 78d31af3f7 | |||
| 1a787019ec | |||
| f2f25763e7 | |||
| de3cf52687 | |||
| 49b151cd98 | |||
| e9fc66a68f | |||
| 0e25584191 | |||
| 074be89825 | |||
| 12dcb791a8 | |||
| de7dbfb9df | |||
| fe49ca7b25 | |||
| 7888b0bbba | |||
| 02791a4ea0 | |||
| 64a0b0e8dc | |||
| 6653d934f6 | |||
| 27f49dfc07 | |||
| ce02093e20 | |||
| e625acbb52 | |||
| 6d34ea0dab | |||
| 8c90da220e | |||
| d1c4282203 | |||
| d0d2cbdc40 | |||
| 2ce1a3edde |
+12
-2
@@ -16,6 +16,11 @@ DerivedData
|
||||
*.hmap
|
||||
*.ipa
|
||||
*.xcuserstate
|
||||
*.DS_Store
|
||||
|
||||
# SwiftPM
|
||||
Packages/
|
||||
.build
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
@@ -24,10 +29,15 @@ DerivedData
|
||||
# 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
|
||||
|
||||
# Swift Package Manager
|
||||
.swiftpm/
|
||||
|
||||
*.resolved
|
||||
@@ -0,0 +1 @@
|
||||
5.2.4
|
||||
@@ -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" == 4.0.4
|
||||
github "httpswift/swifter" == 1.5.0
|
||||
@@ -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</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.6.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "Leaderboard",
|
||||
dependencies: ["SlackKit"],
|
||||
path: "Leaderboard/Sources")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
target 'Leaderboard' do
|
||||
pod 'SlackKit', '>= 4.6.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.6.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "Robot or Not Bot",
|
||||
dependencies: ["SlackKit"],
|
||||
path: "Robot or Not Bot/Sources")
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
platform :osx, '10.11'
|
||||
|
||||
target 'Robot Or Not Bot' do
|
||||
pod 'SlackKit', '>= 4.6.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>
|
||||
@@ -0,0 +1,135 @@
|
||||
import Foundation
|
||||
import SlackKit
|
||||
|
||||
class RobotOrNotBot {
|
||||
|
||||
let verdicts: [String:Bool] = [
|
||||
"Mr. Roboto" : false,
|
||||
"Service Kiosks": false,
|
||||
"Darth Vader": false,
|
||||
"K-9": true,
|
||||
"Emotions": false,
|
||||
"Self-Driving Cars": false,
|
||||
"Telepresence Robots": false,
|
||||
"Roomba": true,
|
||||
"Assembly-Line Robot": false,
|
||||
"ASIMO": false,
|
||||
"KITT": false,
|
||||
"USS Enterprise": false,
|
||||
"Transformers": true,
|
||||
"Jaegers": false,
|
||||
"The Major": false,
|
||||
"Siri": false,
|
||||
"The Terminator": true,
|
||||
"Commander Data": false,
|
||||
"Marvin the Paranoid Android": true,
|
||||
"Pinocchio": false,
|
||||
"Droids": true,
|
||||
"Hitchbot": false,
|
||||
"Mars Rovers": false,
|
||||
"Space Probes": false,
|
||||
"Sasquatch": false,
|
||||
"Toaster": false,
|
||||
"Toaster Oven": false,
|
||||
"Cylons": false,
|
||||
"V'ger": true,
|
||||
"Ilia Robot": false,
|
||||
"The TARDIS": false,
|
||||
"Johnny 5": true,
|
||||
"Twiki": true,
|
||||
"Dr. Theopolis": false,
|
||||
"robots.txt": false,
|
||||
"Lobot": false,
|
||||
"Vicki": true,
|
||||
"GlaDOS": false,
|
||||
"Turrets": true,
|
||||
"Wheatley": true,
|
||||
"Herbie the Love Bug": false,
|
||||
"Iron Man": false,
|
||||
"Ultron": false,
|
||||
"The Vision": false,
|
||||
"Clockwork Droids": false,
|
||||
"Podcasts": false,
|
||||
"Cars": false,
|
||||
"Swimming Pool Cleaners": false,
|
||||
"Burritos": false,
|
||||
"Prince Robot IV": false,
|
||||
"Daleks": false,
|
||||
"Cybermen": false,
|
||||
"The Internet of Things": false,
|
||||
"Nanobots": true,
|
||||
"Two Intermeshed Gears": false,
|
||||
"Crow T. Robot": true,
|
||||
"Tom Servo": true,
|
||||
"Thomas and Friends": false,
|
||||
"Replicants": false,
|
||||
"Chatbots": false,
|
||||
"Agents": false,
|
||||
"Lego Simulated Worm Toy": true,
|
||||
"Ghosts": false,
|
||||
"Exos": true,
|
||||
"Rasputin": false,
|
||||
"Tamagotchi": false,
|
||||
"T-1000": true,
|
||||
"The Tin Woodman": false,
|
||||
"Mic N. The Robot": true,
|
||||
"Robot Or Not Bot": false
|
||||
]
|
||||
|
||||
let bot: SlackKit
|
||||
|
||||
init(token: String) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
let reaction = verdict ? "robot_face" : "no_entry_sign"
|
||||
bot.webAPI?.addReactionToMessage(name: reaction, channel: channel, timestamp: message.ts!, success: nil, failure: nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
// 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")
|
||||
// With OAuth
|
||||
// let slackbot = RobotOrNotBot(clientID: "CLIENT_ID", clientSecret: "CLIENT_SECRET")
|
||||
RunLoop.main.run()
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-x86_64_i386-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
<string>i386</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>macos-x86_64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>macos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-armv7_arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Starscream.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+466
@@ -0,0 +1,466 @@
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
BIN
Binary file not shown.
+466
@@ -0,0 +1,466 @@
|
||||
#if 0
|
||||
#elif defined(__x86_64__) && __x86_64__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#elif defined(__i386__) && __i386__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#endif
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target i386-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target i386-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-ios9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
+327
@@ -0,0 +1,327 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<data>
|
||||
BQJrNbsr8553nondsEMBqJfEBaw=
|
||||
</data>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>Info.plist</key>
|
||||
<data>
|
||||
oP4CFUqNJVIdoCv3XqdH8wLjvZ0=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftdoc</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftinterface</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftmodule</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftdoc</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftinterface</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftmodule</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
BQJrNbsr8553nondsEMBqJfEBaw=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
WzTAT3MIOflP3LGVWW13UJUM/PTx41Ql3QoytUeN5Gg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
uDB1F1BYBSS///5Kx3sW3b25gGjxudlItQDs2UvmKGE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
9MQkrsmF/cH+OB9/YmZMWJyxhobKXIq04SqWyHksiZY=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
SatBt0sLx/ncctmcfRqN71lYIEutDrpwHOLarbUHfK4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386-apple-ios-simulator.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
NLaKTrs6WDyaeZkwMVRsgiRWVv1FENjSwWITdK43DT0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
fv32O5WDulfxgcRaC7n399Q1LUA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
9MQkrsmF/cH+OB9/YmZMWJyxhobKXIq04SqWyHksiZY=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
xrC+rfT/vSQpK5Y1G6y0LpD0ApA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
SatBt0sLx/ncctmcfRqN71lYIEutDrpwHOLarbUHfK4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/i386.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
0Mi+Ky//XPptmpnyBTbUaukObl8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
NLaKTrs6WDyaeZkwMVRsgiRWVv1FENjSwWITdK43DT0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
Qs7n/ErVjkmr34fv+qUum3mp2aymGhyDuBFl2yUVhmo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
GdOgAurAtZ+vIe3ppOXWJDqOeEC8jdFypsFZ4DJv8oM=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
A+Ly7RgI0E7wOOb3VdQiyLSlOyCAUuOcEFPEc33v6x0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
F/tRxtfpdsFqZZbyLoGEErwoPu8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
Qs7n/ErVjkmr34fv+qUum3mp2aymGhyDuBFl2yUVhmo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
lmQeKejoQM4odh3MxRuv+Fs0P34=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
GdOgAurAtZ+vIe3ppOXWJDqOeEC8jdFypsFZ4DJv8oM=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
9sGwWb1dtHRdU3dBPXhnGJ8tF5w=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
A+Ly7RgI0E7wOOb3VdQiyLSlOyCAUuOcEFPEc33v6x0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
nYTs/q5E5rMtj3rXmqMuzZYThSlmu615k3gwB/Evs/I=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Headers
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Modules
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Resources
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Starscream
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-macos10.10 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-macos10.10 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<?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>BuildMachineOSBuild</key>
|
||||
<string>20A5384c</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Starscream</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.vluxe.Starscream</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Starscream</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.0.4</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>11E801a</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>19G68</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.15</string>
|
||||
<key>DTXcode</key>
|
||||
<string>1170</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>11E801a</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.10</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
<integer>3</integer>
|
||||
<integer>4</integer>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
BIN
Binary file not shown.
+231
@@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<data>
|
||||
QNIQI55xFN9YMaXB+YhyRpELnUo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
71VH+DTcavxNXarECOTUSHapQao=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
rjANGFLjI1AvDGsWvmCOHzqXjiMZTDLUy9f9oCpZLt0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
uDB1F1BYBSS///5Kx3sW3b25gGjxudlItQDs2UvmKGE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-macos.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
Pkh3V0Rz4xIirn/+23gpBwv8l54=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
5gIy/0PK510PmUcOJmZhZQ5iQQP53VCprEmclaGtQvQ=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-macos.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
ZVd1T94gkWNGYDEYoaHrQvbR4BA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
0sabhn4E3rIiCpjv+NMyaXuZ6OjGUgfb4swA3f3Qyuo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-macos.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
IklqmxI3t5CabQYPBG5s90wYP0o=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
h+mXqrumf1QHDKWAwXxW63QsitubfRwaZLb3IoJbjo8=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
Pkh3V0Rz4xIirn/+23gpBwv8l54=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
5gIy/0PK510PmUcOJmZhZQ5iQQP53VCprEmclaGtQvQ=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
ZVd1T94gkWNGYDEYoaHrQvbR4BA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
0sabhn4E3rIiCpjv+NMyaXuZ6OjGUgfb4swA3f3Qyuo=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
IklqmxI3t5CabQYPBG5s90wYP0o=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
h+mXqrumf1QHDKWAwXxW63QsitubfRwaZLb3IoJbjo8=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
nYTs/q5E5rMtj3rXmqMuzZYThSlmu615k3gwB/Evs/I=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
QNIQI55xFN9YMaXB+YhyRpELnUo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
qUklPdaPHW8qFlJJFtjYq6nBtKy8OCUJQPob507lP7Y=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^Resources/</key>
|
||||
<true/>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^[^/]+$</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
+1
@@ -0,0 +1 @@
|
||||
A
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-tvos9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-tvos9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
BIN
Binary file not shown.
+230
@@ -0,0 +1,230 @@
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
@import ObjectiveC;
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
||||
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
||||
#if __has_warning("-Wpragma-clang-attribute")
|
||||
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wnullability"
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma push_macro("any")
|
||||
# undef any
|
||||
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
||||
# pragma pop_macro("any")
|
||||
#endif
|
||||
|
||||
@class NSStream;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream19FoundationTransport")
|
||||
@interface FoundationTransport : NSObject <NSStreamDelegate>
|
||||
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
|
||||
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
||||
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
||||
@end
|
||||
|
||||
@class NSURLSession;
|
||||
@class NSURLSessionWebSocketTask;
|
||||
|
||||
SWIFT_CLASS("_TtC10Starscream12NativeEngine") SWIFT_AVAILABILITY(tvos,introduced=13.0) SWIFT_AVAILABILITY(watchos,introduced=6.0) SWIFT_AVAILABILITY(ios,introduced=13.0) SWIFT_AVAILABILITY(macos,introduced=10.15)
|
||||
@interface NativeEngine : NSObject <NSURLSessionDataDelegate, NSURLSessionWebSocketDelegate>
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didOpenWithProtocol:(NSString * _Nullable)protocol;
|
||||
- (void)URLSession:(NSURLSession * _Nonnull)session webSocketTask:(NSURLSessionWebSocketTask * _Nonnull)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(NSData * _Nullable)reason;
|
||||
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
#if __has_attribute(external_source_symbol)
|
||||
# pragma clang attribute pop
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Starscream.h
|
||||
// Starscream
|
||||
//
|
||||
// Created by Austin Cherry on 9/25/14.
|
||||
// Copyright (c) 2014 Vluxe. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//! Project version number for Starscream.
|
||||
FOUNDATION_EXPORT double StarscreamVersionNumber;
|
||||
|
||||
//! Project version string for Starscream.
|
||||
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <Starscream/PublicHeader.h>
|
||||
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-tvos9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+436
@@ -0,0 +1,436 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target x86_64-apple-tvos9.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Starscream
|
||||
import CommonCrypto
|
||||
import Foundation
|
||||
import Network
|
||||
@_exported import Starscream
|
||||
import Swift
|
||||
import zlib
|
||||
public enum HTTPUpgradeError : Swift.Error {
|
||||
case notAnUpgrade(Swift.Int)
|
||||
case invalidData
|
||||
}
|
||||
public struct HTTPWSHeader {
|
||||
public static func createUpgrade(request: Foundation.URLRequest, supportsCompression: Swift.Bool, secKeyValue: Swift.String) -> Foundation.URLRequest
|
||||
public static func generateWebSocketKey() -> Swift.String
|
||||
}
|
||||
public enum HTTPEvent {
|
||||
case success([Swift.String : Swift.String])
|
||||
case failure(Swift.Error)
|
||||
}
|
||||
public protocol HTTPHandlerDelegate : AnyObject {
|
||||
func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPHandler {
|
||||
func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
func parse(data: Foundation.Data) -> Swift.Int
|
||||
}
|
||||
public protocol HTTPServerDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.HTTPEvent)
|
||||
}
|
||||
public protocol HTTPServerHandler {
|
||||
func register(delegate: Starscream.HTTPServerDelegate)
|
||||
func parse(data: Foundation.Data)
|
||||
func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
}
|
||||
public struct URLParts {
|
||||
}
|
||||
extension URL {
|
||||
public var isTLSScheme: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public func getParts() -> Starscream.URLParts?
|
||||
}
|
||||
public protocol FrameCollectorDelegate : AnyObject {
|
||||
func didForm(event: Starscream.FrameCollector.Event)
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class FrameCollector {
|
||||
public enum Event {
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
case closed(Swift.String, Swift.UInt16)
|
||||
}
|
||||
public func add(frame: Starscream.Frame)
|
||||
@objc deinit
|
||||
}
|
||||
public enum SecurityErrorCode : Swift.UInt16 {
|
||||
case acceptFailed
|
||||
case pinningFailed
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum PinningState {
|
||||
case success
|
||||
case failed(CoreFoundation.CFError?)
|
||||
}
|
||||
public protocol CertificatePinning : AnyObject {
|
||||
func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
public protocol HeaderValidator : AnyObject {
|
||||
func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum TCPTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.TCPTransportError, b: Starscream.TCPTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class TCPTransport : Starscream.Transport {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(connection: Network.NWConnection)
|
||||
public init()
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc deinit
|
||||
}
|
||||
public enum FoundationSecurityError : Swift.Error {
|
||||
case invalidRequest
|
||||
public static func == (a: Starscream.FoundationSecurityError, b: Starscream.FoundationSecurityError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public class FoundationSecurity {
|
||||
public init(allowSelfSigned: Swift.Bool = false)
|
||||
@objc deinit
|
||||
}
|
||||
extension FoundationSecurity : Starscream.CertificatePinning {
|
||||
public func evaluateTrust(trust: Security.SecTrust, domain: Swift.String?, completion: ((Starscream.PinningState) -> ()))
|
||||
}
|
||||
extension FoundationSecurity : Starscream.HeaderValidator {
|
||||
public func validate(headers: [Swift.String : Swift.String], key: Swift.String) -> Swift.Error?
|
||||
}
|
||||
public enum FoundationTransportError : Swift.Error {
|
||||
case invalidRequest
|
||||
case invalidOutputStream
|
||||
case timeout
|
||||
public static func == (a: Starscream.FoundationTransportError, b: Starscream.FoundationTransportError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@objc public class FoundationTransport : ObjectiveC.NSObject, Starscream.Transport, Foundation.StreamDelegate {
|
||||
public var usingTLS: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public init(streamConfiguration: ((Foundation.InputStream, Foundation.OutputStream) -> Swift.Void)? = nil)
|
||||
@objc deinit
|
||||
public func connect(url: Foundation.URL, timeout: Swift.Double = 10, certificatePinning: Starscream.CertificatePinning? = nil)
|
||||
public func disconnect()
|
||||
public func register(delegate: Starscream.TransportEventClient)
|
||||
public func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
@objc open func stream(_ aStream: Foundation.Stream, handle eventCode: Foundation.Stream.Event)
|
||||
@objc override dynamic public init()
|
||||
}
|
||||
public enum ErrorType : Swift.Error {
|
||||
case compressionError
|
||||
case securityError
|
||||
case protocolError
|
||||
case serverError
|
||||
public static func == (a: Starscream.ErrorType, b: Starscream.ErrorType) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public struct WSError : Swift.Error {
|
||||
public let type: Starscream.ErrorType
|
||||
public let message: Swift.String
|
||||
public let code: Swift.UInt16
|
||||
public init(type: Starscream.ErrorType, message: Swift.String, code: Swift.UInt16)
|
||||
}
|
||||
public protocol WebSocketClient : AnyObject {
|
||||
func connect()
|
||||
func disconnect(closeCode: Swift.UInt16)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
}
|
||||
extension WebSocketClient {
|
||||
public func write(string: Swift.String)
|
||||
public func write(data: Foundation.Data)
|
||||
public func write(ping: Foundation.Data)
|
||||
public func write(pong: Foundation.Data)
|
||||
public func disconnect()
|
||||
}
|
||||
public enum WebSocketEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error?)
|
||||
case viabilityChanged(Swift.Bool)
|
||||
case reconnectSuggested(Swift.Bool)
|
||||
case cancelled
|
||||
}
|
||||
public protocol WebSocketDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket)
|
||||
}
|
||||
open class WebSocket : Starscream.WebSocketClient, Starscream.EngineDelegate {
|
||||
weak public var delegate: Starscream.WebSocketDelegate?
|
||||
public var onEvent: ((Starscream.WebSocketEvent) -> Swift.Void)?
|
||||
public var request: Foundation.URLRequest
|
||||
public var callbackQueue: Dispatch.DispatchQueue
|
||||
public var respondToPingWithPong: Swift.Bool {
|
||||
get
|
||||
set
|
||||
}
|
||||
public init(request: Foundation.URLRequest, engine: Starscream.Engine)
|
||||
convenience public init(request: Foundation.URLRequest, certPinner: Starscream.CertificatePinning? = FoundationSecurity(), compressionHandler: Starscream.CompressionHandler? = nil, useCustomEngine: Swift.Bool = true)
|
||||
public func connect()
|
||||
public func disconnect(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceDisconnect()
|
||||
public func write(data: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(stringData: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(ping: Foundation.Data, completion: (() -> ())?)
|
||||
public func write(pong: Foundation.Data, completion: (() -> ())?)
|
||||
public func didReceive(event: Starscream.WebSocketEvent)
|
||||
@objc deinit
|
||||
}
|
||||
public class StringHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
public protocol EngineDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.WebSocketEvent)
|
||||
}
|
||||
public protocol Engine {
|
||||
func register(delegate: Starscream.EngineDelegate)
|
||||
func start(request: Foundation.URLRequest)
|
||||
func stop(closeCode: Swift.UInt16)
|
||||
func forceStop()
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
func write(string: Swift.String, completion: (() -> ())?)
|
||||
}
|
||||
public enum CloseCode : Swift.UInt16 {
|
||||
case normal
|
||||
case goingAway
|
||||
case protocolError
|
||||
case protocolUnhandledType
|
||||
case noStatusReceived
|
||||
case encoding
|
||||
case policyViolated
|
||||
case messageTooBig
|
||||
public typealias RawValue = Swift.UInt16
|
||||
public var rawValue: Swift.UInt16 {
|
||||
get
|
||||
}
|
||||
public init?(rawValue: Swift.UInt16)
|
||||
}
|
||||
public enum FrameOpCode : Swift.UInt8 {
|
||||
case continueFrame
|
||||
case textFrame
|
||||
case binaryFrame
|
||||
case connectionClose
|
||||
case ping
|
||||
case pong
|
||||
case unknown
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public struct Frame {
|
||||
}
|
||||
public enum FrameEvent {
|
||||
case frame(Starscream.Frame)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol FramerEventClient : AnyObject {
|
||||
func frameProcessed(event: Starscream.FrameEvent)
|
||||
}
|
||||
public protocol Framer {
|
||||
func add(data: Foundation.Data)
|
||||
func register(delegate: Starscream.FramerEventClient)
|
||||
func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
func updateCompression(supports: Swift.Bool)
|
||||
func supportsCompression() -> Swift.Bool
|
||||
}
|
||||
public class WSFramer : Starscream.Framer {
|
||||
public var compressionEnabled: Swift.Bool
|
||||
public init(isServer: Swift.Bool = false)
|
||||
public func updateCompression(supports: Swift.Bool)
|
||||
public func supportsCompression() -> Swift.Bool
|
||||
public func add(data: Foundation.Data)
|
||||
public func register(delegate: Starscream.FramerEventClient)
|
||||
public func createWriteFrame(opcode: Starscream.FrameOpCode, payload: Foundation.Data, isCompressed: Swift.Bool) -> Foundation.Data
|
||||
@objc deinit
|
||||
}
|
||||
public protocol MyWSArrayType {
|
||||
}
|
||||
extension UInt8 : Starscream.MyWSArrayType {
|
||||
}
|
||||
extension Array where Element : Starscream.MyWSArrayType, Element : Swift.UnsignedInteger {
|
||||
public func readUint16(offset: Swift.Int) -> Swift.UInt16
|
||||
public func readUint64(offset: Swift.Int) -> Swift.UInt64
|
||||
public func unmaskData(maskStart: Swift.Int, offset: Swift.Int, length: Swift.Int) -> Foundation.Data
|
||||
}
|
||||
public func writeUint16(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt16)
|
||||
public func writeUint32(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt32)
|
||||
public func writeUint64(_ buffer: inout [Swift.UInt8], offset: Swift.Int, value: Swift.UInt64)
|
||||
@_hasMissingDesignatedInitializers public class FoundationHTTPServerHandler : Starscream.HTTPServerHandler {
|
||||
public func register(delegate: Starscream.HTTPServerDelegate)
|
||||
public func createResponse(headers: [Swift.String : Swift.String]) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data)
|
||||
@objc deinit
|
||||
}
|
||||
public class WSEngine : Starscream.Engine, Starscream.TransportEventClient, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.HTTPHandlerDelegate {
|
||||
public var respondToPingWithPong: Swift.Bool
|
||||
public init(transport: Starscream.Transport, certPinner: Starscream.CertificatePinning? = nil, headerValidator: Starscream.HeaderValidator = FoundationSecurity(), httpHandler: Starscream.HTTPHandler = FoundationHTTPHandler(), framer: Starscream.Framer = WSFramer(), compressionHandler: Starscream.CompressionHandler? = nil)
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16 = CloseCode.normal.rawValue)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceiveHTTP(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionState {
|
||||
case connected
|
||||
case waiting
|
||||
case cancelled
|
||||
case failed(Swift.Error?)
|
||||
case viability(Swift.Bool)
|
||||
case shouldReconnect(Swift.Bool)
|
||||
case receive(Foundation.Data)
|
||||
}
|
||||
public protocol TransportEventClient : AnyObject {
|
||||
func connectionChanged(state: Starscream.ConnectionState)
|
||||
}
|
||||
public protocol Transport : AnyObject {
|
||||
func register(delegate: Starscream.TransportEventClient)
|
||||
func connect(url: Foundation.URL, timeout: Swift.Double, certificatePinning: Starscream.CertificatePinning?)
|
||||
func disconnect()
|
||||
func write(data: Foundation.Data, completion: @escaping ((Swift.Error?) -> ()))
|
||||
var usingTLS: Swift.Bool { get }
|
||||
}
|
||||
extension Data {
|
||||
}
|
||||
public class FoundationHTTPHandler : Starscream.HTTPHandler {
|
||||
public init()
|
||||
public func convert(request: Foundation.URLRequest) -> Foundation.Data
|
||||
public func parse(data: Foundation.Data) -> Swift.Int
|
||||
public func register(delegate: Starscream.HTTPHandlerDelegate)
|
||||
@objc deinit
|
||||
}
|
||||
@available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
@available(watchOS, unavailable)
|
||||
public class WebSocketServer : Starscream.Server, Starscream.ConnectionDelegate {
|
||||
public var onEvent: ((Starscream.ServerEvent) -> Swift.Void)?
|
||||
public init()
|
||||
public func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
public func didReceive(event: Starscream.ServerEvent)
|
||||
@objc deinit
|
||||
}
|
||||
@_hasMissingDesignatedInitializers @available(OSX 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *)
|
||||
public class ServerConnection : Starscream.Connection, Starscream.HTTPServerDelegate, Starscream.FramerEventClient, Starscream.FrameCollectorDelegate, Starscream.TransportEventClient {
|
||||
public var onEvent: ((Starscream.ConnectionEvent) -> Swift.Void)?
|
||||
weak public var delegate: Starscream.ConnectionDelegate?
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
public func connectionChanged(state: Starscream.ConnectionState)
|
||||
public func didReceive(event: Starscream.HTTPEvent)
|
||||
public func frameProcessed(event: Starscream.FrameEvent)
|
||||
public func didForm(event: Starscream.FrameCollector.Event)
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
public enum ConnectionEvent {
|
||||
case connected([Swift.String : Swift.String])
|
||||
case disconnected(Swift.String, Swift.UInt16)
|
||||
case text(Swift.String)
|
||||
case binary(Foundation.Data)
|
||||
case pong(Foundation.Data?)
|
||||
case ping(Foundation.Data?)
|
||||
case error(Swift.Error)
|
||||
}
|
||||
public protocol Connection {
|
||||
func write(data: Foundation.Data, opcode: Starscream.FrameOpCode)
|
||||
}
|
||||
public protocol ConnectionDelegate : AnyObject {
|
||||
func didReceive(event: Starscream.ServerEvent)
|
||||
}
|
||||
public enum ServerEvent {
|
||||
case connected(Starscream.Connection, [Swift.String : Swift.String])
|
||||
case disconnected(Starscream.Connection, Swift.String, Swift.UInt16)
|
||||
case text(Starscream.Connection, Swift.String)
|
||||
case binary(Starscream.Connection, Foundation.Data)
|
||||
case pong(Starscream.Connection, Foundation.Data?)
|
||||
case ping(Starscream.Connection, Foundation.Data?)
|
||||
}
|
||||
public protocol Server {
|
||||
func start(address: Swift.String, port: Swift.UInt16) -> Swift.Error?
|
||||
}
|
||||
public protocol CompressionHandler {
|
||||
func load(headers: [Swift.String : Swift.String])
|
||||
func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
}
|
||||
public class WSCompression : Starscream.CompressionHandler {
|
||||
public init()
|
||||
public func load(headers: [Swift.String : Swift.String])
|
||||
public func decompress(data: Foundation.Data, isFinal: Swift.Bool) -> Foundation.Data?
|
||||
public func compress(data: Foundation.Data) -> Foundation.Data?
|
||||
@objc deinit
|
||||
}
|
||||
@objc @_inheritsConvenienceInitializers @available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
public class NativeEngine : ObjectiveC.NSObject, Starscream.Engine, Foundation.URLSessionDataDelegate, Foundation.URLSessionWebSocketDelegate {
|
||||
public func register(delegate: Starscream.EngineDelegate)
|
||||
public func start(request: Foundation.URLRequest)
|
||||
public func stop(closeCode: Swift.UInt16)
|
||||
public func forceStop()
|
||||
public func write(string: Swift.String, completion: (() -> ())?)
|
||||
public func write(data: Foundation.Data, opcode: Starscream.FrameOpCode, completion: (() -> ())?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didOpenWithProtocol protocol: Swift.String?)
|
||||
@objc public func urlSession(_ session: Foundation.URLSession, webSocketTask: Foundation.URLSessionWebSocketTask, didCloseWith closeCode: Foundation.URLSessionWebSocketTask.CloseCode, reason: Foundation.Data?)
|
||||
@objc override dynamic public init()
|
||||
@objc deinit
|
||||
}
|
||||
extension Starscream.SecurityErrorCode : Swift.Equatable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.Hashable {}
|
||||
extension Starscream.SecurityErrorCode : Swift.RawRepresentable {}
|
||||
extension Starscream.TCPTransportError : Swift.Equatable {}
|
||||
extension Starscream.TCPTransportError : Swift.Hashable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Equatable {}
|
||||
extension Starscream.FoundationSecurityError : Swift.Hashable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Equatable {}
|
||||
extension Starscream.FoundationTransportError : Swift.Hashable {}
|
||||
extension Starscream.ErrorType : Swift.Equatable {}
|
||||
extension Starscream.ErrorType : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.Equatable {}
|
||||
extension Starscream.CloseCode : Swift.Hashable {}
|
||||
extension Starscream.CloseCode : Swift.RawRepresentable {}
|
||||
extension Starscream.FrameOpCode : Swift.Equatable {}
|
||||
extension Starscream.FrameOpCode : Swift.Hashable {}
|
||||
extension Starscream.FrameOpCode : Swift.RawRepresentable {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
framework module Starscream {
|
||||
umbrella header "Starscream.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
||||
module Starscream.Swift {
|
||||
header "Starscream-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
BIN
Binary file not shown.
+237
@@ -0,0 +1,237 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<data>
|
||||
71VH+DTcavxNXarECOTUSHapQao=
|
||||
</data>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>Info.plist</key>
|
||||
<data>
|
||||
tF7kiYJWx0yWvlvq8f+a7xBmbpQ=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftdoc</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/Starscream-Swift.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
71VH+DTcavxNXarECOTUSHapQao=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
rjANGFLjI1AvDGsWvmCOHzqXjiMZTDLUy9f9oCpZLt0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/Starscream.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
bIF/9oSljUDPWlbHwEoxEPdpaHo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
uDB1F1BYBSS///5Kx3sW3b25gGjxudlItQDs2UvmKGE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
InDr2ZcxemKns5Bo8MAM67o/AIkEsHchCShO+5qhuNg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
FzUFqqCdWHmab6BnSIJmMgtBlPegXAyZ6NzSHRtHyQw=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
PoUbW/m1nLL1GgCSn8Fy6SDjvTubqrmCwDlno8ksL3g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftdoc</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
5bU1KbSjDTNOJZbLVzLoQKgChDU=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
InDr2ZcxemKns5Bo8MAM67o/AIkEsHchCShO+5qhuNg=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftinterface</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
EIZ5dVg6kfuXHaRG+85KIDBRrjM=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
FzUFqqCdWHmab6BnSIJmMgtBlPegXAyZ6NzSHRtHyQw=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/Starscream.swiftmodule/x86_64.swiftmodule</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
w7YmRYHMPPRh38huQYoLnklPLgE=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
PoUbW/m1nLL1GgCSn8Fy6SDjvTubqrmCwDlno8ksL3g=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
sr9DR7cNfv/8frVUIbBLPHCc60g=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
nYTs/q5E5rMtj3rXmqMuzZYThSlmu615k3gwB/Evs/I=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-x86_64_i386-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
<string>i386</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>macos-x86_64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>macos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>tvos-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>tvos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-armv7_arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Swifter.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
#if 0
|
||||
#elif defined(__arm64__) && __arm64__
|
||||
// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
#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.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
|
||||
#if !defined(__has_include)
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_attribute)
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
# define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
# define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_include(<swift/objc-prologue.h>)
|
||||
# include <swift/objc-prologue.h>
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic ignored "-Wauto-import"
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if !defined(SWIFT_TYPEDEFS)
|
||||
# define SWIFT_TYPEDEFS 1
|
||||
# if __has_include(<uchar.h>)
|
||||
# include <uchar.h>
|
||||
# elif !defined(__cplusplus)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
# endif
|
||||
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
|
||||
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
|
||||
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
|
||||
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PASTE)
|
||||
# define SWIFT_PASTE_HELPER(x, y) x##y
|
||||
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
|
||||
#endif
|
||||
#if !defined(SWIFT_METATYPE)
|
||||
# define SWIFT_METATYPE(X) Class
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_PROPERTY)
|
||||
# if __has_feature(objc_class_property)
|
||||
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
|
||||
# else
|
||||
# define SWIFT_CLASS_PROPERTY(...)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(objc_runtime_name)
|
||||
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
|
||||
#else
|
||||
# define SWIFT_RUNTIME_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(swift_name)
|
||||
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
|
||||
#else
|
||||
# define SWIFT_COMPILE_NAME(X)
|
||||
#endif
|
||||
#if __has_attribute(objc_method_family)
|
||||
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
|
||||
#else
|
||||
# define SWIFT_METHOD_FAMILY(X)
|
||||
#endif
|
||||
#if __has_attribute(noescape)
|
||||
# define SWIFT_NOESCAPE __attribute__((noescape))
|
||||
#else
|
||||
# define SWIFT_NOESCAPE
|
||||
#endif
|
||||
#if __has_attribute(ns_consumed)
|
||||
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
|
||||
#else
|
||||
# define SWIFT_RELEASES_ARGUMENT
|
||||
#endif
|
||||
#if __has_attribute(warn_unused_result)
|
||||
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define SWIFT_WARN_UNUSED_RESULT
|
||||
#endif
|
||||
#if __has_attribute(noreturn)
|
||||
# define SWIFT_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
# define SWIFT_NORETURN
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS_EXTRA)
|
||||
# define SWIFT_CLASS_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_PROTOCOL_EXTRA)
|
||||
# define SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_EXTRA)
|
||||
# define SWIFT_ENUM_EXTRA
|
||||
#endif
|
||||
#if !defined(SWIFT_CLASS)
|
||||
# if __has_attribute(objc_subclassing_restricted)
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# else
|
||||
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_RESILIENT_CLASS)
|
||||
# if __has_attribute(objc_class_stub)
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# else
|
||||
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
|
||||
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_PROTOCOL)
|
||||
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
|
||||
#endif
|
||||
|
||||
#if !defined(SWIFT_EXTENSION)
|
||||
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
|
||||
#endif
|
||||
|
||||
#if !defined(OBJC_DESIGNATED_INITIALIZER)
|
||||
# if __has_attribute(objc_designated_initializer)
|
||||
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
|
||||
# else
|
||||
# define OBJC_DESIGNATED_INITIALIZER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM_ATTR)
|
||||
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
|
||||
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
|
||||
# else
|
||||
# define SWIFT_ENUM_ATTR(_extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_ENUM)
|
||||
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# if __has_feature(generalized_swift_name)
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
||||
# else
|
||||
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE)
|
||||
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
||||
#endif
|
||||
#if !defined(SWIFT_UNAVAILABLE_MSG)
|
||||
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
|
||||
#endif
|
||||
#if !defined(SWIFT_AVAILABILITY)
|
||||
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
||||
#endif
|
||||
#if !defined(SWIFT_WEAK_IMPORT)
|
||||
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED)
|
||||
# define SWIFT_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
#if !defined(SWIFT_DEPRECATED_MSG)
|
||||
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
|
||||
#endif
|
||||
#if __has_feature(attribute_diagnose_if_objc)
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
|
||||
#else
|
||||
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
|
||||
#endif
|
||||
#if !defined(IBSegueAction)
|
||||
# define IBSegueAction
|
||||
#endif
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
#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
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// SwifteriOS.h
|
||||
// SwifteriOS
|
||||
//
|
||||
// Created by Romain Pouclet on 2015-11-24.
|
||||
// Copyright © 2015 Damian Kołakowski. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for SwifteriOS.
|
||||
FOUNDATION_EXPORT double SwifteriOSVersionNumber;
|
||||
|
||||
//! Project version string for SwifteriOS.
|
||||
FOUNDATION_EXPORT const unsigned char SwifteriOSVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <SwifteriOS/PublicHeader.h>
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target arm64-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
BIN
Binary file not shown.
+583
@@ -0,0 +1,583 @@
|
||||
// swift-interface-format-version: 1.0
|
||||
// swift-compiler-version: Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
|
||||
// swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Swifter
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import Swift
|
||||
extension String {
|
||||
public enum FileError : Swift.Error {
|
||||
case error(Swift.Int32)
|
||||
}
|
||||
public class File {
|
||||
public init(_ pointer: Swift.UnsafeMutablePointer<Darwin.FILE>)
|
||||
public func close()
|
||||
public func seek(_ offset: Swift.Int) -> Swift.Bool
|
||||
public func read(_ data: inout [Swift.UInt8]) throws -> Swift.Int
|
||||
public func write(_ data: [Swift.UInt8]) throws
|
||||
public static func currentWorkingDirectory() throws -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
public static var pathSeparator: Swift.String
|
||||
public func openNewForWriting() throws -> Swift.String.File
|
||||
public func openForReading() throws -> Swift.String.File
|
||||
public func openForWritingAndReading() throws -> Swift.String.File
|
||||
public func openFileForMode(_ path: Swift.String, _ mode: Swift.String) throws -> Swift.String.File
|
||||
public func exists() throws -> Swift.Bool
|
||||
public func directory() throws -> Swift.Bool
|
||||
public func files() throws -> [Swift.String]
|
||||
}
|
||||
public enum SerializationError : Swift.Error {
|
||||
case invalidObject
|
||||
case notSupported
|
||||
public static func == (a: Swifter.SerializationError, b: Swifter.SerializationError) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
public protocol HttpResponseBodyWriter {
|
||||
func write(_ file: Swift.String.File) throws
|
||||
func write(_ data: [Swift.UInt8]) throws
|
||||
func write(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
func write(_ data: Foundation.NSData) throws
|
||||
func write(_ data: Foundation.Data) throws
|
||||
}
|
||||
public enum HttpResponseBody {
|
||||
case json(Any)
|
||||
case html(Swift.String)
|
||||
case htmlBody(Swift.String)
|
||||
case text(Swift.String)
|
||||
case data(Foundation.Data, contentType: Swift.String? = nil)
|
||||
case custom(Any, (Any) throws -> Swift.String)
|
||||
}
|
||||
public enum HttpResponse {
|
||||
case switchProtocols([Swift.String : Swift.String], (Swifter.Socket) -> Swift.Void)
|
||||
case ok(Swifter.HttpResponseBody), created, accepted
|
||||
case movedPermanently(Swift.String)
|
||||
case movedTemporarily(Swift.String)
|
||||
case badRequest(Swifter.HttpResponseBody?), unauthorized, forbidden, notFound, notAcceptable
|
||||
case tooManyRequests
|
||||
case internalServerError
|
||||
case raw(Swift.Int, Swift.String, [Swift.String : Swift.String]?, ((Swifter.HttpResponseBodyWriter) throws -> Swift.Void)?)
|
||||
public var statusCode: Swift.Int {
|
||||
get
|
||||
}
|
||||
public var reasonPhrase: Swift.String {
|
||||
get
|
||||
}
|
||||
public func headers() -> [Swift.String : Swift.String]
|
||||
}
|
||||
public func scopes(_ scope: @escaping Swifter.Closure) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public typealias Closure = () -> Swift.Void
|
||||
public var idd: Swift.String?
|
||||
public var dir: Swift.String?
|
||||
public var rel: Swift.String?
|
||||
public var rev: Swift.String?
|
||||
public var alt: Swift.String?
|
||||
public var forr: Swift.String?
|
||||
public var src: Swift.String?
|
||||
public var type: Swift.String?
|
||||
public var href: Swift.String?
|
||||
public var text: Swift.String?
|
||||
public var abbr: Swift.String?
|
||||
public var size: Swift.String?
|
||||
public var face: Swift.String?
|
||||
public var char: Swift.String?
|
||||
public var cite: Swift.String?
|
||||
public var span: Swift.String?
|
||||
public var data: Swift.String?
|
||||
public var axis: Swift.String?
|
||||
public var Name: Swift.String?
|
||||
public var name: Swift.String?
|
||||
public var code: Swift.String?
|
||||
public var link: Swift.String?
|
||||
public var lang: Swift.String?
|
||||
public var cols: Swift.String?
|
||||
public var rows: Swift.String?
|
||||
public var ismap: Swift.String?
|
||||
public var shape: Swift.String?
|
||||
public var style: Swift.String?
|
||||
public var alink: Swift.String?
|
||||
public var width: Swift.String?
|
||||
public var rules: Swift.String?
|
||||
public var align: Swift.String?
|
||||
public var frame: Swift.String?
|
||||
public var vlink: Swift.String?
|
||||
public var deferr: Swift.String?
|
||||
public var color: Swift.String?
|
||||
public var media: Swift.String?
|
||||
public var title: Swift.String?
|
||||
public var scope: Swift.String?
|
||||
public var classs: Swift.String?
|
||||
public var manifest: Swift.String?
|
||||
public var value: Swift.String?
|
||||
public var clear: Swift.String?
|
||||
public var start: Swift.String?
|
||||
public var label: Swift.String?
|
||||
public var action: Swift.String?
|
||||
public var height: Swift.String?
|
||||
public var method: Swift.String?
|
||||
public var acceptt: Swift.String?
|
||||
public var object: Swift.String?
|
||||
public var scheme: Swift.String?
|
||||
public var coords: Swift.String?
|
||||
public var usemap: Swift.String?
|
||||
public var onblur: Swift.String?
|
||||
public var nohref: Swift.String?
|
||||
public var nowrap: Swift.String?
|
||||
public var hspace: Swift.String?
|
||||
public var border: Swift.String?
|
||||
public var valign: Swift.String?
|
||||
public var vspace: Swift.String?
|
||||
public var onload: Swift.String?
|
||||
public var target: Swift.String?
|
||||
public var prompt: Swift.String?
|
||||
public var onfocus: Swift.String?
|
||||
public var enctype: Swift.String?
|
||||
public var onclick: Swift.String?
|
||||
public var ontouchstart: Swift.String?
|
||||
public var onkeyup: Swift.String?
|
||||
public var profile: Swift.String?
|
||||
public var version: Swift.String?
|
||||
public var onreset: Swift.String?
|
||||
public var charset: Swift.String?
|
||||
public var standby: Swift.String?
|
||||
public var colspan: Swift.String?
|
||||
public var charoff: Swift.String?
|
||||
public var classid: Swift.String?
|
||||
public var compact: Swift.String?
|
||||
public var declare: Swift.String?
|
||||
public var rowspan: Swift.String?
|
||||
public var checked: Swift.String?
|
||||
public var archive: Swift.String?
|
||||
public var bgcolor: Swift.String?
|
||||
public var content: Swift.String?
|
||||
public var noshade: Swift.String?
|
||||
public var summary: Swift.String?
|
||||
public var headers: Swift.String?
|
||||
public var onselect: Swift.String?
|
||||
public var readonly: Swift.String?
|
||||
public var tabindex: Swift.String?
|
||||
public var onchange: Swift.String?
|
||||
public var noresize: Swift.String?
|
||||
public var disabled: Swift.String?
|
||||
public var longdesc: Swift.String?
|
||||
public var codebase: Swift.String?
|
||||
public var language: Swift.String?
|
||||
public var datetime: Swift.String?
|
||||
public var selected: Swift.String?
|
||||
public var hreflang: Swift.String?
|
||||
public var onsubmit: Swift.String?
|
||||
public var multiple: Swift.String?
|
||||
public var onunload: Swift.String?
|
||||
public var codetype: Swift.String?
|
||||
public var scrolling: Swift.String?
|
||||
public var onkeydown: Swift.String?
|
||||
public var maxlength: Swift.String?
|
||||
public var valuetype: Swift.String?
|
||||
public var accesskey: Swift.String?
|
||||
public var onmouseup: Swift.String?
|
||||
public var autofocus: Swift.String?
|
||||
public var onkeypress: Swift.String?
|
||||
public var ondblclick: Swift.String?
|
||||
public var onmouseout: Swift.String?
|
||||
public var httpEquiv: Swift.String?
|
||||
public var dataText: Swift.String?
|
||||
public var background: Swift.String?
|
||||
public var onmousemove: Swift.String?
|
||||
public var onmouseover: Swift.String?
|
||||
public var cellpadding: Swift.String?
|
||||
public var onmousedown: Swift.String?
|
||||
public var frameborder: Swift.String?
|
||||
public var marginwidth: Swift.String?
|
||||
public var cellspacing: Swift.String?
|
||||
public var placeholder: Swift.String?
|
||||
public var marginheight: Swift.String?
|
||||
public var acceptCharset: Swift.String?
|
||||
public var inner: Swift.String?
|
||||
public func a(_ closure: () -> Swift.Void)
|
||||
public func b(_ closure: () -> Swift.Void)
|
||||
public func i(_ closure: () -> Swift.Void)
|
||||
public func p(_ closure: () -> Swift.Void)
|
||||
public func q(_ closure: () -> Swift.Void)
|
||||
public func s(_ closure: () -> Swift.Void)
|
||||
public func u(_ closure: () -> Swift.Void)
|
||||
public func br(_ closure: () -> Swift.Void)
|
||||
public func dd(_ closure: () -> Swift.Void)
|
||||
public func dl(_ closure: () -> Swift.Void)
|
||||
public func dt(_ closure: () -> Swift.Void)
|
||||
public func em(_ closure: () -> Swift.Void)
|
||||
public func hr(_ closure: () -> Swift.Void)
|
||||
public func li(_ closure: () -> Swift.Void)
|
||||
public func ol(_ closure: () -> Swift.Void)
|
||||
public func rp(_ closure: () -> Swift.Void)
|
||||
public func rt(_ closure: () -> Swift.Void)
|
||||
public func td(_ closure: () -> Swift.Void)
|
||||
public func th(_ closure: () -> Swift.Void)
|
||||
public func tr(_ closure: () -> Swift.Void)
|
||||
public func tt(_ closure: () -> Swift.Void)
|
||||
public func ul(_ closure: () -> Swift.Void)
|
||||
public func ul<T>(_ collection: T, _ closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func h1(_ closure: () -> Swift.Void)
|
||||
public func h2(_ closure: () -> Swift.Void)
|
||||
public func h3(_ closure: () -> Swift.Void)
|
||||
public func h4(_ closure: () -> Swift.Void)
|
||||
public func h5(_ closure: () -> Swift.Void)
|
||||
public func h6(_ closure: () -> Swift.Void)
|
||||
public func bdi(_ closure: () -> Swift.Void)
|
||||
public func bdo(_ closure: () -> Swift.Void)
|
||||
public func big(_ closure: () -> Swift.Void)
|
||||
public func col(_ closure: () -> Swift.Void)
|
||||
public func del(_ closure: () -> Swift.Void)
|
||||
public func dfn(_ closure: () -> Swift.Void)
|
||||
public func dir(_ closure: () -> Swift.Void)
|
||||
public func div(_ closure: () -> Swift.Void)
|
||||
public func img(_ closure: () -> Swift.Void)
|
||||
public func ins(_ closure: () -> Swift.Void)
|
||||
public func kbd(_ closure: () -> Swift.Void)
|
||||
public func map(_ closure: () -> Swift.Void)
|
||||
public func nav(_ closure: () -> Swift.Void)
|
||||
public func pre(_ closure: () -> Swift.Void)
|
||||
public func rtc(_ closure: () -> Swift.Void)
|
||||
public func sub(_ closure: () -> Swift.Void)
|
||||
public func sup(_ closure: () -> Swift.Void)
|
||||
public func varr(_ closure: () -> Swift.Void)
|
||||
public func wbr(_ closure: () -> Swift.Void)
|
||||
public func xmp(_ closure: () -> Swift.Void)
|
||||
public func abbr(_ closure: () -> Swift.Void)
|
||||
public func area(_ closure: () -> Swift.Void)
|
||||
public func base(_ closure: () -> Swift.Void)
|
||||
public func body(_ closure: () -> Swift.Void)
|
||||
public func cite(_ closure: () -> Swift.Void)
|
||||
public func code(_ closure: () -> Swift.Void)
|
||||
public func data(_ closure: () -> Swift.Void)
|
||||
public func font(_ closure: () -> Swift.Void)
|
||||
public func form(_ closure: () -> Swift.Void)
|
||||
public func head(_ closure: () -> Swift.Void)
|
||||
public func html(_ closure: () -> Swift.Void)
|
||||
public func link(_ closure: () -> Swift.Void)
|
||||
public func main(_ closure: () -> Swift.Void)
|
||||
public func mark(_ closure: () -> Swift.Void)
|
||||
public func menu(_ closure: () -> Swift.Void)
|
||||
public func meta(_ closure: () -> Swift.Void)
|
||||
public func nobr(_ closure: () -> Swift.Void)
|
||||
public func ruby(_ closure: () -> Swift.Void)
|
||||
public func samp(_ closure: () -> Swift.Void)
|
||||
public func span(_ closure: () -> Swift.Void)
|
||||
public func time(_ closure: () -> Swift.Void)
|
||||
public func aside(_ closure: () -> Swift.Void)
|
||||
public func audio(_ closure: () -> Swift.Void)
|
||||
public func blink(_ closure: () -> Swift.Void)
|
||||
public func embed(_ closure: () -> Swift.Void)
|
||||
public func frame(_ closure: () -> Swift.Void)
|
||||
public func image(_ closure: () -> Swift.Void)
|
||||
public func input(_ closure: () -> Swift.Void)
|
||||
public func label(_ closure: () -> Swift.Void)
|
||||
public func meter(_ closure: () -> Swift.Void)
|
||||
public func param(_ closure: () -> Swift.Void)
|
||||
public func small(_ closure: () -> Swift.Void)
|
||||
public func style(_ closure: () -> Swift.Void)
|
||||
public func table(_ closure: () -> Swift.Void)
|
||||
public func table<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tbody(_ closure: () -> Swift.Void)
|
||||
public func tbody<T>(_ collection: T, closure: @escaping (T.Iterator.Element) -> Swift.Void) where T : Swift.Sequence
|
||||
public func tfoot(_ closure: () -> Swift.Void)
|
||||
public func thead(_ closure: () -> Swift.Void)
|
||||
public func title(_ closure: () -> Swift.Void)
|
||||
public func track(_ closure: () -> Swift.Void)
|
||||
public func video(_ closure: () -> Swift.Void)
|
||||
public func applet(_ closure: () -> Swift.Void)
|
||||
public func button(_ closure: () -> Swift.Void)
|
||||
public func canvas(_ closure: () -> Swift.Void)
|
||||
public func center(_ closure: () -> Swift.Void)
|
||||
public func dialog(_ closure: () -> Swift.Void)
|
||||
public func figure(_ closure: () -> Swift.Void)
|
||||
public func footer(_ closure: () -> Swift.Void)
|
||||
public func header(_ closure: () -> Swift.Void)
|
||||
public func hgroup(_ closure: () -> Swift.Void)
|
||||
public func iframe(_ closure: () -> Swift.Void)
|
||||
public func keygen(_ closure: () -> Swift.Void)
|
||||
public func legend(_ closure: () -> Swift.Void)
|
||||
public func object(_ closure: () -> Swift.Void)
|
||||
public func option(_ closure: () -> Swift.Void)
|
||||
public func output(_ closure: () -> Swift.Void)
|
||||
public func script(_ closure: () -> Swift.Void)
|
||||
public func select(_ closure: () -> Swift.Void)
|
||||
public func shadow(_ closure: () -> Swift.Void)
|
||||
public func source(_ closure: () -> Swift.Void)
|
||||
public func spacer(_ closure: () -> Swift.Void)
|
||||
public func strike(_ closure: () -> Swift.Void)
|
||||
public func strong(_ closure: () -> Swift.Void)
|
||||
public func acronym(_ closure: () -> Swift.Void)
|
||||
public func address(_ closure: () -> Swift.Void)
|
||||
public func article(_ closure: () -> Swift.Void)
|
||||
public func bgsound(_ closure: () -> Swift.Void)
|
||||
public func caption(_ closure: () -> Swift.Void)
|
||||
public func command(_ closure: () -> Swift.Void)
|
||||
public func content(_ closure: () -> Swift.Void)
|
||||
public func details(_ closure: () -> Swift.Void)
|
||||
public func elementt(_ closure: () -> Swift.Void)
|
||||
public func isindex(_ closure: () -> Swift.Void)
|
||||
public func listing(_ closure: () -> Swift.Void)
|
||||
public func marquee(_ closure: () -> Swift.Void)
|
||||
public func noembed(_ closure: () -> Swift.Void)
|
||||
public func picture(_ closure: () -> Swift.Void)
|
||||
public func section(_ closure: () -> Swift.Void)
|
||||
public func summary(_ closure: () -> Swift.Void)
|
||||
public func basefont(_ closure: () -> Swift.Void)
|
||||
public func colgroup(_ closure: () -> Swift.Void)
|
||||
public func datalist(_ closure: () -> Swift.Void)
|
||||
public func fieldset(_ closure: () -> Swift.Void)
|
||||
public func frameset(_ closure: () -> Swift.Void)
|
||||
public func menuitem(_ closure: () -> Swift.Void)
|
||||
public func multicol(_ closure: () -> Swift.Void)
|
||||
public func noframes(_ closure: () -> Swift.Void)
|
||||
public func noscript(_ closure: () -> Swift.Void)
|
||||
public func optgroup(_ closure: () -> Swift.Void)
|
||||
public func progress(_ closure: () -> Swift.Void)
|
||||
public func template(_ closure: () -> Swift.Void)
|
||||
public func textarea(_ closure: () -> Swift.Void)
|
||||
public func plaintext(_ closure: () -> Swift.Void)
|
||||
public func javascript(_ closure: () -> Swift.Void)
|
||||
public func blockquote(_ closure: () -> Swift.Void)
|
||||
public func figcaption(_ closure: () -> Swift.Void)
|
||||
public func stylesheet(_ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ closure: () -> Swift.Void)
|
||||
public func element(_ node: Swift.String, _ attrs: [Swift.String : Swift.String?] = [:], _ closure: () -> Swift.Void)
|
||||
@_hasMissingDesignatedInitializers public class Process {
|
||||
public static var pid: Swift.Int {
|
||||
get
|
||||
}
|
||||
public static var tid: Swift.UInt64 {
|
||||
get
|
||||
}
|
||||
public static func watchSignals(_ callback: @escaping (Swift.Int32) -> Swift.Void)
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpParser {
|
||||
public init()
|
||||
public func readHttpRequest(_ socket: Swifter.Socket) throws -> Swifter.HttpRequest
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public func unquote() -> Swift.String
|
||||
}
|
||||
extension Unicode.Scalar {
|
||||
public func asWhitespace() -> Swift.UInt8?
|
||||
}
|
||||
@available(*, deprecated, message: "Use websocket(text:binary:pong:connected:disconnected:) instead.")
|
||||
public func websocket(_ text: @escaping (Swifter.WebSocketSession, Swift.String) -> Swift.Void, _ binary: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void, _ pong: @escaping (Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func websocket(text: ((Swifter.WebSocketSession, Swift.String) -> Swift.Void)? = nil, binary: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, pong: ((Swifter.WebSocketSession, [Swift.UInt8]) -> Swift.Void)? = nil, connected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil, disconnected: ((Swifter.WebSocketSession) -> Swift.Void)? = nil) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public class WebSocketSession : Swift.Hashable, Swift.Equatable {
|
||||
public enum WsError : Swift.Error {
|
||||
case unknownOpCode(Swift.String), unMaskedFrame(Swift.String), protocolError(Swift.String), invalidUTF8(Swift.String)
|
||||
}
|
||||
public enum OpCode : Swift.UInt8 {
|
||||
case `continue`, close, ping, pong, text, binary
|
||||
public typealias RawValue = Swift.UInt8
|
||||
public init?(rawValue: Swift.UInt8)
|
||||
public var rawValue: Swift.UInt8 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public enum Control : Swift.Error {
|
||||
case close
|
||||
public static func == (a: Swifter.WebSocketSession.Control, b: Swifter.WebSocketSession.Control) -> Swift.Bool
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Frame {
|
||||
public var opcode: Swifter.WebSocketSession.OpCode
|
||||
public var fin: Swift.Bool
|
||||
public var rsv1: Swift.UInt8
|
||||
public var rsv2: Swift.UInt8
|
||||
public var rsv3: Swift.UInt8
|
||||
public var payload: [Swift.UInt8]
|
||||
@objc deinit
|
||||
}
|
||||
final public let socket: Swifter.Socket
|
||||
public init(_ socket: Swifter.Socket)
|
||||
@objc deinit
|
||||
public func writeText(_ text: Swift.String)
|
||||
public func writeBinary(_ binary: [Swift.UInt8])
|
||||
public func writeBinary(_ binary: Swift.ArraySlice<Swift.UInt8>)
|
||||
public func writeFrame(_ data: Swift.ArraySlice<Swift.UInt8>, _ op: Swifter.WebSocketSession.OpCode, _ fin: Swift.Bool = true)
|
||||
public func writeCloseFrame()
|
||||
public func readFrame() throws -> Swifter.WebSocketSession.Frame
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (webSocketSession1: Swifter.WebSocketSession, webSocketSession2: Swifter.WebSocketSession) -> Swift.Bool
|
||||
@_inheritsConvenienceInitializers open class HttpServer : Swifter.HttpServerIO {
|
||||
public static let VERSION: Swift.String
|
||||
override public init()
|
||||
public var DELETE: Swifter.HttpServer.MethodRoute, PATCH: Swifter.HttpServer.MethodRoute, HEAD: Swifter.HttpServer.MethodRoute, POST: Swifter.HttpServer.MethodRoute, GET: Swifter.HttpServer.MethodRoute, PUT: Swifter.HttpServer.MethodRoute
|
||||
public var delete: Swifter.HttpServer.MethodRoute, patch: Swifter.HttpServer.MethodRoute, head: Swifter.HttpServer.MethodRoute, post: Swifter.HttpServer.MethodRoute, get: Swifter.HttpServer.MethodRoute, put: Swifter.HttpServer.MethodRoute
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
public var routes: [Swift.String] {
|
||||
get
|
||||
}
|
||||
public var notFoundHandler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
public var middleware: [(Swifter.HttpRequest) -> Swifter.HttpResponse?]
|
||||
override open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public struct MethodRoute {
|
||||
public let method: Swift.String
|
||||
public let router: Swifter.HttpRouter
|
||||
public subscript(path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)? {
|
||||
get
|
||||
set
|
||||
}
|
||||
}
|
||||
@objc deinit
|
||||
}
|
||||
public class HttpRequest {
|
||||
public var path: Swift.String
|
||||
public var queryParams: [(Swift.String, Swift.String)]
|
||||
public var method: Swift.String
|
||||
public var headers: [Swift.String : Swift.String]
|
||||
public var body: [Swift.UInt8]
|
||||
public var address: Swift.String?
|
||||
public var params: [Swift.String : Swift.String]
|
||||
public init()
|
||||
public func hasTokenForHeader(_ headerName: Swift.String, token: Swift.String) -> Swift.Bool
|
||||
public func parseUrlencodedForm() -> [(Swift.String, Swift.String)]
|
||||
public struct MultiPart {
|
||||
public let headers: [Swift.String : Swift.String]
|
||||
public let body: [Swift.UInt8]
|
||||
public var name: Swift.String? {
|
||||
get
|
||||
}
|
||||
public var fileName: Swift.String? {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func parseMultiPartFormData() -> [Swifter.HttpRequest.MultiPart]
|
||||
@objc deinit
|
||||
}
|
||||
public func demoServer(_ publicDir: Swift.String) -> Swifter.HttpServer
|
||||
extension Socket {
|
||||
public func writeFile(_ file: Swift.String.File) throws
|
||||
}
|
||||
public enum SocketError : Swift.Error {
|
||||
case socketCreationFailed(Swift.String)
|
||||
case socketSettingReUseAddrFailed(Swift.String)
|
||||
case bindFailed(Swift.String)
|
||||
case listenFailed(Swift.String)
|
||||
case writeFailed(Swift.String)
|
||||
case getPeerNameFailed(Swift.String)
|
||||
case convertingPeerNameFailed
|
||||
case getNameInfoFailed(Swift.String)
|
||||
case acceptFailed(Swift.String)
|
||||
case recvFailed(Swift.String)
|
||||
case getSockNameFailed(Swift.String)
|
||||
}
|
||||
open class Socket : Swift.Hashable, Swift.Equatable {
|
||||
public init(socketFileDescriptor: Swift.Int32)
|
||||
@objc deinit
|
||||
public func hash(into hasher: inout Swift.Hasher)
|
||||
public func close()
|
||||
public func port() throws -> Darwin.in_port_t
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public func writeUTF8(_ string: Swift.String) throws
|
||||
public func writeUInt8(_ data: [Swift.UInt8]) throws
|
||||
public func writeUInt8(_ data: Swift.ArraySlice<Swift.UInt8>) throws
|
||||
public func writeData(_ data: Foundation.NSData) throws
|
||||
public func writeData(_ data: Foundation.Data) throws
|
||||
open func read() throws -> Swift.UInt8
|
||||
open func read(length: Swift.Int) throws -> [Swift.UInt8]
|
||||
public func readLine() throws -> Swift.String
|
||||
public func peername() throws -> Swift.String
|
||||
public class func setNoSigPipe(_ socket: Swift.Int32)
|
||||
public class func close(_ socket: Swift.Int32)
|
||||
open var hashValue: Swift.Int {
|
||||
get
|
||||
}
|
||||
}
|
||||
public func == (socket1: Swifter.Socket, socket2: Swifter.Socket) -> Swift.Bool
|
||||
public protocol HttpServerIODelegate : AnyObject {
|
||||
func socketConnectionReceived(_ socket: Swifter.Socket)
|
||||
}
|
||||
open class HttpServerIO {
|
||||
weak public var delegate: Swifter.HttpServerIODelegate?
|
||||
public enum HttpServerIOState : Swift.Int32 {
|
||||
case starting
|
||||
case running
|
||||
case stopping
|
||||
case stopped
|
||||
public typealias RawValue = Swift.Int32
|
||||
public init?(rawValue: Swift.Int32)
|
||||
public var rawValue: Swift.Int32 {
|
||||
get
|
||||
}
|
||||
}
|
||||
public var state: Swifter.HttpServerIO.HttpServerIOState {
|
||||
get
|
||||
}
|
||||
public var operating: Swift.Bool {
|
||||
get
|
||||
}
|
||||
public var listenAddressIPv4: Swift.String?
|
||||
public var listenAddressIPv6: Swift.String?
|
||||
public func port() throws -> Swift.Int
|
||||
public func isIPv4() throws -> Swift.Bool
|
||||
public init()
|
||||
@objc deinit
|
||||
@available(OSX 10.10, *)
|
||||
public func start(_ port: Darwin.in_port_t = 8080, forceIPv4: Swift.Bool = false, priority: Dispatch.DispatchQoS.QoSClass = DispatchQoS.QoSClass.background) throws
|
||||
public func stop()
|
||||
open func dispatch(_ request: Swifter.HttpRequest) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
}
|
||||
public func shareFile(_ path: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func shareFilesFromDirectory(_ directoryPath: Swift.String, defaults: [Swift.String] = ["index.html", "default.html"]) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
public func directoryBrowser(_ dir: Swift.String) -> ((Swifter.HttpRequest) -> Swifter.HttpResponse)
|
||||
open class HttpRouter {
|
||||
public init()
|
||||
public func routes() -> [Swift.String]
|
||||
public func register(_ method: Swift.String?, path: Swift.String, handler: ((Swifter.HttpRequest) -> Swifter.HttpResponse)?)
|
||||
public func route(_ method: Swift.String?, path: Swift.String) -> ([Swift.String : Swift.String], (Swifter.HttpRequest) -> Swifter.HttpResponse)?
|
||||
@objc deinit
|
||||
}
|
||||
extension NSURL {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension NSString {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
extension String {
|
||||
public func mimeType() -> Swift.String
|
||||
}
|
||||
public struct SHA1 {
|
||||
public static func hash(_ input: [Swift.UInt8]) -> [Swift.UInt8]
|
||||
}
|
||||
extension String {
|
||||
public func sha1() -> [Swift.UInt8]
|
||||
public func sha1() -> Swift.String
|
||||
}
|
||||
extension Socket {
|
||||
public class func tcpSocketForListen(_ port: Darwin.in_port_t, _ forceIPv4: Swift.Bool = false, _ maxPendingConnection: Swift.Int32 = SOMAXCONN, _ listenAddress: Swift.String? = nil) throws -> Swifter.Socket
|
||||
public func acceptClientSocket() throws -> Swifter.Socket
|
||||
}
|
||||
@_hasMissingDesignatedInitializers public class Errno {
|
||||
public class func description() -> Swift.String
|
||||
@objc deinit
|
||||
}
|
||||
extension String {
|
||||
public static func toBase64(_ data: [Swift.UInt8]) -> Swift.String
|
||||
}
|
||||
extension Swifter.SerializationError : Swift.Equatable {}
|
||||
extension Swifter.SerializationError : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.Hashable {}
|
||||
extension Swifter.WebSocketSession.OpCode : Swift.RawRepresentable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Equatable {}
|
||||
extension Swifter.WebSocketSession.Control : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Equatable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.Hashable {}
|
||||
extension Swifter.HttpServerIO.HttpServerIOState : Swift.RawRepresentable {}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
framework module Swifter {
|
||||
header "Swifter-Swift.h"
|
||||
requires objc
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user