From c40a73d93604a3ac1c566ab9346b04083c949af9 Mon Sep 17 00:00:00 2001 From: HexaField Date: Mon, 19 May 2025 09:17:50 +1000 Subject: [PATCH] upgrade typescript --- .../benchmarks/BenchmarkOrchestration.tsx | 22 ++++++++++--------- tsconfig.json | 13 ++++++++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/engine/benchmarks/BenchmarkOrchestration.tsx b/src/engine/benchmarks/BenchmarkOrchestration.tsx index fc147d7..f738049 100644 --- a/src/engine/benchmarks/BenchmarkOrchestration.tsx +++ b/src/engine/benchmarks/BenchmarkOrchestration.tsx @@ -18,14 +18,16 @@ type Benchmark = { systemUUIDs: SystemUUID[] } -export enum BenchmarkStage { - Particles = 'Particles', - Physics = 'Physics', - Avatar = 'Avatar', - Animation = 'Animation', - Rendering = 'Rendering', - IK = 'IK' -} +export const BenchmarkStage = { + Particles: 'Particles', + Physics: 'Physics', + Avatar: 'Avatar', + Animation: 'Animation', + Rendering: 'Rendering', + IK: 'IK' +} as const + +export type BenchmarkStageType = (typeof BenchmarkStage)[keyof typeof BenchmarkStage] const benchmarkOrder = [ BenchmarkStage.Physics, @@ -36,7 +38,7 @@ const benchmarkOrder = [ BenchmarkStage.IK ] -export const benchmarks: { [key in BenchmarkStage]: Benchmark | null } = { +export const benchmarks: { [key in BenchmarkStageType]: Benchmark | null } = { [BenchmarkStage.Avatar]: { benchmark: AvatarBenchmark, systemUUIDs: [SkinnedMeshTransformSystem, AvatarAnimationSystem] @@ -58,7 +60,7 @@ export const benchmarks: { [key in BenchmarkStage]: Benchmark | null } = { } type BenchmarkData = Record< - BenchmarkStage, + BenchmarkStageType, Record< SystemUUID, { diff --git a/tsconfig.json b/tsconfig.json index d34ffee..dd97757 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,11 @@ "target": "ESNext", "useDefineForClassFields": true, "module": "CommonJS", - "lib": ["ESNext", "DOM", "DOM.Iterable"], + "lib": [ + "ESNext", + "DOM", + "DOM.Iterable" + ], "skipLibCheck": true, "moduleResolution": "node", "allowImportingTsExtensions": true, @@ -24,7 +28,10 @@ "allowSyntheticDefaultImports": true, "emitDecoratorMetadata": true, "declaration": false, - "types": ["@types/node"] + "types": [ + "@types/node" + ], + "erasableSyntaxOnly": true }, "include": [ "../../../../../__global.d.ts", @@ -32,4 +39,4 @@ "../../../../server-core/src/", "./src" ] -} +} \ No newline at end of file