From b0210f06972f27ad6f324b636daaccbbf316fab5 Mon Sep 17 00:00:00 2001
From: Andreas Fernandez <a.fernandez@scripting-base.de>
Date: Fri, 17 Mar 2023 17:05:55 +0100
Subject: [PATCH] [TASK] Upgrade TypeScript to 5.0

TypeScript 5.0 has been release a few days ago and brings promising
features, see [1]. This patch therefore updates TypeScript to 5.0
with the following commands executed:

    yarn add --dev typescript@~5.0.0
    yarn build

[1] https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/

Resolves: #100209
Releases: main, 11.5
Change-Id: I19df4f073f3cdeeed2023b57cad647c5a53638a0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78156
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
---
 Build/package.json                                        | 2 +-
 Build/yarn.lock                                           | 8 ++++----
 .../Public/JavaScript/Storage/ModuleStateStorage.js       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Build/package.json b/Build/package.json
index 55c766e8a46b..a64b99473b4f 100644
--- a/Build/package.json
+++ b/Build/package.json
@@ -66,7 +66,7 @@
     "stylefmt": "^6.0.3",
     "stylelint": "^13.12.0",
     "terser": "^5.3.2",
-    "typescript": "~4.9.0"
+    "typescript": "~5.0.0"
   },
   "scripts": {
     "build-css": "./node_modules/.bin/grunt css",
diff --git a/Build/yarn.lock b/Build/yarn.lock
index 2a63aca9bd62..0a9f64cb805a 100644
--- a/Build/yarn.lock
+++ b/Build/yarn.lock
@@ -9503,10 +9503,10 @@ typedarray-to-buffer@^3.1.5:
   dependencies:
     is-typedarray "^1.0.0"
 
-typescript@~4.9.0:
-  version "4.9.5"
-  resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
-  integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
+typescript@~5.0.0:
+  version "5.0.2"
+  resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5"
+  integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==
 
 ua-parser-js@0.7.22:
   version "0.7.22"
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Storage/ModuleStateStorage.js b/typo3/sysext/backend/Resources/Public/JavaScript/Storage/ModuleStateStorage.js
index 9f15372b2225..8f9ffb4aad88 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/Storage/ModuleStateStorage.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/Storage/ModuleStateStorage.js
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleStateStorage=void 0;class r{static update(e,t,i,n){if("number"==typeof t)t=t.toString(10);else if("string"!=typeof t)throw new SyntaxError("identifier must be of type string");if("number"==typeof n)n=n.toString(10);else if("string"!=typeof n&&null!=n)throw new SyntaxError("mount must be of type string");const o=r.assignProperties({mount:n,identifier:t,selected:i},r.fetch(e));r.commit(e,o)}static updateWithCurrentMount(e,t,i){r.update(e,t,i,r.current(e).mount)}static current(e){return r.fetch(e)||r.createCurrentState()}static purge(){Object.keys(sessionStorage).filter(e=>e.startsWith(r.prefix)).forEach(e=>sessionStorage.removeItem(e))}static fetch(e){const t=sessionStorage.getItem(r.prefix+e);return null===t?null:JSON.parse(t)}static commit(e,t){sessionStorage.setItem(r.prefix+e,JSON.stringify(t))}static assignProperties(e,t){let i=Object.assign(r.createCurrentState(),t);return e.mount&&(i.mount=e.mount),e.identifier&&(i.identifier=e.identifier),e.selected&&(i.selection=i.identifier),i}static createCurrentState(){return{mount:null,identifier:"",selection:null}}}if(t.ModuleStateStorage=r,r.prefix="t3-module-state-",window.ModuleStateStorage=r,!top.fsMod||!top.fsMod.isProxy){const e=e=>new Proxy({},{get(t,i){const n=i.toString(),o=r.current(n);return"identifier"===e?o.identifier:"selection"===e?o.selection:void 0},set(e,t,r,i){throw new Error("Writing to fsMod is not possible anymore, use ModuleStateStorage instead.")}}),t={isProxy:!0,recentIds:{},navFrameHighlightedID:{},currentBank:"0"};top.fsMod=new Proxy(t,{get(t,i){const n=i.toString();return"isProxy"===n||(console.warn("Reading from fsMod is deprecated, use ModuleStateStorage instead."),"recentIds"===n?e("identifier"):"navFrameHighlightedID"===n?e("selection"):"currentBank"===n?r.current("web").mount:void 0)},set(e,t,r,i){throw new Error("Writing to fsMod is not possible anymore, use ModuleStateStorage instead.")}})}}));
\ No newline at end of file
+define(["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleStateStorage=void 0;class r{static update(e,t,i,n){if("number"==typeof t)t=t.toString(10);else if("string"!=typeof t)throw new SyntaxError("identifier must be of type string");if("number"==typeof n)n=n.toString(10);else if("string"!=typeof n&&null!=n)throw new SyntaxError("mount must be of type string");const o=r.assignProperties({mount:n,identifier:t,selected:i},r.fetch(e));r.commit(e,o)}static updateWithCurrentMount(e,t,i){r.update(e,t,i,r.current(e).mount)}static current(e){return r.fetch(e)||r.createCurrentState()}static purge(){Object.keys(sessionStorage).filter(e=>e.startsWith(r.prefix)).forEach(e=>sessionStorage.removeItem(e))}static fetch(e){const t=sessionStorage.getItem(r.prefix+e);return null===t?null:JSON.parse(t)}static commit(e,t){sessionStorage.setItem(r.prefix+e,JSON.stringify(t))}static assignProperties(e,t){let i=Object.assign(r.createCurrentState(),t);return e.mount&&(i.mount=e.mount),e.identifier&&(i.identifier=e.identifier),e.selected&&(i.selection=i.identifier),i}static createCurrentState(){return{mount:null,identifier:"",selection:null}}}if(r.prefix="t3-module-state-",t.ModuleStateStorage=r,window.ModuleStateStorage=r,!top.fsMod||!top.fsMod.isProxy){const e=e=>new Proxy({},{get(t,i){const n=i.toString(),o=r.current(n);return"identifier"===e?o.identifier:"selection"===e?o.selection:void 0},set(e,t,r,i){throw new Error("Writing to fsMod is not possible anymore, use ModuleStateStorage instead.")}}),t={isProxy:!0,recentIds:{},navFrameHighlightedID:{},currentBank:"0"};top.fsMod=new Proxy(t,{get(t,i){const n=i.toString();return"isProxy"===n||(console.warn("Reading from fsMod is deprecated, use ModuleStateStorage instead."),"recentIds"===n?e("identifier"):"navFrameHighlightedID"===n?e("selection"):"currentBank"===n?r.current("web").mount:void 0)},set(e,t,r,i){throw new Error("Writing to fsMod is not possible anymore, use ModuleStateStorage instead.")}})}}));
\ No newline at end of file
-- 
GitLab