summaryrefslogtreecommitdiffstats
path: root/toolkit/components/uniffi-fixtures/custom-types/uniffi.toml
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/uniffi-fixtures/custom-types/uniffi.toml')
-rw-r--r--toolkit/components/uniffi-fixtures/custom-types/uniffi.toml40
1 files changed, 40 insertions, 0 deletions
diff --git a/toolkit/components/uniffi-fixtures/custom-types/uniffi.toml b/toolkit/components/uniffi-fixtures/custom-types/uniffi.toml
new file mode 100644
index 0000000000..873fa090fb
--- /dev/null
+++ b/toolkit/components/uniffi-fixtures/custom-types/uniffi.toml
@@ -0,0 +1,40 @@
+[bindings.swift]
+cdylib_name = "custom_types"
+
+[bindings.swift.custom_types.Url]
+# Name of the type in the Swift code
+type_name = "URL"
+# Modules that need to be imported
+imports = ["Foundation"]
+# Functions to convert between strings and URLs
+into_custom = "URL(string: {})!"
+from_custom = "String(describing: {})"
+
+[bindings.kotlin]
+cdylib_name = "custom_types"
+package_name = "customtypes"
+
+[bindings.kotlin.custom_types.Url]
+# Name of the type in the Kotlin code
+type_name = "URL"
+# Classes that need to be imported
+imports = [ "java.net.URL" ]
+# Functions to convert between strings and URLs
+into_custom = "URL({})"
+from_custom = "{}.toString()"
+
+[bindings.python]
+cdylib_name = "custom_types"
+
+[bindings.python.custom_types.Url]
+# We're going to be the urllib.parse.ParseResult class, which is the closest
+# thing Python has to a Url class. No need to specify `type_name` though,
+# since Python is loosely typed.
+# modules to import
+imports = ["urllib.parse"]
+# Functions to convert between strings and the ParsedUrl class
+into_custom = "urllib.parse.urlparse({})"
+from_custom = "urllib.parse.urlunparse({})"
+
+[bindings.ruby]
+cdylib_name = "custom_types"