Export
The Export
aspect creates a public export in the object file for a static method, static field or a type, but does not create an export entry in the dynamic library, as the higher-level [DllExport
] Aspect does. Like DllExpoer
, it takes an optional String parameter which lets you override the default name the symbol will be exported under.
Note that Export
is not required to use type from one Elements library project from a different Elements on the same platform. All public
types and their pubbic
or protected
members will be available when referencing an Elements project via its .fx
file. It is also not required to expose Cocoa classes to Objective-C-based Xcode projects using your library.
Export
is mostly used in WebAssembly projects to make a class available to JavaScript and the browser.
Island Only
The Export
aspect is available only on the Island platform.
type
[Export]
MyClass = public class
public
method MyMethod();
begin
...
end;
end;
[Export]
public class MyClass
{
public void MyMethod()
{
...
}
}
@Export
public class MyClass {
public func MyMethod() {
...
}
}
@Export
public class MyClass {
public void MyMethod() {
...
}
}
<Export>
public class MyClass {
Public Sub MyMethod()
..
End Sub
End Class
See Also
DllExport
Aspect- Interop on the WebAssembly Platform