Skip to content

Commit c0aa9ae

Browse files
committed
Update
1 parent 2d96159 commit c0aa9ae

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- [Type conversion](./as3/type-conversion.md)
88
- [Type matching](./as3/type-matching.md)
99
- [Classes](./as3/classes.md)
10+
- [Enums](./as3/enums.md)
11+
- [Interfaces](./as3/interfaces.md)
1012
- [Namespaces](./as3/namespaces.md)
1113
- [Events](./as3/events.md)
1214
- [Environment variables](./as3/environment.md)

src/as3/enums.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Enums
2+
3+
Enums are special classes consisting of zero or more variants. Use the `enum` definition to define enums.
4+
5+
```
6+
enum Variant {
7+
const VARIANT_ONE;
8+
const VARIANT_TWO = "variantTwo";
9+
const VARIANT_THREE = [2, "variantThree"];
10+
}
11+
```
12+
13+
## Type inference
14+
15+
```
16+
var v : Variant = "variantOne";
17+
```

src/as3/interfaces.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Interfaces
2+
3+
Interfaces are non opaque types that may be implemented by classes through the `implements` clause.
4+
5+
```
6+
interface I {
7+
//
8+
public function m() : void;
9+
10+
//
11+
public function get x() : Number;
12+
public function set x(value);
13+
}
14+
15+
interface Ia extends I {}
16+
```
17+
18+
All interface methods must omit the body.

0 commit comments

Comments
 (0)