Type 'import("sap/ui/core/Popup").Dock' is not assignable to type 'typeof Dock' (since UI5 1.115.0)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 42/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
- Bereich
- tooling
Rechercherichtung
Start with the TypeScript declarations for sap/ui/core/Popup and MessageToast, focusing on how Popup.Dock is referenced in MessageToast.show. Verify the completed change by checking that Dock is accepted there without the typeof mismatch and that the documented example type-checks.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
Since UI5 1.115.0, the TS types use a different strategy for enums attached to another API. They are no longer named exports, but attached as static properties.
When such an enum (e.g. Dock), exported as static property of a class (e.g. Popup.Dock), is used in the signature of yet another class (e.g. MessageToast), then the signature of that other class is broken. For a detailed example see https://github.com/SAP/openui5/issues/4091.
Expected behavior
Any usage of such an enum in another API should work seamlessly.
Additional context
The problem is that the "usage in yet another class" currently uses the static property to refer to the type:
import Popup from "sap/ui/core/Popup";
interface MessageToast {
show(
msg: string,
at: typeof Popup.Dock // <-- problem
)
...
Unfortunately, this is not the same as the original enum. According to my experiments, it would be better to
import type {Dock} from "sap/ui/core/Popup"; // ideally, import as type
interface MessageToast {
show(
msg: string,
at: Dock // <-- better declaration of type
)
...
Interestingly, this works already today as the enum Dock is exported from Popup (any declaration in an ambient module declaration is implicitly an export, even without the keyword export).
- Vorherrschende Sprache
- TypeScript
- Sterne
- 213
- Forks
- 35
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus UI5/typescript
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
UI5/typescript#625 · 4 Kommentare ·
-
dts-generator
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
UI5/typescript#529 · 3 Kommentare ·
-
Dependency DashboardOffen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
UI5/typescript#587 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
UI5/typescript#532 ·
-
enhancement ts-interface-generator
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
UI5/typescript#524 ·
Ähnliche Issues
-
feature
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Team (channel) avatars render noticeably smaller than agent avatars in the sidebar gridOffenbug from-app needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
nightly-labs/openbot#21303 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
OHDSI/Data2Evidence#3816 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
`ovsx verify` fails for a version older than the 100 newest of an extensionEvtl. vergeben @trivikr hat das heute übernommen. Offencli
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 81/100
eclipse-openvsx/openvsx#2482 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag