summaryrefslogtreecommitdiffstats
path: root/toolkit/components/uniffi-example-custom-types/uniffi.toml
blob: 873fa090fbb1f397e114f9b626ffd77607283a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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"