提交 74ac0fa4 编写于 作者: U Urakov Alexandr

Added ArkTS docs

Signed-off-by: NUrakov Alexandr <urakov.alexandr@huawei.com>
上级 43f99693
......@@ -40,38 +40,41 @@
- [Internal Structure of the module Tag](module-structure.md)
- [Resource Categories and Access](resource-categories-and-access.md)
- Learning ArkTS
- [Getting Started with ArkTS](arkts-get-started.md)
- Basic Syntax
- [Basic Syntax Overview](arkts-basic-syntax-overview.md)
- [Declarative UI Description](arkts-declarative-ui-description.md)
- Custom Component
- [Creating a Custom Component](arkts-create-custom-components.md)
- [Page and Custom Component Lifecycle](arkts-page-custom-components-lifecycle.md)
- [\@Builder Decorator: Custom Builder Function](arkts-builder.md)
- [\@BuilderParam Decorator: @Builder Function Reference](arkts-builderparam.md)
- [\@Styles Decorator: Definition of Resusable Styles](arkts-style.md)
- [\@Extend Decorator: Extension of Built-in Components](arkts-extend.md)
- [stateStyles Decorator: Polymorphic Style](arkts-statestyles.md)
- State Management
- [State Management Overview](arkts-state-management-overview.md)
- Component State Management
- [\@State Decorator: State Owned by Component](arkts-state.md)
- [\@Prop Decorator: One-Way Synchronization from Parent to Child Components](arkts-prop.md)
- [\@Link Decorator: Two-Way Synchronization Between Parent and Child Components](arkts-link.md)
- [\@Provide and \@Consume Decorators: Two-Way Synchronization with Descendant Components](arkts-provide-and-consume.md)
- [\@Observed and \@ObjectLink Decorators: Observing Attribute Changes in Nested Class Objects](arkts-observed-and-objectlink.md)
- Application State Management
- [Application State Management Overview](arkts-application-state-management-overview.md)
- [LocalStorage: UI State Storage](arkts-localstorage.md)
- [AppStorage: Application-wide UI State Storage](arkts-appstorage.md)
- [PersistentStorage: Application State Persistence](arkts-persiststorage.md)
- [Environment: Device Environment Query](arkts-environment.md)
- Other State Management Features
- [Overview of Other State Management Features](arkts-other-state-mgmt-functions-overview.md)
- [\@Watch: Getting Notified of State Variable Changes](arkts-watch.md)
- [$$ Syntax: Two-Way Synchronization of Built-in Components](arkts-two-way-sync.md)
- Rendering Control
- [Rendering Control Overview](arkts-rendering-control-overview.md)
- [if/else: Conditional Rendering](arkts-rendering-control-ifelse.md)
- [ForEach: Rendering of Repeated Content](arkts-rendering-control-foreach.md)
- [LazyForEach: Lazy Data Loading](arkts-rendering-control-lazyforeach.md)
- [Getting Started with ArkTS](arkts-get-started.md)
- [Introduction to ArkTS](arkts/introduction-to-arkts.md)
- [TypeScript to ArkTS Migration Guide](arkts/typescript-to-arkts-migration-guide.md)
- UI paradigms
- Basic Syntax
- [Basic Syntax Overview](arkts-basic-syntax-overview.md)
- [Declarative UI Description](arkts-declarative-ui-description.md)
- Custom Component
- [Creating a Custom Component](arkts-create-custom-components.md)
- [Page and Custom Component Lifecycle](arkts-page-custom-components-lifecycle.md)
- [\@Builder Decorator: Custom Builder Function](arkts-builder.md)
- [\@BuilderParam Decorator: @Builder Function Reference](arkts-builderparam.md)
- [\@Styles Decorator: Definition of Resusable Styles](arkts-style.md)
- [\@Extend Decorator: Extension of Built-in Components](arkts-extend.md)
- [stateStyles Decorator: Polymorphic Style](arkts-statestyles.md)
- State Management
- [State Management Overview](arkts-state-management-overview.md)
- Component State Management
- [\@State Decorator: State Owned by Component](arkts-state.md)
- [\@Prop Decorator: One-Way Synchronization from Parent to Child Components](arkts-prop.md)
- [\@Link Decorator: Two-Way Synchronization Between Parent and Child Components](arkts-link.md)
- [\@Provide and \@Consume Decorators: Two-Way Synchronization with Descendant Components](arkts-provide-and-consume.md)
- [\@Observed and \@ObjectLink Decorators: Observing Attribute Changes in Nested Class Objects](arkts-observed-and-objectlink.md)
- Application State Management
- [Application State Management Overview](arkts-application-state-management-overview.md)
- [LocalStorage: UI State Storage](arkts-localstorage.md)
- [AppStorage: Application-wide UI State Storage](arkts-appstorage.md)
- [PersistentStorage: Application State Persistence](arkts-persiststorage.md)
- [Environment: Device Environment Query](arkts-environment.md)
- Other State Management Features
- [Overview of Other State Management Features](arkts-other-state-mgmt-functions-overview.md)
- [\@Watch: Getting Notified of State Variable Changes](arkts-watch.md)
- [$$ Syntax: Two-Way Synchronization of Built-in Components](arkts-two-way-sync.md)
- Rendering Control
- [Rendering Control Overview](arkts-rendering-control-overview.md)
- [if/else: Conditional Rendering](arkts-rendering-control-ifelse.md)
- [ForEach: Rendering of Repeated Content](arkts-rendering-control-foreach.md)
- [LazyForEach: Lazy Data Loading](arkts-rendering-control-lazyforeach.md)
# Getting Started with ArkTS
ArkTS is the preferred main programming language for application development in OpenHarmony. ArkTS is a superset of [TypeScript](https://www.typescriptlang.org/) (TS for short). It contains all TS features and added features. Before getting started with ArkTS, it would be helpful if you have experience with TS development.
ArkTS is the preferred main programming language for application development in OpenHarmony. ArkTS maintains the basic style of [TypeScript](https://www.typescriptlang.org/) (TS for short). It is a static typing language. Some TS features are restricted for better performance.
The added features offered by ArkTS include the following:
The following syntaxes in TS are restricted in ArkTS:
- Static typing is enforced. Static typing is one of the most important features of ArkTS. If the program is statically typed, i.e. all types are known at the compile time, it’s much easier to understand which data structures are used in the code. At the same time, since all types are known before the program actually runs, code correctness can be verified by the compiler, which eliminates many runtime type checks and improves the performance.
- Changing object layout in runtime is prohibited. To achieve maximum performance benefits, ArkTS requires that layout of objects does not change during program execution.
- Semantics of operators is restricted. To achieve better performance and encourage developers to write cleaner code, ArkTS restricts the semantics of operators. Such as, the binary `+` operator supports only for strings and numbers but not for objects.
- structural typing is not supported. Support for structural typing is a major feature which needs lots of consideration and careful implementation in language specification, compiler and runtime. Currently, ArkTS does not supports structural typing. The team will be ready to reconsider based on real-world scenarios and feedback.
The added features offered by ArkTS for ArkUI framework include the following:
- [Basic syntax](arkts-basic-syntax-overview.md): ArkTS defines declarative UI description, custom components, and dynamic extension of UI elements. All these, together with built-in components, event methods, and attribute methods in ArkUI, jointly underpin UI development.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册