-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library includes are missing types #386
Comments
TL;DR: the type is not missing, but the const counterpart. What do you need it for? I assume to call CSSSize.isValid()? For the time being, you should be able to work around the problem like this, with ts-ignore: /**
* @type import("sap/ui/core/library").CSSSize
*/
// @ts-ignore
var csss = coreLib.CSSSize Long and evolving version: import { CSSSize } from "sap/ui/core/library"; However, it's noticeable that even in TypeScript For export type CSSSize = string;
export enum BarColor {...} When it comes to usage in JavaScript, the difference is bigger. As import { CSSSize } from "sap/ui/core/library"; It works for the enums, but for types you get: 'CSSSize' is a type and cannot be imported in JavaScript files. Use 'import("sap/ui/core/library").CSSSize' in a JSDoc type annotation. Types are simply not a thing in JavaScript code. Why would you need a type in JS code, then? Because it is not only a type, but also a value, an object which has the |
We IMO should NOT expose the Unfortunately, we exposed two different natures of I'm therefore strongly in favour of abandoning the 2nd nature also in the runtime. The DataType nature can already today be retrieved via |
@akudev @codeworrior Understood, thanks for the in-depth explanation! |
Alright, then let's close this. Nevertheless thanks for reporting, at least we have the topic now described here for others. |
Describe the bug
For the given snippet:
the following error is raised:
The text was updated successfully, but these errors were encountered: