Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@openui5/ts-types
Advanced tools
This npm package contain the types signatures for all the SAP OpenUI5 libraries, ( sap.ui.core / sap.m / sap.f / ... ).
These signatures can be used to:
These two capabilities are available both for OpenUI5 apps written in TypeScript and in JavaScript.
This project is in an experimental Beta State. Significant changes are likely to occur, including potential breaking changes.
Try it out now:
For the latest version:
npm install @openui5/ts-types --dev
It is recommended to align with the specific OpenUI5 version you may be using, e.g for OpenUI5 1.64:
npm install @openui5/ts-types@1.64 --dev
Note that the version matching is only for the major and minor versions. By design the patch versions of @openui5/ts-types do not match the patch version of the OpenUI5 runtime. This is done to enable a de-coupled life-cycle for the @openui5/ts-types package.
Also Note that the @openui5/ts-types package is only available since version 1.64 of OpenUI5 runtime.
These instruction currently focus on the editor services scenario (e.g: content assist / highlighting api errors). Additional scenarios such as developing UI5 applications in TypeScript or using TypeScript for build time type checks would be added at a later date.
The TypeScript compiler does not resolve global definitions from scoped npm packages. To resolve this a tsconfig.json file must be added to the root of your npm based project:
The most simple tsconfig.json would look like this:
{
"compilerOptions": {
"module": "none",
"noEmit": true,
"checkJs": true,
"allowJs": true,
"types": ["@openui5/ts-types"]
}
}
The important things to note are:
"module": "none"
because UI5 has its own unique modules system."noEmit": true
as we are not interested in generating any code."checkJs": true, "allowJs": true
to enable the TypeScript based language service to inspect
our UI5 Javascript files."types": ["@openui5/ts-types"]
to help the TypeScript based language service resolve the global
type definitions from the @openui5/ts-types package.There are two kinds of UI5 source code.
For UI5 source code using the legacy global imports no additional changes would be needed, simply, open your project in an IDE (VSCode / Eclipse Theia / IntelliJ WebStorm) that supports TypeScript definitions based languages services and start coding.
For UI5 source code using the newer sap.ui.define
syntax, an additional JSDocs parameter is needed.
This parameter "helps" the TypeScript compiler understand the UI5 import syntax and "link" to the correct types signature.
sap.ui.define(
["sap/ui/core/TooltipBase"], // 1. UI5 runtime import
/**
* // 2. Linking TypeScript global signatures (below)
* @param {typeof sap.ui.core.TooltipBase} TooltipBase
*/
function(TooltipBase) {
// 3. Define function parameter
const toolTipInstance = new TooltipBase("myID", {
// try content assist here:
dependents: null,
blocked: true,
closeDelay: 666
});
}
);
Note the @param {typeof sap.ui.core.TooltipBase} TooltipBase
syntax linking the:
"sap/ui/core/TooltipBase"
.{typeof sap.ui.core.TooltipBase}
.TooltipBase
.Please open issues on github.
See CONTRIBUTING.md.
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
FAQs
OpenUI5 TypeScript Definitions
The npm package @openui5/ts-types receives a total of 1,905 weekly downloads. As such, @openui5/ts-types popularity was classified as popular.
We found that @openui5/ts-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.