@sapui5/types
This npm package contains the TypeScript type definitions based on ES modules for all the SAPUI5 libraries. Read below and at the main UI5 & TypeScript documentation how to use them.
These definitions can be used to:
- Enable advanced content assist in IDEs, e.g: (VSCode / IntelliJ / Webstorm) for SAPUI5.
- Integrate type checking for SAPUI5 applications using the TypeScript compiler.
These capabilities are available not only for SAPUI5 apps written in TypeScript, but to some degree also in JavaScript.
NOTE: "based on ES modules" means that the application code needs to load UI5 modules using the ES6 modules syntax and needs to be transformed to standard UI5 require/define syntax before it is executed. This is the recommended approach!
Usage
The central entry point for all information about using UI5 with TypeScript (incl. sample apps and templates) is https://sap.github.io/ui5-typescript.
To see the suggested project setup for TypeScript development, please check out the TypeScript Hello World app. It not only can serve as copy template, but also includes a detailed step-by-step guide for creating this setup from scratch.
The TypeScript branch of the "UI5 CAP Event App" sample demonstrates a more complex application using the same setup. It comes with an explanation of what UI5 TypeScript code usually looks like and what to consider when writing such code.
For quick and easy scaffolding of a new UI5 app written in TypeScript, you can also use the easy-ui5 tool with the generator-ui5-ts-app generator.
Status
The type definitions are in an experimental Beta State. Changes are likely to occur, including potential breaking changes.
For information on changes in the type definitions, in particular ones which require adaptation (but also new enhancements), please refer to the Release Notes.
License
This package is provided under the terms of the SAP Developer License Agreement.