#111482Viewport.Loader is typed as a Loader instance instead of the Loader class
Description
Problem
The backend viewport (typo3/backend/viewport, also reachable as top.TYPO3.Backend) exposes the progress loader as Viewport.Loader@. TypeScript code that calls Viewport.Loader.start() or Viewport.Loader.finish() does not compile:
error TS2576: Property 'start' does not exist on type 'Loader'. Did you mean to access the static member 'Loader.start' instead?
At runtime the calls work, so callers have to cast around the declaration, e.g. (Viewport.Loader as unknown as typeof Loader).start().
Steps to reproduce
- In any TypeScript module below Build/Sources/TypeScript, import Viewport from ‘@typo3/backend/viewport’ and call Viewport.Loader.start().
- Run the TypeScript build: ./Build/Scripts/runTests.sh -s build
- tsc reports TS2576 for the call.
Cause
Build/Sources/TypeScript/backend/viewport.ts declares public readonly Loader: Loader = Loader;. Loader (viewport/loader.ts) only has static members (start(), finish()), and the property holds the class itself, not an instance. The annotation Loader means “an instance of Loader”, which has no members at all; the correct type is typeof Loader.
Suggested fix
--- a/Build/Sources/TypeScript/backend/viewport.ts
+++ b/Build/Sources/TypeScript/backend/viewport.ts
@@ class Viewport {
- public readonly Loader: Loader = Loader;
+ public readonly Loader: typeof Loader = Loader;Reviews 2
History 13
-
Gerrit Code Review pushed patch set 1 for main to change 97764 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-17T17:39:55+00:00" > 11/17/26, 17:39 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 97782 <span data-processor="relativetime" data-value="2026-11-18T09:02:33+00:00" > 11/18/26, 09:02 </span>
-
Benjamin Kott commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-18T09:19:39+00:00" > 11/18/26, 09:19 </span>
Applied in changeset commit:e4c038b1e6ea0ad3b7c23cc8a340a533e8898144.