| 1 |
// Mojo files usually start with a multiline comment and/or copyright |
| 2 |
// statement. They are otherwise quite close to C++ files. |
| 3 |
|
| 4 |
module example_service.mojom; |
| 5 |
|
| 6 |
import "mojo/public/mojom/base/time.mojom"; |
| 7 |
import "some/other/project/base.mojom"; |
| 8 |
|
| 9 |
enum BasicEnum { |
| 10 |
kField1, |
| 11 |
kField2, |
| 12 |
}; |
| 13 |
|
| 14 |
struct BasicStruct { |
| 15 |
// Comment about a field. |
| 16 |
mojo_base.mojom.TimeDelta duration; |
| 17 |
}; |
| 18 |
|
| 19 |
[annotation] |
| 20 |
interface ExampleInterface { |
| 21 |
// Returns a thing from a place using its arguments. |
| 22 |
DecodeInput(array<uint8> input_data, BasicEnum value, bool flag, |
| 23 |
int64 size_of_the_thing) |
| 24 |
=> (BasicStruct? result_maybe); |
| 25 |
|
| 26 |
Frobnicate(map<StringPair, map<int32, array<map<string, string>?>?>?> ridiculous) => (array<unit64, 2> guid); |
| 27 |
}; |