Skip to content
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

@sapui5/ts-types-esm - Opa5.waitFor options.actions should be optional #306

Closed
DetachHead opened this issue Nov 25, 2021 · 4 comments
Closed
Labels
legacy ts-types (with globals) Related to legacy Global types (deprecated)

Comments

@DetachHead
Copy link

actions: Function | Array<() => void> | Action | Action[];

it doesn't seem to be mandatory, see all the examples in the docs where waitFor is called without an action

i see where it's defined here but as far as i can tell the documentation in the source code doesn't appear to control whether the generated types are mandatory or not

@DetachHead DetachHead changed the title Opa5.waitFor options.actions should be optional @sapui5/ts-types - Opa5.waitFor options.actions should be optional Nov 25, 2021
@petermuessig petermuessig added the legacy ts-types (with globals) Related to legacy Global types (deprecated) label Nov 28, 2021
@petermuessig
Copy link
Contributor

Thanks for your feedback. The TS support for the testing related APIs is still work in progress. BTW: did you also use the @sapui5/ts-types for your project or did you use the ESM types @sapui5/ts-types-esm?

As you report quite some issues here, I am getting interested in how you are using the types? How are your projects setup? What toolchain do you use? Which IDE? And, really the classic Global types or the ESM types? Would it be possible for you to share some infos? 🙇‍♂️

@DetachHead DetachHead changed the title @sapui5/ts-types - Opa5.waitFor options.actions should be optional @sapui5/ts-types-esm - Opa5.waitFor options.actions should be optional Nov 29, 2021
@DetachHead
Copy link
Author

@petermuessig thanks for the response! to be honest i'm not all that familiar with ui5, but since i'm good with typescript i'm helping a ui5 developer convert his project to typescript so there's probably quite a few things i'm doing wrong lol. to answer your questions:

How are your projects setup?

mainly like the ui5-typescript-helloworld project. i'm converting a project that appears to be based on this worklist example

Which IDE?

i primarily use webstorm, but sometimes vscode

And, really the classic Global types or the ESM types?

using @sapui5/ts-types-esm, however there's some stuff in this codebase that seems to use the globally defined sap object:

const sManifestUrl = sap.ui.require.toUrl(_sAppModulePath + 'manifest.json')

@DetachHead
Copy link
Author

seems this is fixed in the latest version of @sapui5/ts-types-esm, thanks!

@petermuessig
Copy link
Contributor

@DetachHead thanks for your fast feedback and the answers for my questions.

Some of the Globals can't be avoided easily unfortunately like sap.ui.require.toUrl is often used to calculate the URL to resource paths and sap.ui.require accesses the APIs of the UI5 loader. Some of the APIs could be shifted to ES module APIs but not for all something equivalent is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy ts-types (with globals) Related to legacy Global types (deprecated)
Projects
None yet
Development

No branches or pull requests

2 participants