ArkTS Specification¶
- 1. Introduction
- 2. Lexical Elements
- 3. Types
- 4. Names, Declarations and Scopes
- 5. Generics
- 6. Contexts and Conversions
- 6.1. Assignment-like Contexts
- 6.2. String Operator Contexts
- 6.3. Numeric Operator Contexts
- 6.4. Casting Contexts and Conversions
- 6.5. Implicit Conversions
- 6.5.1. Primitive Types Conversions
- 6.5.2. Widening Primitive Conversions
- 6.5.3. Constant Narrowing Integer Conversions
- 6.5.4. Boxing Conversions
- 6.5.5. Unboxing Conversions
- 6.5.6. Widening Union Conversions
- 6.5.7. Widening Reference Conversions
- 6.5.8. Character to String Conversions
- 6.5.9. Constant String to Character Conversions
- 6.5.10. Function Types Conversions
- 6.5.11. Enumeration to Int Conversions
- 6.5.12. Enumeration to String Conversions
- 7. Expressions
- 7.1. Evaluation of Expressions
- 7.2. Literal
- 7.3. Qualified Name
- 7.4. Array Literal
- 7.5. Object Literal
- 7.6. Spread Expression
- 7.7. Parenthesized Expression
- 7.8.
this
Expression - 7.9. Field Access Expressions
- 7.10. Method Call Expression
- 7.11. Function Call Expression
- 7.12. Indexing Expression
- 7.13. Chaining Operator
- 7.14. New Expressions
- 7.15. Cast Expressions
- 7.16. InstanceOf Expression
- 7.17. TypeOf Expression
- 7.18. Ensure-Not-Nullish Expression
- 7.19. Nullish-Coalescing Expression
- 7.20. Unary Expressions
- 7.21. Multiplicative Expressions
- 7.22. Additive Expressions
- 7.23. Shift Expressions
- 7.24. Relational Expressions
- 7.25. Equality Expressions
- 7.26. Bitwise and Logical Expressions
- 7.27. Conditional-And Expression
- 7.28. Conditional-Or Expression
- 7.29. Assignment
- 7.30. Conditional Expressions
- 7.31. String Interpolation Expressions
- 7.32. Lambda Expressions
- 7.33. Dynamic Import Expression
- 7.34. Constant Expressions
- 8. Statements
- 8.1. Normal and Abrupt Statement Execution
- 8.2. Expression Statements
- 8.3. Block
- 8.4. Local Declarations
- 8.5.
if
Statements - 8.6.
loop
Statements - 8.7.
while
Statements anddo
Statements - 8.8.
for
Statements - 8.9.
for-of
Statements - 8.10.
break
Statements - 8.11.
continue
Statements - 8.12.
return
Statements - 8.13.
switch
Statements - 8.14.
throw
Statements - 8.15.
try
Statements - 8.16.
Assert
Statements
- 9. Classes
- 9.1. Class Declarations
- 9.2. Class Body
- 9.3. Class Members
- 9.4. Access Modifiers
- 9.5. Field Declarations
- 9.6. Method Declarations
- 9.6.1. Class (Static) Methods
- 9.6.2. Instance Methods
- 9.6.3. Abstract Methods
- 9.6.4. Final Methods
- 9.6.5. Overriding Methods
- 9.6.6. Native Methods
- 9.6.7. Method Overload Signatures
- 9.6.8. Method Body
- 9.6.9. Inheritance
- 9.6.10. Overriding by Instance Methods
- 9.6.11. Hiding by Class Methods
- 9.6.12. Requirements in Overriding and Hiding
- 9.6.13. Inheriting Methods with Override-Equivalent Signatures
- 9.7. Accessor Declarations
- 9.8. Class Initializer
- 9.9. Constructor Declaration
- 9.10. Local Classes and Interfaces
- 10. Interfaces
- 11. Enumerations
- 12. Error Handling
- 13. Compilation Units, Packages, and Modules
- 14. Ambient Declarations
- 15. Semantic Rules
- 16. Support for GUI Programming
- 16.1. Annotations
- 16.2. GUI Structs
- 16.3. Builder Function Syntax Conventions
- 16.4. Builder Function Restrictions
- 16.5. Annotations List
- 16.5.1. @Builder Annotation
- 16.5.2. @BuilderParam Annotation
- 16.5.3. @Component Annotation
- 16.5.4. @Consume Annotation
- 16.5.5. @Entry Annotation
- 16.5.6. @Link Annotation
- 16.5.7. @LocalStorageLink Annotation
- 16.5.8. @LocalStorageProp Annotation
- 16.5.9. @ObjectLink Annotation
- 16.5.10. @Observed Annotation
- 16.5.11. @Prop Annotation
- 16.5.12. @Provide Annotation
- 16.5.13. @State Annotation
- 16.5.14. @StorageLink Annotation
- 16.5.15. @StorageProp Annotation
- 16.5.16. @Watch Annotation
- 16.6. Callable Types
- 16.7. Additional Features
- 16.8. Example of GUI Programming
- 17. Experimental Features
- 17.1. Character Type and Literals
- 17.2. Array Creation Expressions
- 17.3. Indexable Types
- 17.4. Iterable Types
- 17.5. Statements
- 17.6. Function and Method Overloading
- 17.7. Native Functions and Methods
- 17.8. Final Classes and Methods
- 17.9. Default and Static Interface Methods
- 17.10. Extension Functions
- 17.11. Trailing Lambda
- 17.12. Enumeration Super Type
- 17.13. Enumeration Methods
- 17.14. Exceptions
- 17.15. Coroutines
- 17.16. Packages
- 17.17. Generics Experimental
- 18. Standard Library
- 19. Grammar Summary
- 20. Implementation Details
- 21. ArkTS-TypeScript compatibility
- 22. Contributors