2 --- description: API Notation
5 API Notation is a language-agnostic notation to share the public API of components in code. It was created to standardize software specification documents in teams that need to review code across several languages.
7 The notation consists of one or more `definitions`, and `comments`
10 // Definitions start with object / module / class names, with namespaces
11 // separated by periods. Types are marked between angular brackets.
12 Definitions.Models.Post
14 +static_property <Type>
15 -instance_property <Types<Can<Be<Nested>>>>
16 // Methods. Parameters are listed in parentheses, and comma separated.
17 // Optional values are inside brackets
18 // => defines return values
19 // #> defines thrown exceptions, can be comma separated.
20 ::static_methods(parameter_label <Type>) => ReturnValueType #> BadTimesException,UnknownError
21 #update(text <String>, [options] <GlobalOptions.tOptions>) => Promise<Void>
23 +>static_listener(parameters_expected <Bool>)
25 ~>network_events(peer <Networking.Peer>)
27 <+emitted_statically(payload <StaticEventPayload>)
28 <-emitted_by_instance(reason <String>, code <Int>)
29 <~emitted_through_network(text <String>)
32 When defining function types, you may use parameter lists, returns and throws notation as well.
36 #transform<T>( Function<T>(payload <T>) => <T>, announce <Bool>) => <Bool>