-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from skiptools/swiftprojecting
Create SwiftProjecting protocol for use by bridging code
- Loading branch information
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 Skip | ||
// | ||
// This is free software: you can redistribute and/or modify it | ||
// under the terms of the GNU Lesser General Public License 3.0 | ||
// as published by the Free Software Foundation https://fsf.org | ||
|
||
/// Marker protocol for types that are custom bridged from the Swift side. | ||
/// | ||
/// - Seealso: `KotlinConverting` | ||
public protocol SwiftCustomBridged { | ||
} | ||
|
||
/// Implemented by the generated Kotlin side of a bridged type to provide its Swift projection. | ||
/// | ||
/// We keep this in SkipLib so that the Kotlin output of transpiled bridged modules does not have a | ||
/// dependency on SkipBridge. We can add the SkipBridge dependency only when compiling for bridging. | ||
/// | ||
/// - Returns: A closure that returns a Swift projection of this object when invoked. | ||
/// - Warning: This protocol is not designed for general use. It is designed for generated bridge code. | ||
/// - Seealso: `SkipBridgeKt.BridgeSupport` | ||
public protocol SwiftProjecting { | ||
func Swift_projection(options: Int) -> () -> Any | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters